function getWidth() {
	var x
	if (self.innerWidth) { // all except Explorer
		x = self.innerWidth - 8
	} else if (document.documentElement && document.documentElement.clientWidth) { // Explorer 6 Strict Mode
		x = document.documentElement.clientWidth - 1
	} else if (document.body) { // other Explorers
		x = document.body.clientWidth - 13
	}
	return x
}
function getHeight() {
	var  y
	if (self.innerWidth) { // all except Explorer
		y = self.innerHeight
	} else if (document.documentElement && document.documentElement.clientWidth) { // Explorer 6 Strict Mode
		y = document.documentElement.clientHeight
	} else if (document.body) { // other Explorers
		y = document.body.clientHeight
	}
	return y
}


function initBackground() {
	x1 = getWidth()
	x2 = x1-800-106
	if(x2>0) {
		document.getElementById('bg-links').style.width = (x2+106)+"px"
		document.getElementById('bg-rechts2').style.width = x2+"px"
	} else {
		document.getElementById('bg-links').style.width = '0px'
		document.getElementById('bg-rechts1').style.width = '0px'
		document.getElementById('bg-rechts2').style.width = '0px'
		if(document.getElementById('sidetitle')) { document.getElementById('sidetitle').style.display = 'none' }
		document.getElementById('drecomm').style.display = 'none'
	}
	if(getHeight()<574 && !self.innerWidth)  {
		x1 = x1 + 20
	} else if(getHeight()<574 && self.innerWidth) {
		x1 = x1 - 20
	}
	x3 = x1/2
	if(x3<454) { x3 = 400 }
	if(document.getElementById('postcodeform')) { document.getElementById('postcodeform').style.left = (x3-200)+'px' }

}

function getResolution() {
	if(getWidth() > 800) {
		document.advertentie.resolutie.value = 1
	} else {
		document.advertentie.resolutie.value = 800
	}
}

function launchRemote(URL) {
	remote = window.open(URL,"remote","height=520,width=770,left=60,top=40,alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=0,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,z-lock=0");
	remote.window.focus();
}

function launchRemotePrint(URL) {
	remote = window.open(URL,"remote","height=570,width=790,left=0,top=0,alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=0,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,z-lock=0");
	remote.window.focus();
}

function switchExtraFoto() {
	var x4 = document.getElementById('extrafoto4');
	var x5 = document.getElementById('extrafoto5');
	var x6 = document.getElementById('extrafoto6');
	var x7 = document.getElementById('extrafoto7');
	if(x4.style.display == 'none') {
		x4.style.display = '';
		x5.style.display = '';
		x6.style.display = '';
		x7.style.display = '';
	} else {
		x4.style.display = 'none';
		x5.style.display = 'none';
		x6.style.display = 'none';
		x7.style.display = 'none';

	}
}

function disableForm(theform) {
    if (document.all || document.getElementById) {
        for (i = 0; i < theform.length; i++) {
            var tempobj = theform.elements[i];
            if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
            tempobj.disabled = true;
        }
        return true;
    } else {
        return false;
   }
}
