var resized = "false";
var pop = null;

function ontframe(moederpagina) { 
    if (top.location.href != moederpagina) top.location.href = moederpagina;
}

function contact(adres) {
	var str = "mailto:"
        if ((adres == null) || (adres == "")) str += "contact";
        else str += adres;
	str += String.fromCharCode(8 * 8);
	str += "peptalks";
	str += ".";
	str += "nl";
	document.location = str;
	return;
}


function sluitPop() {
	if (pop !=null) {
		if (navigator.platform != "MacPPC") { //stomme mac wil geen close-operatie ondersteunen
			pop.close();
			pop = null;
		}
	}
}

function openPop(titel) {
	var w = 550;
	var h = 100;
	var x = (screen.availWidth / 2)- (w / 2);
	var y = (screen.availHeight /2) - (h / 2); 
	var features = "screenX=" + x + ",screenY=" + y + ",width=" + w + ",height=" + h;
	features = features + ",dependent=yes,directories=no,menubar=no,titlebar=no,toolbar=no,scrollbars=no,resizable=no,location=no,status=no";
	if (pop != null) {
		pop.close();
		pop = null;
	}

	pop = window.open("","pop",features);
	pop.moveTo(x,y);

	pop.document.write("<html><head>");
	pop.document.write("<title>");
	pop.document.write(titel);
	pop.document.write("</title><style>");
	pop.document.write("body {color: #000088; font-size: 12px; font-weight: normal; font-family: Verdana, Lucida, Arial, Helvetica, sans-serif;} input {font-size: 12px; font-family: Verdana, Arial; height: 22px;}</style>");
	pop.document.write("</style><script language='Javascript'>function website(url){window.open(url,'extra','menubar=no,scrollbars=yes,resizable=yes,status=no,width=780,height=540');}</script></head><body bgcolor='#FFFFFF'>");
}

function popLinktekst(spec) {
	pop.document.write("<center>Kopieer onderstaande link:<br><br><font color=black>");
	pop.document.write("&lt;a href=\"http://www.peptalks.nl/index.jsp?");
	pop.document.write(spec);
	pop.document.write("\"&gt; UW LINKTEKST &lt;/a&gt;<br><br><input type='button' value='sluiten' onClick='window.close()'>");
	pop.document.write("</body></html>");
}

function linkNaarBestellen(adresbol, adresbruna) {
	openPop("Peptalks: bestellen");
	popBesteltekst(adresbol, adresbruna);
}

function popBesteltekst(adresbol, adresbruna) {
	pop.document.write("Bestellen bij:<center>");
	pop.document.write("<a href=\"javascript:website('");
	pop.document.write(adresbol);
	pop.document.write("')\">Bol.com</a><br>");
	pop.document.write("<a href=\"javascript:website('");
	pop.document.write(adresbruna);
	pop.document.write("')\">Bruna</a><br>");
	pop.document.write("<br><input type='button' value='sluiten' onClick='window.close()'>");
	pop.document.write("</body></html>");

}

function taal(tl) { // voolopige dummyfunctie
    alert("No English versions yet. But there will be...");
}
function naarTaal(pagina) {
	setHidden("peptalks", "taal", pagina);
	document.forms["peptalks"].submit();
}

function resizeBrowser() {
	if (resized = "false") {
	 	if ((navigator.platform != "MacPPC") || (navigator.appName != "Microsoft Internet Explorer")) {
			h = Math.min(768, screen.availHeight);
			w = Math.min(1024, screen.availWidth);
			x = Math.floor((screen.availWidth - w) / 2);
			y = Math.floor((screen.availHeight - h) / 2);
			window.moveTo(x,y);
			window.resizeTo(w,h);
		}
		resized = "true";
	}
}


function website(url){
	window.open(url,"extra","menubar=no,scrollbars=yes,resizable=yes,status=no,width=780,height=540");
}

