<!--
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];}
}


//Déterminer si le formulaire pricing.htm est valide
function form_validate() {
	var str_error = "";
	//vérification des champs obligatoires
	if(document.frmMain.Fullname.value==""){
		str_error = str_error + "Full Name Required.\n";
	}

	if(document.frmMain.Phone.value==""){
		str_error = str_error + "Phone Required.\n";
	}
	if(document.frmMain.Country.value==""){
		str_error = str_error + "Country Required.\n";
	}

	if(document.frmMain.Email.value==""){
		str_error = str_error + "Email Required.\n";
	}

	if (((document.frmMain.Email.value.indexOf('@')==-1)||(document.frmMain.Email.value.indexOf('.')==-1))){
		str_error = str_error + "not a valid email address\n";
	}

	if (((document.frmMain.RetypeEmail.value.indexOf('@')==-1)||(document.frmMain.RetypeEmail.value.indexOf('.')==-1))){
		str_error = str_error + "not a valid email address\n";
	}
	if (!(document.frmMain.RetypeEmail.value==document.frmMain.Email.value)) {
		str_error = str_error + "both e-mails should be the same\n";
	}

	chk=0;
	if (document.frmMain.Product.length  > 0 ) {
		for (i=0;i < document.frmMain.Product.length ; i++ ){
			if (document.frmMain.Product[i].checked==true){
				chk=1;
				break;
			}
		}
	}

	if(chk !=1){
		str_error = str_error + "Please Select a Product.\n";
	}

	if(document.frmMain.Quantity.value==""){
		str_error = str_error + "Quantity Required.\n";
	}

	if (document.frmMain.Date.value.indexOf('/')==-1){
		str_error = str_error + "not a valid date\n";
		document.frmMain.Date.value = "yy/mm/dd";
	}
	if (str_error.length > 0) {
		alert("Required fields:\n\n" + str_error);
		return false;	
	} else return true;
}

//Déterminer si le formulaire de demande de prix dans les pages produit est valide
function form_rqstpricing() {
	var str_error = "";
	//vérification des champs obligatoires
	//nom
	if(document.frmMain.Name.value==""){
		str_error = str_error + "Full Name Required.\n";
	}

	//téléphone
	if(document.frmMain.Phone.value==""){
		str_error = str_error + "Phone Required.\n";
	}
	
	//email
	if(document.frmMain.Email.value==""){
		str_error = str_error + "Email Required.\n";
	}
	
	//email
	if (((document.frmMain.Email.value.indexOf('@')==-1)||(document.frmMain.Email.value.indexOf('.')==-1))){
		str_error = str_error + "not a valid email address\n";
	}

	//quantité
	if(document.frmMain.Quantity.value==""){
		str_error = str_error + "Quantity Required.\n";
	}
	
	//produit
	if (document.frmMain.getProduct.value == 1) {
		var box = document.frmMain.Product;
		var value_product = box.options[box.selectedIndex].value;
		if (value_product == "--") {
			str_error = str_error + "Please Select a Product.\n";
		}
	}
	
	//Afficher l'alerte
	if (str_error.length > 0) {
		alert("Required fields:\n\n" + str_error);
		return false;	
	} else return true;
}

//Méthode pour envoyer les paramètres de la demande de prix dans les page produits au script php
function poststring_requetpricing(){
	
	var poststr;
	
	//vérifier si getProduct == 1
	if (document.frmMain.getProduct.value == 1) {
		var box = document.frmMain.Product;
		var value_product = box.options[box.selectedIndex].value;
		poststr = "product select=" + value_product + "&";
	} else {
		poststr = "";	
	}
	
	
	
	poststr = 	poststr + "nom=" + document.frmMain.Name.value +
	"&phone=" + document.frmMain.Phone.value +
	"&email=" + document.frmMain.Email.value +
	"&quantity=" + document.frmMain.Quantity.value +
	"&lang=" + document.frmMain.Language.value +
	"&product=" + document.frmMain.FormName.value +
	"&page=" + window.location;
	return poststr;
}



