function validate_display()
{

		
	if (document.addToBasket.itemQty.value=="")
	{
		alert("Please enter quantity name");
		document.addToBasket.itemQty.focus();
		return false;
	}
	
	if((isNaN(document.addToBasket.itemQty.value)))
	{
		alert("Please enter valid quantity");
		document.addToBasket.itemQty.focus();
		return false;
	}
}

function validateUP()
{

	if(document.frmLogin2.username.value=="")
	{
		alert("The Email Address Field cannot be blank");
		document.frmLogin2.username.focus();
		return false;
	
	}


	if(ValidEmail(document.frmLogin2.username.value)==false)
	{
	return false;
	
	} 

	if (trim(document.frmLogin2.password.value)=="")
	{
		alert("The Password Field cannot be blank");
		document.frmLogin2.password.focus();
		return false;
	}


return true;
}

function validate_basket()
{
	var counter = document.cart.counter.value;
	
	
	
	for(loop=1; loop<counter; loop++)
	{
		var qty = eval('document.cart.qty'+loop+'.value');
		var stock = eval('document.cart.stock'+loop+'.value');
		
		
		//var stock = eval('document.addToBasket.stock'+loop+'.value');
		
		if(qty=='')
		{	
			alert ('Please enter some quantity');	
			abc = eval('document.cart.qty'+loop);
			abc.focus();
			return false;	
		}
		
		if(qty<=0)
		{	
			alert ('Please enter valid quantity');	
			abc = eval('document.cart.qty'+loop);
			abc.focus();
			return false;	
		}
		
	/*	if(qty!='')
		{
						
			if((stock - qty) < 5)
			{
				var limit = stock - 5;
				alert ('Sorry limited stock! You can only buy '+limit+' items at the moment');
				abc = eval('document.cart.qty'+loop);
				abc.focus();
				return false;	
			}
		
		}*/
		
		
		
		if( isNaN(qty))
		{	
			alert ('Please enter a valid quantity');
			abc = eval('document.cart.qty'+loop);
			abc.focus();
			return false;	
		}
		/*
		if( IsNum(qty)==false)
		{	
			alert ('Please enter a valid value');
			abc = eval('document.cart.qty'+loop);
			abc.focus();
			return false;	
		}*/
		
		
	
	}
	return true;
	
}

function redirectToIndex()
{
	window.location="index.php";
}

function redirectToCheckOut()
{
		
	window.location="contCheckout.php";
}


function IsChar(strString)
{
   var strValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
   var strChar;
   var blnResult = true;
   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
   {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
      {
         blnResult = false;
      }
    }
   return blnResult;
}

function IsNum(strString)
{
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;
   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
   {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
      {
         blnResult = false;
      }
    }
   return blnResult;
}
function validate_recpass()
{
		
	if(document.reqPass.email.value=="")
	{
		alert("The Email Address Field cannot be blank");
		document.reqPass.email.focus();
		return false;
	}
	if (ValidEmail(document.reqPass.email.value)==false)
	{
	//alert("Please enter valid email address");
	return false;
	}
	if (document.reqPass.hintQuestion.value=="1")
	{
		alert("Please select a hint question");
		document.reqPass.hintQuestion.focus();
		return false;
	}
	
	
	if (document.reqPass.answer.value=="")
	{
		alert("The Answer Field cannot be blank");
		document.reqPass.answer.focus();
		return false;
	}
	 
return true;	
}
document.write('');