// JavaScript Document
/*
This file is part of eMerchantPro, an ecommerce application developed and sold by Global Web Solutions LLC. eMerchantPro, its source code, the eMerchantPro name and logo are property of Global Web Solutions, LLC. Copyright 2001-2003. All rights reserved. You are not allowed to use, alter, distribute and/or resell any parts of eMerchantPro's source code without the written consent of Global Web Solutions. To contact Global Web Solutions, please visit www.globalwsolutions.com.

Validate quantity field for product display option "m" */
	function isDigit(s)
	{
	var test=""+s;
	if(test=="0"||test=="1"||test=="2"||test=="3"||test=="4"||test=="5"||test=="6"||test=="7"||test=="8"||test=="9")
	{
	return(true) ;
	}
	return(false);
	}
	
	function allDigit(s)
	{
	var test=""+s ;
	for (var k=0; k <test.length; k++)
	{
		var c=test.substring(k,k+1);
		if (isDigit(c)==false)
	{
	return (false);
	}
	}
	return (true);
	}
	
	function checkproqty(fname,qty,type)
	{
	if (fname.value == "")
	{
		alert("Please enter a value for this field.");
		fname.focus();
		return (false);
		}
	if (allDigit(fname.value) == false)
	{
		alert("Please enter a right integer value for this field.");
		fname.focus();
		return (false);
	}
	if ((qty > 0) && (eval(fname.value) != 0) && (type==1))
	{
	TempValue=eval(fname.value);
	TempV1=(TempValue/qty);
	TempV1a=TempValue*TempV1;
	TempV2=Math.round(TempValue/qty);
	TempV2a=TempValue*TempV2;
		if ((TempV1a != TempV2a) || (TempV1<1))
		{
				alert(vAlert_3 + qty);
				fname.focus();
				return (false);
		}
	}
	else
	{
		if ((qty > 0) && (eval(fname.value) != 0) && (type==0))
		{
		TempValue=eval(fname.value);
			if (TempValue < qty)
			{
				alert(vAlert_8 + " " + qty + " " + vAlert_9);
				fname.focus();
				return (false);
			}
		}
	}
	return (true);
	}
	
	/*
	Clear default form value script- By Ada Shimar (ada@chalktv.com)
	Featured on JavaScript Kit (http://javascriptkit.com)
	Visit javascriptkit.com for 400+ free scripts!
	*/
	
	function clearText(thefield){
	if (thefield.defaultValue==thefield.value)
	thefield.value = ""
	} 

 

 
