///  admin validation script  //////////
function truncateSpace(Val) 
{ 
 	while(''+Val.charAt(0)==' ') 
   	Val=Val.substring(1,Val.length); 
   	return Val 
}  
////////////////////////////////////

function CheckEmptyLbl(Val,Label,LabelName) 
{ 
  if(truncateSpace(Val)=="") 
  {
   alert("Please "+Label) 
   return false;
  } 
  if(Val.charAt(0)==" ")
  {
	  alert("First character of "+LabelName+" should not be empty")
	  return false;
  }
  return true;
}

///////////////////////////////////

function check_email(e) 
{
ok = "1234567890qwertyuiopasdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
for(i=0; i < e.length ;i++)
{
if(ok.indexOf(e.charAt(i))<0)
{ 
return (false);
}	
} 

 if (document.images) 
 {
re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4})(\]?)$/;
if (!e.match(re) && e.match(re_two)) 
{
return (-1);		
} 
 }
 }

/////////////////////////////////

function CheckEmptyBox(Val,Label) 
{ 
  if(truncateSpace(Val)=="") 
  {
   alert(Label+" ") 
   return false;
  } 
  return true;
}

//////////////////////////////
function CheckAlphaSpace(aText,Label)
{
   var ValidChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcedefghijklmnopqrstuvwxyz ";
   var IsNumber=true;
   var Char;
   if(aText=="") 
   {
	alert(Label+ "");
	return false
	}
   for (i = 0; i < aText.length && IsNumber == true;i++) 
   { 
       Char = aText.charAt(i); 
       if(ValidChars.indexOf(Char) == -1) 
      {
         IsNumber = false;
      }
   }
   if(!IsNumber)
   	alert(Label+ " ")
   return IsNumber;
}

//////////////////////////////////
function IsFax(sText,Label)
{
   var ValidChars = "0123456789-() ";
   var IsNumber=true;
   var Char;
   if(sText=="") {alert(Label+ " Should not be Empty");return false}
   for (i = 0; i < sText.length && IsNumber == true; i++) 
   { 
      Char = sText.charAt(i); 
      if(ValidChars.indexOf(Char) == -1) 
      {
         IsNumber = false;
      }
   }
   if(!IsNumber)
   	alert(Label+ "must not contain characters other than 0-9 – ()")
   return IsNumber;
}

//////////////////////////////////

function CheckEmpty(Val,Label) 
{ 
  if(truncateSpace(Val)=="") 
  {
   alert(Label+" should not be empty") 
   return false;
  } 
  if(Val.charAt(0)==" ")
  {
	  alert("First character should not be empty in "+Label)
	  return false;
  }
  return true;
}


///////////////////////////////////////

function validation()
{
	if(document.login.admin_name.value=="")
	{
	alert("Enter User name");
	document.login.admin_name.focus();
	return false;
	}
	
	else if(document.login.admin_pass.value=="")
	{
	alert("Enter Login Password");
	document.login.admin_pass.focus();
	return false;
	}
	else
	{
	return true;
	}
}
///////////////////  End Code //////////////////




///////////////////////     add_admin Validation script          ///////////////////

