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_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_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 MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function setMenu(w) { //level 1
	var imgsrc = new Array("","01","03","05","07","09","11","13");
	eval("MM_changeProp('nav1" + imgsrc[w] + "','','src','../a/i/nav/nav1" + imgsrc[w] + "o.gif','IMG')");
}

function setProdMenu(w) { //level 2
	var imgsrc = new Array("","01","03","05","07","09","11","13");
	eval("MM_changeProp('nav1" + imgsrc[w] + "','','src','../../a/i/nav/nav1" + imgsrc[w] + "o.gif','IMG')");
}

function setAccMenu(w) { //level 3
	var imgsrc = new Array("","01","03","05","07","09","11","13","15","17");
	eval("MM_changeProp('nav2" + imgsrc[w] + "','','src','../../../a/i/nav/nav2" + imgsrc[w] + "o.gif','IMG')");
}

function cWin(url) {
    if (document.getElementById || document.layers || document.all) {
        if (screen.height <= 480) {
            var window_width = screen.width;
            var window_height = screen.height;
        } else {
            var window_width = 580;
            var window_height = 460;
        }
        var window_left = (screen.width - 580) / 2;
        var window_top = (screen.height - 460) / 2;
        window.open(url, "gallery", "resizable=yes,scrollbars=yes,width=" + window_width + ",height=" + window_height + ",top=" + window_top + ",left=" + window_left + "");
    }
}

function smlCWin(url) {
    if (document.getElementById || document.layers || document.all) {
        var window_width = 300;
		var window_height = 150;
	}
	var window_left = (screen.width - 300) / 2;
	var window_top = (screen.height - 150) / 2;
	window.open(url, "Password", "resizable=no,scrollbars=no,width=" + window_width + ",height=" + window_height + ",top=" + window_top + ",left=" + window_left + "");
}

function maxWin(url) {
    if (document.getElementById || document.layers || document.all) {
        if (screen.height <= 500) {
            var window_width = screen.width;
            var window_height = screen.height;
        } else {
            var window_width = 720;
            var window_height = 500;
        }
        var window_left = (screen.width - 720) / 2;
        var window_top = (screen.height - 500) / 2;
        window.open(url, "drawings", "resizable=yes,scrollbars=yes,width=" + window_width + ",height=" + window_height + ",top=" + window_top + ",left=" + window_left + "");
    }
}

function checkRegisterForm() {
	var t = this.document.Register;
	if (t.ContactName.value == "") {
		window.alert("Please enter a Contact Name");
		t.ContactName.focus();
		return false;
	}
	if (t.CompanyName.value == "") {
		window.alert("Please enter a Company Name");
		t.CompanyName.focus();
		return false;
	}
	if (t.Address1.value == "") {
		window.alert("Please enter the first line of the Company Address");
		t.Address1.focus();
		return false;
	}
        //if (t.Address2.value == "") {
	//	window.alert("Please enter the second line of the Company Address");
	//	t.Address2.focus();
	//	return false;
	//}
	if (t.TownCity.value == "") {
		window.alert("Please enter the Town or City of the Company Address");
		t.TownCity.focus();
		return false;
	}
	if (t.State.value == "") {
		window.alert("Please enter the State, Province or County");
		t.State.focus();
		return false;
	}
	if (t.PostCode.value == "") {
		window.alert("Please enter a valid Post or Zip Code");
		t.PostCode.focus();
		return false;
	}
	if (t.Country.options[0].selected) {
		window.alert("Please select a Country from the pull-down list");
		t.Country.focus();
		return false;
	}
	if (t.Telephone.value == "") {
		window.alert("Please enter your contact Telephone Number");
		t.Telephone.focus();
		return false;
	}
	var emailStr = new String(t.Email.value);
	var posat = emailStr.indexOf("@");
	if (emailStr.length < 8) 	{
		window.alert("Please enter a valid contact Email Address");
		t.Email.select();
		t.Email.focus();
		return false;
	}
	if (posat < 2) {
		window.alert("Please enter a valid Email Address");
		t.Email.select();
		t.Email.focus();
		return false;
	}
	var pospoint = emailStr.lastIndexOf(".");
	if (pospoint < 5) {
		window.alert("Please enter a valid Email Address");
		t.Email.select();
		t.Email.focus();
		return false;
	}
	var pw = t.Password.value
	if (pw.length < 3 || pw.length > 8) {
		window.alert("You should choose a password which is between 3 and 8 characters long");
		t.Password.value == "";
		t.Confirm.value == "";
		t.Password.focus();
		return false;
	}
	if (t.Password.value != t.Confirm.value) {
		window.alert("The \"Preferred Password\" and the \"Confirm Password\" fields do not match.\nPlease re-enter this information.");
		t.Password.value == "";
		t.Confirm.value == "";
		t.Password.focus();
		return false;
	}
}

