/* Validate QuantityNumber */
function validate_quantity(field) {
var valid = "123456789"
var ok = "yes";
var temp;
	for (var i=0; i<field.value.length; i++) {
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}
	if (ok == "no") {
		alert("Invalid quantity! Only numbers are accepted.");
		field.select();
		field.focus();
	}
}

/* Copy Contact Details */
function copyContactDetails() {
  document.contactinfo.shipping_fname.value = document.contactinfo.contact_fname.value;
  document.contactinfo.shipping_lname.value = document.contactinfo.contact_lname.value;
  document.contactinfo.shipping_company.value = document.contactinfo.contact_company.value;
  document.contactinfo.shipping_address.value = document.contactinfo.contact_address.value;
  document.contactinfo.shipping_city.value = document.contactinfo.contact_city.value;
  document.contactinfo.shipping_state.value = document.contactinfo.contact_state.value;
  document.contactinfo.shipping_postcode.value = document.contactinfo.contact_postcode.value;
  document.contactinfo.shipping_country.value = document.contactinfo.contact_country.value;
  document.contactinfo.shipping_email.value = document.contactinfo.contact_email.value;
  document.contactinfo.shipping_phone.value = document.contactinfo.contact_phone.value;
  document.contactinfo.shipping_fax.value = document.contactinfo.contact_fax.value;
}

/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);

	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
	
		if(el.style.display != "block"){ //DynamicDrive.com change
		
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") //DynamicDrive.com change
				ar[i].style.display = "none";
				
			}	
			el.style.display = "block";
		}else{
		
			el.style.display = "none";
		}
	}
}