
var gstrLastHelpClicked=null
var gstrReturnRevealHelp
var gstrReturnRevealDate
function getStyleClass(strClassName){var re=new RegExp("\\."+strClassName+"$","gi");if(window.document.all)
{for(var s=0;s<window.document.styleSheets.length;s++)
{for(var r=0;r<window.document.styleSheets[s].rules.length;r++)
{if(window.document.styleSheets[s].rules[r].selectorText.search(re)!=-1)
{return window.document.styleSheets[s].rules[r].style;}}}}
else if(window.document.getElementById)
{for(var s=0;s<window.document.styleSheets.length;s++)
{for(var r=0;r<window.document.styleSheets[s].cssRules.length;r++)
{if(window.document.styleSheets[s].cssRules[r].selectorText.search(re)!=-1)
{window.document.styleSheets[s].cssRules[r].sheetIndex=s;window.document.styleSheets[s].cssRules[r].ruleIndex=s;return window.document.styleSheets[s].cssRules[r].style;}}}}
else if(window.document.layers)
{return window.document.classes[strClassName].all;}
return null;}
function getStyleClassProperty(strClassName,strPropertyName)
{var styleClass=getStyleClass(strClassName);if(styleClass){var styleClassProperty=styleClass.getAttribute(strPropertyName)
return styleClassProperty;}
else
{return null;}}
function cancelDragEvent()
{window.event.returnValue=false;}
function cancelSelectEvent()
{window.event.returnValue=false;}
function getTopCoordinate(obj)
{try
{var intYPos=obj.offsetTop;var objTemp=obj.offsetParent;while(objTemp!=null){intYPos+=objTemp.offsetTop;objTemp=objTemp.offsetParent;}
return(intYPos+g_intSkinOffsetTop);}
catch(e)
{return null;}}
function getTopMiddleCoordinate(obj)
{var intTopCoord=getTopCoordinate(obj);var intHeight=obj.clientHeight;return Math.round(intRightCoord+(intHeight/2));}
function getLeftCoordinate(obj)
{try
{var intXPos=obj.offsetLeft;var objTemp=obj.offsetParent;while(objTemp!=null){intXPos+=objTemp.offsetLeft;objTemp=objTemp.offsetParent;}
return(intXPos+g_intSkinOffsetLeft);}
catch(e)
{return null;}}
function getLeftMiddleCoordinate(obj)
{var intLeftCoord=getLeftCoordinate(obj);var intWidth=obj.clientWidth;return Math.round(intLeftCoord+(intWidth/2));}
function getMonthName(blnAbbrev)
{var strMonth;var strAbbrev;switch(this.getMonth())
{case 0:strMonth="January";strAbbrev="Jan";break;case 1:strMonth="February";strAbbrev="Feb";break;case 2:strMonth="March";strAbbrev="Mar";break;case 3:strMonth="April";strAbbrev="Apr";break;case 4:strMonth="May";strAbbrev="May";break;case 5:strMonth="June";strAbbrev="Jun";break;case 6:strMonth="July";strAbbrev="Jul";break;case 7:strMonth="August";strAbbrev="Aug";break;case 8:strMonth="September";strAbbrev="Sep";break;case 9:strMonth="October";strAbbrev="Oct";break;case 10:strMonth="November";strAbbrev="Nov";break;case 11:strMonth="December";strAbbrev="Dec";break;default:strMonth="Unknown";strAbbrev="Unk";}
if(blnAbbrev)
return strAbbrev;else
return strMonth;}
Date.prototype.getMonthName=getMonthName;function queryStringSwapVariable(strVariable,strValue,strUrl)
{var blnFound=false;if(strUrl==null)
strUrl=window.location.href;arrUrl=strUrl.split("?");if(arrUrl.length>1)
{var arrQueryString=arrUrl[1].split("&");for(var i=0;i<arrQueryString.length;i++)
{var dontJoin=false;var arrVariable=arrQueryString[i].split("=");if(arrVariable[0].toLowerCase()==strVariable.toLowerCase())
{blnFound=true;arrVariable[1]=strValue;if(strValue==null)
{arrQueryString.splice(i,1);dontJoin=true;}}
if(!dontJoin)
arrQueryString[i]=arrVariable.join("=");}
arrUrl[1]=arrQueryString.join("&");}
if(!blnFound&&strValue!=null)
{if(arrUrl.length>1)
return strUrl+"&"+strVariable+"="+strValue;else
return strUrl+"?"+strVariable+"="+strValue;}
else
{return arrUrl.join("?");}}
function queryStringSwapAction(strNewAction)
{return queryStringSwapVariable("action",strNewAction);}
function toggleShowHideSection(objImg)
{var objRow=objImg.parentElement;while(objRow.rowType!="SectionHeader"&&objRow.rowType!="ButtonBar")
{objRow=objRow.parentElement;}
if(objRow.collapsed=="true")
{objImg.src=changeImage(objImg.src,objImg.imgsrc_collapse);showSection(objRow);}
else
{objImg.src=changeImage(objImg.src,objImg.imgsrc_expand);hideSection(objRow);}}
function showSection(objRow)
{objRow.collapsed="false";var objTable=objRow.offsetParent;for(var i=(objRow.rowIndex+1);i<objTable.rows.length;i++)
{if(objTable.rows[i].rowType!="SectionHeader"&&objTable.rows[i].rowType!="ButtonBar")
{objTable.rows[i].style.display="";}
else
{return;}}}
function hideSection(objRow)
{objRow.collapsed="true";var objTable=objRow.offsetParent;for(var i=(objRow.rowIndex+1);i<objTable.rows.length;i++)
{if(objTable.rows[i].rowType!="SectionHeader"&&objTable.rows[i].rowType!="ButtonBar")
{objTable.rows[i].style.display="none";}
else
{return;}}}
function getCheckedRadioOptionValue(objRadio)
{for(var i=0;i<objRadio.length;i++)
{if(objRadio[i].checked)
return objRadio[i].value;}
return null;}
function getCheckedRadioOptionIndex(objRadio)
{for(var i=0;i<objRadio.length;i++)
{if(objRadio[i].checked)
return i;}
return null;}
function changeNode(intSpanID)
{var objSpan=eval("g_doc.span"+intSpanID);var objImage=eval("g_doc.handle"+intSpanID);if(objSpan.style.visibility=="hidden")
{objSpan.style.visibility="";objSpan.style.position="";objSpan.style.display="";objImage.src=changeImage(objImage.src,objImage.imgsrc_collapse);}
else
{objSpan.style.visibility="hidden";objSpan.style.position="absolute";objSpan.style.display="none";objImage.src=changeImage(objImage.src,objImage.imgsrc_expand);}}
function Help(helpUrl)
{var helpWidth=225;var height=screen.availHeight;var width=screen.availWidth-helpWidth-10;if(window.screen)
{window.moveTo(0,0);window.resizeTo(width,height);}
window.open(helpUrl,'XTHelp','width='+helpWidth+',height='+(height-30)+',left='+width+',dependent=1,top=0,toolbar=no,resizable=yes,location=no,directories=no,status=no,menubar=no,scrollbars=no,titlebar=no');}
function restoreOpenerSettings()
{this.window.close();window.opener.resizeTo(screen.availWidth,screen.availHeight);}
function resizeRelativeToWindow(strName,offsetSize)
{var item=document.getElementById(strName);item.style.height=screen.availHeight-offsetSize;}
function enableInput(obj,control)
{var element=getFormElement(control);if(obj.value=="")
{element.disabled=true;element.value="";}
else
element.disabled=false;}
function SelectNavigateTo(strValue,strUrl,selectListID)
{document.pageform.submit();}
function ConfirmDelete(obj,message)
{if(confirm(message))
eval(obj.href);else
return false;}
function redirectV3Search(projectpath,control)
{var element=getFormElement(control);var url=projectpath+"/user/sch/sch_user_display.asp?action=search&Search="+element.value;document.pageform.action=url;document.pageform.submit();}
function GetQueryStringItem(strItem)
{var arrQS=new Array();var arrValues=new Array();var arrItems=new Array();var blnFound=false;var strCurLocation="";var strCurLocation=window.location.toString();arrQS=strCurLocation.split("?")
if(arrQS.length<2)
{return null;}
else
{arrItems=arrQS[1].split("&")
for(var i=0;i<arrItems.length;i++)
{arrValues=arrItems[i].split("=");if(arrValues[0].toLowerCase()==strItem.toLowerCase())
return arrValues[1];}}}
function revealHelp(strSpanID){var objImage=eval("document.img"+strSpanID)
if(gstrLastHelpClicked!=null&&gstrLastHelpClicked!=strSpanID){hideHelp(gstrLastHelpClicked)}
var objHelp=eval("help"+strSpanID)
objHelp.style.visibility="visible"
eval("document.img"+strSpanID).onclick=function onclick(event){hideHelp(strSpanID)}
eval("document.img"+strSpanID).src="/media/images/system/forms/hide_help_button.gif"
window.status="Click to hide help"
gstrLastHelpClicked=strSpanID}
function hideHelp(strSpanID){var objHelp=eval("help"+strSpanID);objHelp.style.visibility="hidden"
eval("document.img"+strSpanID).onclick=function onclick(event){revealHelp(strSpanID)}
eval("document.img"+strSpanID).src="/media/images/system/forms/show_help_button.gif"
window.status="Click to show help"
gstrLastHelpClicked=null}
function toggleDate(strSpanID,objImg)
{var objDate=eval("date"+strSpanID)
if(objDate.style.display=="none")
revealDate(strSpanID,objImg);else
hideDate(strSpanID,objImg);}
function revealDate(strSpanID){var objImage=eval("document.img"+strSpanID)
if(gstrLastDateClicked!=null&&gstrLastDateClicked!=strSpanID){hideDate(gstrLastDateClicked);}
var objDate=eval("date"+strSpanID)
objDate.style.visibility="visible"
eval("document.img"+strSpanID).onclick=function onclick(event){hideDate(strSpanID)}
eval("document.img"+strSpanID).src="/media/images/system/forms/hide_date_button.gif"
window.status="Click to hide Date"
gstrLastDateClicked=strSpanID}
