ipjUA=navigator.userAgent; ipjIsIE = (navigator.appName == "Microsoft Internet Explorer"); ipjIsIE5 = ipjIsIE && (ipjUA.indexOf('MSIE 5') != -1); ipjIsIE5_0 = ipjIsIE && (ipjUA.indexOf('MSIE 5.0') != -1); ipjIsIE7 = ipjIsIE && (ipjUA.indexOf('MSIE 7') != -1); ipjIsGecko = ipjUA.indexOf('Gecko') != -1; // Will also be true on Safari ipjIsSafari = ipjUA.indexOf('Safari') != -1; ipjIsOpera = window['opera'] && opera.buildNumber ? true : false; ipjIsMac = ipjUA.indexOf('Mac') != -1; ipjIsNS7 = ipjUA.indexOf('Netscape/7') != -1; ipjIsNS71 = ipjUA.indexOf('Netscape/7.1') != -1; ipjIsFF = ipjUA.indexOf('Firefox') != -1; ipjIsFF3 = ipjUA.indexOf('Firefox/3') != -1; var ipjPageSiteID=-1; var ipjPageSiteGroupID=-1; function ipjCreateCookie(name,value,days){ if (days){ var date=new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function ipjReadCookie(name){ var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p); } if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i0) && (path2.length>0)){ return "/" + path1 + "/" + path2; } if (path1.length>0){ return "/" + path1; } if (path2.length>0){ return "/" + path2; } }; String.prototype.endsWith=function(sEnd) { return (this.substr(this.length-sEnd.length)==sEnd); }; String.prototype.startsWith=function(sStart) { return (this.substr(0,sStart.length)==sStart); }; String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); } String.prototype.toCharArray=function() { var arrRet=new Array(); for(var i=0;iiDivUpdateLast+1000){ var div=ipjFindObj(elemName); div.innerHTML+=msg; window.scrollTo(0,document.body.scrollHeight); iDivUpdateLast=(new Date()).getTime(); } }; function ipjRadioSelect(rbId) { var rb=ipjFindObj(rbId); rb.checked=true; }; function ipjClearDefaultAndCSS(el) { if (el){ if (el.defaultValue==el.value) el.value = "" } }; function ipjAddPostBack() { if(typeof(__doPostBack) == 'undefined') { document.write(""); document.write(""); document.write(""); } }; function ipjSetRadioButton(groupName, value){ var radios=document.getElementsByName(groupName); for (i=0; i'; } else // We're hiding the frame { objFrame.src = ""; objFrame.height = "0"; objFrame.width = "0"; url.innerHTML=strPreview; } }; function ipjShowPopupWithContent(strContent,winName,features) { if (winName =="") winName = "_blank"; if (winName =="center") features = ipjFindCenterForPopup(); if (features == "") features = "width=300,height=300" var ipDisplayWindow = window.open("",winName,features); ipDisplayWindow.document.write(unescape(strContent)); ipDisplayWindow.document.close(); } function ipjShowPopupByURL(strURL,winName,features) { if (winName =="") winName = "_blank"; if (winName =="center") features = ipjFindCenterForPopup(); if (features == "") features = "width=300,height=300" var ipDisplayWindow=window.open(strURL,winName,features); } function ipjFindCenterForPopup() { if (window.screen){ var nWidth=380; var nHeight=350; var nLeft=10; var nTop=10; nLeft=(window.screen.availWidth-nWidth)/2; nTop=(window.screen.availHeight-nHeight)/2; var features = 'width='+nWidth+',height='+nHeight+',left='+nLeft+',top='+nTop; } else{ var features='width=380,height=350'; } return features; } var ipjModalDialogWindow=null; var ipjModalReturnFunction=null; var ipjModalReturnFunctionArgs=null; var ipjModalAbortNew=false; var ipjEventActionCancelled=false; function Dimensions(){ this.top=0; this.left=0; this.width=0; this.height=0; } function ipjGetDialogDimensions(intWidth, intHeight) { var dim=new Dimensions(); dim.width=intWidth; dim.height=intHeight; if (window.screenX){ dim.left=window.screenX+((window.outerWidth-intWidth)/2); dim.top=window.screenY+((window.outerHeight-intHeight)/2); }else if (window.screenLeft){ var CSSCompat = (document.compatMode && document.compatMode != "BackCompat"); window.outerWidth=(CSSCompat) ? document.body.parentElement.clientWidth : document.body.clientWidth; window.outerHeight=(CSSCompat) ? document.body.parentElement.clientHeight : document.body.clientHeight; window.outerHeight-=80; dim.left=parseInt(window.screenLeft+((window.outerWidth-intWidth)/2)); dim.top=parseInt(window.screenTop+((window.outerHeight-intHeight)/2)); }else{ dim.left=(screen.width-intWidth)/2; dim.top=(screen.height-intHeight)/2; } return dim; } function ipjShowModal(strUrl, intHeight, intWidth , args, objPointer, funcReturnFunc, functionArgs, dialogArgs){ ipjEventActionCancelled=false; if (ipjModalAbortNew==true) return true; ipjSessionWarningSet(); if (args !=null){ strUrl += "?" + args; } var dim=ipjGetDialogDimensions(intWidth, intHeight); if (!ipjModalDialogWindow || (ipjModalDialogWindow && ipjModalDialogWindow.closed)){ if (window.showModalDialog){ var ieFeatures = "resizable:no;dialogLeft:" + dim.left + "px;dialogTop:" + dim.top + "px;dialogWidth:" + dim.width + "px;dialogHeight:" + dim.height + "px;status:no;help:no;scroll:no"; //mr var returnValue=window.showModalDialog(strUrl, dialogArgs, ieFeatures); ipjSessionKeepAlive(); ipjSessionWarningSet(); if (funcReturnFunc !=null){ funcReturnFunc(returnValue, functionArgs); return; } else{ return returnValue; } } else{ ipjModalReturnFunction=funcReturnFunc; ipjModalReturnFunctionArgs=functionArgs; ipjModalDialogArgs=dialogArgs; var nnfeatures = "dependent=yes,resizable=no,screenX=" + dim.left + ",screenY=" + dim.top + ",width=" + dim.width + ",height=" + dim.height; ipjModalDialogWindow=window.open(strUrl, (new Date()).getTime().toString(), nnfeatures); ipjModalDialogWindow.focus(); window.top.captureEvents(Event.CLICK|Event.FOCUS); window.top.onfocus=iHandleFocus; window.top.onclick=iHandleFocus; setTimeout("ipjModalDialogWindow.focus();",1) } } else{ ipjModalDialogWindow.focus(); } } function ipjCloseModal(returnValue) { returnValue=unescape(returnValue); if (ipjIsFF3) { window.top.returnValue=returnValue; window.top.close(); } else if (window.showModalDialog) { window.close(); window.returnValue=returnValue; } else { parent.opener.top.releaseEvents(Event.CLICK|Event.FOCUS); parent.opener.top.onclick=""; parent.opener.top.onfocus=""; if (parent.opener.ipjModalReturnFunction!=null) parent.opener.ipjModalReturnFunction(returnValue,parent.opener.ipjModalReturnFunctionArgs); window.top.close(); } }; function ipjForcePostBack(returnValue, postbackArgs) { if (postbackArgs==null || typeof(postbackArgs)!="object") __doPostBack('',''); else{ if (postbackArgs.length==1) __doPostBack(postbackArgs[0],''); if (postbackArgs.length==2) __doPostBack(postbackArgs[0],postbackArgs[1]); } } function ipjUpdateHyperlink(hyperlinkText, hyperlinkElementId) { if (hyperlinkText==null || hyperlinkText=="") return; document.getElementById(hyperlinkElementId).innerHTML=hyperlinkText; } function ipjContinueEventAction(returnValue, elementId) { if (document.all) return; if (returnValue=="true" || returnValue==true) { ipjModalAbortNew=true; document.getElementById(elementId).click(); } else{ __doPostBack('',''); //default action is to postback when the modal is closed } } function ipjContinueEventActionWithCancel(returnValue, elementId) { if (document.all || ipjIsFF3){ if (returnValue==window.undefined || returnValue=="" || returnValue=="false") ipjEventActionCancelled=true; return; } else{ if (returnValue==window.undefined || returnValue=="" || returnValue=="false") { } else{ ipjModalAbortNew=true; document.getElementById(elementId).click(); } } } function iIgnoreEvents(e) { return false; }; function iHandleFocus() { if (ipjModalDialogWindow){ if (!ipjModalDialogWindow.closed){ ipjModalDialogWindow.focus(); return false; } else{ window.top.releaseEvents(Event.CLICK|Event.FOCUS); window.top.onclick=""; window.top.onfocus=""; } } }; var ipjULMouseoutLIs=new Array(); var ipjULMouseoutLITimeouts=new Array(); function ipjInitUnorderedListMenu(sectionMenuElementID, collapseDelay){ if (arguments.length==1) collapseDelay=0; var sfEls = document.getElementById(sectionMenuElementID).getElementsByTagName("LI"); for (var i=0; i0) { sfEls[i].className = sfEls[i].className + ' ipf-active' + intLevel; } else { sfEls[i].className = 'ipf-active' + intLevel; } break; } } } } } function ipjOpenCalendarButtonClick(ctlID, doAutoPostBack, localize) { var selectedDate = encodeURI(document.getElementById(ctlID+"_txtDate").value); var iframeElem = document.getElementById(ctlID+"_ifrCalendarPage"); var pathToIframe = iAppendVirtualPath(ipVirDir, "/CM/WebUI/UserControls/DateTimeControlIframe.aspx?ctlID=" + ctlID + "&doAutoPostBack=" + doAutoPostBack + "&localize=" + localize + "&selectedDate=" + selectedDate); iframeElem.src=pathToIframe; if (!document.all) iframeElem.height=parseInt(iframeElem.height)+20; iframeElem.style.display=(iframeElem.style.display=="block"?"none":"block"); } function ipjClearCalendarButtonClick(ctlID, doAutoPostBack) { if (document.getElementById(ctlID+"_txtDate")) document.getElementById(ctlID+"_txtDate").value=""; if (document.getElementById(ctlID+"_hdnDateValueForQuestionnaireResponses")) document.getElementById(ctlID+"_hdnDateValueForQuestionnaireResponses").value=""; if (document.getElementById(ctlID+"_dd24Hours")) document.getElementById(ctlID+"_dd24Hours").selectedIndex=0; if (document.getElementById(ctlID+"_dd12Hours")) document.getElementById(ctlID+"_dd12Hours").selectedIndex=0; if (document.getElementById(ctlID+"_ddMinute")) document.getElementById(ctlID+"_ddMinute").selectedIndex=0; if (document.getElementById(ctlID+"_ddAMPM")) document.getElementById(ctlID+"_ddAMPM").selectedIndex=0; if (doAutoPostBack) __doPostBack('',''); } function ipjCalendarDaySelectedClick(ctlID, strDate, strDateValueForQuestionnaireResponses, doAutoPostBack) { document.getElementById(ctlID+"_txtDate").value=strDate; try { eval(ctlID+"_DaySelectedClick();"); } catch (err) { } document.getElementById(ctlID+"_hdnDateValueForQuestionnaireResponses").value=strDateValueForQuestionnaireResponses; if (doAutoPostBack) __doPostBack('',''); else document.getElementById(ctlID+"_ifrCalendarPage").style.display="none"; } var __nonMSDOMBrowser = (window.navigator.appName.toLowerCase().indexOf('explorer') == -1); var __theFormPostData = ""; var __theFormPostCollection=new Array(); function WebForm_InitCallback(){ __theFormPostData = ""; __theFormPostCollection=new Array(); for (var formIndex=0; formIndex -1) { var count=objForm.elements.length; var element; for (var i=0; i0) { strData = __theFormPostData + '__CALLBACKID=' + WebForm_EncodeCallback(strCallerId) + '&__CALLBACKPARAM='; } if (strPostData.length>0) { strData+=WebForm_EncodeCallback(strPostData); } xmlHttp.send(strData); return xmlHttp.responseText; } function ipjDoXmlHttpRequest(strCallerId, strURL, strPostData, ptrStateChangeFunc) { WebForm_InitCallback(); var xmlHttp=iGetXmlHttpObject(); if (xmlHttp==null) { alert ('Browser does not support HTTP Request'); return; } xmlHttp.onreadystatechange=function() { if (xmlHttp.readyState==4 || xmlHttp.readyState=='complete') { ptrStateChangeFunc(xmlHttp); } } xmlHttp.open('POST',strURL,true); xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); var strData=new String; if (strCallerId.length>0) { strData = __theFormPostData + '__CALLBACKID=' + WebForm_EncodeCallback(strCallerId) + '&__CALLBACKPARAM='; } if (strPostData.length>0) { strData+=WebForm_EncodeCallback(strPostData); } xmlHttp.send(strData); } function ipjDoXmlHttpRequestFromModal(returnValue, postbackArgs) { if (returnValue) { if (postbackArgs.length==3) { ipjDoXmlHttpRequest(postbackArgs[0],postbackArgs[1],postbackArgs[2]); } } } function ipjCreateXMLDOM(strResponseText) { var vXMLDoc; if (window.ActiveXObject) { vXMLDoc = new ActiveXObject("Microsoft.XMLDOM"); vXMLDoc.async=false; vXMLDoc.loadXML(strResponseText); } else if(document.implementation.createDocument) { var vParser=new DOMParser(); vXMLDoc = vParser.parseFromString(strResponseText, "text/xml"); } return vXMLDoc; } function iGetXmlHttpObject() { var objXMLHttp=null; if (window.XMLHttpRequest) { objXMLHttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP"); } return objXMLHttp; } function ipjSessionKeepAlive() { var objXMLHttp=iGetXmlHttpObject(); var strURL = iAppendVirtualPath(ipVirDir, "/CM/WebUI/Admin/ServerAction.aspx?action=session_keepalive&dt=" + new Date().getTime()); objXMLHttp.open('GET', strURL, true); objXMLHttp.send(null); } function ipjSessionTerminate() { var objXMLHttp=iGetXmlHttpObject(); var strURL = iAppendVirtualPath(ipVirDir, "/CM/WebUI/Admin/ServerAction.aspx?action=session_terminate&dt=" + new Date().getTime()); objXMLHttp.open('GET', strURL, true); objXMLHttp.send(null); } function getKeyCode(e) { if (window.event) return window.event.keyCode; else if (e) return e.which; else return null; } function ipKeyRestrict(e, validchars, blurOnEnter, caller) { var key='', keychar=''; key=getKeyCode(e); if (key==null) return true; keychar=String.fromCharCode(key); keychar=keychar.toLowerCase(); validchars=validchars.toLowerCase(); if (validchars.indexOf(keychar) !=-1) return true; if (blurOnEnter && key==13) { caller.blur(); return false; } if ( key==null || key==0 || key==8 || key==9 || key==13 || key==27 ) return true; return false; } ipjAddEvent(window, "resize", ipjCenterModalDialogPanel); ipjAddEvent(window, "scroll", ipjCenterModalDialogPanel); var ipjModalDialogPanelCurrentElem=null; function ipjShowModalDialogPanel(elemID){ if (ipjModalDialogPanelCurrentElem!=null) return; ipjModalDialogPanelCurrentElem=document.getElementById(elemID); ipjModalDialogPanelCurrentElem.style.display="block"; var overlayElem=ipjModalDialogPanelCurrentElem.nextSibling; if (document.all) overlayElem.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ipSysImageDir+"/ModalOverlay.png', sizingMethod='scale')"; else overlayElem.style.backgroundImage="url("+ipSysImageDir+"/ModalOverlay.png)"; overlayElem.style.display="block"; ipjCenterModalDialogPanel(); } function ipjHideModalDialogPanel(){ ipjModalDialogPanelCurrentElem.style.display="none"; ipjModalDialogPanelCurrentElem.nextSibling.style.display="none"; ipjModalDialogPanelCurrentElem=null; } function ipjCenterModalDialogPanel(){ if (ipjModalDialogPanelCurrentElem==null) return; var top=ipjPageScrollTop()+((ipjPageHeight()-parseInt(ipjModalDialogPanelCurrentElem.style.height))/2); var left=ipjPageScrollLeft()+((ipjPageWidth()-parseInt(ipjModalDialogPanelCurrentElem.style.width))/2); ipjModalDialogPanelCurrentElem.style.top = (top<0?0:top)+"px"; ipjModalDialogPanelCurrentElem.style.left = (left<0?0:left)+"px"; var overlayElem=ipjModalDialogPanelCurrentElem.nextSibling; overlayElem.style.height = ipjPageHeight()+"px"; overlayElem.style.width = ipjPageWidth()+"px"; overlayElem.style.top = ipjPageScrollTop()+"px"; overlayElem.style.left = ipjPageScrollLeft()+"px"; } var ipjSessionWarningCounter=0; var ipjSessionWarningTimer=null; var ipjSessionWarningPageTitle=null; var ipjSessionWarningPageTitleFlashInterval=null; function ipjSessionWarningSet(){ if (!window.ipjSessionWarningEnabled || window.ipjSessionWarningEnabled==false) return; if (window.ipjSessionWarningTimer) clearTimeout(ipjSessionWarningTimer); ipjSessionWarningTimer = setTimeout("ipjShowSessionWarning()", ipjSessionWarningSecondsTo*1000); } function ipjShowSessionWarning(){ if (ipjSessionWarningIsModalPage==true){ ipjSessionTerminate(); document.getElementById("divSessionWarningText").innerHTML=" Your session has expired."; document.getElementById("divSessionWarningButton").value="OK"; document.getElementById("divSessionWarningButton").onclick=ipjSessionWarningModalPageClose; ipjShowModalDialogPanel(ipjSessionWarningModalID); if (!document.all) window.top.opener.ipjHideModalDialogPanel(); } else{ ipjSessionWarningCounter=ipjSessionWarningCounterInitial; ipjShowModalDialogPanel(ipjSessionWarningModalID); ipjSessionWarningCountdown(); } window.focus(); ipjSessionWarningPageTitle=document.title; ipjSessionWarningPageTitleFlashInterval=setInterval("ipjSessionWarningFlashTitle()",1000); } function ipjSessionWarningFlashTitle(){ document.title=(document.title==ipjSessionWarningPageTitle?"SESSION EXPIRY":ipjSessionWarningPageTitle); } function ipjSessionWarningCountdown(){ document.getElementById("divSessionWarningSeconds").innerHTML=ipjSessionWarningCounter+" seconds"; if (ipjSessionWarningCounter<=0){ ipjSessionTerminate(); document.getElementById("divSessionWarningText").innerHTML=" Your session has expired."; document.getElementById("divSessionWarningButton").value="OK"; document.getElementById("divSessionWarningButton").onclick=ipjSessionWarningReloadPage; clearInterval(ipjSessionWarningPageTitleFlashInterval); document.title=ipjSessionWarningPageTitle; } else{ ipjSessionWarningCounter--; ipjSessionWarningTimer = setTimeout("ipjSessionWarningCountdown()", 1000); } } function ipjSessionWarningExtend(){ clearTimeout(ipjSessionWarningTimer); ipjHideModalDialogPanel(); ipjSessionKeepAlive(); ipjSessionWarningSet(); clearInterval(ipjSessionWarningPageTitleFlashInterval); document.title=ipjSessionWarningPageTitle; } function ipjSessionWarningReloadPage(){ if (window.ipjQuestionnaireLastPageURL){ document.location.href=unescape(ipjQuestionnaireLastPageURL); } else{ document.location.href=document.location.href; } } function ipjSessionWarningModalPageClose(){ window.top.close(); } var ipjMouseoutLIs=new Array(); var ipjMouseoutLITimeouts=new Array(); function ipjInitULMenu(menuElementID, frameElementID){ var sfEls = document.getElementById(menuElementID).getElementsByTagName("LI"); var elFrame=document.getElementById(frameElementID); for (var i=0; i 0) ipjAddEvent(window, "unload" , function (){}) } function ipjInitIronPointFormHandling(){ ipjRegisterSubmitButtons(); if (typeof(__doPostBack) == 'undefined') { return; } __oldDoPostBack=__doPostBack; __doPostBack=ipjSubmitIronPointForm; } function ipjRegisterSubmitButtons(){ for (var formIndex=0; formIndex -1) { var elements = innerForm.getElementsByTagName("INPUT"); for (var elementIndex=0; elementIndex -1) { for (var elementIndex=0; elementIndex"; var tickerBodyID = this.containerDivID + 'TICKER_BODY'; containerDiv.onmouseover=function(){instanceOfTicker.mouseoverBol=1} containerDiv.onmouseout=function(){instanceOfTicker.mouseoverBol=0} if (ipjIsFF || ipjIsSafari){ containerDiv.innerHTML = "
"+img+" "+img+"
"; tickerSupported=true; } if (ipjIsIE){ containerDiv.innerHTML = "
"+img+""+img+"
"; tickerSupported=true; } if(tickerSupported){ containerDiv.scrollLeft=this.isLeftToRight ? containerDiv.scrollWidth-containerDiv.offsetWidth : 0; document.getElementById(tickerBodyID).innerHTML=this.content; containerDiv.style.display="block"; this.tick(); } } IPHTicker.prototype.tick=function(){ var containerDiv=document.getElementById(this.containerDivID) var instanceOfTicker=this if(!this.mouseoverBol) containerDiv.scrollLeft+=this.speed * (this.isLeftToRight ?-1 : 1); if(this.isLeftToRight && containerDiv.scrollLeft<=0) containerDiv.scrollLeft=containerDiv.scrollWidth-containerDiv.offsetWidth; if(!this.isLeftToRight && containerDiv.scrollLeft>=containerDiv.scrollWidth-containerDiv.offsetWidth) containerDiv.scrollLeft=0; setTimeout(function(){instanceOfTicker.tick()}, this.delay) } function IPVTicker (strContainerDivID, intSpeed, delay, initialDelay){ this.containerDivID=strContainerDivID; this.speed=intSpeed; this.content=document.getElementById(this.containerDivID).innerHTML; this.mouseoverBol=0; this.delay=delay; this.initialDelay=initialDelay; this.actualHeight = ''; this.containerHeight = ''; } IPVTicker.prototype.initialize=function(){ var instanceOfTicker=this var containerDiv=document.getElementById(this.containerDivID) var tickerBodyDiv = document.getElementById(this.containerDivID + '_TICKER_BODY') containerDiv.onmouseover=function(){instanceOfTicker.mouseoverBol=1} containerDiv.onmouseout=function(){instanceOfTicker.mouseoverBol=0} tickerBodyDiv.style.top=0 this.actualHeight=tickerBodyDiv.offsetHeight if (ipjIsOpera || ipjIsNS7){ tickerBodyDiv.style.height = containerDiv.offsetHeight + "px" tickerBodyDiv.style.overflow = "scroll" return } setTimeout(function(){instanceOfTicker.tick()}, this.initialDelay) } IPVTicker.prototype.tick=function(){ var containerDiv=document.getElementById(this.containerDivID) var instanceOfTicker=this var tickerBodyDiv = document.getElementById(this.containerDivID + '_TICKER_BODY') if(!this.mouseoverBol){ if (parseInt(tickerBodyDiv.style.top)>(this.actualHeight*(-1)+8)) tickerBodyDiv.style.top=parseInt(tickerBodyDiv.style.top)-this.speed+"px" else tickerBodyDiv.style.top=parseInt(containerDiv.offsetHeight)+8+"px" } setTimeout(function(){instanceOfTicker.tick()}, this.delay) }