function checkUpdateForm() {
	var t = this.document.Update;
	if (t.ContactName.value == "") {
		window.alert("Please enter a Contact Name");
		t.ContactName.focus();
		return false;
	}
	if (t.CompanyName.value == "") {
		window.alert("Please enter a Company Name");
		t.CompanyName.focus();
		return false;
	}
	if (t.Address1.value == "") {
		window.alert("Please enter the first line of the Company Address");
		t.Address1.focus();
		return false;
	}
	if (t.TownCity.value == "") {
		window.alert("Please enter the Town or City of the Company Address");
		t.TownCity.focus();
		return false;
	}
	if (t.State.value == "") {
		window.alert("Please enter the State, Province or County");
		t.State.focus();
		return false;
	}
	if (t.PostCode.value == "") {
		window.alert("Please enter a valid Post or Zip Code");
		t.PostCode.focus();
		return false;
	}
	if (t.Country.options[0].selected) {
		window.alert("Please select a Country from the pull-down list");
		t.Country.focus();
		return false;
	}
	if (t.Telephone.value == "") {
		window.alert("Please enter your contact Telephone Number");
		t.Telephone.focus();
		return false;
	}
	var emailStr = new String(t.Email.value);
	var posat = emailStr.indexOf("@");
	if (emailStr.length < 8) 	{
		window.alert("Please enter a valid contact Email Address");
		t.Email.select();
		t.Email.focus();
		return false;
	}
	if (posat < 2) {
		window.alert("Please enter a valid Email Address");
		t.Email.select();
		t.Email.focus();
		return false;
	}
	var pospoint = emailStr.lastIndexOf(".");
	if (pospoint < 5) {
		window.alert("Please enter a valid Email Address");
		t.Email.select();
		t.Email.focus();
		return false;
	}
	var pw = t.Password.value
	if (pw.length < 3 || pw.length > 8) {
		window.alert("You should choose a password which is between 3 and 8 characters long");
		t.Password.value == "";
		t.Confirm.value == "";
		t.Password.focus();
		return false;
	}
	if (t.Password.value != t.Confirm.value) {
		window.alert("The \"Preferred Password\" and the \"Confirm Password\" fields do not match.\nPlease re-enter this information.");
		t.Password.value == "";
		t.Confirm.value == "";
		t.Password.focus();
		return false;
	}
}

function checkEnquiryForm() {
	var t = this.document.Enquiry;
	if (t.ContactName.value == "") {
		window.alert("Please enter a Contact Name");
		t.ContactName.focus();
		return false;
	}
	if (t.CompanyName.value == "") {
		window.alert("Please enter a Company Name");
		t.CompanyName.focus();
		return false;
	}
	if (t.Telephone.value == "") {
		window.alert("Please enter your contact Telephone Number");
		t.Telephone.focus();
		return false;
	}
	var emailStr = new String(t.Email.value);
	var posat = emailStr.indexOf("@");
	if (emailStr.length < 8) 	{
		window.alert("Please enter a valid contact Email Address");
		t.Email.select();
		t.Email.focus();
		return false;
	}
	if (posat < 2) {
		window.alert("Please enter a valid Email Address");
		t.Email.select();
		t.Email.focus();
		return false;
	}
	var pospoint = emailStr.lastIndexOf(".");
	if (pospoint < 5) {
		window.alert("Please enter a valid Email Address");
		t.Email.select();
		t.Email.focus();
		return false;
	}
	if (t.Address1.value == "") {
		window.alert("Please enter the first line of the Company Address");
		t.Address1.focus();
		return false;
	}
	if (t.TownCity.value == "") {
		window.alert("Please enter the Town or City of the Company Address");
		t.TownCity.focus();
		return false;
	}
	if (t.State.value == "") {
		window.alert("Please enter the State, Province or County");
		t.State.focus();
		return false;
	}
	if (t.Country.options[0].selected) {
		window.alert("Please select a Country from the pull-down list");
		t.Country.focus();
		return false;
	}	
}

function checkContactForm() {
	var t = this.document.ContactUs;
	if (t.Name.value == "") {
		window.alert("Please enter a Contact Name");
		t.Name.focus();
		return false;
	}
	if (t.CompanyName.value == "") {
		window.alert("Please enter a Company Name");
		t.CompanyName.focus();
		return false;
	}
	if (t.Telephone.value == "") {
		window.alert("Please enter your contact Telephone Number");
		t.Telephone.focus();
		return false;
	}
	var emailStr = new String(t.Email.value);
	var posat = emailStr.indexOf("@");
	if (emailStr.length < 8) 	{
		window.alert("Please enter a valid contact Email Address");
		t.Email.select();
		t.Email.focus();
		return false;
	}
	if (posat < 2) {
		window.alert("Please enter a valid Email Address");
		t.Email.select();
		t.Email.focus();
		return false;
	}
	var pospoint = emailStr.lastIndexOf(".");
	if (pospoint < 5) {
		window.alert("Please enter a valid Email Address");
		t.Email.select();
		t.Email.focus();
		return false;
	}
	if (t.Address1.value == "") {
		window.alert("Please enter the first line of the Company Address");
		t.Address1.focus();
		return false;
	}
	if (t.TownCity.value == "") {
		window.alert("Please enter the Town or City of the Company Address");
		t.TownCity.focus();
		return false;
	}
}

function checkCDForm() {
	var t = this.document.CDRequest;
	if (t.Name.value == "") {
		window.alert("Please enter a Contact Name");
		t.Name.focus();
		return false;
	}
	if (t.CompanyName.value == "") {
		window.alert("Please enter a Company Name");
		t.CompanyName.focus();
		return false;
	}
	if (t.Address1.value == "") {
		window.alert("Please enter the first line of the Company Address");
		t.Address1.focus();
		return false;
	}
	if (t.TownCity.value == "") {
		window.alert("Please enter the Town or City of the Company Address");
		t.TownCity.focus();
		return false;
	}
	if (t.Country.options[0].selected) {
		window.alert("Please select a Country from the pull-down list");
		t.Country.focus();
		return false;
	}
	if (t.PostCode.value == "") {
		window.alert("Please enter a valid Zip / Post Code");
		t.PostCode.focus();
		return false;
	}
}