monName=new Array("Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December");
dayName=new Array("Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag");
now=new Date;
glob_title=new String;

function writeDate() {
 document.write(now.getDate()+" "+monName[now.getMonth()]);
}

function startMyJS() {
 MM_preloadImages('pics/cplogo_on.gif','pics/cplogo_over.gif','pics/cplogo_off_m.gif','pics/cplogo_off_f.gif','pics/cplogo_off_i.gif');
 cphello();
 showToplist(11);
 showUpdlist(5);
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){
  if(!d.MM_p)
   d.MM_p=new Array();
  var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
  for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){
    d.MM_p[j]=new Image;
    d.MM_p[j++].src=a[i];
   }
  }
}
    
function MM_findObj(n, d) { //v4.0
 var p,i,x;
 if (!d)
  d=document;
 if((p=n.indexOf("?"))>0&&parent.frames.length){
  d=parent.frames[n.substring(p+1)].document;
  n=n.substring(0,p);
 }
 if(!(x=d[n])&&d.all)
  x=d.all[n];
 for (i=0;!x&&i<d.forms.length;i++)
  x=d.forms[i][n];
 for(i=0;!x&&d.layers&&i<d.layers.length;i++)
  x=MM_findObj(n,d.layers[i].document);
 if(!x && document.getElementById)
  x=document.getElementById(n);
 return x;
}

function MM_swapImage(){ //v3.0
 var i,j=0,x,a=MM_swapImage.arguments;
 document.MM_sr=new Array;
 for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){
   document.MM_sr[j++]=x;
   if(!x.oSrc)
    x.oSrc=x.src;
   x.src=a[i+2];
  }
}

function MM_swapImgRestore() { //v3.0
 var i,x,a=document.MM_sr;
 for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
  x.src=x.oSrc;
}

var bookmarkurl="http://www.checklistpagina.nl/index1.html";
var bookmarktitle="De ChecklistPagina, om niets te vergeten!";
function Bookmark(){
 if (document.all)
  window.external.AddFavorite(bookmarkurl,bookmarktitle);
}

function AfkoWindow() {
 afkoWindow = window.open("index-afkozoek.html","afkoWin","width=340,height=110");
}

function MailWindow() {
 mailWindow = window.open("index-mailfriend1.php?mylink="+window.location+"&mycl="+glob_title,"mailWin","width=310,height=200");
}

function PrintWindow(title) {
 printWindow = window.open("checklist-print1.php?cl="+title,"printWin","width=620,height=500,scrollbars=yes");
}

function NewWindow(page) {
 infoWindow = window.open(page,"infoWin","width=540,height=440,scrollbars=yes");
}

function gotoHome(){
 window.location.href = window.location;
}

function WallpaperWindow(wpfile) {
 width =800; if (screen) {width =screen.width-10;}
 height=600; if (screen) {height=screen.height-60;}
 wpWindow = window.open(wpfile, "wpWin", ",scrollbars=yes,resizable=yes,width="+width+",height="+height+",left=0,top=0,");
 wpWindow.focus();
}

function ReplaceOldPHPref(str){  
//old:<a href="checklist.php?cl=Barbecue">Barbecue</a>
//new:<a href="javascript:showChecklist("Barbecue")">Barbecue</a>
 var str2=str;
 if (str2.indexOf('checklist.php') != -1){
  str2 = str2.replace("checklist.php?cl=", "javascript:showChecklist(\'"); 
  str2 = str2.replace("\">", "\')\">");
//  alert(str2);
 } 
 return str2; 
}

function cpalert(){  
 var referrer=document.referrer;
 if (referrer.indexOf('checklistpagina') == -1){
   alert('   * * *  De ChecklistPagina.nl is vernieuwd! * * * *\r\n\r\n'+
         '  Klik op de banner om naar de nieuwe index te gaan.\r\n\r\n'+
         '(nieuwe url http://www.checklistpagina.nl/index1.html)');}
}

function checkBrowser() {
var ok;
 ok=true;
 if (!(document.getElementById || document.all || document.layers)){
  alert('DHTML is not supported!');
  ok=false;}
 if (!window.XMLHttpRequest){
  if (!window.ActiveXObject){
   alert('ActiveXObject is not supported!');
   ok=false;
  }
  else {alert('ActiveXObject is supported!');}
 }
 else {alert('XMLHttpRequest is supported!');}
 return ok;
} 
