//global constants used in the jsp pages var TYPE_TXT_BOX = "1"; var TYPE_LIST_BOX = "2"; var TYPE_HIDDEN = "3"; var USE_OLD_ANCHOR = "USE_OLD_ANCHOR" //*** This removes the request param(including value) in the URL *****// function removeFromURL(xRmParam){ return removeFromxURL(document.location.href,xRmParam); } function removeFromxURL(xURL,xRmParam){ var str = xURL; var strtIndx=str.indexOf(xRmParam+"="); if(strtIndx <=0) return xURL; var endIndx=str.indexOf("&",strtIndx); if(str.substring(strtIndx-1,strtIndx)=="&"){ strtIndx = strtIndx-1; } else{ if(endIndx!=-1){ endIndx=endIndx+1; } } var strToRm; if(endIndx!=-1){ strToRm=str.substring(strtIndx,endIndx); } else{ strToRm=str.substring(strtIndx); } var re=new RegExp(strToRm); str=str.replace(re,""); return str; } /*** adding the param in the url after removing it, and appends the anchor text if exists **/ function getParamAddedURL(xParamName,xParamValue,xAnchorText){ return getParamAddedxURL(document.location.href,xParamName,xParamValue,xAnchorText); } function getParamAddedxURL(xURL,xParamName,xParamValue,xAnchorText){ var urlStr = xURL; var lastStr=""; if(urlStr.indexOf("#")>0){ lastStr=urlStr.substring(urlStr.indexOf("#")); urlStr=urlStr.substring(0,urlStr.indexOf("#")); } urlStr = removeFromxURL(urlStr,xParamName); if(urlStr.indexOf("?")>0){ urlStr = urlStr +"&"+ xParamName +"="+xParamValue; }else{ urlStr = urlStr +"?"+ xParamName +"="+xParamValue; } if( xAnchorText == null || xAnchorText== "" || xAnchorText == "null" ) return urlStr; else if( xAnchorText==USE_OLD_ANCHOR ) return urlStr + lastStr; else return urlStr +"#"+ xAnchorText; } /************ adding the params in the url after removing it, and appends the anchor text if exists************/ function getParamsAddedURL(xParamNames,xParamTypes,xAnchorText){ return getParamsAddedxURL(document.location.href,xParamNames,xParamTypes,xAnchorText); } function getParamsAddedxURL(xURL,xParamNames,xParamTypes,xAnchorText){ var urlStr =xURL; var lastStr=""; if(urlStr.indexOf("#")>0){ lastStr = urlStr.substring(urlStr.indexOf("#")); urlStr = urlStr.substring(0,urlStr.indexOf("#")); } var ParamName,ParamValue,ParamType; for(i=0;i0){ urlStr = urlStr +"&"+ ParamName +"="+ ParamValue; }else{ urlStr = urlStr +"?"+ ParamName +"="+ ParamValue; } } if( xAnchorText == null || xAnchorText== "" || xAnchorText == "null" ) return urlStr; else if( xAnchorText==USE_OLD_ANCHOR ) return urlStr + lastStr; else return urlStr +"#"+ xAnchorText; } //******** GET THE URL WITH THE ANCHOR TEXT GIVEN ******************// function getAnchoredURL(xAnchorText){ return getAnchoredxURL(document.location.href,xAnchorText); } function getAnchoredxURL(xURL,xAnchorText){ var urlStr =xURL; var lastStr=""; if(urlStr.indexOf("#")>0){ lastStr = urlStr.substring(urlStr.indexOf("#")); urlStr = urlStr.substring(0,urlStr.indexOf("#")); } if( xAnchorText == null || xAnchorText== "" || xAnchorText == "null" ) return urlStr; else if( xAnchorText==USE_OLD_ANCHOR ) return urlStr + lastStr; else return urlStr +"#"+ xAnchorText; } function browseURL(){ browsexURL(document.location.href); } function browsexURL(xURL){ document.location.href = xURL; } /**It setting the anchor after loading all the imgs in the page**/ function setAnchorInPage(pAnchorName){ var url = document.location.href; if(pAnchorName==null || pAnchorName==""){ if( url.indexOf("#")>0){ pAnchorName = url.substring(url.indexOf("#")+1); }else{ return; } } //if(url.indexOf("#"+pAnchorName) <=0 ) return; var setAnchor = false; if (document.images){ var numOfImgs = document.images.length; for(i=0;i1){ dash_currentCount = parseInt(window.name.split('@')[1]); //getting the count from the window.name windowDeactiveFlag = eval(""+window.name.split('@')[3]); }else{ dash_windowName = setDashWindowName( dash_currentCount, windowDeactiveFlag);//if no value in window.name set it to 0 } } function autoRefresh(pIntervalTime,pMsgNodeId,pMsg){ if(!windowDeactiveFlag){dash_currentCount = 0;} if(dash_currentCount < dash_stoppingCount){ setTimeout('reloadPage()', pIntervalTime); } else{ //adding message //var myElement = document.getElementById(pMsgNodeId); //get all the nodes contain the name and chech for the id //given, if it exists then added the img and msg node var myAllElements = document.getElementsByTagName('span'); //span if(pMsg==null || pMsg==''){ //getting the nls translated msg from hidden variable "autoReloadMsgId" var pMsgElem = document.getElementById("autoReloadMsgId"); if(pMsgElem!=null){pMsg=pMsgElem.value;} } if(myAllElements!=null){ for(j=0;j