function createRqObject() {
    var ro;
	if(window.XMLHttpRequest) {
    	try {
			ro = new XMLHttpRequest();
        } catch(e) {
			ro = false;
        }
    // branch for IE/Windows ActiveX version
    } else if(window.ActiveXObject) {
       	try {
        	ro = new ActiveXObject("Msxml2.XMLHTTP");
      	} catch(e) {
        	try {
          		ro = new ActiveXObject("Microsoft.XMLHTTP");
        	} catch(e) {
          		ro = false;
        	}
		}
    }
	
    return ro;
}

var http = createRqObject();

function sendReq(action, method, script) {
	if (!http) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
    } else {
    	if (method == "get") {
		    http.open('get', script+action);
		    http.onreadystatechange = getResponse;
		    http.send(null);
    	} else {
    		if (form_rqstpricing()) {
    			document.getElementById('soumettre').style.visibility = "hidden";
    			parameters = poststring_requetpricing();
    			http.onreadystatechange = getResponse;
    			http.open('POST', script, true);
    			http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    			http.setRequestHeader("Content-length", parameters.length);
    			http.setRequestHeader("Connection", "close");
    			http.send(parameters);
    		}
    	}
    }
}

function getResponse() {
	if(http.readyState == 1){
		document.getElementById('form').innerHTML = '<b>Processing....</b>';
	}
	if(http.readyState == 4){
		var response = http.responseText;
		document.getElementById('form').innerHTML = response;
		
	}
}





function mValidate(){
	var bok=true;
		if(document.frmMain.Fullname.value==""){
			alert("Full Name Required.");
			document.frmMain.Fullname.focus();
			bok = false;
		}

		if(bok==true && document.frmMain.Phone.value==""){
			alert("Phone Required.");
			document.frmMain.Phone.focus();
			bok = false;
		}
		if(bok==true && document.frmMain.Country.value==""){
			alert("Country Required.");
			document.frmMain.Country.focus();
			bok = false;
		}
		
		if(bok==true && document.frmMain.Email.value==""){
			alert("Email Required.");
			document.frmMain.Email.focus();
			bok = false;
		}
		
		if (bok==true && ((document.frmMain.Email.value.indexOf('@')==-1)||(document.frmMain.Email.value.indexOf('.')==-1))){
			
			document.frmMain.Email.select();
			alert ("not a valid email address");
			bok = false;
		}
		
		if (bok==true && ((document.frmMain.RetypeEmail.value.indexOf('@')==-1)||(document.frmMain.RetypeEmail.value.indexOf('.')==-1))){
			
			document.frmMain.RetypeEmail.select();
			alert ("not a valid email address");
			bok = false;
		}
		if (bok==true && !(document.frmMain.RetypeEmail.value==document.frmMain.Email.value)) {
			document.frmMain.Email.select();
			alert ("both e-mails should be the same");
			bok = false;
		}
		
		chk=0
		for (i=0;i < document.frmMain.Product.length ; i++ ){
		
			if (document.frmMain.Product[i].checked==true){
		
				chk=1;
			}
		}
		
		if(bok==true && chk !=1){
			alert("Please Select a Product.");
			bok = false;
		}
		
		if(bok==true && document.frmMain.Quantity.value==""){
			alert("Quantity Required.");
			document.frmMain.Quantity.focus();
			bok = false;
		}
		
		if (bok==true && document.frmMain.Date.value.indexOf('/')==-1){
			alert ("not a valid date");
			document.frmMain.Date.value = "yy/mm/dd";
			document.frmMain.Date.select();
			bok = false;
		}
		
		if(bok==true) { 
			document.frmMain.submit(); 
		}
		/*alert("Email Sent")		
		stat.innerHTML = "Email Sent."
		document.frmMain.reset();*/
		return false;
}

