// This JavaScript file contains functions written by Peter Wright
// Version 1 [ 18 Jul 2003 - 23:42 ]

var imageDir="images/";			// path images
var imageDirGB="../images/";		// path Guesy Book images
var myName="jdm.js";			// name of this file for nesting purposes
var good;

var xPost="dave." + "drew@jd-mot" + "ors.co.uk";
var ePost="dave." + "drew@jd-mot" + "ors.co.uk";
var jPost="john." + "drew@jd-mot" + "ors.co.uk";

var sbNarrative="JD Motors";             // default status bar narrative for IE XP SP2
function sbYear() { sbDate = new Date(); return sbDate.getYear() }
sbNarrative="(C) " + sbYear() + " JD Motors.  Picture not to be published elsewhere without authority from librarian" + "@" + "jd-motors.co.uk";

var altTitle="";                                                 // default 'alt' narrative
var altClose=" Click to close window ";
var altBig=" Click on picture to close window&#13; Click red square to view image at maximum resolution ";

function documentwrite(dat) { document.write(dat); }	// embedded objects fix - 24 Apr 06

var mailList = new Array();
   mailList[0] = new Array("jd-motors.co.uk");
   mailList[1] = new Array("postcard");
   mailList[2] = new Array("david.bradley");
   mailList[3] = new Array("emma.drew");
   mailList[4] = new Array("michelle.ingram");
   mailList[5] = new Array("adam.bradley");
   mailList[6] = new Array("susan.summers");
   mailList[7] = new Array("admin");
   mailList[8] = new Array("ian2");
   mailList[9] = new Array("rushmoor");
   mailList[10] = new Array("jamie.gordon");

var limitedList = new Array();
   limitedList[0] = new Array("jd-motors.co.uk");
   limitedList[1] = new Array("letter");
   limitedList[2] = new Array("david.bradley");
   limitedList[3] = new Array("emma.drew");
   limitedList[4] = new Array("admin");

// -------------------------------

// Remember to addd mouse click

var message="Web Site ©2010\nJD Motors\n----------------------------------\n       \n1 Rowan Industrial Estate       \nMill Lane       \nAlton      \nHampshire       \nGU34 2NQ\n       \nTelephone: +44 1420 544644       ";

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;

// -------------------------------

function recipientList() {
      var tempList = "";
      for (nn=1; nn<mailList.length; nn++) {
         if (tempList != "") { tempList += ", " };
         tempList += mailList[nn] + "@" + mailList[0];
      }
      return tempList;
   }

function cvtList() {
      var tempList = "";
      for (nn=1; nn<limitedList.length; nn++) {
         if (tempList != "") { tempList += ", " };
         tempList += limitedList[nn] + "@" + limitedList[0];
      }
      return tempList;
   }

function check_email(email_id,err_id) {
          emailRegExp = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.([a-z]){2,4})$/;
              var err_mail='<br>Please make sure you have entered a valid email address<br>then despatch this form again';
              if(emailRegExp.test(document.getElementById(email_id).value)){
                  return true;
              }else{
                  document.getElementById(err_id).innerHTML=err_mail;
                  return false;
              }
 }

function web( text, subject) {
   nn="";
   nn+='<a href="mailto:' + xPost;
   if (subject!="" && subject!=null) { nn+='?Subject=' + subject }
   nn+='">' + text + '</a>';
   return nn;
}

function job( text, subject) {
   nn="";
   nn+='<a href="mailto:' + jPost;
   if (subject!="" && subject!=null) { nn+='?Subject=' + subject }
   nn+='">' + text + '</a>';
   return nn;
}

function thisone() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="145" height="136">';
    nn+='<param name="movie" value="menuleft.swf">';
    nn+='<param name="quality" value="best">';
    nn+='<param name="menu" value="true">';
    nn+='<embed src="menuleft.swf" quality="best" menu="true" width="145" height="136" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
    nn+='<\/embed><\/object>';
    return nn;
}

function thistwo() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="157" height="136">';
    nn+='<param name="movie" value="menuright.swf">';
    nn+='<param NAME="wmode" VALUE="transparent">';
    nn+='<param name="quality" value="best">';
    nn+='<param name="menu" value="true">';
    nn+='<embed src="menuright.swf" WMODE="transparent" quality="high" menu="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="157" height="136">';
    nn+='<\/embed><\/object>';
    return nn;
}

function navleftGB() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="145" height="136">';
    nn+='<param name="movie" value="../menuleftGB.swf">';
    nn+='<param name="quality" value="best">';
    nn+='<param name="menu" value="true">';
    nn+='<embed src="../menuleftGB.swf" quality="best" menu="true" width="145" height="136" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
    nn+='<\/embed><\/object>';
    return nn;
}

function navrightGB() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="157" height="136">';
    nn+='<param name="movie" value="../menurightGB.swf">';
    nn+='<param name="quality" value="best">';
    nn+='<param name="menu" value="true">';
    nn+='<embed src="../menurightGB.swf" quality="best" menu="true" width="157" height="136" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
    nn+='<\/embed><\/object>';
    return nn;
}

function ql() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="122" height="178">';
    nn+='<param name="movie" value="navigation/ql.swf">';
    nn+='<param NAME="wmode" VALUE="transparent">';
    nn+='<param name="quality" value="high">';
    nn+='<param name="menu" value="true">';
    nn+='<embed src="navigation/ql.swf" WMODE="transparent" quality="high" menu="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="122" height="178"><\/embed>';
    nn+='<\/object>';
    return nn;
}

