 function img_on(imgName)
{
   imgOn =  'images/' + imgName + 'on.gif';
    document.menu [imgName].src = imgOn;
}


 function img_off(imgName)
{
   imgOff= 'images/' + imgName + 'off.gif';
  document.menu [imgName].src = imgOff;
}

function stopSpam() {
  var displaytext = "here"; // Enter text to display on page
  var mail1 = "sales"; // Enter first part of e-mail address
  var mail2 = "agsmotor.co.uk"; // Enter second part of e-mail address
  var subject = "?subject=AGS Web_Enquiry"; // enter subject for e-mail
  document.write("<a href=" + "mail" + "to:" + mail1 + "@" + mail2 + subject + ">" + displaytext + "</a>")
}

function agsscrollit(seed) {
var m1 = "Welcome to AGS Motor Company.";
var m2 = " The new name for quality used cars.";
var m3 = " ..................";
var m4 = "";
var msg=m1+m2+m3+m4;
var out = " ";
var c = 1;
if (seed > 100) {
seed--;
cmd="agsscrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 100 && seed > 0) {
for (c=0 ; c < seed ; c++) {
out+=" ";
}
out+=msg;
seed--;
window.status=out;
cmd="agsscrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 0) {
if (-seed < msg.length) {
out+=msg.substring(-seed,msg.length);
seed--;
window.status=out;
cmd="agsscrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else {
window.status=" ";
timerTwo=window.setTimeout("scrollit(100)",75);
}
}
}
function whofor(){
var locate = location.href.substring((location.href.indexOf('=')+1), location.href.length);
if (locate=="A"){
document.query.FieldData0.value= "AGS Motors Enquiry";
}
else if (locate=="B"){
document.query.FieldData0.value="AGS Commercial Enquiry";
}
else if (locate=="C"){
document.query.FieldData0.value="AGS Economy Enquiry";
}
else if (locate=="D"){
document.query.FieldData0.value="Waverley Service Enquiry";
}
else if (locate=="E"){
document.query.FieldData0.value="Waverley MOT Booking";
}
//document.write(header)
}