<!--
function Popup(error_message)
	{
alert(error_message);
			return false;	
	}
	
function CheckNumber(object_value)
    {
    //Returns true if value is a number or is NULL
    //otherwise returns false	

    if (object_value.length == 0)
        return false;

    //Returns true if value is a number defined as
    //   having an optional leading + or -.
    //   having at most 1 decimal point.
    //   otherwise containing only the characters 0-9.
	var start_format = " .+0123456789";
	var number_format = " .0123456789";
	var check_char;
	var decimal = false;
	var trailing_blank = false;
	var digits = false;

    //The first character can be + - .  blank or a digit.
	check_char = start_format.indexOf(object_value.charAt(0))
    //Was it a decimal?
	if (check_char == 1)
	    decimal = true;
	else if (check_char < 1)
		return false;
        
	//Remaining characters can be only . or a digit, but only one decimal.
	for (var i = 1; i < object_value.length; i++)
	{
		check_char = number_format.indexOf(object_value.charAt(i))
		if (check_char < 0 || check_char==0)
			return false;
		else if (check_char == 1)
		{
			if (decimal)		// Second decimal.
				return false;
			else
				decimal = true;
		}
		else if (check_char == 0)
		{
			if (decimal || digits)	
				trailing_blank = true;
        // ignore leading blanks

		}
	        else if (trailing_blank)
			return false;
		else
			digits = true;
	}	
    //All tests passed, so...
    return true
}

<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function  CheckForm(theForm) {
//	alert(theForm.normal1.value); return false;
	 
	if  (!(CheckNumber(theForm.orderqty.value)))
		{
			if  (!Popup("Put a numeric value !"))
			{
				return false; 
			}
		}	
	if  (theForm.orderqty.value<1)
		{
			if  (!Popup("Put a value greater than 0!"))
			{
				return false; 
			}
		}	
		return true; 
} 
	

function  CheckReg(theForm) {
	
	if (theForm.fname.value == "")	{	if  (!Popup("Your name is required!"))	{	return false; } }  
	if (theForm.email.value == "")	{	if  (!Popup("Email address is required!"))	{	return false; } } 
	if (theForm.email.value != "")	{
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/;
		if (filter.test(theForm.email.value)) {
		} else {
				if  (!Popup("Invalid email format!"))	{	return false; }
		}
	}
	if (theForm.address.value == "")	{	if  (!Popup("Your address is required for shipping information!"))	{	return false; } }  
	if (theForm.city.value == "")	{	if  (!Popup("City is required!"))	{	return false; } } 
	if (theForm.state.value == "")	{	if  (!Popup("State is required!"))	{	return false; } }  
	if (theForm.zipcode.value == "")	{	if  (!Popup("Zip code is required!"))	{	return false; } }  
	if (theForm.phone.value == "")	{	if  (!Popup("Phone is required!"))	{	return false; } }  		
	if (theForm.username.value == "")	{	if  (!Popup("Username is required!"))	{	return false; } }  
	if (theForm.password.value == "")	{	if  (!Popup("Password is required!"))	{	return false; } }  
	if (theForm.password.value != theForm.retype.value )	{	if  (!Popup("Password and re-type password not same!"))	{	return false; } }  		 
	return true; 
} 

function  CheckContact(theForm) {
//	alert(theForm.normal1.value); return false;	 
	if (theForm.fname.value == "")	{	if  (!Popup("Your name is required!"))	{	return false; } } 
	if (theForm.email.value == "")	{	if  (!Popup("Email address is required!"))	{	return false; } } 
	if (theForm.email.value != "")	{
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/;
		if (filter.test(theForm.email.value)) {
		} else {
				if  (!Popup("Invalid email format!"))	{	return false; }
		}
	} 
	if (theForm.comment.value == "")	{	if  (!Popup("Please fill your inquiry"))	{	return false; } } 
	return true; 
 } 

function  CheckMail(theForm) {
//	alert(theForm.normal1.value); return false;	 
	if (theForm.email.value == "")	{	if  (!Popup("Email address is required!"))	{	return false; } } 
	if (theForm.email.value != "")	{
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/;
		if (filter.test(theForm.email.value)) {
		} else {
				if  (!Popup("Invalid email format!"))	{	return false; }
		}
	} 
	return true; 
 } 

function  CheckPayment(theForm) {	
	if (theForm.paymentopt.value == "none")	{
		if  (!Popup("Please choose your payment !"))	{	return false; }
	}
	if (theForm.new_shipaddress.checked == "true")	{
		if (theForm.new_address.value == "")	{	if  (!Popup("Your new address is required for shipping information!"))	{	return false; } }  
		if (theForm.new_city.value == "")	{	if  (!Popup("New City is required!"))	{	return false; } } 
		if (theForm.new_state.value == "")	{	if  (!Popup("New State is required!"))	{	return false; } }  
		if (theForm.new_zipcode.value == "")	{	if  (!Popup("New Zip code is required!"))	{	return false; } }  
	}
	return true; 
} 

//-->