function gaq() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="413" height="26">';
    nn+='<param name="movie" value="cvtform.swf">';
    nn+='<param name="quality" value="best">';
    nn+='<param name="menu" value="true">';
    nn+='<param name="allowScriptAccess" value="always">';
    nn+='<embed src="cvtform.swf" quality="best" menu="true" width="413" height="26" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always"><\/embed>';
    nn+='<\/object>';
    return nn;
}

function workshop() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="413" height="26">';
    nn+='<param name="movie" value="workshop.swf">';
    nn+='<param name="quality" value="best">';
    nn+='<param name="menu" value="true">';
    nn+='<param name="allowScriptAccess" value="always">';
    nn+='<embed src="workshop.swf" quality="best" menu="true" width="413" height="26" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always"><\/embed>';
    nn+='<\/object>';
    return nn;
}

function back() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="137" height="26">';
    nn+='<param name="movie" value="back.swf">';
    nn+='<param name="quality" value="best">';
    nn+='<param name="menu" value="true">';
    nn+='<param name="allowScriptAccess" value="always">';
    nn+='<embed src="back.swf" quality="best" menu="true" width="137" height="26" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always"><\/embed>';
    nn+='<\/object>';
    return nn;
}

function contact() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="137" height="26">';
    nn+='<param name="movie" value="contact.swf">';
    nn+='<param name="quality" value="best">';
    nn+='<param name="menu" value="true">';
    nn+='<param name="allowScriptAccess" value="always">';
    nn+='<embed src="contact.swf" quality="best" menu="true" width="137" height="26" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always"><\/embed>';
    nn+='<\/object>';
    return nn;
}

function aol() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="137" height="26">';
    nn+='<param name="movie" value="aol.swf">';
    nn+='<param name="quality" value="best">';
    nn+='<param name="menu" value="true">';
    nn+='<param name="allowScriptAccess" value="always">';
    nn+='<embed src="aol.swf" quality="best" menu="true" width="137" height="26" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always"><\/embed>';
    nn+='<\/object>';
    return nn;
}

function customer() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="413" height="26">';
    nn+='<param name="movie" value="customer.swf">';
    nn+='<param name="quality" value="best">';
    nn+='<param name="menu" value="true">';
    nn+='<param name="allowScriptAccess" value="always">';
    nn+='<embed src="customer.swf" quality="best" menu="true" width="413" height="26" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always"><\/embed>';
    nn+='<\/object>';
    return nn;
}

function bam() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="275" height="26">';
    nn+='<param name="movie" value="bam.swf">';
    nn+='<param name="quality" value="best">';
    nn+='<param name="menu" value="true">';
    nn+='<param name="allowScriptAccess" value="always">';
    nn+='<embed src="bam.swf" quality="best" menu="true" width="275" height="26" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always"><\/embed>';
    nn+='<\/object>';
    return nn;
}

function news() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="275" height="26">';
    nn+='<param name="movie" value="news.swf">';
    nn+='<param name="quality" value="best">';
    nn+='<param name="menu" value="true">';
    nn+='<param name="allowScriptAccess" value="always">';
    nn+='<embed src="news.swf" quality="best" menu="true" width="275" height="26" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always"><\/embed>';
    nn+='<\/object>';
    return nn;
}

function bas() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="551" height="26">';
    nn+='<param name="movie" value="bas.swf">';
    nn+='<param name="quality" value="best">';
    nn+='<param name="menu" value="true">';
    nn+='<param name="allowScriptAccess" value="always">';
    nn+='<embed src="bas.swf" quality="best" menu="true" width="551" height="26" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always"><\/embed>';
    nn+='<\/object>';
    return nn;
}

function linkmenu() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="551" height="26">';
    nn+='<param name="movie" value="links.swf">';
    nn+='<param name="quality" value="best">';
    nn+='<param name="menu" value="true">';
    nn+='<param name="allowScriptAccess" value="always">';
    nn+='<embed src="links.swf" quality="best" menu="true" width="551" height="26" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always"><\/embed>';
    nn+='<\/object>';
    return nn;
}

function pagebaseT2() {
   nn=""
   nn+='<table style="margin: 25px 0 0">';
   nn+='<tr>';
   nn+='<td><img src="../images/telephonehelpline.jpg" width="42" height="42" vspace="3" alt=" Phone "></td>';
   nn+='<td><span class="ucon">24 Hour Control Room Number: &nbsp; 01420 544644</span><br>';
   nn+='<span class="ecdt"><center>';
   nn+=lastMod();
   nn+='</center></span></td>';
   nn+='</tr></table>';
   return nn;
}

function pagebaseT3() {
   nn=""
   nn+='<table style="margin: 25px 0 0">';
   nn+='<tr>';
   nn+='<td><img src="images/telephonehelpline2.gif" width="42" height="42" vspace="3" alt="Phone"></td>';
   nn+='<td><span class="ucon2">24 Hour Control Room Number: &nbsp; 01420 544644</span><br>';
   nn+='<span class="ecdt2"><center>';
   nn+='1 Rowan Industrial Estate, Mill Lane, Alton, Hampshire, GU34 2NQ<br>';
   nn+='Also at Rushmoor Garage, Tilford Road, Rushmoor, Farnham, Surrey, GU10 2EP';
   nn+='</center></span></td>';
   nn+='</tr></table>';
   return nn;
}

