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.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><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=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 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 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 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")
   {
   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;
}
