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_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;
}

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.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 Load_Buttons() {
   MM_preloadImages('../common/images/Final%20Buttons/Topbar_but_events_down.gif')
   MM_preloadImages('../common/images/Final%20Buttons/Topbar_but_guests_down.gif')
   MM_preloadImages('../common/images/Final%20Buttons/Topbar_but_social_down.gif')
   MM_preloadImages('../common/images/Final%20Buttons/Topbar_but_victuals_down.gif')
   MM_preloadImages('../common/images/Final%20Buttons/Topbar_but_sports_down.gif')
   MM_preloadImages('../common/images/Final%20Buttons/Topbar_but_contact_down.gif')

}

   var ie=document.all
   var ns=document.layers
   var ns6=document.getElementById&&!document.all

function Config3v(x,wid,hig,ext) {
   twfact=window.screen.width/1024
   w=twfact*wid
   h=twfact*hig
   imwid=w/1.04
       var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=no,width='+w+',height='+h+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/'+x+"."+ext+'"';
   var thisline='<html><body><img src='+thispic+'" width='+imwid+'></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function Config3w(x,wid,hig,ext) {
   twfact=window.screen.width/1024
   w=twfact*wid
   h=twfact*hig
   imwid=w/1.08
       var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=no,width='+w+',height='+h+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/'+x+"."+ext+'"';
   var thisline='<html><body><center><img src='+thispic+'" width='+imwid+'></center></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function Config3lft(x,wid,hig,lft,ext,thetitle) {
   twfact=window.screen.width/1024
   w=twfact*wid
   h=twfact*hig
   imwid=w/1.08
       var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=yes,width='+w+',height='+h+',left='+lft+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/'+x+"."+ext+'"';
   var thisline='<html><head><title>'+thetitle+'</title></head><body><center><img src='+thispic+'" width='+imwid+'></center></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function Configkef(x,wid,hig,lft,ext,thetitle) {
   twfact=window.screen.width/1024;
   w=twfact*wid;
   h=twfact*hig;
   imwid=w/1.08;
   var myBars='directories=no,location=no,menubar=no,status=no';
   myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=yes,width='+w+',height='+h+',left='+lft+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/kefal/'+x+"."+ext+'"';
   var embed="<span style='font-family:helvetica; font-size:10pt; color:#000099;'>For information visit our website: <a href='http://www.kefalonia-villa.gr'>www.kefalonia-villa.gr</a></span>";
   var thisline='<html><head><title>'+thetitle+'</title></head><body><center><img src='+thispic+'" width='+imwid+'><br>' + embed + '</center></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function ConfigWin(page,wid,hig,lft,thetitle) {
   twfact=window.screen.width/1024;
   w=twfact*wid;
   h=twfact*hig;
   imwid=w/1.08;
   var myBars='directories=no,location=no,menubar=no,status=no';
   myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=yes,width='+w+',height='+h+',left='+lft+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open(page,'mywin',myFeatures);
   newWin.document.close();
}

var mess="hello sailor!";

function Config3JH(x,wid,hig,ext) {
   twfact=window.screen.width/1024
   w=twfact*wid
   h=twfact*hig
   imwid=w/1.04
       var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/'+x+"."+ext+'"';
   var thisline='<html><body>';
   thisline+='<img src='+thispic+'" width='+imwid+'>';
   thisline+="<br><a href='notices/RaceJHdoc.htm' target='JH'>For more information click me</a>";
   thisline+='</body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function westmap() {
   alert('here is a map')
}


