
function WriteGoogleAdd(){
	var ScreenW;
	ScreenW = GetScreenSize();
	if (ScreenW > 1024){
		google_ad_width = 160;
		google_ad_format = "160x600_as";
		document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>');
	}else if (ScreenW > 800){
		google_ad_width = 120;
		google_ad_format = "120x600_as";
		document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>');
	}
}

function GetScreenSize(){
	if (parseInt(navigator.appVersion)>3) {
	 screenW = screen.width;
	 screenH = screen.height;
	}
	else if (navigator.appName == "Netscape" 
		&& parseInt(navigator.appVersion)==3
		&& navigator.javaEnabled()
	   ) 
	{
	 var jToolkit = java.awt.Toolkit.getDefaultToolkit();
	 var jScreenSize = jToolkit.getScreenSize();
	 screenW = jScreenSize.width;
	 screenH = jScreenSize.height;
	}
	return screenW;
}

function LuisterRadio(){
	window.open('http://www.games-server.nl/webradio.php', 'webradio', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=464,height=300,left=270,top=230'); 
	document.luisterradio.submit();
}

function mOvr(src) {
	  src.className="ContentRowHover";
	  window.status='  ';
  }
  function mOut(src,clrIn) {
      src.className="ContentRow";
  }
  
 function GoToURL(strURL){
 	document.location = strURL;
 }
 

var bookmarkurl="http://www.games-server.nl/"
var bookmarktitel="Games-server.nl - Online games spelen"

function favorieten(){
	if (document.all)
		window.external.AddFavorite(bookmarkurl,bookmarktitel)
	}
 
function OpenInPopup(strURL){ 
	window.open (strURL,'supportpop','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=640,height=480,top=250,left=250');
} 
function OpenZigiz(strURL){ 
	window.open (strURL,'supportpop','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=800,height=600,top=250,left=250');
} 
function PopUpScherm(URL, Titel, Width, Height){
	if (Width=="")
	{
		Width = "640";
	}
	if (Height=="")
	{
		Height = "480";
	}
		
	window.open (URL,Titel,'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width='+Width+',height='+Height+',top=250,left=250');
}
var TargetEl;

function Stemmen(){
	TargetEl = document.getElementById("stemform");
	GameID=document.getElementById("gameid").value;	
	Stem = document.getElementById("stem").value;
	strURL = "../spelbeoordelen.php?gameid="+GameID+"&stem="+Stem;
	makeRequest(strURL, "http_request.onreadystatechange = WriteHTTPResponseText; ");	
}
function makeRequest(url, strReturn) { 
		 
		 if (window.XMLHttpRequest) { // Mozilla, Safari,... 
	   http_request = new XMLHttpRequest(); 
   } else if (window.ActiveXObject) { // IE 
	   http_request = new ActiveXObject("Microsoft.XMLHTTP"); 
   } 
   eval(strReturn);
   http_request.open('GET', url, true);   
   http_request.send(null); 


} 
function WriteHTTPResponseText() { 
   	if (http_request.readyState == 4) { 
    	if (http_request.status == 200) { 
      	TargetEl.innerHTML = "";
        TargetEl.innerHTML = http_request.responseText; 
        } 
    } 
  } 
  
function getCookie(NameOfCookie){ 
var strCookie;
strCookie="";
if (document.cookie.length > 0) 
{begin = document.cookie.indexOf(NameOfCookie+"="); 
if (begin != -1) { 
begin += NameOfCookie.length+1; 
end = document.cookie.indexOf(";", begin);
if (end == -1) end = document.cookie.length;
strCookie = unescape(document.cookie.substring(begin, end)); 
} 
}
return strCookie;
}

function setCookie(NameOfCookie, value, expiredays) 
{ var ExpireDate = new Date ();
var strCookie;
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
strCookie = getCookie(NameOfCookie);
strMsg = "Spel toegevoegd aan je favorieten.";
if (strCookie !=""){
	strCookie2 = "|" + strCookie + "|";
	Plaats = strCookie2.indexOf("|"+value+"|");
	if (Plaats==-1){
		strCookie = strCookie + "|" + value;
	}else{
		if (confirm("Deze spel staat al in je favorieten.\nWil je hem uit je favorieten verwijderen?")){
			strCookie2 = strCookie2.replace("|"+value+"|","|");
			strCookie2 = strCookie2.replace("||","|");
			if (strCookie2.substr(0,1)=="|"){
				strCookie2=strCookie2.substr(1,strCookie2.length);
			}
			if (strCookie2.substr(strCookie2.length-1,1)=="|"){
				strCookie2=strCookie2.substr(0,strCookie2.length-1);
			}
			strMsg = "Spel verwijderd aan je favorieten.";
			strCookie = strCookie2;
		}
	}
		
}else{
	strCookie = value;
}
document.cookie = NameOfCookie + "=" + escape(strCookie) + 
((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString()) + "; path=/";
alert(strMsg);
}

function delCookie (NameOfCookie) 
{ if (getCookie(NameOfCookie)) {
document.cookie = NameOfCookie + "=" +
"; expires=Thu, 01-Jan-70 00:00:01 GMT;";
}

}
function CheckAge(){
	return confirm("18plus/adult games zijn niet geschikt voor personen onder de 18 jaar!\n Weet je zeker dat je door wilt gaan?.")
}