function pagebaseCVT3() {
   nn=""
   nn+='<table style="margin: 25px 0 0">';
   nn+='<tr>';
   nn+='<td><img src="images/telephonehelpline2.gif" width="42" height="42" style="margin: 3px 0 0" alt="Phone"></td>';
   nn+='<td><span class="ucon2">Dedicated Enquiry Number: &nbsp; 01420 544644</span><br>';
   nn+='<span class="ecdt2"><center>';
   nn+='1 Rowan Industrial Estate, Mill Lane, Alton, Hampshire, GU34 2NQ<br>';
   nn+='Also at Rushmoor Garage, Tilford Road, Rushmoor, Farnham, Surrey, GU10 2EP';
   nn+='</center></span></td>';
   nn+='</tr></table>';
   return nn;
}

function pagebaseCVT3X() {
   nn=""
   nn+='<table style="margin: 0 0 10px">';
   nn+='<tr>';
   nn+='<td><img src="images/telephonehelpline2.gif" width="42" height="42" alt="Phone"></td>';
   nn+='<td><span class="ucon3">Dedicated Enquiry Number: &nbsp; 01252 757 767</span><br>';
   nn+='<span class="ecdt2"><center>';
   nn+='1 Rowan Industrial Estate, Mill Lane, Alton, Hampshire, GU34 2NQ<br>';
   nn+='Also at Rushmoor Garage, Tilford Road, Rushmoor, Farnham, Surrey, GU10 2EP';
   nn+='</center></span></td>';
   nn+='</tr></table>';
   return nn;
}

function pagebaseBFX() {
   nn=""
   nn+='<table style="margin: 0 0 10px">';
   nn+='<tr>';
   nn+='<td><img src="images/telephonehelpline2.gif" width="42" height="42" alt="Phone"></td>';
   nn+='<td><span class="ucon2" style="margin: 0 0 0">24 Hour Control Room Number: &nbsp; 01420 544644</span><br>';
   nn+='<span class="ecdt2"><center>';
   nn+='1 Rowan Industrial Estate, Mill Lane, Alton, Hampshire, GU34 2NQ<br>';
   nn+='Also at Rushmoor Garage, Tilford Road, Rushmoor, Farnham, Surrey, GU10 2EP';
   nn+='</center></span></td>';
   nn+='</tr></table>';
   return nn;
}

function pagebaseT4() {
   nn=""
   nn+='<table style="margin: 25px 0 0">';
   nn+='<tr>';
   nn+='<td><img src="../images/telephonehelpline2.gif" width="42" height="42" vspace="3" alt="Phone"></td>';
   nn+='<td><span class="ucon2">24 Hour Control Room Number: &nbsp; 01420 544644</span><br>';
   nn+='<span class="ecdt2"><center>';
   nn+='1 Rowan Industrial Estate, Mill Lane, Alton, Hampshire, GU34 2NQ<br>';
   nn+='Also at Rushmoor Garage, Tilford Road, Rushmoor, Farnham, Surrey, GU10 2EP';
   nn+='</center></span></td>';
   nn+='</tr></table>';
   return nn;
}

function pagebase() {
   nn=""
   nn+='<span class="ecdt">';
   nn+=lastMod();
   nn+='</span>';
   return nn;
}

function lastMod() {
  var x = new Date (document.lastModified);
  Modif = new Date(x.toGMTString());
  Year = takeYear(Modif);
  Month = Modif.getMonth();
  Day = Modif.getDate();
  Mod = (Date.UTC(Year,Month,Day,0,0,0))/86400000;
  x = new Date();
  today = new Date(x.toGMTString());
  Year2 = takeYear(today);
  Month2 = today.getMonth();
  Day2 = today.getDate();
  now = (Date.UTC(Year2,Month2,Day2,0,0,0))/86400000;
  daysago = now - Mod;
  if (daysago < 0) return '';
  unit = 'days';
  if (daysago > 730)
  {
  daysago = Math.round(daysago/365);
  unit = 'years';
  }
  else if (daysago > 60)
  {
  daysago = Math.round(daysago/30);
  unit = 'months';
  }
  else if (daysago > 14)
  {
  daysago = Math.round(daysago/7);
  unit = 'weeks'
  }
  towrite = 'This page last updated ';
  if (daysago == 0) towrite += 'today';
  else if (daysago == 1) towrite += 'yesterday';
  else towrite += daysago + ' ' + unit + ' ago';
  towrite += '.  &nbsp; &nbsp; &copy; ' + Year2 + ' JD Motors';
  return towrite;
}

function takeYear(theDate) {
  y = theDate.getYear();
  y += (y < 1900) ? 1900 : 0;
  return y;
}

function javahere() {
   if (navigator.javaEnabled()) {
      return 1
  } else {
      return 2
  }
}

function verFlash(vHi) {
      if (navigator.appName.indexOf('Microsoft') >=0) {
         for (fv=vHi; fv>0; fv--) {
            if (eval("activeXDetect('ShockwaveFlash.ShockwaveFlash."+fv+"')")) return fv
         }
      } else {
         for (pn=0; pn<navigator.plugins.length; pn++) {
            if (navigator.plugins[pn].name.indexOf('Flash')>=0) {
               for (fv=vHi; fv>0; fv--) {
                  if (navigator.plugins[pn].description.indexOf(fv+'.')>=0) return fv
               }
            }
         }
      }
      return '0';
}

