//NOZZMAN
var nozz;
function nozzManOn(n) { 
	de("nozzmanOver").style.left = findPosX(de("nozzIMG"));
	de("nozzmanOver").style.top = findPosY(de("nozzIMG"));
	de("nozzmanOver").style.background = "url('../images/modules/nozzman/"+n+".gif')";
	if((de("linePlaceHolder").style.display != "block") && (getBrowser() == "ie")) { 
		nozz = setTimeout("showDiv('nozzmanOver')",400);
	}
}

function nozzmanOff(id) {
	clearTimeout(nozz);
	if (!id) { closeDiv('nozzmanOver');	}
}

function openNozzman() { open("http://www.nozzman.nl","_blank"); }

//ALTAVISTA
function searchAltavista() {
	open("http://www.altavista.com/web/results?pg=q&amp;q="+de("altavistaTerm").value,"_blank");
}
function msnSearch() {
	open("http://search.msn.nl/results.aspx?q="+de("msnTerm").value+"&FORM=MSNH&srch_type=0&cp=65001","_blank");
}
function searchYahoo() {
	open("http://search.yahoo.com/search?p="+de("yahooTerm").value+"&fr=yfp-t-500&toggle=1&cop=&ei=UTF-8","_blank");
}
function searchGoogle() {
	open("http://www.google.nl/search?hl=nl&q="+de("googleTerm").value+"&btnG=Google+zoeken&meta=","_blank");
}
function checkenter(e) {
	if (typeof e == 'undefined') { e = event; }
	var key = (typeof e.which == 'undefined')? 0:e.which;
	if ((key == 0) && (typeof e.keyCode != 'undefined')) { key = e.keyCode; } 
	if (key == 13) { searchAltavista(); }
}
function checkenterF(e,f) {
	if (typeof e == 'undefined') { e = event; }
	var key = (typeof e.which == 'undefined')? 0:e.which;
	if ((key == 0) && (typeof e.keyCode != 'undefined')) { key = e.keyCode; } 
	if (key == 13) { eval(f); }
}
// ZYLOM
var popupURL = 'http://main.zylom.com/servlet/PPTrack?pid=2473&l=1&t=0';
if (typeof logo != 'undefined')
{
	        popupURL = popupURL + "&o=" + escape(logo);
}
function affPopUp(s)
{
	        popUp(popupURL + '&s='+s);
}

function popUp(popupURL)
{
width = 700; height = 550; leftPosition = (screen.width) ? (screen.width-width)/2 : 0;
if (screen.height && (screen.height <= 600)) { topPosition = 0; } else { topPosition = (screen.height) ? (screen.height-height)/2 : 0; }
var settings='width='+width+',height='+height+',left='+leftPosition+',top='+topPosition+'toolbar=0,location=0,directories=0,menubar=0,scrollbar=0,resizable=0,status=0';
var popup=window.open(popupURL, 'gamepopup', settings); popup.focus();
}


// RADIO
function luisterRadio() {
	open("/luisterradio.php?url="+escape(document.getElementById('zender').value),"_blank","width=322,height=170,scrollbars=no,statusbar=yes,menubar=no,toolbar=no,resizable=no");	
}
function luisterRadio2() {
	open("/luisterradio.php","_blank","width=322,height=170,scrollbars=no,statusbar=yes,menubar=no,toolbar=no,resizable=no");	
}

// MAIL A FRIEND
/*function mailFriend() {
	if (de("Tellfriend_naam").value) {
		if (checkemail(de("Tellfriend_email").value)) {
			if (de("Tellfriend_email1").value) {
				okay = true;
				for (aTel=1;aTel<=5;aTel++) {
					if (!checkemail(de("Tellfriend_email"+aTel).value)) { 
						if (de("Tellfriend_email"+aTel).value) { 
							okay = false;
						}
					}
				}
				if (!okay) { alert("Een of meerdere van je ingevoerde email adressen zijn niet geldig"); 
				} else { 
					de("mailFriendGo").style.display = "none";
					loading("Email wordt verstuurd...");
					sAjax.open("GET","inc/ajax/mailFriend.php?rand="+Math.random()+"&naam="+de("Tellfriend_naam").value+"&email="+de("Tellfriend_email").value+"&gsm="+de("Tellfriend_06").value+"&email1="+de("Tellfriend_email1").value+"&email2="+de("Tellfriend_email2").value+"&email3="+de("Tellfriend_email3").value+"&email4="+de("Tellfriend_email4").value+"&email5="+de("Tellfriend_email5").value);
					sAjax.onreadystatechange = mailFriendDone;
					sAjax.send(null);	
				}
			} else { alert("Je moet minsten 1 geldige email invullen van een vriend."); }
		} else { alert("Je hebt je geen geldig email aders ingevuld (eigen email)"); }
	} else { alert("Je hebt je eigen naam niet ingevuld"); }
}

function mailFriendDone() {
	if (sAjax.readystate == 4) {
			if (!USER_ID) {
				de("Tellfriend_naam").value = "";
				de("Tellfriend_email").value = "";
				de("Tellfriend_06").value = "";
			}
			de("Tellfriend_email1").value = "";
			de("Tellfriend_email2").value = "";
			de("Tellfriend_email3").value = "";
			de("Tellfriend_email4").value = "";
			de("Tellfriend_email5").value = "";
			loading();
			de("mailFriendGo").style.display = "block";
			ingaveAlert("Tell-a-friend","De tell-a-friend mailtjes zijn verstuurd naar de desbetreffende email adressen.<BR><BR>Bedankt voor je interesse.",32,200,"info");
	}
}*/
function tellfriend() {
	open("/tellfriend.php","_blank","width=615,height=400,scrollbars=yes,toolbars=no,statusbar=yes,resizable=no");	
}

function tellFriendSubmit() {
	if ((document.getElementById("naam1").value) && (document.getElementById("email1").value)) {	
		if (document.getElementById("akkoord_actie").checked) { 
			document.getElementById("form1").submit();
		} else { alert("Je moet wel akkoord gaan met de algemene voorwaarden."); }
	} else { alert("Je hebt niet alle verplichte velden (*) ingevuld"); }
	
}

// MARKTPLAATS

var MarkttPlaatsurl = "http://www.marktplaats.nl/nieuw_zoek.php3?";
var MarkttPlaatsmediaplex = "http://adfarm.mediaplex.com/ad/ck/5026-29028-4128-34?&mpro=";
var MarkttPlaatstradedoubler = "http://clk.tradedoubler.com/click?p=23892&amp;g=16142348&a=1299103&url=";

function zoekMarktplaats() {
	term = de("marktplaatsZoekTerm").value;
	
	if (term == "") {
		var target = "http://www.marktplaats.nl/";    
	} else {
		var target = MarkttPlaatsurl + "q=" + escape(term);
	}
	
	target = MarkttPlaatsmediaplex + escape(target);
	target = MarkttPlaatstradedoubler + escape(target);
	
	window.open(target, "result");
}

// BOL.COM

function zoekBol() {
	window.open("http://www.nl.bol.com/is-bin/INTERSHOP.enfinity/eCS/Store/nl/-/EUR/BOL_ParametricSearch-Start?Ntk=nl_books&Nty=1&Section=BOOK&Ntt=test&submit.x=7&submit.y=12","_blank");
}