//globals var layerRef="null",layerStyleRef="null",styleSwitch="null",leftSwitch="null",topSwitch="null",show="show",hide="hide",height,width; var newPageName = "default.asp"; var contentFrame= ""; explorer = (document.all) ? true:false; netscape = (document.layers) ? true:false; dom = (document.getElementById) ? true:false; //----------------popup variables--------------- var left = Math.round(screen.availWidth/2) var top = Math.round(screen.availHeight/2) var windowCount = 0 //----------------popup variables--------------- //run Imediately if(explorer){ //width = document.body.clientWidth; //height = document.body.clientHeight; layerStyleRef="layer.style."; layerRef="document.all"; styleSwitch=".style"; leftSwitch=".pixelLeft"; topSwitch=".pixelTop"; show = "visible"; hide = "hidden"; } if(netscape){ width = window.innerWidth; height = window.innerHeight; layerStyleRef="layer."; layerRef="document.layers"; styleSwitch=""; leftSwitch=".left"; topSwitch=".top"; show = "show"; hide = "hide"; } if(dom){ layerRef="document.getElementById"; styleSwitch=".style"; leftSwitch=".left"; topSwitch=".top"; show = "visible"; hide = "hidden"; } //----------layer functions---------------- function getLayerReference(layerName){ if(netscape || (explorer && !dom)) return (layerRef+"['"+layerName+"']"); else return (layerRef+"('"+layerName+"')"); } function showLayer(layerName){ eval(getLayerReference(layerName)+styleSwitch+'.display="";'); } function hideLayer(layerName){ eval(getLayerReference(layerName)+styleSwitch+'.display="none";'); } function moveTo(layerName, top, left){ eval(getLayerReference(layerName)+styleSwitch+topSwitch+' ="'+top+'";'); eval(getLayerReference(layerName)+styleSwitch+leftSwitch+' ="'+left+'";'); } function moveBy(layerName, dX, dY){ eval(getLayerReference(layerName)+styleSwitch+topSwitch+' ='+layerRef+'["'+layerName+'"]'+styleSwitch+topSwitch+' + ' +dY+ ";"); eval(getLayerReference(layerName)+styleSwitch+leftSwitch+' ='+layerRef+'["'+layerName+'"]'+styleSwitch+leftSwitch+' + '+dX+ ";"); } function getLayerTop(layerName){ return eval(getLayerReference(layerName)+styleSwitch+topSwitch+ ";"); } //----------non layer functions---------------- function currentFile(){ currLoc = new String(document.location); return currLoc.substring(currLoc.lastIndexOf("/") + 1, currLoc.indexOf("?") > 0 ? currLoc.indexOf("?") : currLoc.length); } function jumpTo(whichPage){ //alert(parent.frames['navigation']) if(parent.frames['navigation'] != null && parent.frames['navigation'].isPreview) return; //---------------------------------------------------------------------------------------- // New code 26/02/06 // // set current section as referring page //---------------------------------------------------------------------------------------- var URLBeforeJump = "" + document.location; var QStringArray=URLBeforeJump.split("&"); var QStringVal=QStringArray[0]; var equalsIndex=QStringVal.indexOf("="); if (equalsIndex == -1) { var referringPage = "=HomePage" } if (equalsIndex > 0) { var referringPage = QStringVal.substring(equalsIndex) } //---------------------------------------------------------------------------------------- // end of new code //---------------------------------------------------------------------------------------- //pageLink = newPageName + "?site=ROOT§ion=" +whichPage; //pageLink = newPageName + "?section=" +whichPage; //---------------------------------------------------------------------------------------- // New code 26/02/06 // // Set pageLink with a new Querystring including referring page //---------------------------------------------------------------------------------------- pageLink = newPageName + "?section=" +whichPage + "&ref" + referringPage; //---------------------------------------------------------------------------------------- // popup login page if clicked login button //---------------------------------------------------------------------------------------- if (whichPage == 300) { newwindow=window.open('https://www.childcareaccount.co.uk/SSL//LoginDB/login.asp','childcareaccountpopup','height=600,width=750,left=50,top=25,scrollbars=yes'); if (window.focus) {newwindow.focus()} } else //---------------------------------------------------------------------------------------- // else go to next page as normal - end of new code //---------------------------------------------------------------------------------------- { loadNewPage(contentFrame, pageLink); } } function loadNewPage(frame, page){ if(page == "#" || page =="") return; if(frame.length > 0) top.frames[frame].document.location = page; else document.location = page; } function popUp(width, height, target){ windowCount++ window.open(target,windowCount,"width="+width+",height="+height+",top="+(top - Math.round(height/2))+",left="+(left - Math.round(width/2))+"scrollbars=no,resizable=no") }