function whichBrs() {
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("opera") != -1) return 'Opera';
if (agt.indexOf("staroffice") != -1) return 'Star Office';
if (agt.indexOf("beonex") != -1) return 'Beonex';
if (agt.indexOf("chimera") != -1) return 'Chimera';
if (agt.indexOf("netpositive") != -1) return 'NetPositive';
if (agt.indexOf("phoenix") != -1) return 'Phoenix';
if (agt.indexOf("safari") != -1) return 'Safari';
if (agt.indexOf("skipstone") != -1) return 'SkipStone';
if (agt.indexOf("msie") != -1) return 'Internet Explorer';
if (agt.indexOf("netscape") != -1) return 'Netscape';
if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
if (agt.indexOf('\/') != -1) {
if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
return navigator.userAgent.substr(0,agt.indexOf('\/'));}
else return 'Netscape';} else return navigator.userAgent.substr(0,agt.indexOf(' '));
}

function emailPage(){
zxcv = document.title .substring (55 ,115)
document.location = 'mailto:?subject=[JDs] ' + zxcv + '&bcc=registrar&#064;cyberpictures.net&body=Hello, %0D%0DOn the JD Motors web site, I found the ' + zxcv + ' page and thought it would be of interest to you: ' + document.location+ ' %0D%0DJ D MOTORS are 24 hour vehicle recovery specialists providing breakdown and recovery assistance irrespective of vehicle size. Their home page can be found at http://www.jd-motors.co.uk %0D%0DBye for now.';
   }

function verFlash(vHi) {
      if (navigator.appName.indexOf('Microsoft') >=0) {
         for (fv=vHi; fv>0; fv--) {
            if (eval("activeXDetect('ShockwaveFlash.ShockwaveFlash."+fv+"')")) return fv
         }
      } else {
         for (pn=0; pn<navigator.plugins.length; pn++) {
            if (navigator.plugins[pn].name.indexOf('Flash')>=0) {
               for (fv=vHi; fv>0; fv--) {
                  if (navigator.plugins[pn].description.indexOf(fv+'.')>=0) return fv
               }
            }
         }
      }
      return '0';
}

function w3c() {
asdf = document.title .substring (55 ,115)
   nn="";
   nn+='<p class="menu">';
   nn+='Page URL: &nbsp; ' + location.toString();
   nn+='&nbsp; &nbsp; &nbsp;Page Title: &nbsp; ' + asdf + '<br>';
   nn+=lastMod();
   nn+='<br><a class="exc" href="http://validator.w3.org/check?uri=' + location.toString() + '" target="_w3c" onmouseover="self.status=\'This web page has been designed to work under all operating sytems and with all web browsers\'; return true" onmouseout="self.status=\'\'; return true" title="Web page with valid HTML 4.01 markup">Check HTML</a>';
   nn+=' &nbsp; &bull; &nbsp; <a class="exc" href="http://jigsaw.w3.org/css-validator/check/referer" target="_w3c" onmouseover="self.status=\'This site uses Cascading Style Sheets [CSS] which is a mechanism for adding style [e.g. fonts, colors, spacing] to our pages\'; return true" onmouseout="self.status=\'\'; return true" title="This site uses Cascading Style Sheets [CSS] which is a simple mechanism for adding style [e.g. fonts, colors, spacing] to our pages. Hyperlink checks for design errors.">Check CSS</a>';
   nn+=' &nbsp; &bull; &nbsp; <a class="exc" href="javascript:emailPage()" onmouseover="self.status=\'Have a nice day\'; return true" onmouseout="self.status=\'\'; return true" title="Sends the URL of this page via email to your friend">Share Page</a><br>';
   nn+='</p><p>&nbsp;</p>';
   return nn;
}

function w3cCVT() {
asdf = document.title .substring (12 ,115)
   nn="";
   nn+='<p class="menu">';
   nn+='Page URL: &nbsp; ' + location.toString();
   nn+='&nbsp; &nbsp; &nbsp;Page Title: &nbsp; ' + asdf + '<br>';
   nn+=lastMod();
   nn+='<br><a class="exc" href="http://validator.w3.org/check?uri=' + location.toString() + '" target="_w3c" onmouseover="self.status=\'This web page has been designed to work under all operating sytems and with all web browsers\'; return true" onmouseout="self.status=\'\'; return true" title="Web page with valid HTML 4.01 markup">Check HTML</a>';
   nn+=' &nbsp; &bull; &nbsp; <a class="exc" href="http://jigsaw.w3.org/css-validator/check/referer" target="_w3c" onmouseover="self.status=\'This site uses Cascading Style Sheets [CSS] which is a mechanism for adding style [e.g. fonts, colors, spacing] to our pages\'; return true" onmouseout="self.status=\'\'; return true" title="This site uses Cascading Style Sheets [CSS] which is a simple mechanism for adding style [e.g. fonts, colors, spacing] to our pages. Hyperlink checks for design errors.">Check CSS</a>';
   nn+=' &nbsp; &bull; &nbsp; <a class="exc" href="javascript:emailPage()" onmouseover="self.status=\'Have a nice day\'; return true" onmouseout="self.status=\'\'; return true" title="Sends the URL of this page via email to your friend">Share Page</a><br>';
   nn+='</p><p>&nbsp;</p>';
   return nn;
}

