//********GENERIC DW THING function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); //********INFO LAYER //prep, according to browser var IE = document.all?true:false if (!IE) document.captureEvents(Event.MOUSEMOVE) //else document.onmousemove = getMouse; //prep storage vars var mouseX = 0; var mouseY = 0; //prep configurational vars // 1) these ensure top left corner of layer doesn't appear exactly at cursor but slightly away, to avoid cursor obstructing view mouseOffsetX = -35; mouseOffsetY = 28; // 2) declare visual preferences // 3) declare strings to locate objects infoLayerObj = "document.getElementById('infoLayer')"; infoLayerArrowObj = "document.getElementById('infoLayerArrow')"; infoLayerTextHolderObj = "document.getElementById('infoLayerTextHolder')"; window.infoLayerShowing = false; function getMouse(ev) { if (IE) { mouseX = window.event.clientX + document.body.scrollLeft mouseY = window.event.clientY + document.body.scrollTop } else { mouseX = ev.pageX mouseY = ev.pageY } if (mouseX < 0){mouseX = 0} if (mouseY < 0){mouseY = 0} if (window.infoLayerShowing == true) { //DEBUG alert(eval(infoLayerObj)+"\n"+eval(infoLayerArrowObj)+"\n"+eval(infoLayerTextHolderObj)); eval(infoLayerObj).style.left = mouseX + mouseOffsetX; eval(infoLayerObj).style.top = mouseY + mouseOffsetY; eval(infoLayerArrowObj).style.left = mouseX + mouseOffsetX + 45; eval(infoLayerArrowObj).style.top = mouseY + mouseOffsetY - 16; } } opacityStages = new Array() for (n=0; n<10; n++) { opacityStages[opacityStages.length] = n / 10; } function infoLayerFade(out) { if (!out) { for (g=0; g"; infoLineStart2 = ""; function info(area, sectors, tags, geogInfoNotHeadlineInfo) { if (area) { window.infoLayerShowing = true; eval(infoLayerObj).style.left = mouseX + mouseOffsetX; eval(infoLayerObj).style.top = mouseY + mouseOffsetY; eval(infoLayerArrowObj).style.left = mouseX + mouseOffsetX + 45; eval(infoLayerArrowObj).style.top = mouseY + mouseOffsetY - 16; innerTextVar = ''; if (!geogInfoNotHeadlineInfo) { innerTextVar = infoLineStart2+"AREAS: "; document.getElementById('infoLayerHeaderText').innerHTML = "Story overview"; } else { document.getElementById('infoLayerHeaderText').innerHTML = "Major areas"; } innerTextVar += area; if (sectors) innerTextVar += infoLineStart+infoLineStart2+"SECTORS(S): "+sectors; if (tags) innerTextVar += infoLineStart+infoLineStart2+"Tags: "+tags.replace(/ /g, ", "); eval(infoLayerObj).style.display = 'block'; eval(infoLayerArrowObj).style.display = 'block'; if (IE != true) infoLayerFadeInt = setInterval('infoLayerFade()', 10); } else { //if no text passed, it's mouseout if (IE != true) clearInterval(infoLayerFadeInt); //if fade-in int is still alive (i.e. mouse out happened before it reached full opacity and thus int wasn't killed), kill here to be sure of proper fade effect on next mouseover innerTextVar = ""; window.infoLayerShowing = "no"; eval(infoLayerObj).style.display = 'none'; eval(infoLayerArrowObj).style.display = 'none'; if (!IE) infoLayerFade(true); } eval(infoLayerTextHolderObj).innerHTML = innerTextVar; } //func for handling rollovers on geography links (Eng site only) function geogInfo(text) { info(text, null, null, true); } //********SEND SITE PAGE (modified version of old 'send story' script but can now send any page dependnging on args passed) function sendStory(storyId, sendReferrerPageNotNecessarilyAStory) { if (!sendReferrerPageNotNecessarilyAStory) urlAdder = "id="+storyId; else urlAdder = "referrer=https://marchmontcapital.com/scripts/general/basicscripts.php"; window.open ("emailthispage.php?"+urlAdder, "mywindow", "location=0,status=0,scrollbars=0,width=360,height=360"); } //********LOGIN function positionLoginFormHolderDiv() { //Centres abs-pos divs used during login process, relative to available browser area of user's screen objs = new Array('loginFormHolder', 'login_afterSuccessful', 'login_afterError'); for (r=0; rLogged in: "+name+" (Logout)"; document.getElementById('userNameReplace').innerHTML = name; document.getElementById('login_afterSuccessful').style.display = 'block'; document.getElementById('loginFormHolder').style.display = 'none'; document.getElementById('loginSubmitButton').innerHTML = "login"; } function logout(afterIframeHasKilledSession) { if (!afterIframeHasKilledSession) { login_ifr.location.href = "/scripts/general/loginHandler.php?logout=true"; } else { document.getElementById('topLoginLogoutArea').innerHTML = "Login ?|? Join! ?|? Last update 7?Mar?08:09"; alert("You have successfully logged out"); } } //********SEARCH function searchMe(geogSearchNotTop) { if (geogSearchNotTop) { form = "geogSearchForm"; obj = document.getElementById('geogSearch'); } else { form = "topSearchForm"; obj = document.getElementById('topSearch'); } if (obj.value != '') document.getElementById(form).submit(); else alert("You did not specify anything to search for"); } //********LEFT NAV MOUSEOVER/OUT function leftNavHov (objId, outNotOver) { if (outNotOver) { borderCol = 'bbbbbb'; bgCol = 'd9d9d9'; } else { borderCol = 'bb0000'; bgCol = 'c9c9c9'; } (obj = document.getElementById(objId)).style.borderRightColor = '#'+borderCol; obj.style.backgroundColor = bgCol; } function SetStorySize() { var bound = document.getElementById('stroydiv').getBoundingClientRect(); document.getElementById('storycolumn').height = (bound.bottom - bound.top) + 20; }