var strArrowChar = 4; var nTimeout = 500; var strBackground = "menustyle"; var strBackgroundOver = "menustyleover"; var strColor = "menustyle"; var strColorOver = "menustyleover"; var objActive; var objTopTimer; function MouseOverTop() { clearTimeout( objTopTimer ); this.className += " " + strBackgroundOver; /*with(this.style) { backgroundColor = strBackgroundOver; color = strColorOver; }*/ } function MouseOverHead() { var objChild = document.getElementById( this.getAttribute("childid") ); objChild.style.visibility = "visible"; } function MouseOutHead() { if ( objTopTimer && objActive != document.getElementById( this.getAttribute("childid") ) ) { Hide(); clearTimeout( objTopTimer ); } objActive = document.getElementById( this.getAttribute("childid") ); objTopTimer = setTimeout( "Hide()" , 200 ); } function Hide() { objActive.style.visibility = "hidden"; } function MouseOutTop() { if ( ( "" + this.className ).indexOf( strBackgroundOver ) != -1 ) { this.className = this.className.substring( 0 , this.className.indexOf(" " ) ); } with(this.style) { //backgroundColor = strBackground; //color = strColor; } if ( objTopTimer && objActive != this.parentElement ) { Hide(); clearTimeout( objTopTimer ); } objActive = this.parentElement; objTopTimer = setTimeout( "Hide()" , 200 ); } function MouseDownTop() { var strURL = "" + this.getAttribute("action"); if( strURL.indexOf("javascript:") != -1 ) { eval(strURL); } else if ( strURL != "" ) { document.location = strURL; } } function OutputTopMenu( strName , strAction , objContent , nLeft ) { var nY = 75; var nX = nLeft; var objHead = document.createElement("SPAN"); objHead.innerHTML = strName; objHead.className = "menutop"; objHead.style.top = 57; objHead.style.left = nLeft - 10; objHead.setAttribute( "action" , strAction ); if ( objContent.length > 0 ) { objHead.onmouseover = MouseOverHead; objHead.onmouseout = MouseOutHead; } objHead.onclick = MouseDownTop; document.body.appendChild( objHead ); var objArrow = document.createElement("SPAN"); objArrow.className = "ding"; objArrow.innerHTML = 4; if ( objContent.length == 0 ) { objArrow.className = "ding extrading"; } objHead.appendChild( objArrow ); var nID = document.uniqueID; if ( objContent.length > 0 ) { var objContainer = document.createElement("SPAN"); objContainer.id = nID; objHead.setAttribute( "childid" , nID ); objContainer.className = "menucontainer"; objContainer.style.top = nY + "px"; objContainer.style.left = nX + "px"; document.body.appendChild( objContainer ); for ( var j = 0 ; j < objContent.length ; j++ ) { var objSpan = document.createElement("SPAN"); with( objSpan ) { var strHTML = objContent[ j ][ 0 ]; if ( strHTML.length > 20 ) { title = strHTML + " - " + objContent[ j ][ 1 ]; strHTML = strHTML.substring(0,20) + "..."; } else { title = objContent[ j ][ 1 ]; } innerHTML = strHTML; setAttribute( "action" , objContent[ j ][ 2 ] ); style.height = "16px"; style.width = "100%"; style.paddingLeft = "12px"; onmouseover = MouseOverTop; onmouseout = MouseOutTop; onmousedown = MouseDownTop; } objContainer.appendChild( objSpan ); } } } function AddShortCut() { var strTitle = document.all.tags( "HEAD" ).item( 0 ).children[ 0 ].innerText; var objForm = document.createElement( "FORM" ); objForm.action = "/add_shortcut.asp"; objForm.method = "post"; document.body.appendChild( objForm ); var objInput = document.createElement( "INPUT" ); objInput.type = "hidden"; objInput.name = "pagename"; objInput.value = strTitle; objForm.appendChild( objInput ); objForm.submit(); } var objContacts = new Array( ); var objBookmarks = new Array( new Array( "Tilføj genvej" , "Tilføj genvej" , "javascript:AddShortCut()" ) ); function CreateTopMenu() { // alert( "False" ); if ( ( "" + document.location ).indexOf("frontpage") == -1 && ( "" + document.location ).indexOf("wait_find_residence.asp") == -1 && ! bFrontPage ) { // No logon menu on english version of waitinglist system OutputTopMenu( "Log på", "javascript:document.location='/rootobject.asp?name=logon_fbnu'" , new Array() , 920 ); } else { //OutputTopMenu( "Glemt adgangskode", "javascript:window.showModalDialog( '/dialogs/applicant_forgottenpassword.asp', new Array(), 'status:no' );", new Array() , 850 ); OutputTopMenu( "Glemt adgangskode", "javascript:LaunchModal( '/dialogs/applicant_forgottenpassword.asp', new Array());", new Array() , 850 ); if ( ( "" + document.location ).indexOf("wait_find_residence.asp") == -1 ) { //OutputTopMenu( "Ny bruger", "javascript:document.location = '/wait_applicant_profile.asp'", new Array() , 780 ); } } } //Call menucontruction on load. AttachToLoad( "CreateTopMenu()" );