function flashw() {
   var FlashVersion = verFlash(10);
   nn="";
   nn+='<script type="text/javascript">document.write(whichBrs())</script> requires Flash Player for this site';
   if (FlashVersion == 0) nn+= '. Please download this software using the link provided.';
   else nn+= ' and will use Version ' + FlashVersion + ' found on your PC';
   return nn;
}

function newflashw() {
   var FlashVersion = verFlash(10);
   nn="";
   nn+='<script type="text/javascript">document.write(whichBrs())</script> requires Flash Player for this site';
   if (FlashVersion == 0) nn+= '. Use this hyperlink to <a href="http://www.adobe.com/support/flashplayer/downloads.html">install Flash Player</a>.';
   else nn+= ' and will use Version ' + FlashVersion + ' found on your PC';
   return nn;
}

function w3cF() {
asdf = document.title .substring (55 ,115)
   nn="";
   nn+='<p class="menu" style="margin: 10px 0 0">';
   nn+='<a href="http://validator.w3.org/check/referer" target="_w3c" onmouseover="self.status=\'This web page has been designed to work under all operating sytems and with all WEB Browsers\'; return true" onmouseout="self.status=\'\'; return true"><img src="../' + imageDir + 'w3c-401.gif" alt="An interoperable WEB page with valid HTML 4.01" border="0" height="31" width="93" hspace="8"></a>';
   nn+='<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_w3c" onmouseover="self.status=\'This site uses Cascading Style Sheets [CSS] which is a mechanism for adding style [e.g. fonts, colors, spacing] to our pages\'; return true" onmouseout="self.status=\'\'; return true"><img src="../' + imageDir + 'w3c-css.gif" alt="This site uses Cascading Style Sheets [CSS] which is a simple mechanism for adding style [e.g. fonts, colors, spacing] to our pages. Hyperlink checks for design errors." border="0" height="31" width="93" hspace="8"></a>';
   nn+='<a href="http://www.anybrowser.org/campaign/index.html" target="_new" onmouseover="self.status=\'With minor differences this site should be viewable with any graphical browser that supports Java\'; return true" onmouseout="self.status=\'\'; return true"><img src="../logos/anybrowser.gif" alt="With minor differences this site should be viewable with any graphical browser that supports Java. Some features will be lost when using a Java incapable browser." border="0" height="31" width="88" hspace="10"></a>';
   nn+='<a href="javascript:emailPage()" onmouseover="self.status=\'Have a nice day\'; return true" onmouseout="self.status=\'\'; return true"><img src="../images/tell-a-friend.gif" alt="Feature sends an email to your friend" border="0" height="32" width="130" vspace="0" hspace="8"></a>';
   nn+='<br>Page URL: &nbsp; ' + location.toString();
   nn+='<br>Page Title: &nbsp; ' + asdf;
   nn+='</p><p>&nbsp;</p>';
   return nn;
}

function captionStyle(txt) {
   while (txt.indexOf("{#")>0) {		// replace custom format commands {#?} with <p class="CF?>
      txtP=txt.indexOf("{#");
      txtL=txt.substring(0, txtP);
      txtS=txt.charAt(txtP+2);
      txtR=txt.substring(txtP+4);
      txt=txtL + '<p class="CF' + txtS + '">' + txtR;
   }
   while (txt.indexOf("{/#}")>0) {		// replace custom format end commands {/#} with </p>
      txtP=txt.indexOf("{/#}");
      txtL=txt.substring(0, txtP);
      txtR=txt.substring(txtP+4);
      txt=txtL + '</p>' + txtR;
   }
   return txt;
}