function val()
{
	if(document.form1.firstname.value=="")
	{
	alert("Enter  First Name ");
	document.form1.firstname.focus();
	return false;
	}
	if(document.form1.firstname.value!="")
	      {
	       var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?0123456789";
    	      for (var i = 0; i < document.form1.firstname.value.length; i++)
	        	 {
  		           if (iChars.indexOf(document.form1.firstname.value.charAt(i)) != -1)
			         {
  			          alert ("Your First Name has special characters. \nThese are not allowed.\n Please remove them and try again.");
			         document.form1.firstname.value="";
			          document.form1.firstname.focus();
			          return false;
			        }
  		          }
 	         } 
	if(document.form1.lastname.value=="")
	{
	alert("Enter Second name");
	document.form1.lastname.focus();
	return false;
	}
	if(document.form1.lastname.value!="")
	      {
	       var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?0123456789";
    	      for (var i = 0; i < document.form1.lastname.value.length; i++)
	        	 {
  		           if (iChars.indexOf(document.form1.lastname.value.charAt(i)) != -1)
			         {
  			          alert ("Your Second Name has special characters. \nThese are not allowed.\n Please remove them and try again.");
			         document.form1.lastname.value="";
			          document.form1.lastname.focus();
			          return false;
			        }
  		          }
 	         } 
	
	if(document.form1.email.value=="")
	{
	alert("Enter the Email");
	document.form1.email.focus();
	return false;
	}
	 if(document.form1.email.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
	{
		alert("Your email is not valid");
		document.form1.email.focus();
		return false;
	}
	if(document.form1.admin_name.value=="")
	{
	alert("Enter Admin login name");
	document.form1.admin_name.focus();
	return false;
	}
	if(document.form1.adminpass.value=="")
	{
	alert("Enter Admin Password");
	document.form1.adminpass.focus();
	return false;
	}
	
	
	 if(document.form1.admin_status.value=="")
	{
	alert("Enter Admin Status");
	document.form1.admin_status.focus();
	return false;
	}

	return true;
	}


	function PopupPic(sPicURL)
	 {
		window.open("image.php?"+sPicURL,"", "resizable=1,HEIGHT=200,WIDTH=200");

	}

function check(){

	if(document.test.category.value=="")
	{
		alert("Enter category Name");
		document.test.category.focus();
		return false;
	}

	if(document.test.rank.value=="")
	{
		alert("Enter The rank");
		document.test.rank.focus();
		return false;
	}
	
	if(document.test.status.value=="")
	{
		alert("Select the status ");
		document.test.status.focus();
		return false;
	}
	return true;
}

function edit_fun(id,cat_name,rank,status)
{

 document.test.category.value=cat_name;
 document.test.rank.value=rank;
 document.test.status.value=status;
 
 document.test.eid.value=id;
 document.test.sub_val.value=2;
 document.test.Submit.value="Update"; 
}			 

function delete_fun(id,cat_name,rank,status)
{
 document.test.category.value=cat_name;
 document.test.rank.value=rank;
 document.test.status.value=status;
 
 document.test.eid.value=id;
 document.test.sub_val.value=3;
 document.test.Submit.value="Delete";
}			 

/////////////////////// Product Validation /////////////////////////////


 
function product()
{
if(document.test.id.value=="")
	{
		alert("SelectCategory Name");
		document.test.id.focus();
		return false;
	}
	
	
	
	if(document.test.productname.value=="")
	{
		alert("Enter The product Name");
		document.test.productname.focus();
		return false;
	}
	
	if(document.test.productname.value!="")
	      {
	       var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?0123456789";
    	      for (var i = 0; i < document.test.productname.value.length; i++)
	        	 {
  		           if (iChars.indexOf(document.test.productname.value.charAt(i)) != -1)
			         {
  			          alert ("Your Second Name has special characters. \nThese are not allowed.\n Please remove them and try again.");
			         document.test.productname.value="";
			          document.test.productname.focus();
			          return false;
			        }
  		          }
 	         } 

    
	
	
	if(document.test.usd.value=="")
	{
		alert("Enter The USD Value ");
		document.test.usd.focus();
		return false;
	}
	if(document.test.portal.value=="")
	{
		alert("Enter The portal  Value" );
		document.test.portal.focus();
		return false;
	}
	if(document.test.rank.value=="")
	{
		alert("Enter The rank ");
		document.test.rank.focus();
		return false;
	}if(document.test.image1.value=="")
	{
		alert("Enter The image1");
		document.test.image1.focus();
		return false;
	}if(document.test.image2.value=="")
	{
		alert("Enter The image2 ");
		document.test.image2.focus();
		return false;
	}
	if(document.test.discount.value=="")
	{
		alert("Enter The discount");
		document.test.discount.focus();
		return false;
	}
	if(document.test.metatag.value=="")
	{
		alert("Enter The metatag ");
		document.test.metatag.focus();
		return false;
	}
	if(document.test.meta_keyword.value=="")
	{
		alert("Enter The meta Keyword ");
		document.test.meta_keyword.focus();
		return false;
	}
	if(document.test.status.value=="")
	{
		alert("Select Tha status ");
		document.test.status.focus();
		return false;
	}
	return true;
}


function searchdate()
{
if(document.test.sdate.value=="")
	{
		alert("Select The Dates ");
		document.test.sdate.focus();
		return false;
	}
	return true;
}
 

function parentvalid()
{
if(document.test.parentname.value=="")
	{
		alert("Enter The Product Name");
		document.test.parentname.focus();
		return false;
	}
	return true;
}

function alphabet()
{
if(document.test.categories.value=="")
	{
		alert("Select The category Name");
		document.test.categories.focus();
		return false;
	}
	return true;
}

function valid2()
{
if(document.test.alpha.value=="")
	{
		alert("Select  the Alphabet");
		document.test.alpha.focus();
		return false;
	}
	return true;
}
//////////////////// update cart //////////////

function CheckNumber(sText,Label)
{
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;
   if(sText=="") {alert(Label+ " Should not be Empty");return false}
   for (i = 0; i < sText.length && IsNumber == true;i++) 
   { 
      Char = sText.charAt(i); 
      if(ValidChars.indexOf(Char) == -1) 
      {
         IsNumber = false;
      }
   }
   if(!IsNumber)
   	alert(Label+ " Must Be numeric")
   return IsNumber;
}
////////////////////////////////////
function CheckCustomerData(frm)
{
			if(!CheckEmptyLbl(frm.email.value,"enter your E-Mail address","E-Mail Address"))
			{
			frm.email.focus();
			return false;
			}
			 if(frm.email.value != "")
			 {
				 if(!check_email(frm.email.value))
				 {
					 alert("Please enter a valid email address");
					 frm.email.focus();
					 return false;
				 }
			 }
					
				    if(!CheckEmptyLbl(frm.confirmemail.value,"Enter your Confirm-Email address","Confirm E-Mail Address"))
					{
					frm.confirmemail.focus();
					return false;
					}
					
					if(frm.confirmemail.value != "")
					{
					if(!check_email(frm.confirmemail.value))
					{
						alert("Please enter a valid email address");
						frm.confirmemail.focus();
						return false;
					}
					}
 	
				 if(frm.email.value != frm.confirmemail.value)
				 {
				 alert('Email address And Confirmemail address sbould  be same!');
				 frm.confirmemail.focus();
				 return false;
				 }
	 
				var email	= frm.email.value;
				
			   myString = new String(email)
			   splitString = myString.split("@")
			   var emailtest = splitString[0];
			   				
		if(!CheckEmptyBox(frm.password.value,"Please fill in the field Password"))
				{
					frm.password.focus();
					return false;
				}
 
			var pwdlen	= frm.password.value;
			if(pwdlen.length < 6 || pwdlen.length >20 )
			{
				alert("Please enter between 6 and 20 characters for the password field");
				frm.password.focus();		
				return false;
			}
	
		 if(emailtest == frm.password.value)
		  {
			alert('User Id And Password Should not be same!');
			frm.password.focus();
			return false;
		  }
		  
		  if(frm.email.value == frm.password.value)
		 {
			alert('User Id And Password Should not be same!');
			frm.password.focus();
			return false;
		 }
	
		if(!CheckEmptyBox(frm.confirmpassword.value,"Please fill in the field Confirm Password"))
		{
			frm.confirmpassword.focus();
			return false;
		}
	
	  if(frm.password.value != frm.confirmpassword.value)
	  {
		alert('The text in the Password and Confirm password fields don’t match');
		frm.confirmpassword.focus();
		return false;
	  }
			
				if(frm.firstname.value == "" )
				{
					alert("Please enter the First Name!");
					frm.firstname.focus();
					return false;
				}
				
				if(!CheckEmpty(frm.firstname.value,"First Name"))
				{
					frm.firstname.focus();
					return false;
				}
	
				var fstname = frm.firstname.value;
				
				if (fstname.length < 2)
				 {
						 alert('First Name should not be in single character');
						 frm.firstname.focus();
						 return false;
				 }
	
				if(!CheckAlphaSpace(frm.firstname.value,"First Name must contain only alphabets: A-Z or a-z")) 
				{ 
				frm.firstname.focus();
				return false;
				}
 
				   if(frm.lastname.value != "" )
					{
						if(frm.lastname.value.charAt(0)==" ")
						{
							alert("First character should not be empty in Last Name");
							frm.lastname.focus();
							return false;
						}
						
						if(!CheckAlphaSpace(frm.lastname.value,"Last Name must contain only alphabets: A-Z or a-z")) 
						{ 
						frm.lastname.focus();
						return false;
						}
					}
	
				
				if(frm.country.selectedIndex == 0 )
				{
					alert("Please select your Country!");
					frm.country.focus();
					return false;
				}
				if(!CheckEmpty(frm.address.value,"address"))
				{
					frm.address.focus();
					return false;
				}
				if(!CheckEmpty(frm.city.value,"city"))
				{
					frm.city.focus();
					return false;
				}
				if(!CheckEmpty(frm.state.value,"State"))
				{
					frm.state.focus();
					return false;
				}
				
  			if(!CheckEmpty(frm.postcode.value,"Postcode"))
				{
					frm.postcode.focus();
					return false;
				}
				
				if(!IsFax(frm.postcode.value ,"postcode"))
				{
						frm.postcode.focus();
						return false;
				}	
			
			if(frm.phone.value == "" )
				{
				confirm("Please fill in your Phone number!");
				frm.phone.focus();
				return false;
				}
					
				if(!CheckEmpty(frm.phone.value,"Phone Number"))
				{
					frm.phone.focus();
					return false;
				}
				
			
				
				var phonelen = frm.phone.value;
			
				 if (phonelen.length < 6)
				 {
						 alert('Phone Number should not be less than 6 digits');
						 frm.phone.focus();
						 return false;
				 }
				
					if(!IsFax(frm.phone.value ,"Phone Number"))
					{
						frm.phone.focus();
						return false;
					}
					
					var radio_choice = false;
					
					// Loop from zero to the one minus the number of radio button selections
					for (counter = 0; counter < frm.radiobutton.length; counter++)
					{
					// If a radio button has been selected it will return true
					// (If not it will return false)
					if (frm.radiobutton[counter].checked)
					radio_choice = true; 
					}
					
					if (!radio_choice)
					{
					// If there were no selections made display an alert box 
					alert("Please select a billing and shipping address.")
					return (false);
					}

				
				if(document.getElementById('extra_content').style.display == "" )
				{
				if(document.frmCustomer.s_country.selectedIndex == 0 )
				{
					alert("Please select your Country!");
					document.frmCustomer.s_country.focus();
					return false;
				}
				if(!CheckEmpty(document.frmCustomer.s_address.value,"address"))
				{
					document.frmCustomer.s_address.focus();
					return false;
				}
				if(!CheckEmpty(document.frmCustomer.s_city.value,"city"))
				{
					document.frmCustomer.s_city.focus();
					return false;
				}
				if(!CheckEmpty(document.frmCustomer.s_state.value,"State"))
				{
					document.frmCustomer.s_state.focus();
					return false;
				}
					if(!CheckEmpty(document.frmCustomer.s_postcode.value,"Postcode"))
				{
					document.frmCustomer.s_postcode.focus();
					return false;
				}
				
  				if(document.frmCustomer.s_phone.value == "" )
				{
				confirm("Please fill in your Phone number!");
				document.frmCustomer.s_phone.focus();
				return false;
				}
					
				if(!CheckEmpty(document.frmCustomer.s_phone.value,"Phone Number"))
				{
					document.frmCustomer.s_phone.focus();
					return false;
				}
				
			
				
				if(!IsFax(document.frmCustomer.s_postcode.value ,"postcode"))
				{
						document.frmCustomer.s_postcode.focus();
						return false;
				}
				
				var phonelen = document.frmCustomer.s_phone.value;
			
				 if (phonelen.length < 6)
				 {
						 alert('Phone Number should not be less than 6 digits');
						 document.frmCustomer.s_phone.focus();
						 return false;
				 }
				
					if(!IsFax(document.frmCustomer.s_phone.value ,"Phone Number"))
					{
						document.frmCustomer.s_phone.focus();
						return false;
					}	
					
					}
				
				
					
				if(frm.hear.selectedIndex == 0 )
				{
					alert("Please select your hear!");
					frm.hear.focus();
					return false;
				}
  	
}//end of function

//////////////////////////////////
function ValidateLoginData(frm)
{
	if(!CheckEmpty(frm.txtUserName.value,"Email"))
	{
		frm.txtUserName.focus();
		return false;
	}
	if(frm.txtUserName.value != "")
	{
	if(!check_email(frm.txtUserName.value))
	{
						alert("Please enter a valid email address");
						frm.txtUserName.focus();
						return false;
	}
	}
  	if(!CheckEmpty(frm.txtPassword.value,"Password"))
	{
		frm.txtPassword.focus();
		return false;
	}
  	 
	 var hint = frm.txtPassword.value;
	var lent = hint.length;

  	if(lent < 6 || lent >20 )
	{
		alert("Password should have atleast 6 characters and maximum 20 characters.");
		frm.txtPassword.focus();		
		return false;
	}
	return true;
 }//end of function
 //////////////////////////////
  ////////////////////////////////////
function CheckEditCustomerData(frm)
{
	if(frm.firstname.value == "" )
				{
					alert("Please enter the First Name!");
					frm.firstname.focus();
					return false;
				}
				
				if(!CheckEmpty(frm.firstname.value,"First Name"))
				{
					frm.firstname.focus();
					return false;
				}
	
				var fstname = frm.firstname.value;
				
				if (fstname.length < 2)
				 {
						 alert('First Name should not be in single character');
						 frm.firstname.focus();
						 return false;
				 }
	
				if(!CheckAlphaSpace(frm.firstname.value,"First Name must contain only alphabets: A-Z or a-z")) 
				{ 
				frm.firstname.focus();
				return false;
				}
 
				   if(frm.lastname.value != "" )
					{
						if(frm.lastname.value.charAt(0)==" ")
						{
							alert("First character should not be empty in Last Name");
							frm.lastname.focus();
							return false;
						}
						
						if(!CheckAlphaSpace(frm.lastname.value,"Last Name must contain only alphabets: A-Z or a-z")) 
						{ 
						frm.lastname.focus();
						return false;
						}
					}
	
		/*		if(!CheckEmpty(frm.company.value,"Company Name"))
				{
					frm.company.focus();
					return false;
				}
				*/
				if(frm.b_country.selectedIndex == 0 )
				{
					alert("Please select your Country!");
					frm.b_country.focus();
					return false;
				}
				if(!CheckEmpty(frm.b_address.value,"address"))
				{
					frm.b_address.focus();
					return false;
				}
				if(!CheckEmpty(frm.b_city.value,"city"))
				{
					frm.b_city.focus();
					return false;
				}
 				if(frm.b_state.selectedIndex == 0 )
				{
					alert("Please select your State!");
					frm.b_state.focus();
					return false;
				}
				
  			if(!CheckEmpty(frm.b_postcode.value,"Postcode"))
				{
					frm.b_postcode.focus();
					return false;
				}
				
				if(!IsFax(frm.b_postcode.value ,"postcode"))
				{
						frm.b_postcode.focus();
						return false;
				}	
			
			if(frm.b_phone.value == "" )
				{
				confirm("Please fill in your Phone number!");
				frm.b_phone.focus();
				return false;
				}
					
				if(!CheckEmpty(frm.b_phone.value,"Phone Number"))
				{
					frm.b_phone.focus();
					return false;
				}
				
			
				
				var phonelen = frm.b_phone.value;
			
				 if (phonelen.length < 6)
				 {
						 alert('Phone Number should not be less than 6 digits');
						 frm.b_phone.focus();
						 return false;
				 }
				
					if(!IsFax(frm.b_phone.value ,"Phone Number"))
					{
						frm.b_phone.focus();
						return false;
					}
					
					var radio_choice = false;
					
					// Loop from zero to the one minus the number of radio button selections
					for (counter = 0; counter < frm.billship.length; counter++)
					{
					// If a radio button has been selected it will return true
					// (If not it will return false)
					if (frm.billship[counter].checked)
					radio_choice = true; 
					}
					
					if (!radio_choice)
					{
					// If there were no selections made display an alert box 
					alert("Please select a billing and shipping address.")
					return (false);
					}

				
				if(document.getElementById('extra_content').style.display == "" )
				{
				if(document.frmCustomer.s_country.selectedIndex == 0 )
				{
					alert("Please select your Country!");
					document.frmCustomer.s_country.focus();
					return false;
				}
				if(!CheckEmpty(document.frmCustomer.s_address.value,"address"))
				{
					document.frmCustomer.s_address.focus();
					return false;
				}
				if(!CheckEmpty(document.frmCustomer.s_city.value,"city"))
				{
					document.frmCustomer.s_city.focus();
					return false;
				}
 				if(document.frmCustomer.s_state.selectedIndex == 0 )
				{
					alert("Please select your State!");
					document.frmCustomer.s_state.focus();
					return false;
				}
				
				if(!CheckEmpty(document.frmCustomer.s_postcode.value,"Postcode"))
				{
					document.frmCustomer.s_postcode.focus();
					return false;
				}
				
				if(!IsFax(document.frmCustomer.s_postcode.value ,"postcode"))
				{
						document.frmCustomer.s_postcode.focus();
						return false;
				}
				
				if(document.frmCustomer.s_phone.value == "" )
				{
				confirm("Please fill in your Phone number!");
				document.frmCustomer.s_phone.focus();
				return false;
				}
					
				if(!CheckEmpty(document.frmCustomer.s_phone.value,"Phone Number"))
				{
					document.frmCustomer.s_phone.focus();
					return false;
				}
				
				var phonelen = document.frmCustomer.s_phone.value;
			
				 if (phonelen.length < 6)
				 {
						 alert('Phone Number should not be less than 6 digits');
						 document.frmCustomer.s_phone.focus();
						 return false;
				 }
				
					if(!IsFax(document.frmCustomer.s_phone.value ,"Phone Number"))
					{
						document.frmCustomer.s_phone.focus();
						return false;
					}	
					}
					
				if(frm.hear.selectedIndex == 0 )
				{
					alert("Please select your hear!");
					frm.hear.focus();
					return false;
				}
  	
}//end of function

//////////////////////////////////////////////////////////////////
function CheckBillingData(frm)
{
	if(frm.firstname.value == "" )
				{
					alert("Please enter the First Name!");
					frm.firstname.focus();
					return false;
				}
				
				if(!CheckEmpty(frm.firstname.value,"First Name"))
				{
					frm.firstname.focus();
					return false;
				}
	
				var fstname = frm.firstname.value;
				
				if (fstname.length < 2)
				 {
						 alert('First Name should not be in single character');
						 frm.firstname.focus();
						 return false;
				 }
	
				if(!CheckAlphaSpace(frm.firstname.value,"First Name must contain only alphabets: A-Z or a-z")) 
				{ 
				frm.firstname.focus();
				return false;
				}
 
				   if(frm.lastname.value != "" )
					{
						if(frm.lastname.value.charAt(0)==" ")
						{
							alert("First character should not be empty in Last Name");
							frm.lastname.focus();
							return false;
						}
						
						if(!CheckAlphaSpace(frm.lastname.value,"Last Name must contain only alphabets: A-Z or a-z")) 
						{ 
						frm.lastname.focus();
						return false;
						}
					}
	
	/*			if(!CheckEmpty(frm.company.value,"Company Name"))
				{
					frm.company.focus();
					return false;
				}
				*/
				if(frm.b_country.selectedIndex == 0 )
				{
					alert("Please select your Country!");
					frm.b_country.focus();
					return false;
				}
				if(!CheckEmpty(frm.b_address.value,"address"))
				{
					frm.b_address.focus();
					return false;
				}
				if(!CheckEmpty(frm.b_city.value,"city"))
				{
					frm.b_city.focus();
					return false;
				}
 				if(!CheckEmpty(frm.b_state.value,"State") )
				{
					
					frm.b_state.focus();
					return false;
				}
				
  			if(!CheckEmpty(frm.b_postcode.value,"Postcode"))
				{
					frm.b_postcode.focus();
					return false;
				}
				
				if(!IsFax(frm.b_postcode.value ,"postcode"))
				{
						frm.b_postcode.focus();
						return false;
				}	
			
			if(frm.b_phone.value == "" )
				{
				confirm("Please fill in your Phone number!");
				frm.b_phone.focus();
				return false;
				}
					
				if(!CheckEmpty(frm.b_phone.value,"Phone Number"))
				{
					frm.b_phone.focus();
					return false;
				}
				
			
				
				var phonelen = frm.b_phone.value;
			
				 if (phonelen.length < 6)
				 {
						 alert('Phone Number should not be less than 6 digits');
						 frm.b_phone.focus();
						 return false;
				 }
				
					if(!IsFax(frm.b_phone.value ,"Phone Number"))
					{
						frm.b_phone.focus();
						return false;
					}
					
		/*			var radio_choice = false;
					
					// Loop from zero to the one minus the number of radio button selections
					for (counter = 0; counter < frm.billship.length; counter++)
					{
					// If a radio button has been selected it will return true
					// (If not it will return false)
					if (frm.billship[counter].checked)
					radio_choice = true; 
					}
					
					if (!radio_choice)
					{
					// If there were no selections made display an alert box 
					alert("Please select a billing and shipping address.")
					return (false);
					}
				*/
				if(frm.s_country.selectedIndex == 0 )
				{
					alert("Please select your Country!");
					frm.s_country.focus();
					return false;
				}
				if(!CheckEmpty(frm.s_address.value,"address"))
				{
					frm.s_address.focus();
					return false;
				}
				if(!CheckEmpty(frm.s_city.value,"city"))
				{
					frm.s_city.focus();
					return false;
				}
 				if(!CheckEmpty(frm.s_state.value,"State") )
				{
					
					frm.s_state.focus();
					return false;
				}
				
				
  			if(!CheckEmpty(frm.s_postcode.value,"Postcode"))
				{
					frm.s_postcode.focus();
					return false;
				}
				
				if(!IsFax(frm.s_postcode.value ,"postcode"))
				{
						frm.s_postcode.focus();
						return false;
				}	
			
			if(frm.s_phone.value == "" )
				{
				confirm("Please fill in your Phone number!");
				frm.s_phone.focus();
				return false;
				}
					
				if(!CheckEmpty(frm.s_phone.value,"Phone Number"))
				{
					frm.s_phone.focus();
					return false;
				}
				if(!IsFax(frm.s_phone.value ,"Phone Number"))
					{
						frm.s_phone.focus();
						return false;
					}
				var phonelen = frm.s_phone.value;
			
				 if (phonelen.length < 6)
				 {
						 alert('Phone Number should not be less than 6 digits');
						 frm.s_phone.focus();
						 return false;
				 }
				
					
  	
}//end of function