function WestEndB(x,wid,hig,ext) {
   twfact=window.screen.width/1024
   w=twfact*wid
   h=twfact*hig
   imwid=w/1.08
       var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/'+x+"."+ext+'"';
   var thisfunc='"westmap()"';
   var thisline='<html><body><img src='+thispic+' width='+imwid+' onClick='+thisfunc+'></body></html>';
   alert(thisline);
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function Config4w(x,wid,hig,ext) {
   twfact=window.screen.width/1024
   w=twfact*wid
   h=twfact*hig
   imwid=w/1.1
       var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/'+x+"."+ext+'"';
   var thisline='<html><body><img src='+thispic+'" width='+imwid+'></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function Config3x(x,wid,hig,ext) {
   twfact=window.screen.width/1024
   w=twfact*wid
   h=twfact*hig
   imwid=w/1.05
   var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=no,width='+w+',height='+h+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/'+x+"."+ext+'"';
   var thisline='<html><body><img src='+thispic+'" width='+imwid+'></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function Config3x10(x,wid,hig,ext) {
   twfact=window.screen.width/1024
   w=twfact*wid
   h=twfact*hig
   imwid=w/1.05
   var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=no,width='+w+',height='+h+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/tourn10/'+x+"."+ext+'"';
   var thisline='<html><body><img src='+thispic+'" width='+imwid+'></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function Config3x11(x,wid,hig,ext) {
   twfact=window.screen.width/1024
   w=twfact*wid
   h=twfact*hig
   imwid=w/1.05
   var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=no,width='+w+',height='+h+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/tourn11/'+x+"."+ext+'"';
   var thisline='<html><body><img src='+thispic+'" width='+imwid+'></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function Config3g(x,wid,hig,ext) {
   twfact=window.screen.width/1024
   w=twfact*wid
   h=twfact*hig
   imwid=w/1.05
   var myBars='directories=no,location=no,menubar=yes,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=yes';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/'+x+"."+ext+'"';
   var thisline='<html><body><img src='+thispic+'" width='+imwid+'></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function Config4x(x,wid,hig,ext) {
   twfact=window.screen.width/1024
   w=twfact*wid
   h=twfact*hig
   imwid=w/1.1
   var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/jtourn/'+x+"."+ext+'"';
   var thisline='<html><body><img src='+thispic+'" width='+imwid+'></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function Config5x(x,wid,hig,ext) {
   twfact=window.screen.width/1024;
   if(wid>hig) {
      w=twfact*wid;
      h=twfact*hig;
      imwid=w/1.04;
      w=w-12;
   }
   else {
      w=0.85*twfact*wid;
      h=0.85*twfact*hig;
      imwid=w/1.04;
      w=w+10;
   }
   var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/jtourn09/'+x+"."+ext+'"';
   var thisline='<html><body><img src='+thispic+'" width='+imwid+'></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function jpicst10(x,wid,hig,ext) {
   twfact=window.screen.width/1024;
   if(wid>hig) {
      w=twfact*wid;
      h=twfact*hig;
      imwid=w/1.04;
      w=w-12;
   }
   else {
      w=0.85*twfact*wid;
      h=0.85*twfact*hig;
      imwid=w/1.04;
      w=w+10;
   }
   var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/jtourn10/'+x+"."+ext+'"';
   var thisline='<html><body><img src='+thispic+'" width='+imwid+'></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function jpicst10a(x,wid,hig,ext) {
   twfact=window.screen.width/1024;
   if(wid>hig) {
      w=twfact*wid;
      h=twfact*hig;
      imwid=w/1.04;
      w=w-12;
   }
   else {
      w=0.85*twfact*wid;
      h=0.85*twfact*hig;
      imwid=w/1.04;
      w=w+10;
   }
   var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../../common/images/jtourn10/'+x+"."+ext+'"';
   var thisline='<html><body><img src='+thispic+'" width='+imwid+'></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function jpicst11(x,wid,hig,ext) {
   twfact=window.screen.width/1024;
   if(wid>hig) {
      w=twfact*wid;
      h=twfact*hig;
      imwid=w/1.04;
      w=w-12;
   }
   else {
      w=0.85*twfact*wid;
      h=0.85*twfact*hig;
      imwid=w/1.04;
      w=w+10;
   }
   var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/jtourn11/'+x+"y."+ext+'"';
   var thisline='<html><body><img src='+thispic+'" width='+imwid+'></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function jpicst11b(x,wid,hig,ext) {
   twfact=window.screen.width/1024;
   if(wid>hig) {
      w=twfact*wid;
      h=twfact*hig;
      imwid=w/1.04;
      w=w-12;
   }
   else {
      w=0.85*twfact*wid;
      h=0.85*twfact*hig;
      imwid=w/1.04;
      w=w+10;
   }
   var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../../common/images/jtourn11/'+x+"y."+ext+'"';
   var thisline='<html><body><img src='+thispic+'" width='+imwid+'></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function ppicj10(snap,w,h,who,ref) {
  var mywid=200;
  if(ref==144) {mywid=300;}
  if(ref==300) {mywid=400;}
  s='<td class="tdc">\n' + who + '<br><br>\n';
  s=s+'<img src="../common/images/jtourn10/'+snap+'x.jpg" width="'+mywid+'"'
  s=s+' onClick="jpicst10('
  s=s+"'"+snap+"',"+w+","+h+",'jpg')"
  s=s+'"><br>\n'
  s=s+'<a class="a1" href="../common/images/jtourn10/'+snap+'z.jpg" target=snap onClick="alert('
  s=s+mess+')"><span class="spc">'+ref+'</span></a>\n</td>'
  document.write(s)
}

function ppicj10a(snap,w,h,who,ref) {
  var mywid=100;
  var stemp;
  stemp='<td class="tdc" rowspan="2">\n' + who + ' - ' + ref + '<br><br>\n';
  s='<img src="../../common/images/jtourn10/'+snap+'x.jpg" width="'+mywid+'"'
  s=s+' onClick="jpicst10a('
  s=s+"'"+snap+"',"+w+","+h+",'jpg')"
  s=s+'"><br>\n'
  s=s+'<a class="a1" href="../../common/images/jtourn10/'+snap+'z.jpg" target=snap onClick="alert('
  s=s+mess+')"><span class="spc">'+who + ' <br> ' + ref+'</span></a>\n'
  document.write(s)
}

function ppicj11(snap,w,h,who,ref) {
  var mywid=200;
  s='<td class="tdc">\n' + who + '<br><br>\n';
  s=s+'<img src="../common/images/jtourn11/'+snap+'y.jpg" width="'+mywid+'"'
  s=s+' onClick="jpicst11('
  s=s+"'"+snap+"',"+w+","+h+",'jpg')"
  s=s+'"><br>\n'
  s=s+'<a class="a1" href="../common/images/jtourn11/'+snap+'z.jpg" target=snap onClick="alert('
  s=s+mess+')"><span class="spc">'+ref+'</span></a>\n</td>'
  document.write(s)
}

function ppicj11a(snap,w,h,who,rc,nrc) {
  var mywid=100;
  if(w>h) mywid=150;
  var src;
  if(rc=="r") src='rowspan=' + nrc;
  if(rc=="c") src='colspan=' + nrc;
  s='<td class="tdc11"' + src + '>\n\n';
  s=s+'<img src="../common/images/jtourn11/'+snap+'y.jpg" width="'+mywid+'"'
  s=s+' onClick="jpicst11('
  s=s+"'"+snap+"',"+w+","+h+",'jpg')"
  s=s+'"><br>\n'
  s=s+'<a class="a1" href="../common/images/jtourn11/'+snap+'z.jpg" target=snap onClick="alert('
  s=s+mess+')"><span class="spc">' + who +'</span></a><br><br>\n</td>'
//  alert(s);
  document.write(s)
}

function ppicj11b(snap,pl) {
  if(pl=="p") {
     mywid=60;
     myhit=90;
     delwid=20;
     delhit=30;
  }
  else {
     mywid=90;
     myhit=60;
     delwid=30;
     delhit=20;
  }
  var w=5*mywid+delwid;
  var h=5*myhit+delhit;
  s='<td style="text-align:center;">\n';
  s=s+'<img src="../../common/images/jtourn11/'+snap+'x.jpg" width="'+mywid+'"'
  s=s+' onClick="jpicst11b('
  s=s+"'"+snap+"',"+w+","+h+",'jpg')"
  s=s+'"><br>\n'
  s=s+'<a class="a11" href="../../common/images/jtourn11/'+snap+'z.jpg" target=snap onClick="alert('
  s=s+mess+')">' + snap + '</a><br>\n</td>'
  document.write(s)
}

function Config3xr(x,wid,hig,ext) {
   twfact=window.screen.width/1024
   w=twfact*wid
   h=twfact*hig
   imwid=w/1.1
   var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=yes';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/'+x+"."+ext+'"';
   var thisline='<html><body><img src='+thispic+'" width='+imwid+'></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function Config3y(x,wid,hig,ext) {
   twfact=window.screen.width/1024
   w=twfact*wid
   h=twfact*hig
   imwid=w/1.03
   var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=no,width='+w+',height='+h+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/ball/'+x+"."+ext+'"';
   var thisline='<html><body><img src='+thispic+'" width='+imwid+'></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function Config3z(x,wid,hig,ext) {
   twfact=window.screen.width/1024
   w=twfact*wid
   h=twfact*hig
   imwid=w/1.03
   var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/tour06/'+x+"."+ext+'"';
   var thisline='<html><body><img src='+thispic+'" width='+imwid+'></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}

function Config3p(x,wid,hig,ext) {
   twfact=window.screen.width/1024
   w=twfact*wid
   h=twfact*hig
   imwid=w/1.1
   var myBars='directories=no,location=no,menubar=yes,status=no';
       myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=yes';
   var myFeatures=myBars+','+myOptions;
   var newWin=open('','W'+x,myFeatures);
   var thispic='"../common/images/'+x+"."+ext+'"';
   var thisline='<html><body><img src='+thispic+'" width='+imwid+'></body></html>';
   newWin.document.writeln(thisline);
   newWin.document.close();
}



function ConfigNote(xx,yy,wid,hig,n) {
   twfact=window.screen.width/1024
   if (n==1) {
      w=twfact*wid
      h=twfact*(150+20*lines1)
      imwid=w/1.1
      var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
      var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=no';
      var myFeatures=myBars+','+myOptions;
      var newWin1=open('','n1',myFeatures);
//      newWin1.moveTo(xx,yy)
      newWin1.document.writeln('<html><body bgcolor=' + bgcol1 + '>');
      newWin1.document.writeln(title1);
      newWin1.document.writeln("<hr>")
      for (i=1;i<=lines1;i++) {
         newWin1.document.writeln(xline[1][i] + "<br>")
      }
      newWin1.document.writeln('</body></html>');
      newWin1.document.close();
   }
   if (n==2) {
      w=twfact*wid
      h=twfact*(150+20*lines2)
      imwid=w/1.1
      var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
      var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=no';
      var myFeatures=myBars+','+myOptions;
      var newWin2=open('','n2',myFeatures);
//      newWin2.moveTo(xx,yy)
      newWin2.document.writeln('<html><body bgcolor=' + bgcol2 + '>');
      newWin2.document.writeln(title2);
      newWin2.document.writeln("<hr>")
      for (i=1;i<=lines2;i++) {
         newWin2.document.writeln(xline[2][i] + "<br>")
      }
      newWin2.document.writeln('</body></html>');
      newWin2.document.close();
   }
   if (n==3) {
      w=twfact*wid
      h=twfact*(150+20*lines3)
      imwid=w/1.1
      var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
      var myOptions='scrollbars=no,width='+w+',height='+h+',resizable=no';
      var myFeatures=myBars+','+myOptions;
      var newWin3=open('','n3',myFeatures);
//      newWin3.moveTo(xx,yy)
      newWin3.document.writeln('<html><body bgcolor=' + bgcol3 + '>');
      newWin3.document.writeln(title3);
      newWin3.document.writeln("<hr>")
      for (i=1;i<=lines3;i++) {
         newWin3.document.writeln(xline[3][i] + "<br>")
      }
      newWin3.document.writeln('</body></html>');
      newWin3.document.close();
   }
   if (n==4) {
      w=twfact*wid
      h=twfact*(150+20*lines4)
      imwid=w/1.1
      var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
      var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=no';
      var myFeatures=myBars+','+myOptions;
      var newWin4=open('','n4',myFeatures);
//      newWin4.moveTo(xx,yy)
      newWin4.document.writeln('<html><body bgcolor=' + bgcol4 + '>');
      newWin4.document.writeln(title4);
      newWin4.document.writeln("<hr>")
      for (i=1;i<=lines4;i++) {
         newWin4.document.writeln(xline[4][i] + "<br>")
      }
      newWin4.document.writeln('</body></html>');
      newWin4.document.close();
   }

   if (n==5) {
      w=twfact*wid
      h=twfact*(150+20*lines5)
      imwid=w/1.1
      var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
      var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=no';
      var myFeatures=myBars+','+myOptions;
      var newWin5=open('','n5',myFeatures);
//      newWin5.moveTo(xx,yy)
      newWin5.document.writeln('<html><body bgcolor=' + bgcol5 + '>');
      newWin5.document.writeln(title5);
      newWin5.document.writeln("<hr>")
      for (i=1;i<=lines5;i++) {
         newWin5.document.writeln(xline[5][i] + "<br>")
      }
      newWin5.document.writeln('</body></html>');
      newWin5.document.close();
   }
   if (n==6) {
      w=twfact*wid
      h=twfact*(150+20*lines6)
      imwid=w/1.1
      var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
      var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=no';
      var myFeatures=myBars+','+myOptions;
      var newWin6=open('','n6',myFeatures);
//      newWin6.moveTo(xx,yy)
      newWin6.document.writeln('<html><body bgcolor=' + bgcol6 + '>');
      newWin6.document.writeln(title6);
      newWin6.document.writeln("<hr>")
      for (i=1;i<=lines6;i++) {
         newWin6.document.writeln(xline[6][i] + "<br>")
      }
      newWin6.document.writeln('</body></html>');
      newWin6.document.close();
   }
   if (n==7) {
      w=twfact*wid
      h=twfact*(150+20*lines7)
      imwid=w/1.1
      var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
      var myOptions='scrollbars=no,width='+w+',height='+h+',resizable=no';
      var myFeatures=myBars+','+myOptions;
      var newWin7=open('','n7',myFeatures);
//      newWin7.moveTo(xx,yy)
      newWin7.document.writeln('<html><body bgcolor=' + bgcol7 + '>');
      newWin7.document.writeln(title7);
      newWin7.document.writeln("<hr>")
      for (i=1;i<=lines7;i++) {
         newWin7.document.writeln(xline[7][i] + "<br>")
      }
      newWin7.document.writeln('</body></html>');
      newWin7.document.close();
   }
   if (n==8) {
      w=twfact*wid
      h=twfact*(150+20*lines8)
      imwid=w/1.1
      var myBars='directories=no,location=no,menubar=no,status=no';
       myBars+=',titlebar=no,toolbar=no';
      var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=no';
      var myFeatures=myBars+','+myOptions;
      var newWin8=open('','n8',myFeatures);
//      newWin8.moveTo(xx,yy)
      newWin8.document.writeln('<html><body bgcolor=' + bgcol8 + '>');
      newWin8.document.writeln(title8);
      newWin8.document.writeln("<hr>")
      for (i=1;i<=lines8;i++) {
         newWin8.document.writeln(xline[8][i] + "<br>")
      }
      newWin8.document.writeln('</body></html>');
      newWin8.document.close();
   }
}

function getElement(psID) {
   if(document.all) {
      return document.all[psID];
   } else {
      return document.getElementById(psID);
   }
}

function LoadHomePic(p,w) {
   if(document.title=="Cumberland Lawn Tennis Club and Hampstead Cricket Club - Home Page")
   {
   if(p==1){getElement('hpic').src="../common/images/homepic3.jpg";getElement('hpic').width=w};
   if(p==2){getElement('hpic').src="../common/images/homepic7.jpg";getElement('hpic').width=w};
   if(p==3){getElement('hpic').src="../common/images/airpic01.jpg";getElement('hpic').width=w};
   if(p==4){getElement('hpic').src="../common/images/cd4_31.jpg";getElement('hpic').width=w};
   if(p==5){getElement('hpic').src="../common/images/twilight1.jpg";getElement('hpic').width=w};
   if(p==6){getElement('hpic').src="../common/images/cricket2.jpg";getElement('hpic').width=w};
   if(p==7){getElement('hpic').src="../common/images/i8096.jpg";getElement('hpic').width=w};
   if(p==8){getElement('hpic').src="../common/images/homepic5.jpg";getElement('hpic').width=w};
   }
}


var lpath = new String();
function showdetail() {
   var lString = new String(document.location);
   n = lString.indexOf("public/private");
   if(n > 0) {lpath = "../"}
   else {lpath = "null"};
}


function showseg(myseg) {
   i96x.src=myseg
}



var ie=document.all;
var nn6=document.getElementById&&!document.all;

var isdrag=false;
var x,y;
var dobj;

function movemouse(e)
{
  if (isdrag)
  {
    var myX = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
    var myY = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
    dobj.style.left = myX;
    dobj.style.top  = myY;
    if(dobj.id == "img1") {
       getElement('txt1').style.left = myX + 25;
       getElement('txt1').style.top  = myY + 20;
    }
    return false;
  }
}

function selectmouse(e) 
{
  var fobj       = nn6 ? e.target : event.srcElement;
  var topelement = nn6 ? "HTML" : "BODY";
  var button     = nn6 ? e.button : event.button
  if(button != 2) {return false}
  while (fobj.tagName != topelement && fobj.className != "dragme")
  {
    fobj = nn6 ? fobj.parentNode : fobj.parentElement;
  }

  if (fobj.className=="dragme")
  {
    isdrag = true;
    dobj = fobj;
    tx = parseInt(dobj.style.left+0);
    ty = parseInt(dobj.style.top+0);
    x = nn6 ? e.clientX : event.clientX;
    y = nn6 ? e.clientY : event.clientY;
    document.onmousemove=movemouse;
    return false;
  }
}

document.onmousedown=selectmouse;
document.onmouseup=new Function("isdrag=false");


   var newWin

   function showspan() {
      w=800
      h=600
      left=200;
      xtop=200;
      var myBars='directories=no,location=no,menubar=yes,status=no';
      myBars+=',titlebar=no,toolbar=no';
      var myOptions1='scrollbars=yes,width='+w+',height='+h;
      var myOptions2='left='+left+',top='+xtop+',resizable=no';
      var myFeatures=myBars+','+myOptions1+','+myOptions2;
      newWin=open('','spn',myFeatures);
      newWin.document.write("<span class='popup3b'>");
      for (i=1;i<=lines1;i++) {
         newWin.document.writeln(xline[1][i])
      }
      newWin.document.write("</span>");
      newWin.document.close();
   }

   function showimage(obj,left,top) {
      w=window.screen.width/3
      h=window.screen.height/3
      w=200
      h=255
      var myBars='directories=no,location=no,menubar=no,status=no';
      myBars+=',titlebar=no,toolbar=no';
      var myOptions1='scrollbars=no,width='+w+',height='+h;
      var myOptions2='left='+left+',top='+top+',resizable=no';
      var myFeatures=myBars+','+myOptions1+','+myOptions2;
      newWin=open('','xxx',myFeatures);
      var thedoc="../common/images/"+obj
      newWin.document.location=thedoc;
   }

   function showimage2(obj,wid,hei,left,top) {
      w=wid
      h=hei
      var myBars='directories=no,location=no,menubar=no,status=no';
      myBars+=',titlebar=no,toolbar=no';
      var myOptions1='scrollbars=no,width='+w+',height='+h;
      var myOptions2='left='+left+',top='+top+',resizable=no';
      var myFeatures=myBars+','+myOptions1+','+myOptions2;
      newWin=open('','xxx',myFeatures);
      var thedoc="../common/images/"+obj
      newWin.document.location=thedoc;
   }

   function closethis(obj) {
      newWin.close()
   }


function xdate(thisdate) {
// Returns a date object corresponding to the string thisdate.
   var dd   = thisdate.substr(0,2);
   var mmm  = thisdate.substr(2,3);
   var yyyy = thisdate.substr(5,4);
   switch(mmm.toUpperCase())
   {
       case "JAN": mm=0;  break;
       case "FEB": mm=1;  break;
       case "MAR": mm=2;  break;
       case "APR": mm=3;  break;
       case "MAY": mm=4;  break;
       case "JUN": mm=5;  break;
       case "JUL": mm=6;  break;
       case "AUG": mm=7;  break;
       case "SEP": mm=8;  break;
       case "OCT": mm=9;  break;
       case "NOV": mm=10; break;
       case "DEC": mm=11; break;
       default:
   }
   var pdate = new Date(yyyy,mm,dd,0,0,0,0);
   return pdate;
}

function nextday(strday) {
  var adate = xdate(strday);
  var aday  = 24*3600*1000;
  var next  = adate.getTime()+aday;
  var bdate = new Date();
  bdate.setTime(next);
  return bdate;
}

function nextdate(adate) {
  var aday  = 24*3600*1000;
  var next  = adate.getTime()+aday;
  var bdate = new Date();
  bdate.setTime(next);
  return bdate;
}

function future(strdate) {
  var adate = xdate(strdate);
  var bdate = nextdate(adate);
  var today = new Date(); 
  if(bdate >= today) {return true} else {return false}
}

function past(strdate) {
  var adate = xdate(strdate);
  var today = new Date(); 
  if(adate <= today) {return true} else {return false}
}

function current(sdate0,sdate1) {
  if (past(sdate0) && future(sdate1)) {return true} else {return false}
}

function myNan(ss) {
// Returns true if ss is NaN else returns false.
  if(parseInt(ss,10) != ss-0) {return true}
  else {return false}
}

function valdate(thisdate) {
// Validates thisdate for the form: ddMMMyyyy
   var valid = true;
   var mess  = "";
   if (thisdate.length != 9) {
      valid = false
      mess = "Date has wrong format. Should be ddMMMyyyy: "
   }
   if (valid) {
      var dd   = thisdate.substr(0,2);
      var mmm  = thisdate.substr(2,3);
      var yyyy = thisdate.substr(5,4);
      if(myNan(dd)) {
         valid = false;
         mess = "Date day (" + dd +") is not numeric";
      }
      if(myNan(yyyy)) {
         valid = false;
         mess = mess + "\nDate year (" + yyyy +") is not numeric";
      }
   }
   if (valid) {
      if(dd < 1) {
         valid = false;
         mess = "Date day must be greater than 0 ";
      }
   }
   if (valid) {
      if(yyyy < 1900) {
         valid = false;
         mess = "Date year must be greater than 1899 ";
      }
   }
   if (valid) {
      switch(mmm.toUpperCase())
      {
       case "JAN":
          if(dd > 31) {
             valid = false;
             mess = "January date > 31";
          }
          break;
       case "FEB":
          if(dd > 31) {
             valid = false;
             mess = "February date > 29";
          }
          break;
       case "MAR":
          if(dd > 31) {
             valid = false;
             mess = "March date > 31";
          }
          break;
       case "APR":
          if(dd > 31) {
             valid = false;
             mess = "April date > 30";
          }
          break;
       case "MAY":
          if(dd > 31) {
             valid = false;
             mess = "May date > 31";
          }
          break;
       case "JUN":
          if(dd > 31) {
             valid = false;
             mess = "June date > 30";
          }
          break;
       case "JUL":
          if(dd > 31) {
             valid = false;
             mess = "July date > 31";
          }
          break;
       case "AUG":
          if(dd > 31) {
             valid = false;
             mess = "August date > 31";
          }
          break;
       case "SEP":
          if(dd > 31) {
             valid = false;
             mess = "September date > 30";
          }
          break;
       case "OCT":
          if(dd > 31) {
             valid = false;
             mess = "October date > 31";
          }
          break;
       case "NOV":
          if(dd > 31) {
             valid = false;
             mess = "November date > 30";
          }
          break;
       case "DEC":
          if(dd > 31) {
             valid = false;
             mess = "December date > 31";
          }
          break;
       default:
          valid = false;
          mess = "Invalid month ("+mmm+")";
      }
   }

   if(valid) {alert("Date is valid ("+thisdate+")")}
   else {alert("Invalid date.\n" +mess+" ("+thisdate+")")}
}

function fileName(path) {
   p=path.lastIndexOf("/");
   if(p==-1) result="null";
   else result=path.substring(p+1,path.length);
   return result;
}

function postpress(article) {
   getElement('showframe').src='press/'+article;
}

function blinkFont() {
   getElement('blink1').style.color="#990000";
   getElement('blink1').innerHTML="D  I  A  R  Y";
   setTimeout('setblinkFont()',1500);
}

function setblinkFont() {
   getElement('blink1').style.color="#000099";
   getElement('blink1').innerHTML="DIARY";
   setTimeout('blinkFont()',1500);
}

function theblinks() {
  var zmain=true;
  var zweek=true;
  var zsqua=true;
  var zjuns=false;
  if(zmain) {
     getElement('blinkmain').style.color="#ffff00";
     getElement('blinkmain').innerHTML="N E W";
  }
  if(zweek) {
     getElement('blinkweek').style.color="#ff0000";
     getElement('blinkweek').innerHTML="N E W";
  }
  if(zjuns) {
     getElement('blinkjuns').style.color="#ff00ff";
     getElement('blinkjuns').innerHTML="N E W";
  }
  if(zsqua) {
     getElement('blinksqua').style.color="#0000ff";
     getElement('blinksqua').innerHTML="N E W";
  }
  if(zmain || zweek || zjuns || zsqua) {
     setTimeout('setblinkElem()',1500);
  }
}

function setblinkElem() {
   getElement('blinkmain').style.color="#000099";
   getElement('blinkmain').innerHTML="Main Tennis";
   getElement('blinkweek').style.color="#000099";
   getElement('blinkweek').innerHTML="Mid-Week Tennis";
   getElement('blinkjuns').style.color="#000099";
   getElement('blinkjuns').innerHTML="Junior Tennis";
   getElement('blinksqua').style.color="#000099";
   getElement('blinksqua').innerHTML="Squash";
   setTimeout('theblinks()',1500);
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function ShowNotice(note,wid,hig) {
   twfact=window.screen.width/1024;
   w=twfact*wid;
   h=twfact*hig ;
   imwid=w/1.1
   var myBars='directories=no,location=no,menubar=no,status=no';
   myBars+=',titlebar=no,toolbar=no';
   var myOptions='scrollbars=yes,width='+w+',height='+h+',resizable=no';
   var myFeatures=myBars+','+myOptions;
   var newWin=open(note,'Wnote',myFeatures);
   newWin.document.close();
}

function chand (obj) {
   getElement(obj).style.cursor='hand';
}

function cpointer (obj) {
   getElement(obj).style.cursor='pointer';
}

function showspan(obj) {
   getElement(obj).style.visibility="visible";
}

function hidespan(obj) {
   getElement(obj).style.visibility="hidden";
}



