
onerror = handleErrors
var msg = null

function handleErrors(errorMessage, url, line) {
    return true
}

var valid = 0;

function verify(form) {
     with (form) {
        if (emptyvalidation(Full_Name,"Please enter your Name")==false) {
            Full_Name.focus(); return false;
        }
        if (emptyvalidation(Street_Address,"Please enter your Street Address")==false) {
            Street_Address.focus(); return false;
        }
        if (emptyvalidation(Country,"Please enter your Country")==false) {
            Country.focus(); return false;
        }
        if (emptyvalidation(Telephone,"Please enter your Telephone number")==false) {
            Telephone.focus(); return false;
        }
        if (emailvalidation(E_Mail,"Please enter a valid email address")==false) {
            E_Mail.focus(); return false;
        }
     return true;
     }
 }
 
 function emptyvalidation(entered, alertbox) {
     with (entered) {
         if (value==null || value=="") {
            if (alertbox!="") {alert(alertbox);
         }
         return false;
         }
      else {return true;
      }
     }
 }
 
 function emailvalidation(entered, alertbox) {
     with (entered) {
         apos=value.indexOf("@");
         dotpos=value.lastIndexOf(".");
         lastpos=value.length-1;
         if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2)
         {if (alertbox) {alert(alertbox);} return false;}
         else {return true;}
     }
 }
 
 function framecheck() {
    var parentframe = 'frame_index.htm';
    if (parent.location.href == self.location.href) 
    {
        var current = window.self.location.pathname;
        window.location.replace (parentframe + '?' + current);
      }
  }
  
  // script for popup
  function showPop(x, y, z) {
     remote = window.open("","DisplayWindow","width="+ x +",height="+ y +",screenX=225,screenY=175,left=225,top=175,scrollbars=no")
     remote.location.href = z;
     remote.focus();
  }
  function showPic(x,y) {
     remote = window.open("","DisplayWindow","width=350,height="+y+",screenX=175,screenY=125,left=175,top=125,scrollbars=no")
     remote.location.href = "popup/"+x;
     remote.focus();
  }

  function switchDiv(div_id) {
    var style_sheet = getStyleObject(div_id);
    if (style_sheet) {
      hideAll();
      changeObjectVisibility(div_id,"block");
    } else {
      alert("sorry, this only works in browsers that do Dynamic HTML");
    }
  }
  function hideAll() {
//         changeObjectVisibility("std_seat","none");
//         changeObjectVisibility("hd_seat","none");
     changeObjectVisibility("q1","none");
     changeObjectVisibility("q2","none");
     changeObjectVisibility("q3","none");
     changeObjectVisibility("q4","none");
     changeObjectVisibility("q5","none");
     changeObjectVisibility("q7","none");
     changeObjectVisibility("q8","none");
     changeObjectVisibility("q9","none");
  }
  function getStyleObject(objectId) {
    if(document.getElementById && document.getElementById(objectId)) {
      return document.getElementById(objectId).style;
     } else if (document.all && document.all(objectId)) {
      return document.all(objectId).style;
     } else if (document.layers && document.layers[objectId]) {
      return document.layers[objectId];
     } else {
      return false;
     }
  }

  function changeObjectVisibility(objectId, newVisibility) {
      var styleObject = getStyleObject(objectId);
      if(styleObject) {
        styleObject.display = newVisibility;
        return true;
      } else {
        return false;
      }
  }
  function SeatChange(val,theForm) {
     if (val == "290lbs (std)")
       theForm.seat_option[0].checked = true;
     if (val == "350lbs (heavy duty)")
       theForm.seat_option[3].checked = true;
  }
function FlashInstalled() {
 result = false;

 if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"])
 {
     result = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
 }
 else if (document.all && (navigator.appVersion.indexOf("Mac")==-1))
 {
     // IE Windows only -- check for ActiveX control, have to hide code in eval from Netscape (doesn't like try)
     eval ('try {var xObj = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if (xObj) result = true; xObj = null; } catch (e) {}');
 }
 return result;
}

function FlashWrite(url,width,height) {
 document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
 document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ');
 document.write('  WIDTH=' + width + ' HEIGHT=' + height + '>');
 document.write(' <PARAM NAME=movie VALUE="' + url + '"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>  ');
 document.write(' <EMBED src="' + url + '" quality=high bgcolor=#FFFFFF  ');
 document.write(' swLiveConnect=FALSE WIDTH=' + width + ' HEIGHT=' + height);
 document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
 document.write(' </EMBED></OBJECT>');
}

function noFlashWrite() {
  document.write('<img src="http://images.acornstairlifts.net/acornlogo3.jpg" width="125" height="166" alt="Acorn Stairlifts" border="0">');
}
