function reportError(msg, url, line) {
	if (url == window.location.href) {
		top.location.href = ok_urls[1] + "?" + window.location.href;
		return true;
   }
}


 
function doValidate() {
    var why = "";
    why += checkName(document.orderForm.name.value);
    why += checkEmail(document.orderForm.email.value);
    why += checkEither(document.orderForm.email.value, document.orderForm.tel.value);
    if (why != "") {
       alert(why);
       return false;
    }
doPostings();
return true;
}


 
function checkName (string) {
 var error = "";
 if (string == "") {
    error = "You didn't enter your name.\n";
 }
 return error;    
}



function checkEmail (string) {
 var error = "";
 if (string != "") {
    if (document.layers||document.getElementById||document.all) {
    if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(string)) {
    	  error = "Please input a valid email address!\n";
    	};  
    };	
 }
return error;    
}



function checkEither (string1, string2) {
 var error = "";
 if ((string1 == "" || string1 == null) && (string2 == "" || string2 == null)) {
    error = "You must enter either an email address (which we would prefer) or a telephone number.\n";
 }
 return error;    
}



function doPostings() {
	var email1 = "Sales"
	var email2 = "SmallBattery.Company.org.uk"
	document.orderForm.recipient.value = email1 + "@" + email2;	 // change recipient
	document.orderForm.submit();		// submit form 
		
}
