function GetWindowWidth(){var width=0;if(typeof(window.innerWidth)=='number'){width=window.innerWidth;}else if(document.documentElement&&document.documentElement.clientWidth){width=document.documentElement.clientWidth;}else if(document.body&&document.body.clientWidth){width=document.body.clientWidth;}if(!width||width<100){width=100;}return width;}
function GetWindowHeight(){var height=0;if(typeof(window.innerHeight)=='number'){height=window.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){height=document.documentElement.clientHeight;}else if(document.body&&document.body.clientHeight){height=document.body.clientHeight;}if(!height||height<100){height=100;}return height;}

function ShowMenu(URL, WinTitle, WinWidth, WinHeight, WinLeft, WinTop){
        attr = "resizable=yes,scrollbars=yes,width=" + WinWidth + ",height=" + GetWindowHeight() + ",screenX=" + WinLeft + ",screenY=" + WinTop + ",left=" + WinLeft + ",top=" + WinTop + "";
        msgWindow=open(URL, WinTitle, attr);
        if (msgWindow.opener == null) msgWindow.opener = self;
}
function go(loc) {
window.location.href = loc;
}

function personen(arg){
document.selectie.action = arg;
document.selectie.submit();
}

function dateInvulCheck(){
	datebegin = document.selectie.datebegin[document.selectie.datebegin.selectedIndex].value;
	duration = document.selectie.duration[document.selectie.duration.selectedIndex].value;
		if((duration=='0') && (datebegin=='0'))	{
			document.selectie.datebegin.focus();
			return false;
			}
		else if((datebegin!='0') && (duration=='0')) {
			document.selectie.duration.focus();
			return false;
			}
		else if((duration!='0') && (datebegin=='0')) {
			document.selectie.datebegin.focus();
			return false;
			}
		else {
			return true;
			}
		}

function checkform ( form , arg, arg2, arg3 ){ 
  if (form.searchterm.value == arg) {
    alert(arg2);
    form.searchterm.focus();
    return false ;
  }
else if (form.searchterm.value == "") {
		alert(arg3);
		return false;
	}
  return true ;
}

function addBasket (arg){
	basketno = arg;
	document.getElementById('inmandje_'+ basketno).style.display = "block";
	Id = setTimeout('closeBasket()', 3000)
}


function closeBasket () {
	document.getElementById('inmandje_'+ basketno).style.display = "none";
	clearTimeout(Id);
}

function submitform(deform,arg)
{
	document.forms[deform].url.value = arg;
  	document.forms[deform].submit();
}

function showInline (elName) {
	var theElemenet = document.getElementById(elName);
	if (theElemenet) {
		theElemenet.style.display = "inline";
	}
}
function hideInline (elName) {
	var theElemenet = document.getElementById(elName);
	if (theElemenet) {
		theElemenet.style.display = "none";
	}
}

function showListMore (e) {
	document.getElementById('houseDescMore_' + e).style.display = 'none';
	document.getElementById('houseDescLess_' + e).style.display = 'inline';
	document.getElementById('houseDescRemain_' + e).style.display = 'inline';
	document.getElementById('houseDescBlok_' + e).style.display = 'block';
}

function showListLess (e) {
	document.getElementById('houseDescMore_' + e).style.display = 'inline';
	document.getElementById('houseDescLess_' + e).style.display = 'none';
	document.getElementById('houseDescRemain_' + e).style.display = 'none';
	document.getElementById('houseDescBlok_' + e).style.display = 'none';
}

var offsetx = 12;
var offsety =  8;
var ie5 = (document.getElementById && document.all); 
var ns6 = (document.getElementById && !document.all); 
var ua = navigator.userAgent.toLowerCase();
var isapple = (ua.indexOf('applewebkit') != -1 ? 1 : 0);
function getmouseposition(e)
{
    if(document.getElementById)
    {
        var iebody=(document.compatMode && 
        	document.compatMode != 'BackCompat') ? 
        		document.documentElement : document.body;
        pagex = (isapple == 1 ? 0:(ie5)?iebody.scrollLeft:window.pageXOffset);
        pagey = (isapple == 1 ? 0:(ie5)?iebody.scrollTop:window.pageYOffset);
        mousex = (ie5)?event.x:(ns6)?clientX = e.clientX:false;
        mousey = (ie5)?event.y:(ns6)?clientY = e.clientY:false;
    document.getElementById('pikto').style.top = (mousey+pagey+offsety) + 'px'; 
    document.getElementById('pikto').style.left = (mousex+pagex+offsetx)-220 + 'px';     
    }
}
	
function showRating (e) {
document.getElementById('rating_' + e).style.display = 'block';
}

function closeRating (e) {
document.getElementById('rating_' + e).style.display = 'none';
}

e = 0;
a = 0;
Id = 0;
foto = 0;

function eraseFoto (e) {
	clearTimeout(Id);
		document.getElementById('mfoto_' + e).style.display = 'none';
}

function showFoto (foto,e) {
	if (foto != ''){
a = 0;
//global maken
nummer = e;
var p = foto.length	
	 preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = foto[i]
}
	document.getElementById('mfoto_' + nummer).style.display = 'block';
	changeDia()
	}
}

Id = null;

function changeDia(){
  if (a == preLoad.length) a = 0;
   if (document.all){
      document.images['fotoname_' + nummer].style.filter="blendTrans(duration=2)"
      document.images['fotoname_' + nummer].style.filter="blendTrans(duration=crossFadeDuration)"
      document.images['fotoname_' + nummer].filters.blendTrans.Apply()      
   }
   document.images['fotoname_' + nummer].src = preLoad[a].src
   if (document.all){
      document.images['fotoname_' + nummer].filters.blendTrans.Play()
   }
 	a = a + 1;
   Id = setTimeout('changeDia()', 3*500)
}

var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}

function toolTip (id,language) {
document.getElementById('pikto').style.display = 'block';
document.onmousemove = getmouseposition;
getData(id,language);
}

function closeTip() {	
document.getElementById('pikto').style.display = "none";
document.getElementById('pikto').innerHTML = '';
}

function getData(id,language) {
url = 'http://www.toprentals.nl/pikto_feed.php';
aanvraag = 'Id=' + id + '&LanguageCode=' + language;

 if (xmlhttp) {
 	
 	//xmlhttp.close;
	xmlhttp.open("POST", url, true); 
 	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
	xmlhttp.setRequestHeader('Connection', 'close');
	xmlhttp.setRequestHeader('Cache-Control', 'no-cache');
	xmlhttp.send(aanvraag);
	xmlhttp.onreadystatechange=verwerk;
  }

 
function verwerk(e) {
 if (xmlhttp.readyState==4) {
  document.getElementById('pikto').innerHTML = xmlhttp.responseText;
 		}
	}	
	
}