var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;//ie6 of lager als true

function centreerme() {
offsetheight = 0;
if(window.innerHeight) {
	iwidth = window.innerWidth;
	iheight = window.innerHeight;
} else {
if(document.body.clientHeight) {
	iwidth = document.body.clientWidth;
	iheight = document.body.clientHeight;
}
}
if(iwidth<=1028) {
	document.write("<style>#main {width:995px;} </style>");
}
if(iheight<=681) {
	offsetheight = Math.round(iheight/-2);
	document.write("<style>#main {height:"+iheight+"px;top:"+offsetheight+"px;} </style>");
	document.write("<style>body {background-position: top center;} </style>");
} else {
	document.write("<style>#main {height:681px;overflow:auto;}</style>");
}
}


function pngme() {
if(!IE6) {
	document.getElementById("logo").src = "images/andriessen_pianos_vleugels.png";
}
}

function doe_favoriet() {
try {
if(window.external) {
	window.external.AddFavorite("http://www.andriessenpiano.nl/", "Andriessen Piano's ~ Vleugels");
}
}
catch(err) {}
}


function doe_vriend() {
popup('maileenvriend.php', 'maileenvriend', 500, 250, 'no');
}

var popupje;

function popup(url, naam, width, height, resizable, scrollable) {
if(popupje) {popupje.close();}
if(document.body) {
	left = Math.round((document.body.clientWidth - width)/2);
} else {
	left = Math.round((window.innerWidth - width)/2);
}
if(document.body) {
	toppie = Math.round((document.body.clientHeight - height)/2);
} else {
	top = Math.round((window.innerHeight - height)/2);
}
popupje = window.open(url, naam, 'toolbar=no,scrollbars='+scrollable+',resizable='+resizable+',status=no,width='+width+',height='+height+',top='+toppie+',left='+left+',menubar=no,directories=no');
}

function emailvalidation(entered) {
with (entered) {
	apos=value.indexOf("@"); 
	dotpos=value.lastIndexOf(".");
	lastpos=value.length-1;
	if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) {
		return false;
	} else {
		return true;
	}
}
}



