
<!--
var msg="";
var haveerrors=0;

function check_register_info()
{
	haveerrors=0;
	msg="";

	var s_name = document.register_form.s_name.value;
	var s_address = document.register_form.s_address.value;
	var s_city = document.register_form.s_city.value;
	var s_state = document.register_form.s_state.value;
	var s_country = document.register_form.s_country.value;
	var s_zip = document.register_form.s_zip.value;
	var s_phone = document.register_form.s_phone.value;
	var s_email = document.register_form.s_email.value;


	var pin = document.register_form.pin.value;
	var repin = document.register_form.repin.value;
	
	validate_not_incl_num(trim(s_name),"Full name",2,30);
	validate_incl_num(trim(s_address),"Address",2,100);
	validate_not_incl_num(trim(s_city),"City",2,20);
	validate_not_incl_num(trim(s_state),"Province",2,40);
	validate_not_incl_num(trim(s_country),"Country",2,20);
	validateZip(trim(s_zip),"Postal code");
	validate_phone(trim(s_phone),"Phone's");
	isValidEmailAddress(trim(s_email));
	
	
	minLength(pin, 5, "Password");
	checkConsistency(pin,repin,"Password");
	
	
/*	if (!document.register_form.terms_agree.checked)
	{
		haveerrors = 1;
		msg = msg + "You don't agree our Terms of Use?";
	}
*/


	if (haveerrors)
	{
		if (msg!="")
		{
			showErrorMsg(msg);
		}
		return false;
	}

	return true;
}


function check_search_info()
{
        alert(document.search_form.search_type.value);
        haveerrors=0;
	msg="";
	msgs="";	
	var s_email = document.search_form.search_type.value;
        var pin = document.search_form.search_keyword.value;
        //alert("document.search_form.search_type.value.length");
               
        var length_check =1;
        if(document.search_form.search_type.value.length==0 || trim(s_email) ==""){
        length_check =0;
        msgs = "please check one search parameter";
        }
        
        if(document.search_form.pin.value.length==0 || trim(pin) ==""){
	        length_check =0;
	        msgs = "please input your search parameter";
        }
        
	
	if (length_check == 0)
		{
			haveerrors = 1;
			alert(msgs + " can not be empty, " + msgs);
			return false;
		}
	
	
	if (haveerrors)
		{
			if (msg!="")
			{
				showErrorMsg(msg);
			}
			return false;
		}

	return true;
}

function check_quote_info()
{
	haveerrors=0;
	msg="";

	
	        var s_name = document.register_form.s_name.value;
		var s_address = document.register_form.s_address.value;
		var s_city = document.register_form.s_city.value;
		var s_state = document.register_form.s_state.value;
		//var s_country = document.register_form.s_country.value;
		var s_zip = document.register_form.s_zip.value;
		var s_phone = document.register_form.s_phone.value;
		var s_compound = document.register_form.s_compound.value;
		var s_catalogue = document.register_form.s_catalogue.value;
		var s_quantity = document.register_form.s_quantity.value;
	
	
		//var pin = document.register_form.pin.value;
		//var repin = document.register_form.repin.value;
		
		validate_not_incl_num(trim(s_name),"Full name",2,30);
		validate_incl_num(trim(s_address),"Address",2,100);
		validate_not_incl_num(trim(s_city),"City",2,20);
		validate_not_incl_num(trim(s_state),"Province",2,40);
		
		validateZip(trim(s_zip),"Postal code");
		validateZip(trim(s_compound),"Compound");		
		
		//validate_incl_num(trim(s_catalogue),"Catalogue",2,20);
		validate_incl_num(trim(s_quantity),"Quantity",1,20);
		
		validate_phone(trim(s_phone),"Phone's");
		//isValidEmailAddress(trim(s_email));
	
	
	
	//minLength(pin, 5, "Password");
	//checkConsistency(pin,repin,"Password");
	
	
        if (haveerrors)
	{
		if (msg!="")
		{
			showErrorMsg(msg);
		}
		return false;
	}

	return true;
}
//-->