function showAlert(){
alert("Server timeout. Please try again later.")}
function stages(div,per,persons,flag){
$('knoppen').setStyle('display','none')
$('loader').setStyle('visibility','visible')
var req=new Request.HTML({url:'http://www.tophomes.nl/v3_AjPlanning.php?per='+per+'&flag='+flag,
onSuccess: function(html){
$('loader').setStyle('visibility','hidden')
$('knoppen').setStyle('display','block')
$('balk').highlight('#93B7DB')
$(div).set('text','')
$(div).adopt(html)
},
onFailure: function(){
$(div).set('text','The request failed.')}
}).post($('ajax-form'))
req.send();}
function getInfo(){
thePlanning.set('persons',document.ajaxForm.persons.value)
thePlanning.set('planDate',document.ajaxForm.yearmnd.value)
thePlanning.set('housenumber',document.ajaxForm.number.value)
$('attentionPersons').setStyle('display','none')
$('attentionPeriod').setStyle('display','none')
if(document.ajaxForm.yearmnd.value=='null'){
$('attentionPeriod').setStyle('display','block')
document.ajaxForm.yearmnd.focus()}
else if(document.ajaxForm.persons.value=='null'){
$('attentionPersons').setStyle('display','block')
document.ajaxForm.persons.focus()}
else{
stages('oneWeek',7,document.ajaxForm.persons.value,1)
stages('twoWeeks',14,document.ajaxForm.persons.value)
stages('treeWeeks',21,document.ajaxForm.persons.value)
if(document.ajaxForm.mini.value=='Y'){
$('knoppen').setStyle('display','none')
$('loader').setStyle('visibility','visible')
stages('weekend','wk',document.ajaxForm.persons.value)
stages('midWeek','mw',document.ajaxForm.persons.value)}}}
function blockdisplay(i){
if(document.getElementById){
if(document.getElementById("blockdisplay"+i)){
for(j=1;j<1000;j++){
if(document.getElementById('blockdisplay'+j)){
document.getElementById('blockdisplay'+j).style.display='none'
document.getElementById("tab"+j).style.color='black'
document.getElementById("tab"+j).style.backgroundColor='#9ED64B'
document.getElementById("tab"+j).style.borderBottom='1px solid #A5CDEB'}
else{j=1000;}}
var fload;
if(i){
document.getElementById("blockdisplay"+i).style.display='block'
document.getElementById("tab"+i).style.color='black'
document.getElementById("tab"+i).style.backgroundColor='white'
document.getElementById("tab"+i).style.borderBottom='1px solid white'
if(i==4 && fload != 1 ){load();fload = 1;}
if(i==3){
if(thePlanning.get('housenumber')!=document.ajaxForm.number.value){
getInfo()}}}}}}
var offsetfromcursorX=12
var offsetfromcursorY=10
var offsetdivfrompointerX=10
var offsetdivfrompointerY=14
document.write('<div id="dhtmltooltip"></div>')
document.write('<img id="dhtmlpointer" src="http://www.tophomes.nl/images/arrow2.gif">')
var ie=document.all
var ns6=document.getElementById&&!document.all
var enabletip=false
if(ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip"): ""
var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer"): ""
function ietruebody(){
return(document.compatMode&&document.compatMode!="BackCompat")? document.documentElement : document.body}
function ddrivetip(thetext,thewidth,thecolor){
if(ns6||ie){
if(typeof thewidth!="undefined")tipobj.style.width=thewidth+"px"
if(typeof thecolor!="undefined"&&thecolor!="")tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false}}
function positiontip(e){
if(enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20
var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY
var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1):-1000
if(rightedge<tipobj.offsetWidth){
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true}
else if(curX<leftedge)
tipobj.style.left="5px"
else{
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"}
if(bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"}
tipobj.style.visibility="visible"
if(!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"}}
function hideddrivetip(){
if(ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''}}
document.onmousemove=positiontip
function ShowMenu(URL,WinTitle,WinWidth,WinHeight,WinLeft,WinTop){
attr="resizable=yes,scrollbars=yes,width="+WinWidth+",height="+WinHeight+",screenX="+WinLeft+",screenY="+WinTop+",left="+WinLeft+",top="+WinTop+""
msgWindow=open(URL,WinTitle,attr)
if(msgWindow.opener==null)msgWindow.opener=self}
function sorteerSelect(form,arg){
if(form.sortField.options[form.sortField.options.selectedIndex].value=='starPlus'){
thePlanning.set('sortOn',form.sortField.options[form.sortField.options.selectedIndex].value)}
else if(form.sortField.options[form.sortField.options.selectedIndex].value=='starMin'){
thePlanning.set('sortOn',form.sortField.options[form.sortField.options.selectedIndex].value)}
else{
thePlanning.erase('sortOn')}
whiteLayer()
location.href='http://'+window.location.hostname+'/'+arg}
function dePeriode(form,arg){
thePlanning.set('period',form.period.options[form.period.options.selectedIndex].value)
if(thePlanning.get('persons')&&thePlanning.get('planDate')&&thePlanning.get('period')&&thePlanning.get('startDate')){
if(form.fromWeeks.options.selectedIndex==0){
form.fromWeeks.focus()}
else{
whiteLayer()
location.href='http://'+window.location.hostname+'/'+arg}}}
function fineSelection(arg1,arg2){
setFine.set(arg1,arg2)}
function land(form){
location.href=form.countryJump.options[form.countryJump.options.selectedIndex].value}
function hoofdRegio(form){
location.href=form.mainRegionJump.options[form.mainRegionJump.options.selectedIndex].value}
function subRegio(form){
location.href=form.subRegionJump.options[form.subRegionJump.options.selectedIndex].value}
function whiteLayer(){
$('softWhite').setStyle('visibility','visible')}
function getWeeks(arg){
var jsonRequest=new Request.JSON({url: "http://www.tophomes.nl/v3_AjWeeks.php",onComplete: function(weeks){
var myHash=new Hash(weeks)
x=1
document.searchForm.fromWeeks.length=1
myHash.each(function(key,value){
if(key !='false'){
document.searchForm.fromWeeks.options[x]=new Option(key,value)
x++}
})
}}).get({'yearMonth': arg})}
function Mark(arg1,arg2){
if(arg2==1){
document.getElementById(arg1).style.backgroundColor='#F2F2F2'}
else{
document.getElementById(arg1).style.backgroundColor='white'}}
function showHouseAlert(arg1,arg2){var element='addFav'+arg2;if(arg1==1){if(!Cookie.read('favorite')){$('houseListAlert').fade('in');}
$(element).setStyle('visibility','visible');$(element).highlight('#00FF00');theFavorites.set(arg2,'t');$('totalList').innerHTML=theFavorites.getLength();}
else if(arg1==2){theFavorites.erase(arg2);$(element).setStyle('visibility','hidden');$('totalList').innerHTML=theFavorites.getLength();}
else{$('houseListAlert').fade('out');}}
function popUp(URL){day=new Date();id=day.getTime();eval("page"+id+" = window.open(URL, '"+id+"', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 440,top = 225');");}
var win=null;function NewWindow(mypage,myname,w,h,scroll){var winl=(screen.width-w)/2;var wint=(screen.height-h)/2;var settings='height='+h+',';settings+='width='+w+',';settings+='top='+wint+',';settings+='left='+winl+',';settings+='scrollbars='+scroll+',';settings+='resizable=yes';win=window.open(mypage,myname,settings);if(parseInt(navigator.appVersion)>=4){win.window.focus();}}
function delFavCookie(){Cookie.dispose('favorite',{path: '/'});}