function valForm(prodName,mLanguage){
if(document.frmMain.Name.value==""){
	alert("Name Required.");
	document.frmMain.Name.focus();
	return false;
}	
if(document.frmMain.Phone.value==""){
	alert("Phone Required.");
	document.frmMain.Phone.focus();
	return false;
}


if(document.frmMain.Email.value==""){
	alert("Email Required.");
	document.frmMain.Email.focus();
	return false;

}

if ((document.frmMain.Email.value.indexOf('@')==-1)||(document.frmMain.Email.value.indexOf('.')==-1)){
	document.frmMain.Email.select();
	alert ("not a valid address");
	return false;
}

if(document.frmMain.Quantity.value==""){
	alert("Quantity Required.");
	document.frmMain.Quantity.focus();
	return false;

}

if (isNaN(document.frmMain.Quantity.value)){
	alert("Not a Valid Number.");
	document.frmMain.Quantity.select();
	return false;
}

		document.frmMain.action=  'form/SMailForm.asp?subject=Pricing Request-'+ prodName + "-" + mLanguage;		//'mailto:sales@universalboot.com?subject=Pricing Request-'+ prodName + "-" + mLanguage  ;
		document.frmMain.submit();
		//alert("Email Sent");
		//document.frmMain.reset();
		return false;
}


//script for printing
var gAutoPrint = true; // Flag for whether or not to automatically call the print function

function printSpecial()
{
	if (document.getElementById != null)
	{
		var html = '<HTML>\n<HEAD>\n';

		if (document.getElementsByTagName != null)
		{
			var headTags = document.getElementsByTagName("head");
			if (headTags.length > 0)
				html += headTags[0].innerHTML;
		}
		
		html += '\n</HE' + 'AD>\n<BODY>\n';
		
		var printReadyElem = document.getElementById("printReady");
		
		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Could not find the printReady section in the HTML");
			return;
		}
			
		html += '\n</BO' + 'DY>\n</HT' + 'ML>';
		
		var printWin = window.open("","printSpecial");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
	}
	else
	{
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
}
//script for ADs


var sprachwahl = new Array (
"5", "images/ro_add_09.jpg", "",  "",
"5", "images/ro_add_11.jpg", "", "",
"5", "images/ro_add_13.jpg", "", "");

this_url = location.href;
if ( this_url.indexOf( "WebSite" ) != -1 ) {
	rootpath = this_url.replace( /WebSite.*/, "WebSite" );
	actualpath = this_url.substr(0, this_url.lastIndexOf("/")+1);
} else {
	//rootpath = "http://" + window.location.hostname;
	rootpath = "";
	actualpath = "";
}

//-----------------------------

function banner(which){
	sum = 0;
	
	for(i=0; i<which.length; i+=4){
		sum += parseInt(which[i]);
	}
	
	zufall			= Math.floor(sum*Math.random());
	hit					= 0;
	banner			=	"";
	statustext	=	"";
	target			= "";
	onclick			= "";
	
	for(i=0; i<which.length; i+=4){
		hit += parseInt(which[i]);
		
		if(hit>zufall){
			banner			= rootpath + which[i+1];
			statustext	= which[i+2];
			link				= which[i+3];
			target			= (link.indexOf("http")!=-1) ? "_blank" : "_parent";
			
			if (link.indexOf("javascript:")!=-1){
				onclick	= link;
				link		= "javascript://";
				target	= "_self";
			}
			
			break; 
		}
	}
	return banner;
}

function loc(currentImageSrc){
	switch(currentImageSrc){
	case "images/ro_add_09.jpg":
		location.href="wheel-clamp01.htm";
		break;
	case "images/ro_add_11.jpg":
		location.href="king-pin-lock.htm";
		break;
	case "images/ro_add_13.jpg":
		location.href="wheel-clamp03.htm";
		break;
	}
}

function addBookmark(title,url) {
    if (window.sidebar) {
        window.sidebar.addPanel(title, url,"");
    } else if( document.all ) {
        window.external.AddFavorite( url, title);
    } else if( window.opera && window.print ) {
        return true;
    }
} 

//-->

<!--//--><![CDATA[//><!--

/*sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
*/
//--><!]]>