function popBig(filename, winname, description, imageW, imageH, closeParent) {
   if (description.indexOf("|")>0) { var describe = description.split("|"); description=describe[1] }
   description=captionStyle(description);
   nn="";
   nn+='<html><head><title>JD Motors Image Library - Picture ' + winname + '</title>';
   nn+='<meta http-equiv="imagetoolbar" content="no">';
   nn+='<meta name="MSSmartTagsPreventParsing" content="TRUE">';
   nn+='<style type="text/css">';
   nn+=' body { background: #3d5a95; font-family: Verdana, sans-serif; margin: 10px 0 10px; }';
   nn+=' .descriptive { font-family: Verdana, sans-serif; font-size: 24px; font-weight: bold; text-align: center; color: #ffffff; }';
   if (description.indexOf('<h6>')>0) { nn+=' h6 { font-family: Verdana, Arial, sans-serif; font-size: 12pt; font-weight: bold; text-align: justify; color: #804000; margin: 4px 30px 0; }'; }
   if (description.indexOf('class="CFj"')>0) { nn+=' .CFj { font-family: Verdana, Arial, sans-serif; font-size: 12pt; font-weight: bold; text-align: justify; color: #804000; margin: 4px 30px 0; }'; }
   if (description.indexOf('class="CFc"')>0) { nn+=' .CFc { font-family: Verdana, Arial, sans-serif; font-size: 12pt; font-weight: bold; text-align: center; color: #804000; margin: 0 0 0; }'; }
   nn+='</style></head><body>';
   nn+='<script language="JavaScript" type="text/javascript">window.defaultStatus="' + sbNarrative + '"</script>'
   nn+='<center><table border=0 cellpadding=0 cellspacing=0 align="center" width="100%">';
   nn+=' <tr>';
   nn+='  <td align="center"><a href="javascript:window.close()" onMouseOver="self.status=\'' + sbNarrative + '\'; return true" onMouseOut="self.status=\'\'; return true"><img src="' + filename + '" width=' + imageW + ' height=' + imageH + ' border=0 alt="" title=" Picture ' + winname + '&#13; Click to close window "></a></td>';
   nn+=' </tr>';
   nn+=' <tr valign="middle">';
   nn+='  <td height=50 class="descriptive">' + description + '</td>';
   nn+=' </tr>';
   nn+='</table></center></body></html>';
   window2=window.open("", "", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,left=0,top=0,width=" + (screen.availWidth-10) + ",height=" + (screen.availHeight-30));
   window2.document.open();
   window2.document.write(nn);
   window2.document.close();
   if (closeParent) { parent.window.close() };
   window2.focus()
}

function popUp(filename, winname, description, imageW, imageH) {
   bigURL="popBig('" + filename + "', '" + winname + "', '" + description + "', " + imageW + ", " + imageH + ", ";
   if (description.indexOf("|")>0) { var describe = description.split("|"); description=describe[0] }
   if (navigator.appName=="Opera" || document.layers) { eval(bigURL+"false)"); return } else { bigURL+= "true)" }
   winH=screen.availHeight-28;			// set popup window height to max available
   winW=screen.availWidth-9;			// set popup window width to max available
   imgH=winH-52;					// calculate maximum image height
   imgH=winH-56;					// calculate maximum image height
 
   if (window.navigator.userAgent.indexOf("MSIE 7") != -1) {imgH-=50}  // allow for origin bar and mandatory status bar in IE7
   else if (window.navigator.userAgent.indexOf("SV1") != -1) {imgH-=25}  // allow for mandatory status bar in IE6 on XP with SP2
   else if (navigator.userAgent.toLowerCase().indexOf('firefox')!=-1) {imgH-=25}   // depth allowance for Firefox status bar
   else {};

   imgW=parseInt(imageW*(imgH/imageH));		// calculate proportional image width
   if (imgW>(winW-8)) {				// if resulting image is too wide
      imgW=winW-8;				// reduce image width
      imgH=parseInt(imageH*(imgW/imageW));		// calculate proportional image height
   }
   if (imgW>imageW || imgH>imageH) { imgW=imageW; imgH=imageH }
   if (imageW>imgW || imageH>imgH) { altTitle=altBig } else { altTitle=altClose }
   nn="";
   nn+='<html><head><title>JD Motors Image Library - Picture ' + winname + '</title>';
   nn+='<meta http-equiv="imagetoolbar" content="no">';
   nn+='<meta name="MSSmartTagsPreventParsing" content="TRUE">';
   nn+='<style type="text/css">';
   nn+=' body { background-image: url("' + imageDir + 'qq.png"); font-family: Verdana, sans-serif; margin: 10px 0 10px; }';
   nn+=' .descriptive { font-family: Verdana, sans-serif; font-size: 24px; font-weight: bold; text-align: center; color: red; }';
   nn+=' .click { font-family: Arial, sans-serif; font-size: 11px; font-weight: normal; text-align: left; color: #000039; }';
   nn+=' .whbdr { border: 2px solid #ffffff; }';
  nn+='</style></head><body><center>';
   nn+='<script type="text/javascript" src="' + myName + '"></script>';
   nn+='<script type="text/javascript">window.defaultStatus="' + sbNarrative + '"</script>'
   nn+='<table border="0" cellpadding="0" cellspacing="0" align="center" width=' + (winW-14) + '>';
   nn+=' <tr>';
   nn+='  <td height=' + imgH + ' colspan="2" align="center"><a href="javascript:window.close()" onMouseOver="self.status=\'' + sbNarrative + '\'; return true" onMouseOut="self.status=\'\'; return true"><img src="' + filename + '" width=' + imgW + ' height=' + imgH + ' border="0" class="whbdr" alt="" title=" Picture ' + winname + ' &#13;' + altTitle + '"></a></td>';
   nn+=' </tr>';
   nn+=' <tr valign="bottom">';
   nn+='  <td width=' + (winW-214) + ' height="40" class="descriptive">' + description + '</td>';
   nn+='  <td width="200" class="click">Click on the image to close this window';
   if (imageW>imgW || imageH>imgH) { nn+='<br><a href="javascript:' + bigURL + '"  onMouseOver="self.status=\'' + sbNarrative + '\'; return true" onMouseOut="self.status=\'\'; return true"><img src="' + imageDir + 'redsq.gif" width=9 height=9 border=0 alt=""></a> &nbsp; See image at maximum resolution' }
   nn+='</td>';
   nn+=' </tr>';
   nn+='</table></center></body></html>';
   window1=window.open('', '', "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,left=0,top=0,width=" + winW + ",height=" + winH);
   window1.document.open();
   window1.document.write(nn);
   window1.document.close();
   window1.focus()
}

function display_time_in_status_line(  )
{
 var d = new Date(  );
   // Get the current time
 var h = d.getHours(  );
   // Extract hours: 0 to 23
 var m = d.getMinutes(  );
   // Extract minutes: 0 to 59
 var ampm = (h >= 12)?"pm":"am";
   // Is it a.m. or p.m.?
 if (h > 12) h -= 12;
   // Convert 24-hour format to 12-hour
 if (h == 0) h = 12;
   // Convert 0 o'clock to midnight
 if (m < 10) m = "0" + m;
   // Convert 0 minutes to 00 minutes, etc.
 var t = 'Excellent; you have found the No.1 breakdown service on the net!  The time is now:  ' + h + ':' + m + ' ' + ampm;
   // Put it all together

    defaultStatus = t;
      // Display it in the status line

    // Arrange to do it all again in one minute
    setTimeout("display_time_in_status_line(  )", 60000);
      // 60000 ms is one minute
}

function gb_picture(Image,imgWidth,imgHeight) {
    var border = 24;
    var img = Image;
    var features;
    var w;
    var h;
    winWidth = (imgWidth<100) ? 100 : imgWidth+border;
    winHeight = (imgHeight<100) ? 100 : imgHeight+border;
    if (imgWidth+border > screen.width) {
        winWidth = screen.width-10;
        w = (screen.width - winWidth)/2;
        features = "scrollbars=yes";      
    } else {
        w = (screen.width - (imgWidth+border))/2;
    }
    if (imgHeight+border > screen.height) {
        winHeight = screen.height-60;
        h = 0;
        features = "scrollbars=yes";      
    } else {
        h = (screen.height - (imgHeight+border))/2 - 20;
    }
    winName = (img.indexOf("t_") == -1) ? img.substr(4,(img.length-8)) : img.substr(6,(img.length-10));
    features = features+',toolbar=no,width='+winWidth+',height='+winHeight+',top='+h+',left='+w;
    theURL = '$GB_PG[base_url]/picture.php?img='+Image;
    popup = window.open(theURL,winName,features);
    popup.focus();
}
function getEmail(email) {
		var stringPos = false;
		var stringEmail = "";
		if (email.length>0) {
			for (var i=0; i<email.length; i++) {	
				stringPos = (i % 2) ? false : true;
				if (stringPos == true) {
					stringEmail = stringEmail + "%" + email.charAt(i); 
				} else {
					stringEmail = stringEmail + email.charAt(i); 
				}
			}
			stringEmail = unescape(stringEmail);
			window.location.href = stringEmail;
		}
}

// -------------Clock--START----------

function dateclock() {
	var xdt = new Date(), xtz = "GMT";
	if (xdt.getTimezoneOffset() == -60) { xtz += "0100" };
	obj=new Object;obj.clockfile="5003-blue.swf";
	obj.width=240;obj.height=20;
	obj.TimeZone = xtz;
	obj.Place="";
	obj.DateFormat="dd / mm / yyyy DDD";
	obj.TimeFormat="HH:mm:ss TT";
	obj.wmode="transparent";
	showClock(obj);
}

function showClock(obj){
	var str = '<embed src="http://www.clocklink.com/clocks/'
		+ obj.clockfile;
	str += "?";
		
	for( prop in obj ) {
		if( 'clockfile' == prop 
			|| 'width' == prop
			|| 'height' == prop
			|| 'wmode' == prop
			|| 'type' == prop
		) continue;
		str += ( prop + "=" + _escape(obj[prop]) + "&" );
	}
	str += '" ';
	str += ' width="' + obj.width + '"';
	str += ' height="' + obj.height + '"';
	str += ' wmode="' + obj.wmode + '"';
	str += ' type="application/x-shockwave-flash">';
	str += ' &nbsp; ';
	
	document.write( str );
}

function openWindow(windowURL,windowName,windowWidth,windowHeight) {
window.name = 'parentWnd';
newWindow = window.open(windowURL,windowName,'width='+windowWidth+',height='+windowHeight+',toolbar=0,location=0,directories=0, status=0,menuBar=0,scrollBars=1,resizable=0');
newWindow.focus();
}

function _escape(str){
	str = str.replace(/ /g, '+');
	str = str.replace(/%/g, '%25');
	str = str.replace(/\?/, '%3F');
	str = str.replace(/&/, '%26');
	return str;
}

function showBanner(BannerLink){
	document.write(BannerLink);
}

// -------------Clock--END-----------

function rmi() {
msg=window.open("","","height=499,width=600,left=20,top=20,scrollbars=yes");
msg.document.write("<html><head><title>JD MOTORS - Customer Charter</title>");
msg.document.write("<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>");
msg.document.write("<link rel='stylesheet' type='text/css' href='styles/workshop.css'></head>");
msg.document.write("<body bgcolor='#DDE1FF' title='Customer Charter'>");
msg.document.write("<img style='margin: 0 18px 0' align='left' src='images/1st.gif' width='70' height='60' border='0' alt='First Class!'>");
msg.document.write("<font size='4' face='Trebuchet MS'><b>JD MOTORS - Customer Charter</b></font>");
msg.document.write("<br>We will deal with you fairly. Our Workshop staff will:");
msg.document.write("<table cellpadding='0' cellspacing='0' width='450'>");
msg.document.write("<tr><td>");
msg.document.write("<ul style='margin: 0 0 0 45px'><li>be trained to customer service standards;</li>");
msg.document.write("<li>only do what they are qualified to do;</li>");
msg.document.write("<li>give clear details of repair options and costs;</li>");
msg.document.write("<li>discuss work requirements and confirm actions to be taken with you;</li>");
msg.document.write("<li>give fixed-price, written quotes [including VAT] or written estimates if quotes are not possible;</li>");
msg.document.write("<li>explain why any diagnostic work is needed to identify a problem and get your agreement to any follow-on work and costs;</li>");
msg.document.write("<li>tell you in advance if they unable to take certain types of payment [such as cheques, credit or debit cards];</li>");
msg.document.write("<li>get your permission to go ahead if the cost is likely to exceed the estimate;</li>");
msg.document.write("<li>explain why any replacement parts are needed;</li>");
msg.document.write("<li>let you inspect any replaced parts or return them to you;</li>");
msg.document.write("<li>use only new replacements unless you agree otherwise;</li>");
msg.document.write("<li>provide full details of work done on invoices and receipts, including:</li>");
msg.document.write("<ul style='margin: 0 0 0 50px'>");
msg.document.write("<li>materials used;</li>");
msg.document.write("<li>descriptions of any replacements used;</li>");
msg.document.write("<li>labour charges;</li>");
msg.document.write("<li>the total cost including VAT.</li></ul>");
msg.document.write("<li>comply with consumer protection legislation;</li>");
msg.document.write("<li>tell you who will deal with any complaints.</li></ul>");
msg.document.write("</td></tr></table><center>");
msg.document.write("<form style='margin: 30px 0 30px'><input type='button' value=' Close Window ' onclick='window.close();'></form>");
msg.document.write("</center></body></html>");
msg.document.close();
}

function dateNarrative() {
   var xx="th"
   mydate = new Date();
   myday = mydate.getDay();
   myweekday= mydate.getDate();
   mymonth = mydate.getMonth();
   year = mydate.getYear();
   year+=(year<1900) ? 1900 : 0;
   if (myweekday==1 || myweekday==21 || myweekday==31) { xx="st" }
   if (myweekday==2 || myweekday==22) { xx="nd" }
   if (myweekday==3 || myweekday==23) { xx="rd" }
   arday = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
   armonth = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
   return arday[myday] + ", " + myweekday + xx + " " + armonth[mymonth] + " " + year;
}

function buildCal(m, y, cM, cH, cDW, cD, brdr) {

var dcb=['January','February','March','April','May','June','July','August','September','October','November','December'];
var dim=[31,0,31,30,31,30,31,31,30,31,30,31];

var oD = new Date(y, m-1, 1); //DD replaced line to fix date bug when current day is 31st
oD.od=oD.getDay()+1; //DD replaced line to fix date bug when current day is 31st

var xtodaydate=new Date() //DD added
var scanfortoday=(y==xtodaydate.getFullYear() && m==xtodaydate.getMonth()+1)? xtodaydate.getDate() : 0 //DD added

dim[1]=(((oD.getFullYear()%100!=0)&&(oD.getFullYear()%4==0))||(oD.getFullYear()%400==0))?29:28;
var t='<table class="'+cM+'" cols="7" cellpadding="0" border="'+brdr+'" cellspacing="0"><tr align="center">';
t+='<td colspan="7" align="center" class="'+cH+'">'+dcb[m-1]+' - '+y+'</td></tr><tr align="center">';
for(s=0;s<7;s++)t+='<td class="'+cDW+'">'+"SMTWTFS".substr(s,1)+'</td>';
t+='</tr><tr align="center">';
for(i=1;i<=42;i++){
var x=((i-oD.od>=0)&&(i-oD.od<dim[m-1]))? i-oD.od+1 : '&nbsp;';

if (x==scanfortoday)
x='<img src="images/motdue.jpg" width="23" height="18" alt="Arrange an MOT appointment with JD Motors">'

t+='<td class="'+cD+'">'+x+'</td>';
if(((i)%7==0)&&(i<36))t+='</tr><tr align="center">';
}
return t+='</tr></table>';
}


function xbuildCal(m, y, cM, cH, cDW, cD, brdr) {

var dcb=['January','February','March','April','May','June','July','August','September','October','November','December'];
var dim=[31,0,31,30,31,30,31,31,30,31,30,31];

var oD = new Date(y, m-1, 1); //DD replaced line to fix date bug when current day is 31st
oD.od=oD.getDay()+1; //DD replaced line to fix date bug when current day is 31st

var xtodaydate=new Date() //DD added
var scanfortoday=(y==xtodaydate.getFullYear() && m==xtodaydate.getMonth()+1)? xtodaydate.getDate() : 0 //DD added

dim[1]=(((oD.getFullYear()%100!=0)&&(oD.getFullYear()%4==0))||(oD.getFullYear()%400==0))?29:28;
var t='<table class="'+cM+'" cols="7" cellpadding="0" border="'+brdr+'" cellspacing="0"><tr align="center">';
t+='<td colspan="7" align="center" class="'+cH+'">'+dcb[m-1]+' - '+y+'</td></tr><tr align="center">';
for(s=0;s<7;s++)t+='<td class="'+cDW+'">'+"SMTWTFS".substr(s,1)+'</td>';
t+='</tr><tr align="center">';
for(i=1;i<=42;i++){
var x=((i-oD.od>=0)&&(i-oD.od<dim[m-1]))? i-oD.od+1 : '&nbsp;';

if (x==scanfortoday)
x='<font color="red"><b>'+x+'</b></font>'

t+='<td class="'+cD+'">'+x+'</td>';
if(((i)%7==0)&&(i<36))t+='</tr><tr align="center">';
}
return t+='</tr></table>';
}