//Helper routines function GetTop( objElement ) { var nAmount = parseInt( objElement.offsetTop ); while( objElement.parentElement && objElement.parentElement.id != "widecontent" ) { if ( objElement.parentElement.tagName != "FORM" && objElement.parentElement.tagName != "TD" && objElement.parentElement.tagName != "TBODY" ) { nAmount += parseInt( objElement.parentElement.offsetTop ); } objElement = objElement.parentElement; } if ( objElement.parentElement && objElement.parentElement.id == "widecontent" ) { nAmount += parseInt( objElement.parentElement.offsetTop ); } return nAmount; } function isIE() { return ( document.all ? true : false ); } function GetLeft( objElement ) { var nAmount = parseInt( objElement.offsetLeft ); while( objElement.parentElement && objElement.parentElement.id != "widecontent" ) { if ( objElement.parentElement.tagName != "FORM" && objElement.parentElement.tagName != "TBODY" ) { nAmount = nAmount + parseInt( objElement.parentElement.offsetLeft ); } objElement = objElement.parentElement; } if ( objElement.parentElement && objElement.parentElement.id == "widecontent" ) { nAmount = nAmount + parseInt( objElement.parentElement.offsetLeft ); } return nAmount; } //Banners var objBanners = new Array(); var nMaxRevolutions = 3; function SetBanners() { var objElements = document.getElementsByName("banner"); for ( var i = 0 ; i < objElements.length ; i++ ) { objElements[ i ].nRev = 0; objElements[ i ].onclick = LaunchBanner; objElements[ i ].nNum = 1; objElements[ i ].nIndex = objBanners.length; objBanners[ objBanners.length ] = objElements[ i ]; objElements[ i ].nTimer = setTimeout("AnimateBanners(" + objElements[ i ].nIndex + ")" , 3000 ); } } function AnimateBanners( nIndex ) { var objElement = objBanners[ nIndex ]; var nNum = parseInt(objElement.nNum)+1; var nRev = objElement.nRev; if ( ! eval("objElement.text" + nNum ) || eval("objElement.text" + nNum ) == "" ) { nRev++; if ( nRev != nMaxRevolutions ) { objElement.nRev = nRev; objElement.nNum = 0; objElement.innerHTML = ""; objElement.nTimer = setTimeout("AnimateBanners(" + nIndex + ")" , 3000 ); } } else { objElement.innerHTML = unescape(eval("objElement.text" + nNum ) ); objElement.nNum = nNum; objElement.nTimer = setTimeout("AnimateBanners(" + nIndex + ")" , 3000 ); } } function LaunchBanner() { var objURL = unescape( this.url ).split("€"); if ( objURL[ 0 ] != "null" ) { if ( objURL[ 1 ] == "_self" ) { document.location = objURL[ 0 ]; } else { window.open( objURL[ 0 ] ); } } } /*HELP*/ function CloseHelp( obj ) { while ( obj.tagName != "DIV" ) { obj = obj.parentElement; } obj.style.visibility = "hidden"; } /*VALIDATION*/ function GetParent( obj , tagName ) { while ( obj && obj.tagName != tagName ) { obj = obj.parentNode; } return obj; } function ResizeModal() { window.dialogHeight = "2px"; window.dialogWidth = "2px"; var objDiv = document.createElement( "DIV" ); objDiv.id = "pos"; objDiv.style.position = "absolute"; objDiv.style.width = "0px"; objDiv.style.height = "0px"; objDiv.style.right = "0px"; objDiv.style.bottom = "0px"; document.body.appendChild( objDiv ); var nWidth = objDiv.offsetLeft; var nHeight = objDiv.offsetTop; var nHeightDiff = parseInt( window.dialogHeight ) - nHeight; var nWidthDiff = parseInt( window.dialogWidth ) - nWidth; window.dialogHeight = ( document.body.scrollHeight + nHeightDiff) + "px"; window.dialogWidth = ( document.body.scrollWidth + nWidthDiff + 100 ) + "px"; } var strBGColor = "ffffff"; var strFGColor = "FF8340"; var objColors = new Array( 40 ); GenerateFadeColors( strBGColor , strFGColor , objColors); var nCurColor = 0; var nStep = 1; var objInputToFade; var objFadeTimer; function FadeInput() { if ( nCurColor >= objColors.length - 1 ) { nStep = -1; } if ( nCurColor == 0 ) { if ( "" + objInputToFade.getAttribute("fadeindex") != "null" ) { var nFade = parseInt( objInputToFade.getAttribute("fadeindex") ); objInputToFade.setAttribute( "fadeindex" , ++nFade ); } else { objInputToFade.setAttribute( "fadeindex" , 1 ); } nStep = 1; } nCurColor += nStep; objInputToFade.style.backgroundColor = objColors[ nCurColor ]; if ( "" + objInputToFade.getAttribute("fadeindex") != "4" ) { objFadeTimer = setTimeout( "FadeInput()" , 70 ); } else { objInputToFade.style.backgroundColor = objColors[ 0 ]; } } function GenerateFadeColors( strColorStart , strColorEnd ) { nLength = objColors.length; var nR = parseInt( strColorStart.substring( 0 , 2 ) , 16 ); var nG = parseInt( strColorStart.substring( 2 , 4 ) , 16 ); var nB = parseInt( strColorStart.substring( 4 , 6 ) , 16 ); var nR2 = parseInt( strColorEnd.substring( 0 , 2 ) , 16 ); var nG2 = parseInt( strColorEnd.substring( 2 , 4 ) , 16 ); var nB2 = parseInt( strColorEnd.substring( 4 , 6 ) , 16 ); var nRStep = ( nR2 - nR ) / nLength; var nGStep = ( nG2 - nG ) / nLength; var nBStep = ( nB2 - nB) / nLength; for (i = 0 ; i < nLength - 1 ; i++) { objColors[ i ] = "#" + IntToHex( parseInt( nR ) ) + IntToHex( parseInt( nG ) ) + IntToHex( parseInt( nB ) ); nR += nRStep; nG += nGStep; nB += nBStep; } objColors[ nLength - 1 ] = strColorEnd; } function IntToHex(n) { var result = n.toString( 16 ); return ( result.length == 1 ? "0" + result : result ); } function GenericValidate( e , objForm ) { var LANG_DA = "1"; var LANG_EN = "2"; var strCurLang = "1"; clearTimeout( objFadeTimer ); var objElement; if( isIE() ) { objElement = ( objForm ? objForm : window.event.srcElement ); } else { objElement = ( objForm ? objForm : e.target ); } var objInput = new Array( 2 ); objInput[ 0 ] = objElement.getElementsByTagName("INPUT"); objInput[ 1 ] = objElement.getElementsByTagName("SELECT"); objInput[ 2 ] = objElement.getElementsByTagName("TEXTAREA"); for ( var n = 0 ; n < objInput.length ; n++ ) { for ( var i = 0 ; i < objInput[ n ].length ; i++ ) { if ( objElement == GetParent( objInput[ n ][ i ] , "FORM" ) ) { if ( objInput[ n ][ i ].getAttribute("required") == "true" && ( "" + objInput[ n ][ i ].disabled ) != "true" ) { if ( objInput[ n ][ i ].type == "hidden" || objInput[ n ][ i ].type == "password" || objInput[ n ][ i ].type == "text" || objInput[ n ][ i ].tagName == "TEXTAREA" ) { if ( objInput[ n ][ i ].getAttribute("code") != null ) { if ( ! objInput[ n ][ i ].value.match( objInput[ n ][ i ].getAttribute("code") ) ) { objInput[ n ][ i ].style.backgroundColor = "white"; if ( strCurLang == LANG_DA ) { var strError = ( objInput[ n ][ i ].getAttribute("error") != null ? objInput[ n ][ i ].getAttribute("error") : "Du har ikke indtastet korrekt formateret data for dette felt!" ); } else { var strError = ( objInput[ n ][ i ].getAttribute("error") != null ? objInput[ n ][ i ].getAttribute("error") : "The data you have entered for this field is not valid!" ); } alert( strError ); objInputToFade = objInput[ n ][ i ]; FadeInput(); if( objInput[ n ][ i ].type != "hidden" ) { objInput[ n ][ i ].focus(); if( ! isIE() ) { e.preventDefault(); } else { objInput[ n ][ i ].scrollIntoView(true); } } return false; } } else if ( objInput[ n ][ i ].value == "" ) { objInput[ n ][ i ].style.backgroundColor = "white"; if ( strCurLang == LANG_DA ) { var strError = ( objInput[ n ][ i ].getAttribute("error") != null ? objInput[ n ][ i ].getAttribute("error") : "Du skal udfylde dette felt!" ); } else { var strError = ( objInput[ n ][ i ].getAttribute("error") != null ? objInput[ n ][ i ].getAttribute("error") : "This field is required!" ); } alert( strError ); objInputToFade = objInput[ n ][ i ]; FadeInput(); objInput[ n ][ i ].focus(); if( ! isIE() ) { e.preventDefault(); } else { objInput[ n ][ i ].scrollIntoView(true); } return false; } } else if ( objInput[ n ][ i ].type == "radio" ) { var p = i; var bRadioTouch = false; while( objInput[ n ][ p ].name == objInput[ n ][ i ].name ) { if ( objInput[ n ][ p ].checked == true ) { bRadioTouch = true; } p++; } if ( ! bRadioTouch ) { if ( strCurLang == LANG_DA ) { var strError = ( objInput[ n ][ i ].getAttribute("error") != null ? objInput[ n ][ i ].getAttribute("error") : "Du skal vælge en radioknap!" ); } else { var strError = ( objInput[ n ][ i ].getAttribute("error") != null ? objInput[ n ][ i ].getAttribute("error") : "Please select a radiobutton!" ); } alert( strError ); objInput[ n ][ i ].focus(); if( ! isIE() ) { e.preventDefault(); } else { objInput[ n ][ i ].scrollIntoView(true); } return false; } i = p - 1; } else if( objInput[ n ][ i ].type == "checkbox" ) { if ( objInput[ n ][ i ].checked != true ) { if ( strCurLang == LANG_DA ) { var strError = ( objInput[ n ][ i ].getAttribute("error") != null ? objInput[ n ][ i ].getAttribute("error") : "Dette felt skal afkrydses!" ); } else { var strError = ( objInput[ n ][ i ].getAttribute("error") != null ? objInput[ n ][ i ].getAttribute("error") : "Please check this field!" ); } alert( strError ); objInput[ n ][ i ].focus(); if( ! isIE() ) { e.preventDefault(); } else { objInput[ n ][ i ].scrollIntoView(true); } return false; } } } //This is not strictly a validation //In order to collect selects multiples, we need to select them all in most cases. if ( objInput[ n ][ i ].tagName == "SELECT" ) { if ( objInput[ n ][ i ].multiple == true && "" + objInput[ n ][ i ].getAttribute( "collectall" ) == "true" ) { for ( var p = 0 ; p < objInput[ n ][ i ].options.length ; p++ ) { objInput[ n ][ i ].options[ p ].selected = true; } } } //Add more validations //Size-check if( objInput[ n ][ i ].getAttribute("maxsize") ) { var nMaxSize = parseInt( objInput[ n ][ i ].getAttribute("maxsize") ); var nCurSize = parseInt( objInput[ n ][ i ].value.length ); if ( nCurSize > nMaxSize ) { objInput[ n ][ i ].style.backgroundColor = "white"; if ( strCurLang == LANG_DA ) { alert( "Feltet må maksimum indeholde " + nMaxSize + " tegn. Du benytter " + nCurSize ); } else { alert( "This field is limited to " + nMaxSize + " characters. You have entered " + nCurSize ); } objInputToFade = objInput[ n ][ i ]; FadeInput(); objInput[ n ][ i ].focus(); if( ! isIE() ) { e.preventDefault(); } else { objInput[ n ][ i ].scrollIntoView(true); } return false; } } } } } return true; } function SetValidate() { var objForms = document.getElementsByTagName("FORM"); for ( var i = 0 ; i < objForms.length ; i++ ) { if ( objForms[ i ].onsubmit ) { var strSubmit = "" + objForms[ i ].onsubmit; strSubmit = strSubmit.substring( strSubmit.lastIndexOf("{") + 1 , strSubmit.lastIndexOf("}") ); objForms[ i ].onsubmit = new Function("if ( GenericValidate(false,document.getElementById('" + objForms[ i ].id + "')) == false ) return false;" + strSubmit ); } else { try { objForms[ i ].attachEvent("onsubmit" , GenericValidate ); } catch ( E ) { objForms[ i ].addEventListener("submit" , GenericValidate , false ); } } } } /*Selectmover*/ function MoveSelected( strSource , strDest ) { var objSource = document.getElementById( strSource ); var objDest = document.getElementById( strDest ); for ( var i = 0 ; i < objSource.options.length ; i++ ) { if ( ( "" + objSource.options[ i ].selected ) == "true" ) { var objOption = document.createElement("OPTION"); objOption.value = objSource.options[ i ].value; objOption.text = objSource.options[ i ].text; objDest.options.add( objOption ); objSource.remove( i ); i--; } } } /*Window handling*/ function ShowWindow( strLoc, strWindowName ) { self.name = "opener"; remote = open( strLoc, strWindowName ? strWindowName : "DE", "scrollbars,status"); if (!remote) { if (1 == 1) //LANG_DA alert('Vi har konstateret at din browser blokerer pop-up vinduer.\nDenne side benytter pop-up vinduer. Du skal derfor ændre dette hvis du vil benytte www.findbolig.nu.'); else alert('We have detected that you are using popup blocking software.\nThis site requires that you disable the popup blocker.'); UnSpawnProgress(); } } /*Help*/ function SetHelp() { var objElements = document.getElementsByName("dict"); for ( var i = 0 ; i < objElements.length ; i++ ) { if( isIE() ) { objElements[ i ].attachEvent( "onclick" , PopHelp ); } else { objElements[ i ].addEventListener( "click" , PopHelp , false ); } objElements[ i ].style.cursor = "hand"; } } function PopHelp( e ) { var objElement = ( e ? e.target : window.event.srcElement ); if( ! objElement ) { objElement = e.srcElement; } var i = 0; while( objElement.tagName != "SPAN" && i < 3) { objElement = objElement.parentNode; i++; } if( objElement.tagName != "SPAN" ) { objElement = ( e ? e.target : window.event.srcElement ); if( ! objElement ) { objElement = e.srcElement; } } var strText = ""; if( objElement.getAttribute( "word" ) ) { strText = objElement.getAttribute( "word" ); } else { strText = objElement.innerText; } ShowWindow( "/help.asp?query=" + strText ); } function PopHelpManual( strHeading, strBody ) { ShowWindow( "/help.asp?heading=" + strHeading + "&body=" + strBody ); } /*Printing*/ function SetPrint() { var objElement = document.createElement("DIV"); objElement.className = "printlogo"; document.body.appendChild( objElement ); var objImage = document.createElement("IMG"); objImage.src = "/_gfx/printlogo.gif"; objImage.width = "212"; objImage.height = "15"; objElement.appendChild( objImage ); } function ToFront() { document.location = "/index.asp"; } function InitSessionWarning_v1() { setTimeout( "SessionWarning_v1()", 119 * 1000 * 60 ); } function SessionWarning_v1() { try { eval( "V2ScriptIncluded();" ); } catch (E) { var nResult = window.showModalDialog( "dialogframe.asp?url=" + escape( "/session_warning.asp" ), null, 'status:no' ); if( nResult == 0 ) { location = "/logoff.asp?building="; } else { InitSessionWarning_v1(); } } } /*Loaders*/ var objLoadFunctions = new Array(); function AttachToLoad( objFunction ) { objLoadFunctions[ objLoadFunctions.length ] = objFunction; } function InitLoads() { for ( var i = 0 ; i < objLoadFunctions.length ; i++ ) { eval( objLoadFunctions[ i ] ); } SetHelp(); } function LaunchSetup() { self.name = "opener"; remote = open( "/personlig.asp?tab=2", "remote", "resizable,scrollbars"); } function Enable( objChildNode ) { var objChild = document.getElementById( objChildNode ); objChild.setAttribute( "disabled" , false ); if ( HasClass( "disabled" , objChild ) ) { RemoveClass( "disabled" , objChild ); } } function Disable( objChildNode ) { var objChild = document.getElementById( objChildNode ); objChild.setAttribute( "disabled" , true ); if ( ! HasClass( "disabled" , objChild ) ) { AddClass( "disabled" , objChild ); } } function SetFieldState( objArg ) { var objElement = ( objArg ? objArg : window.event.srcElement ); var objChildren = objElement.getAttribute( "toggles" ).split(","); if ( objElement.type == "radio" ) { //alert(objElement.checked); if ( objElement.checked ) { for ( var i = 0 ; i < objChildren.length ; i++ ) { var bTest = ( objElement.getAttribute( "togglestate" ) == "on" ? Enable( objChildren[ i ] ) : Disable( objChildren[ i ] ) ); } } } else { for ( var i = 0 ; i < objChildren.length ; i++ ) { var bTest = ( objElement.checked ? Enable( objChildren[ i ] ) : Disable( objChildren[ i ] ) ); } } } function PatchReset() { var objForms = document.getElementsByTagName( "FORM" ) for ( var i = 0 ; i < objForms.length ; i++ ) { //objForms[ i ].attachEvent( "onreset" , SetDisabled ); } } function FieldStateChanged() { var objEvent = window.event; var objElement = objEvent.srcElement; var strPropName = objEvent.propertyName.toLowerCase(); if ( strPropName == "checked" ) { SetFieldState( objElement ); } } function SetDisabled() { var objInputs = document.getElementsByTagName( "INPUT" ); for ( var i = 0 ; i < objInputs.length ; i++ ) { if ( ( objInputs[ i ].getAttribute( "type" ) == "checkbox" || objInputs[ i ].getAttribute( "type" ) == "radio" ) && objInputs[ i ].getAttribute( "toggles" ) != null ) { objInputs[ i ].attachEvent( "onpropertychange" , FieldStateChanged ); var objChild = document.getElementById( objInputs[ i ].getAttribute( "toggles" ) ); /*if ( objInputs[ i ].checked ) { SetFieldState( objInputs[ i ] ); }*/ SetFieldState( objInputs[ i ] ); //objInputs[ i ].onclick = SetFieldState; } } } function ShowGroup( objSource , strID ) { var objElement = document.getElementById( strID ); if ( objElement.style.display == "block" ) { objElement.style.display = "none"; objSource.style.borderBottom = "1px solid #CBD1DD"; objSource.getElementsByTagName( "SPAN" )[ 0 ].innerText = 4; } else { objElement.style.display = "block"; objSource.style.borderBottom = "1px solid white"; objSource.getElementsByTagName( "SPAN" )[ 0 ].innerText = 6; } } function AlwaysShowGroup( objSource , strID ) { var objElement = document.getElementById( strID ); if ( objElement != null ) { objElement.style.display = "block"; objSource.style.borderBottom = "1px solid white"; objSource.getElementsByTagName( "SPAN" )[ 0 ].innerText = 6; } } var objCurrentTables = new Array(); var nUniqueID = 1; function SetTable() { var objTables = document.getElementsByTagName( "TABLE" ); for ( var i = 0 ; i < objTables.length ; i++ ) { if ( objTables[ i ].className.indexOf( "coretable" ) != -1 && objTables[ i ].getAttribute( "interactive" ) == "true" ) { objTables[ i ].getSelected = GetSelected; if( ! objTables[ i ].getAttribute( "id" ) ) { objTables[ i ].setAttribute( "id" , "m" + nUniqueID ); } var strID = objTables[ i ].getAttribute( "id" ); objCurrentTables[ strID ] = -1; AddTableEvents( objTables[ i ] ); } } } function GetSelected() { if ( this.getAttribute( "multiselect" ) != "true" ) { return objCurrentTables[ this.getAttribute( "id" ) ]; } else { var objSelected = new Array(); var objTRs = this.getElementsByTagName( "tr" ); for ( var i = 0; objTRs != null && i < objTRs.length; i++ ) { if ( HasClass( "selected", objTRs[ i ] ) ) { objSelected.push( objTRs[ i ] ); } } return objSelected; } } function AddTableEvents( objTable ) { var objRows = objTable.tBodies[ 0 ].rows; for ( var i = 0 ; i < objRows.length ; i++ ) { if( ! objRows[ i ].getAttribute( "noninteractive" ) ) { if( HasClass( "selected" , objRows[ i ] ) ) { objCurrentTables[ objTable.getAttribute( "id" ) ] = objRows[ i ]; } objRows[ i ].onclick = SetRowColor; objRows[ i ].style.cursor = "hand"; } } } function HasClass( strClass, objElement ) { var strClassName = objElement.className; var objClassTokens = strClassName.split( " " ); for ( var i = 0 ; i < objClassTokens.length ; i++ ) { if( objClassTokens[ i ] == strClass ) { return true; } } return false; } function AddClass( strClass, objElement ) { var strClassName = objElement.className; var objClassTokens = strClassName.split( " " ); objClassTokens[ objClassTokens.length ] = strClass; objElement.className = objClassTokens.join( " " ); } function RemoveClass( strClass, objElement ) { var strClassName = objElement.className; var objClassTokens = strClassName.split( " " ); for ( var i = 0 ; i < objClassTokens.length ; i++ ) { if( objClassTokens[ i ] == strClass ) { objClassTokens.splice( i , 1 ); objElement.className = objClassTokens.join( " " ); } } } function SetRowColor( e ) { SetRowColorSub( e, false ); } function SetRowColorSub( e, bIsElement ) { var objElement = ( bIsElement ? e : ( e ? e.target : window.event.srcElement ) ); if( objElement.tagName == "INPUT" ) { return; } while ( objElement.tagName != "TR" && objElement ) { objElement = objElement.parentNode; } if ( ! objElement ) { return; } var objTable = objElement; while ( objTable.tagName != "TABLE" ) { objTable = objTable.parentNode; } if ( HasClass( "selected" , objElement ) ) { RemoveClass( "selected" , objElement ); objCurrentTables[ objTable.getAttribute( "id" ) ] = -1; } else { if( objCurrentTables[ objTable.getAttribute( "id" ) ] != -1 && objTable.getAttribute( "multiselect" ) != "true" ) { RemoveClass( "selected" , objCurrentTables[ objTable.getAttribute( "id" ) ] ); } AddClass( "selected" , objElement ); objCurrentTables[ objTable.getAttribute( "id" ) ] = objElement; if ( objElement.getAttribute( "action" ) != "" ) { eval( objElement.getAttribute( "action" ) ); } } } var nWinCount = 1; function LaunchWindow( strURL, strArgs ) { var test = window.open( strURL, "_blank" , strArgs ); if (!test) { if (1 == 1) //LANG_DA alert('Vi har konstateret at din browser blokerer pop-up vinduer.\nDenne side benytter pop-up vinduer. Du skal derfor ændre dette hvis du vil benytte www.findbolig.nu.'); else alert('We have detected that you are using popup blocking software.\nThis site requires that you disable the popup blocker.'); UnSpawnProgress(); } } function LaunchWindow2( strURL, strName, strArgs, bReplace ) { var test = window.open( strURL, strName , strArgs, bReplace ); if (!test) { if (1 == 1) //LANG_DA alert('Vi har konstateret at din browser blokerer pop-up vinduer.\nDenne side benytter pop-up vinduer. Du skal derfor ændre dette hvis du vil benytte www.findbolig.nu.'); else alert('We have detected that you are using popup blocking software.\nThis site requires that you disable the popup blocker.'); UnSpawnProgress(); } } function LaunchModal( strURL , objArgs ) { try { return window.showModalDialog( strURL , objArgs , 'status:no' ); } catch(e) { if (1 == 1) //LANG_DA alert('Vi har konstateret at din browser blokerer pop-up vinduer.\nDenne side benytter pop-up vinduer. Du skal derfor ændre dette hvis du vil benytte www.findbolig.nu.'); else alert('We have detected that you are using popup blocking software.\nThis site requires that you disable the popup blocker.'); UnSpawnProgress(); return "blocker"; } } var objPreFill = new Array(); function SetInputs() { for ( var i = 1 ; i < objPreFill.length ; i+=2 ) { var objElements = document.getElementsByName( unescape( objPreFill[ i ] ) ); if ( objElements.length > 0 ) { var strTag = objElements[ 0 ].tagName; switch( strTag ) { case "INPUT": { var strType = objElements[ 0 ].getAttribute( "type" ).toUpperCase(); switch( strType ) { case "RADIO": { for ( var q = 0 ; q < objElements.length ; q++ ) { if ( objElements[ q ].value == unescape( objPreFill[ i + 1 ] ) ) { objElements[ q ].checked = "checked"; } } break; } case "CHECKBOX": { if( objPreFill[ i + 1 ] == "0" || objPreFill[ i + 1 ] == "" || ( "" + objPreFill[ i + 1 ] ).toLowerCase() == "false" ) { objElements[ 0 ].checked = false; } else { objElements[ 0 ].checked = "checked"; } break; } default: { objElements[ 0 ].value = unescape( objPreFill[ i + 1 ] ); break; } } break; } case "TEXTAREA": { objElements[ 0 ].innerText = unescape( objPreFill[ i + 1 ] ); break; } case "SELECT": { if ( unescape( objPreFill[ i + 1 ] ).indexOf(",") != -1 ) { var objValues = unescape( objPreFill[ i + 1 ] ).split(","); for ( var p = 0 ; p < objValues.length ; p++ ) { for ( var q = 0 ; q < objElements[ 0 ].options.length ; q++ ) { if ( "" + objElements[ 0 ].options[ q ].value == TrimString( "" + objValues[ p ] ) ) { objElements[ 0 ].options[ q ].selected = "selected"; } } } } else { for ( var q = 0 ; q < objElements[ 0 ].options.length ; q++ ) { if ( objElements[ 0 ].options[ q ].value == unescape( objPreFill[ i + 1 ] ) ) { objElements[ 0 ].options[ q ].selected = "selected"; } } } break; } default: { objElements[ 0 ].innerText = unescape( objPreFill[ i + 1 ] ); } } } } } function TrimString( strString ) { strString = "" + strString; return strString.replace( /^[ \t\n\r]*/, "" ).replace( /[ \t\n\r]*$/, "" ); } function ToggleSelects( bFlag ) { var objElements = document.getElementsByTagName( "SELECT" ); for ( var i = 0 ; i < objElements.length ; i++ ) { objElements[ i ].style.visibility = ( bFlag ? "hidden" : "visible" ); } } function SpawnProgress() { var objElement = document.getElementById( "progress" ); if ( ! objElement ) { var objElement = document.createElement( "DIV" ); objElement.id = "progress"; var objText = document.createElement( "DIV" ) objText.innerText = "Vent venligst..."; objElement.appendChild( objText ); document.body.appendChild( objElement ); } ToggleSelects( true ); objElement.style.visibility = "visible"; if( document.all ) { objElement.onclick = StopClick; objElement.onmousedown = StopClick; objElement.setCapture(); } } function StopClick() { if( window.event ) { window.event.cancelBubble = true; window.event.returnValue = false; return false; } } function UnSpawnProgress() { var objElement = document.getElementById( "progress" ); if ( objElement ) { objElement.style.visibility = "hidden"; ToggleSelects(); if( document.all ) { objElement.releaseCapture(); } } } function HTMLDecode( strString ) { var objTag = document.createElement( "SPAN" ); objTag.innerHTML = strString; return objTag.innerText; } function OpenKRAKWindow( strLink ) { var test = window.open( strLink, null, "location=no,resize=no,width=600,height=570" ); if (!test) { if (1 == 1) //LANG_DA alert('Vi har konstateret at din browser blokerer pop-up vinduer.\nDenne side benytter pop-up vinduer. Du skal derfor ændre dette hvis du vil benytte www.findbolig.nu.'); else alert('We have detected that you are using popup blocking software.\nThis site requires that you disable the popup blocker.'); UnSpawnProgress(); } } function SetTabClick(e) { var objSrc try { objSrc = e.target; } catch(e) { objSrc = window.event.srcElement; } if ( objSrc.tagName == "DIV" ) { var objParent = objSrc.parentNode; if ( objParent.getAttribute( "onclick" ) ) { eval( objParent.getAttribute( "onclick" ) ); } if ( objSrc.getAttribute( "click" ) == "true" ) { var strSearch = window.document.location.search; strSearch = strSearch.split("&"); var strID = strSearch[ 0 ].substring( 4 , strSearch[ 0 ].length ); var strHost = window.document.location.host; var strPage = window.document.location.pathname; var strProtocol = window.document.location.protocol; window.document.location = strProtocol + "//" + strHost + strPage + "?id=" + strID + "&tab=" + objSrc.getAttribute( "index" ); } if ( objParent.getAttribute( "static" ) == "true" ) { return; } var objChildren = document.getElementsByTagName("TAB"); var nActive = 0; for ( var i = 0 ; i < objChildren.length ; i++ ) { if ( HasClass( objChildren[ i ], "active_tab" ) ) { AddClass( objChildren[ i ], "inactive_tab" ); //objChildren[ i ].style.color = "#153064"; } if ( objSrc == objChildren[ i ] ) { nActive = i; } } AddClass( objSrc , "active_tab" ); objSrc.style.color = "white"; objCurrentTab.style.display = "none"; var objTables = document.getElementsByTagName("TABLE"); for ( var i = 0 ; i < objTables.length ; i++ ) { if ( objTables[ i ].getAttribute("tab") == nActive ) { objTables[ i ].style.display = "block"; objCurrentTab = objTables[ i ]; } } } } function SetTabs() { var nIndex = 0; if ( ! isIE() ) { var objElements = document.getElementsByName( "tabitem" ); for ( var i = 0 ; i < objElements.length ; i++ ) { if( HasClass( "active_tab" , objElements[ i ] ) ) { nIndex = i; } if( objElements[ i ].getAttribute( "click" ) == "true" ) { objElements[ i ].onclick = SetTabClick; } } } else if( document.documentElement.clientHeight == 0 ) { var objElements = document.getElementsByTagName( "DIV" ); var objTabs = new Array(); for ( var i = 0 ; i < objElements.length ; i++ ) { if( objElements[ i ].name == "tabitem" ) { objTabs[ objTabs.length ] = objElements[ i ]; } } for ( var i = 0 ; i < objTabs.length ; i++ ) { if( HasClass( "active_tab" , objTabs[ i ] ) ) { nIndex = i; } if( objTabs[ i ].getAttribute( "click" ) == "true" ) { objTabs[ i ].onclick = SetTabClick; } } } else { return; } var objTables = document.getElementsByTagName( "TABLE" ); for ( var i = 0 ; i < objTables.length ; i++ ) { if( objTables[ i ].getAttribute( "tab" ) == nIndex ) { objTables[ i ].style.display = "block"; } } } var nCurrent = 0; var nMax = 99; function OldFlipPage( nDir ) { if( nDir == -1 && nCurrent == 0 ) { return; } if( nDir == 1 && ! document.getElementById( "show" + ( nCurrent + 1 ) ) ) { nMax = nCurrent + 1; } if( nDir == 1 && nCurrent == nMax - 1) { return; } document.getElementById( "show" + nCurrent ).style.display = "none"; nCurrent += nDir; if( nCurrent == 0 ) { AddClass( "inactive" , document.getElementById( "flipback" ) ); } else { if ( HasClass( "inactive" , document.getElementById( "flipback" ) ) ) { RemoveClass( "inactive" , document.getElementById( "flipback" ) ); } } if( nMax == nCurrent + 1 ) { AddClass( "inactive" , document.getElementById( "flipforward" ) ); } else { if( HasClass( "inactive" , document.getElementById( "flipforward" ) ) ) { RemoveClass( "inactive" , document.getElementById( "flipforward" ) ); } } document.getElementById( "firstCount" ).innerText = ( nCurrent + 1 ); document.getElementById( "show" + nCurrent ).style.display = "block"; } AttachToLoad( "SetTabs()" ); AttachToLoad( "SetTable()" ) AttachToLoad( "SetBanners()" ); AttachToLoad( "SetValidate()" ); AttachToLoad( "SetDisabled()" ); AttachToLoad( "SetInputs()" ); AttachToLoad( "PatchReset()" ); //AttachToLoad( "SetHelp()" ); window.onload = InitLoads;