var highlighted=0;function playGame(name_url){var scr_w=screen.width;var scr_h=screen.height;var win_w=940;var win_h=800;var win_left=(scr_w-win_w)/2;var win_top=(scr_h-win_h)/2;var playGame=window.open('./'+name_url+'.html','_blank','width='
+win_w+', height='+win_h+', top='+win_top+', left='
+win_left+',scrollsbar=0, status=0, resizable=1');}
function stageImg(id){var content='<div id="overblokje"><img src="./images/thumbs/'+id+'_thumb.jpg" /></div>';return overlib(content,BACKGROUND,'/images/over_blokje.png',RIGHT,WIDTH,125,HEIGHT,100);}
function sorteer(nieuweLocatie){window.location=nieuweLocatie;}
function addslashes(str){str=str.replace("\'","\\'");return str;}
function stripslashes(str){str=str.replace(/\\'/g,'\'');str=str.replace(/\\"/g,'"');str=str.replace(/\\\\/g,'\\');str=str.replace(/\\0/g,'\0');return str;}
function Set_Cookie(name,value,expires,path,domain,secure){var today=new Date();today.setTime(today.getTime());if(expires){expires=expires*1000*60*60*24;}
var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)
+((expires)?";expires="+expires_date.toGMTString():"")
+((path)?";path="+path:"")
+((domain)?";domain="+domain:"")
+((secure)?";secure":"");}
function Get_Cookie(check_name){var a_all_cookies=document.cookie.split(';');var a_temp_cookie='';var cookie_name='';var cookie_value='';var b_cookie_found=false;for(i=0;i<a_all_cookies.length;i++){a_temp_cookie=a_all_cookies[i].split('=');cookie_name=a_temp_cookie[0].replace(/^\s+|\s+$/g,'');if(cookie_name==check_name){b_cookie_found=true;if(a_temp_cookie.length>1){cookie_value=unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g,''));}
return cookie_value;break;}
a_temp_cookie=null;cookie_name='';}
if(!b_cookie_found){return null;}}
function eraseCookie(name){Set_Cookie(name,"",-1);}
function updateDB(action){id=document.getElementById('gameid').innerHTML;if(window.XMLHttpRequest){ajax=new XMLHttpRequest();}else if(window.ActiveXObject){ajax=new ActiveXObject("Microsoft.XMLHTTP");}
if(!ajax){alert("No ajax");return false;}
ajax.open('get','./includes/mygames.php?action='+action+'&id='+id);ajax.send(null);}
function toevoegen(name){if(name.indexOf('|')!=-1){currentCookie=Get_Cookie('mygames');if(currentCookie!=null){if(currentCookie.indexOf(name)!=-1){}else{Set_Cookie('mygames',name,"-1");name=currentCookie+name;Set_Cookie('mygames',name,3600,'/','','');updateDB('add');}}else{Set_Cookie('mygames',name,"-1");Set_Cookie('mygames',name,3600,'/','','');}
displayGames(false);}}
function displayGames(id){var mygamesList='';currentCookie=Get_Cookie('mygames');if(currentCookie!=null){brokenstring=currentCookie.split(';');if(brokenstring.length-1==0){if(!id){mygamesList=('<li class="odd"><span class="gamename" style="color:#999"><i>Nog geen spelletjes.</i></a></li>');}else{mygamesList="<li class='odd' id='listVoegToe'><div style='position:relative;' onclick=\"toevoegen('"+id+";')\"><a class='gamenameToevoeg' href='#'>+ Voeg dit spel toe</a></li>";}}else{document.getElementById('mygames').style.visibility='visible';for(i=0;i<brokenstring.length-1;i++){nameUrl=brokenstring[i].split("|");if(i%2!=1){mygamesList=mygamesList
+'<li class="oddmg"><div style="width:153px;float:left;"><a href="/'
+nameUrl[1].toLowerCase()
+'.html" style="cursor: pointer;" class="mygameslink">'
+nameUrl[0]
+"</a>"
+'</div><div class="delete" onclick="deleteSpel(\''
+addslashes(nameUrl[0])
+'\');" ><img src="/images/kruisje_01.png" onmouseover="this.src=\'/images/kruisje_02.png\'" onmouseout="this.src=\'/images/kruisje_01.png\'" /></div></li>';}else{mygamesList=mygamesList
+'<li class="evenmg"><div style="width:153px;float:left;"><a href="/'
+nameUrl[1].toLowerCase()
+'.html" style="cursor: pointer;" class="mygameslink">'
+nameUrl[0]
+"</a>"
+'</div><div class="delete" onclick="deleteSpel(\''
+addslashes(nameUrl[0])
+'\');" ><img src="/images/kruisje_01.png" onmouseover="this.src=\'/images/kruisje_02.png\'" onmouseout="this.src=\'/images/kruisje_01.png\'" /></div></li>';}}
if(!id){}else{mygamesList=mygamesList
+"<li class='odd' id='listVoegToe'><div style='position:relative;' onclick=\"toevoegen('"+id+";')\"><a class='gamenameToevoeg' href='#'>+ Voeg dit spel toe</a></li>";}}}else{if(!id){mygamesList=('<li class="odd"><span class="gamename" style="color:#999"><i>Nog geen spelletjes.</i></a></li>');}else{mygamesList="<li class='odd' id='listVoegToe'><div style='position:relative;' onclick=\"toevoegen('"+id+";')\"><a class='gamenameToevoeg' href='#'>+ Voeg dit spel toe</a></div></li>";}}
document.getElementById('mygamesList').innerHTML=mygamesList;}
function displayGamesBig(){var mygamesList='';currentCookie=Get_Cookie('mygames');if(currentCookie!=null){brokenstring=currentCookie.split(';');if(brokenstring.length-1==0){document.getElementById('mygamesListBig').innerHTML='<img src="/images/witvlak_boven.png" alt="text Header" style="margin-left:10px;margin-top:10px;"/>'+'<div id="v404"><center><p>Je hebt nog geen spellen opgeslagen.</p></center>'+'</div>'+'<img src="/images/witvlak_onder.png" alt="text Header" style="margin-left:10px;"/>';}else{for(i=0;i<brokenstring.length-1;i++){nameUrl=brokenstring[i].split("|");mygamesList+=nameUrl[1]+"|";}
if(window.XMLHttpRequest)
{ajax=new XMLHttpRequest();}
else if(window.ActiveXObject)
{ajax=new ActiveXObject("Microsoft.XMLHTTP");}
if(!ajax)
{document.getElementById(tagID).innerHTML="Opgegeven: kon geen verbinding maken.";return false;}
ajax.open('get','./includes/incl_mijnspellen.php?spellen='+mygamesList);ajax.onreadystatechange=handlRespMijnSpellen;ajax.send(null);}}else{document.getElementById('mygamesListBig').innerHTML='<img src="/images/witvlak_boven.png" alt="text Header" style="margin-left:10px;margin-top:10px;"/>'+'<div id="v404"><center><p>Je hebt nog geen spellen opgeslagen.</p></center>'+'</div>'+'<img src="/images/witvlak_onder.png" alt="text Header" style="margin-left:10px;"/>';}}
function handlRespMijnSpellen(){if(ajax.readyState==4){if(ajax.status==200){var response=ajax.responseText;document.getElementById('mygamesListBig').innerHTML=response;}}}
function deleteSpel(name){newCookie="";currentCookie=Get_Cookie('mygames');brokenstring=currentCookie.split(';');for(i=0;i<brokenstring.length-1;i++){if(brokenstring[i].indexOf(name)==-1){newCookie=newCookie+brokenstring[i]+";";}}
Set_Cookie('mygames',newCookie,3600,'/','','');displayGames(true);}
function GetXmlHttpObject(){var xmlHttp=null;try{xmlHttp=new XMLHttpRequest();}catch(e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}
return xmlHttp;}
function showHint(str,e){if(e!=null){keynum=0;if(window.event)
{keynum=e.keyCode;}else if(e.which)
{keynum=e.which;}
if(keynum==13){if(highlighted!=0){window.location=document.getElementById('a'+highlighted).href;return;}else{document.zoeken.submit();}}
if(keynum==40){if(highlighted<document.getElementById('suggestlist').childNodes.length-1){highlighted+=1;document.getElementById(highlighted).style.backgroundColor='#999999';document.getElementById(highlighted-1).style.backgroundColor='';}
return;}
if(keynum==38){if(highlighted>1){highlighted-=1;document.getElementById(highlighted).style.backgroundColor='#999999';document.getElementById(highlighted+1).style.backgroundColor='';}
return;}}
if(str.length==0){document.getElementById("suggestions").innerHTML="-";document.getElementById("suggestions").style.visibility='hidden';return;}
xmlHttp=GetXmlHttpObject();if(xmlHttp==null){return;}
var url="../includes/suggest.php";url=url+"?q="+str;url=url+"&sid="+Math.random();xmlHttp.onreadystatechange=stateChanged;xmlHttp.open("GET",url,true);xmlHttp.send(null);highlighted=0;}
function stateChanged(){if(xmlHttp.readyState==4){document.getElementById("suggestions").style.visibility='visible';document.getElementById("suggestions").innerHTML=xmlHttp.responseText;}}
function clearSuggest(){document.getElementById("zoekinput").innerHTML="";document.getElementById("suggestions").style.visibility='hidden';};function correctPNG()
{var arVersion=navigator.appVersion.split("MSIE")
var version=parseFloat(arVersion[1])
if((version>=5.5)&&(document.body.filters))
{for(var i=0;i<document.images.length;i++)
{var img=document.images[i]
var imgName=img.src.toUpperCase()
if(imgName.substring(imgName.length-3,imgName.length)=="PNG")
{var imgID=(img.id)?"id='"+img.id+"' ":""
var imgClass=(img.className)?"class='"+img.className+"' ":""
var imgTitle=(img.title)?"title='"+img.title+"' ":"title='"+img.alt+"' "
var imgStyle="display:inline-block;"+img.style.cssText
if(img.align=="left")imgStyle="float:left;"+imgStyle
if(img.align=="right")imgStyle="float:right;"+imgStyle
if(img.parentElement.href)imgStyle="cursor:hand;"+imgStyle
var strNewHTML="<span "+imgID+imgClass+imgTitle
+" style=\""+"width:"+img.width+"px; height:"+img.height+"px;"+imgStyle+";"
+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+"(src=\'"+img.src+"\', sizingMethod='scale');\"></span>"
img.outerHTML=strNewHTML
i=i-1}}}}
if(window.attachEvent){window.attachEvent("onload",correctPNG);}