	
	function NewWindow(mypage,myname,w,h,pos,infocus){
		var win=null;
		
		if (pos=="random") {
			myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
		}
		
		if (pos=="center") {
			myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;
		} else if((pos!='center' && pos!="random") || pos==null) {
			myleft=0;mytop=20
		}
		
		settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=yes,directories=no,status=no,menubar=no,toolbar=no,resizable=no";
		win=window.open(mypage,myname,settings);
		win.focus();
	
	}

	function setCookie(c_name,value,expiredays) {
		var exdate=new Date();
		exdate.setDate(exdate.getDate()+expiredays);
		document.cookie=c_name+ "=" +escape(value)+
		((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
	}
	
	function getCookie(c_name)
	{
	if (document.cookie.length>0)
	  {
	  c_start=document.cookie.indexOf(c_name + "=");
	  if (c_start!=-1)
		{
		c_start=c_start + c_name.length+1;
		c_end=document.cookie.indexOf(";",c_start);
		if (c_end==-1) c_end=document.cookie.length;
		return unescape(document.cookie.substring(c_start,c_end));
		}
	  }
	return "";
	}
	
	
	function luister(zenderid) {	
		try {		
			ajaxRequest = new XMLHttpRequest();
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {
					alert("AJAX niet ondersteund. Update je browser!");
				}
			}
		}
		
		ajaxRequest.onreadystatechange = function() {
			if (ajaxRequest.readyState == 4) {
				var antwoord = ajaxRequest.responseText;
				var statsArray = new Array();
				statsArray = antwoord.split('|||');

				document.getElementById('playerdiv').innerHTML = '<object id="MediaPlayer" width="224" height="35" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" standby="" type="application/x-oleobject"><param name="url" value="' + statsArray[1] + '"><param name="InvokeURLs" value="false"><param name="AutoStart" value="true"><param name="uiMode" value="mini"><embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="' + statsArray[1] + '" width="224" height="35" ShowStatusbar="1" AutoStart="1" InvokeURLs="0"></embed></object>';
				
				document.getElementById('huidigezender_right').innerHTML = statsArray[0];
				document.getElementById('zenderlogo').innerHTML = "<br><img src=\"../" + statsArray[2] + "\">";
				
			}
		}	
	
		ajaxRequest.open("GET", "ajax/laadzender.php?zid=" + zenderid, true);
		ajaxRequest.send('');
	}
	
	function browseTo(bestand) {	
	
		try {		
			ajaxRequest1 = new XMLHttpRequest();
		} catch (e) {
			try{
				ajaxRequest1 = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					ajaxRequest1 = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {
					alert("AJAX niet ondersteund. Update je browser!");
				}
			}
		}
		
		ajaxRequest1.onreadystatechange = function() {
			if (ajaxRequest1.readyState == 4) {
				var antwoord1 = ajaxRequest1.responseText;
				document.getElementById('content').innerHTML = antwoord1;
				setCookie("page",bestand,1);
				accountBox();
				urchinTracker();
			}
		}	
	
		ajaxRequest1.open("GET", bestand, true);
		ajaxRequest1.send('');
	}
	
	function reloadPage() {	
		
		var bestand = getCookie("page");
	
		try {		
			ajaxRequest10 = new XMLHttpRequest();
		} catch (e) {
			try{
				ajaxRequest10 = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					ajaxRequest10 = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {
					alert("AJAX niet ondersteund. Update je browser!");
				}
			}
		}
		
		ajaxRequest10.onreadystatechange = function() {
			if (ajaxRequest10.readyState == 4) {
				var antwoord10 = ajaxRequest10.responseText;
				document.getElementById('content').innerHTML = antwoord10;
				updateLogins();
				accountBox();
			}
		}	
	
		ajaxRequest10.open("GET", bestand, true);
		ajaxRequest10.send('');
	}
	
	function setColor(color) {	
		try {		
			ajaxRequest5 = new XMLHttpRequest();
		} catch (e) {
			try{
				ajaxRequest5 = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					ajaxRequest5 = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {
					alert("AJAX niet ondersteund. Update je browser!");
				}
			}
		}
	
		ajaxRequest5.open("GET", "ajax/setcolor.php?c=" + color, true);
		ajaxRequest5.setRequestHeader("X_USERAGENT", "AJAXORS");
		ajaxRequest5.send('');
	}	

	function chooseColor(color) {	
	
		if (color == "red") {
			document.getElementById('stylesheet').href = "red.css";
			setColor('red');
		} else if (color == "blue") {
			document.getElementById('stylesheet').href = "blue.css";
			setColor('blue');
		} else if (color == "green") {
			document.getElementById('stylesheet').href = "green.css";
			setColor('green');
		} else if (color == "pink") {
			document.getElementById('stylesheet').href = "pink.css";
			setColor('pink');
		} else if (color == "black") {
			document.getElementById('stylesheet').href = "black.css";
			setColor('black');
		}
	}	
	
	function zoeken() {	
	
		var zoekterm = document.getElementById('search').value;
		
		browseTo("zoeken.php?s=" + zoekterm);
		
	}
