// JavaScript Document function show(layer) { if(document.getElementById(layer).style.display == 'block') { hide(layer); } else {document.getElementById(layer).style.display='block';} } function hide(layer) { document.getElementById(layer).style.display='none'; } function sho(layer) { document.getElementById(layer).style.display='block'; } function visible(layer) { document.getElementById(layer).style.visibility = 'visible'; } function invisible(layer) { document.getElementById(layer).style.visibility = 'hidden'; } function collapse(collayer, vislayer, movlayer, heightto, heightfrom, posto, posfrom) { show(vislayer); if(document.getElementById(vislayer).style.display == 'block') { document.getElementById(collayer).style.height = heightfrom; document.getElementById(movlayer).style.margin = posfrom + ' 0px 0px 0px;'; } else { document.getElementById(collayer).style.height = heightto; document.getElementById(movlayer).style.margin = posto + ' 0px 0px 0px;'; } } function disablebtn(t) { t.onclick = function() {return false;} } function popurl(url, w, h) { if (typeof(w) == 'undefined') { w = 800; //default width } if (typeof(h) == 'undefined') { h = 600; } sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width='+ w + ',height=' + h +''); self.name = "mainWin"; sealWin.focus(); } function pleasewait(layer,action,type) { var con = document.getElementById('container'); con.className = "fade"; show('fade'); show('pwblock'); pwdiv = document.getElementById('pleasewaitdiv'); pwdiv.innerHTML = ""; pwdiv.innerHTML = document.getElementById(layer).innerHTML; if(layer.toLowerCase() == "eta") { layerheight = document.getElementById('fmiddle').scrollHeight; document.getElementById('fmiddle').style.height = eval(layerheight)+40 + "px"; } if(layer.toLowerCase() == "updating" && (document.location.href.toString().search(/kcnl/gi) > 0 || document.location.href.toString().search(/keycamp.nl/gi) > 0 || document.location.href.toString().search(/ver=5/gi) > 0) && type !== undefined && action !== undefined) { timer = window.setInterval( function() { if(type == "form") { document[action].submit(); } else { document.location.href = action; } } , 10000); } } function pleasewaitalert(text) { var con = document.getElementById('container'); con.className = "fade"; show('fade'); show('pwblock'); pwdiv = document.getElementById('pleasewaitdiv'); //alertdiv = document.getElementById('alerttext'); pwdiv.innerHTML = ""; pwdiv.innerHTML = document.getElementById('alert').innerHTML; alertdiv = document.getElementById('alerttext'); alertdiv.innerHTML = ""; alertdiv.innerHTML = text; } function hidepleasewait() { try { var con = document.getElementById('container'); con.className = ""; hide('fade'); hide('pwblock'); } catch(err) { } } function swapText(e, t) { document.getElementById(e).innerHTML = t; } function popupSearch(searchtype) { // change iframe document.getElementById('searchiframe').src = '/SearchFormPopUp/PopUp.aspx?searchmode=' + searchtype; pleasewait('popsearch'); setTimeout("hide('pwblock');show('sablock');",3500); } function popupSearchOLD() { var con = document.getElementById('container'); con.className = "fade"; show('fade'); show('sablock'); } function popdownSearch() { try { continuediv = document.getElementById('continueblock'); if(continuediv.style.display == "") { var con = document.getElementById('container'); con.className = ""; hide('fade'); hide('sablock'); } else { hide('sablock'); show('continueblock'); } } catch(err) { var con = document.getElementById('container'); con.className = ""; hide('fade'); hide('sablock'); } } function popdownContinue() { var con = document.getElementById('container'); con.className = ""; hide('fade'); hide('continueblock'); } function showContinueOptions(package) { var con = document.getElementById('container'); con.className = "fade"; show('fade'); show('continueblock'); if(typeof(package) != 'undefined'){ hide('addstaybtn'); } else { show('addstaybtn'); } } function hideContinueOptions() { var con = document.getElementById('container'); con.className = ""; hide('fade'); hide('continueblock'); } function reloadturingtest() { var randomnumber = 0; var ttblock = document.getElementById('turingtestblock'); var d = new Date(); randomnumber = d.getTime();//stops cache var xurl="../ajax/ajaxmanagebooking/turingtest.cfm?rts="+randomnumber; var xmlhttp = getxmlhttp(); xmlhttp.open("GET", xurl, true); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { rtxt=xmlhttp.responseText; if(rtxt !== "-1") { ttblock.innerHTML = rtxt; } else { document.location.href = "login.cfm" } } } xmlhttp.send(null); } function showcosts() { var divcostbreakdown = document.getElementById('breakdownblock'); var divcostbreakdownPs = divcostbreakdown.getElementsByTagName('p'); var boolshow = true; for(var i=0; i