// JavaScript Document
startList = function() {
	//code only for IE
	if(!document.body.currentStyle) return;
	var subs = document.getElementsByName('submenu');
	for(var i=0; i<subs.length; i++) {
		var li = subs[i].parentNode;
		if(li && li.lastChild.style) {
			li.onmouseover = function() {
				this.lastChild.style.visibility = 'visible';
			}
			li.onmouseout = function() {
				this.lastChild.style.visibility = 'hidden';
			}
		}
	}
}
window.onload=startList;

function confirmMsg(msg){
	if(!confirm(msg)){
		return false;

	} else {
		return true;

	}
}


function bookmarksite(title, url){
	if (document.all)
	window.external.AddFavorite(url, title);
	else if (window.sidebar)
	window.sidebar.addPanel(title, url, "");
}

function subscribe_validate()
{
	if (!validateEmail(document.frm_subscribe.email_id.value,1,1)) 
	{
		document.frm_subscribe.email_id.focus();
		return false;
	}
	document.frm_subscribe.action="newsletter.php?task=sub";
	document.frm_subscribe.submit();
}

function checkNewsletter(e){
var characterCode
	 if(e && e.which){
	 e = e
	 characterCode = e.which
	 }
	 else{
	 e = event
	 characterCode = e.keyCode
	 }	 
	 if(characterCode == 13){
 	 subscribe_validate();
 	 return false
	 }
return true
}



function SubclearEmail()
{
	if(document.frm_subscribe.email_id.value == "Enter Your Email Address")
	{
		document.frm_subscribe.email_id.value = "";
	}
}

function clearEmail()
{
	if(document.frm_subscribe.email_id.value == "Enter your Email Address to Unsubscribe")
	{
		document.frm_subscribe.email_id.value = "";
	}
}
function mail_unsubscribe()
{
	if (!validateEmail(document.frm_subscribe.email_id.value,1,1)) 
	{
		document.frm_subscribe.email_id.focus();
		return false;
	}
	document.frm_subscribe.action="newsletter.php?task=unsub";
	document.frm_subscribe.submit();
}

var nn4 = (navigator.appName.indexOf("Netscape") > -1 && navigator.appVersion.indexOf("4") > -1) ? true : false

function checkEnter(e){
var characterCode
	 if(e && e.which){
	 e = e
	 characterCode = e.which
	 }
	 else{
	 e = event
	 characterCode = e.keyCode
	 }	 
	 if(characterCode == 13){
 	 mail_unsubscribe();
 	 return false
	 }
return true
}


//Email Validation Script
function validateEmail(addr,man,db) {
	if (addr == '' && man) {
	   if (db) alert('Email address is mandatory');
	   return false;
	}
	var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars.charAt(i),0) > -1) {
		  if (db) alert('Email address contains invalid characters');
		  return false;
	   }
	}
	for (i=0; i<addr.length; i++) {
	   if (addr.charCodeAt(i)>127) {
		  if (db) alert("Email address contains non ascii characters.");
		  return false;
	   }
	}
	var atPos = addr.indexOf('@',0);
	if (atPos == -1) {
	   if (db) alert('Email address must contain an @');
	   return false;
	}
	if (atPos == 0) {
	   if (db) alert('Email address must not start with @');
	   return false;
	}
	if (addr.indexOf('@', atPos + 1) > - 1) {
	   if (db) alert('Email address must contain only one @');
	   return false;
	}
	if (addr.indexOf('.', atPos) == -1) {
	   if (db) alert('Email address must contain a period in the domain name');
	   return false;
	}
	if (addr.indexOf('@.',0) != -1) {
	   if (db) alert('period must not immediately follow @ in email address');
	   return false;
	}
	if (addr.indexOf('.@',0) != -1){
	   if (db) alert('period must not immediately precede @ in email address');
	   return false;
	}
	if (addr.indexOf('..',0) != -1) {
	   if (db) alert('two periods must not be adjacent in email address');
	   return false;
	}
	var suffix = addr.substring(addr.lastIndexOf('.')+1);
	if (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') {
	   if (db) alert('invalid primary domain in email address');
	   return false;
	}
return true;
}

//Function phone validation Script
// Declaring required variables
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()-. ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

function pop_print(url)
{
	var width = 700;
	var height = 600; 
	var left = screen.width/2 - (width/2);
	var top = 100;
	newwindow=window.open(url,'name','scrollbars=yes,resizable=yes,height='+height+',width='+width+',left='+left+',top='+top+'');
	if (window.focus) {newwindow.focus()}
}

function pop_friend(url)
{
	var width = 500;
	var height = 400; 
	var left = screen.width/2 - (width/2);
	var top = 100;
	newwindow=window.open(url,'name','scrollbars=yes,resizable=yes,height='+height+',width='+width+',left='+left+',top='+top+'');
	if (window.focus) {newwindow.focus()}
}

function pop_order(url)
{
	var width = 500;
	var height = 400; 
	var left = screen.width/2 - (width/2);
	var top = 100;
	newwindow=window.open(url,'name','scrollbars=yes,resizable=yes,height='+height+',width='+width+',left='+left+',top='+top+'');
	if (window.focus) {newwindow.focus()}
}


<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->


function checkContact(e){
var characterCode
	 if(e && e.which){
	 e = e
	 characterCode = e.which
	 }
	 else{
	 e = event
	 characterCode = e.keyCode
	 }	 
	 if(characterCode == 13){
 	 mail_form();
 	 return false
	 }
return true
}


function mail_form()
{
	if(document.frm_contact.fname.value == "")
	{
		alert("Please Enter the First Name");
		document.frm_contact.fname.focus();
		return false;
	}
	if(document.frm_contact.lname.value == "")
	{
		alert("Please Enter the Last Name");
		document.frm_contact.lname.focus();
		return false;
	}
//	if(document.frm_contact.company.value == "")
//	{
//		alert("Please Enter the Company");
//		document.frm_contact.company.focus();
//		return false;
//	}
	if (!validateEmail(document.frm_contact.email.value,1,1)) 
	{
		document.frm_contact.email.focus();
		return false;
	}
	if(document.frm_contact.comments.value == "")
	{
		alert("Please Enter the Comment");
		document.frm_contact.comments.focus();
		return false;
	}
	document.frm_contact.action="contact.php";
	document.frm_contact.submit();
}


function reset_form()
{
	document.frm_contact.fname.value = "";
	document.frm_contact.lname.value = "";
	document.frm_contact.company.value = "";
	document.frm_contact.ph1.value = "";
	document.frm_contact.ph2.value = "";
	document.frm_contact.ph3.value = "";
	document.frm_contact.email.value = "";
	document.frm_contact.comments.value = "";
}


function openw(){
	window.location.href = "store_category.php";
}

function openwi(){
	window.location.href = "checkout.php";
}

function openwindow(){
	document.viewcart.action="deletecart.php";
	document.viewcart.submit();
}

function opencart(){
 	var len=document.viewcart.ONE.length;
		   var flag=0;
		  	for(var index=0;index<len;index++)
			{
			quantity = document.viewcart.ONE[index].value;
			stockvalue = document.viewcart.STOCK[index].value;
				if( (quantity == "")  || isNaN(quantity) || (quantity == 0) || (quantity.indexOf("-") >= 0) || (quantity.indexOf(".") >= 0) || (quantity > 65535) )
				{
					
							alert("Type the valid quantity");
							document.viewcart.ONE[index].focus();
							return false;
				}
				
				if(parseInt(quantity) > parseInt(stockvalue)){
						alert("Quantity is out of stock");
						document.viewcart.ONE[index].focus();
						return false;
				}
						
			}
document.viewcart.action="modifycart.php";
document.viewcart.submit();
}

function coupon_check()
{
	if(document.frm_coupon.ccode.value == "")
	{
		alert("Please Enter the Coupon Code to Calculate");
		document.frm_coupon.ccode.focus();
		return false;
	}
	return true;
}

function checkout_validate()
{
	if(document.checkout.fname.value == ""){
		alert("Please Enter the First Name");
		document.checkout.fname.focus();
		return false;
	}
	if(document.checkout.lname.value == ""){
		alert("Please Enter the Last Name");
		document.checkout.lname.focus();
		return false;
	}
	if(document.checkout.addr.value == ""){
		alert("Please Enter the Address");
		document.checkout.addr.focus();
		return false;
	}
	if(document.checkout.city.value == ""){
		alert("Please Enter the City");
		document.checkout.city.focus();
		return false;
	}
	if(document.checkout.state.value == "" && document.checkout.state1.value == "" && document.checkout.chk_state.checked == false){
		alert("Please Select or Enter the State");
		document.checkout.state.focus();
		return false;
	}
	if(document.checkout.country.value == ""){
		alert("Please Select the Country");
		document.checkout.country.focus();
		return false;
	}
	if(document.checkout.zip.value == "" && document.checkout.chk_zip.checked == false){
		alert("Please Enter the Zipcode");
		document.checkout.zip.focus();
		return false;
	}
	phone = document.checkout.phone;
	if (checkInternationalPhone(phone.value)==false)
	{
		alert("Please Enter a Valid Phone Number")
		phone.value=""
		phone.focus()
		return false
	}
	if (!validateEmail(document.checkout.email.value,1,1)) 
	{
		document.checkout.email.focus();
		return false;
	}
	if(!(document.checkout.chkDelivery.checked))
	{
		if(document.checkout.delifname.value == ""){
			alert("Please Enter the First Name");
			document.checkout.delifname.focus();
			return false;
		}
		if(document.checkout.delilname.value == ""){
			alert("Please Enter the Last Name");
			document.checkout.delilname.focus();
			return false;
		}
		if(document.checkout.deliaddr.value == ""){
			alert("Please Enter the Address");
			document.checkout.deliaddr.focus();
			return false;
		}
		if(document.checkout.delicity.value == ""){
			alert("Please Enter the City");
			document.checkout.delicity.focus();
			return false;
		}
		if(document.checkout.delistate.value == "" && document.checkout.delistate1.value == "" && document.checkout.chk_delistate.checked == false){
			alert("Please Select or Enter the State");
			document.checkout.delistate.focus();
			return false;
		}
		if(document.checkout.delicountry.value == ""){
			alert("Please Select the Country");
			document.checkout.delicountry.focus();
			return false;
		}
		if(document.checkout.delizip.value == "" && document.checkout.chk_delizip.checked == false){
			alert("Please Enter the Zipcode");
			document.checkout.delizip.focus();
			return false;
		}
		phone = document.checkout.deliphone;
		if (checkInternationalPhone(phone.value)==false)
		{
			alert("Please Enter a Valid Phone Number")
			phone.value=""
			phone.focus()
			return false
		}
		if (!validateEmail(document.checkout.deliemail.value,1,1)) 
		{
			document.checkout.deliemail.focus();
			return false;
		}
	}
}

var ShippingFname;
var ShippingLname;
var ShippingAddress;
var ShippingCity;
var ShippingState;
var ShippingState1;
var ShippingNoState;
var ShippingCountry;
var ShippingZip;
var ShippingNoZip;
var ShippingPhone;
var ShippingEmail;

function InitSaveVariables(form) {
		ShippingFname = form.fname.value;
		ShippingLname = form.lname.value;
		ShippingAddress = form.addr.value;
        ShippingCity = form.city.value;
		ShippingStateIndex = form.state.selectedIndex;
        ShippingState = form.state[ShippingStateIndex].value;
		ShippingState1 = form.state1.value;
		ShippingNoState = form.chk_state.checked;
		ShippingCountryIndex = form.country.selectedIndex;
		ShippingCountry = form.country[ShippingCountryIndex].value;
        ShippingZip = form.zip.value;
		ShippingNoZip = form.chk_zip.checked;
		ShippingPhone = form.phone.value;
		ShippingEmail = form.email.value;
}
function ShipToBillPerson(form) {
        if (form.chkDelivery.checked) {
                InitSaveVariables(form);
                form.delifname.value = form.fname.value;
                form.delilname.value = form.lname.value;
                form.deliaddr.value = form.addr.value;
                form.delicity.value = form.city.value;
                form.delistate.selectedIndex = form.state.selectedIndex;
				form.delistate1.value = form.state1.value;
				form.chk_delistate.checked = form.chk_state.checked;
                form.delicountry.selectedIndex = form.country.selectedIndex;
                form.delizip.value = form.zip.value;
				form.chk_delizip.checked = form.chk_zip.checked;
                form.deliphone.value = form.phone.value;
                form.deliemail.value = form.email.value;
			 }
       /* else {
                form.fname.value = ShippingFname;
                form.lname.value = ShippingLname;
                form.addr.value = ShippingAddress;
                form.city.value = ShippingCity;
                form.state.selectedIndex = ShippingState;
                form.country.selecIndex = ShippingCountry;
                form.zip.value = ShippingZip;
                form.phone.value = ShippingPhone;
                form.email.value = ShippingEmail;
			}*/
}

function final_check()
{
//	Credit card Validation
	if (document.frm_finalcheckout.Cardname.value == ""){
		alert ("Please Select your Card Name");
		document.frm_finalcheckout.Cardname.focus();
		return false;
	}
	if (document.frm_finalcheckout.CardexpM.value == ""){
		alert ("Please Select the Expiry Month");
		document.frm_finalcheckout.CardexpM.focus();
		return false;
	}
	if (document.frm_finalcheckout.CardexpY.value == ""){
		alert ("Please Select the Expiry Year ");
		document.frm_finalcheckout.CardexpY.focus();
		return false;
	}
	if (document.frm_finalcheckout.Nameoncard.value == ""){
		alert ("Please enter your name as shown on your credit card");
		document.frm_finalcheckout.Nameoncard.focus();
		return false;
	}
	if (document.frm_finalcheckout.cardnumber.value == ""){
		alert ("Please Enter the Card Number");
		document.frm_finalcheckout.cardnumber.focus();
		return false;
	}
	if (isNaN(document.frm_finalcheckout.cardnumber.value) || (document.frm_finalcheckout.cardnumber.value.indexOf('-') > -1)){
		alert ("Card Number is invalid");
		document.frm_finalcheckout.cardnumber.value = "";
		document.frm_finalcheckout.cardnumber.focus();
		return false;
	}
	/*if (document.frm_finalcheckout.cvv2.value == ""){
		alert ("Please Enter the 3 digit code that is on the back of their credit card");
		document.frm_finalcheckout.cvv2.focus();
		return false;
	}*/
}


function checkLogin(e){
var characterCode
	 if(e && e.which){
	 e = e
	 characterCode = e.which
	 }
	 else{
	 e = event
	 characterCode = e.keyCode
	 }	 
	 if(characterCode == 13){
 	 login_validate();
 	 return false
	 }
return true
}

function login_validate()
{
	if(document.frm_login.username.value == "")
	{
		alert("Please Enter the Username");
		document.frm_login.username.focus();
		return false;
	}
	if(document.frm_login.password.value == "")
	{
		alert("Please Enter the Password");
		document.frm_login.password.focus();
		return false;
	}
	document.frm_login.action="members.php";
	document.frm_login.submit();
}

function checkPass(e){
var characterCode
	 if(e && e.which){
	 e = e
	 characterCode = e.which
	 }
	 else{
	 e = event
	 characterCode = e.keyCode
	 }	 
	 if(characterCode == 13){
 	 frgt_validate();
 	 return false
	 }
return true
}

function frgt_validate()
{
	if(document.frm_loginfor.login_user.value == "")
	{
		alert("Please Enter the User Id");
		document.frm_loginfor.login_user.focus();
		return false;
	}
	document.frm_loginfor.action="forget_pass.php";
	document.frm_loginfor.submit();
}

function pop_printorder(url)
{
	var width = 600;
	var height = 600; 
	var left = screen.width/2 - (width/2);
	var top = 100;
	newwindow=window.open(url,'name','scrollbars=yes,resizable=yes,height='+height+',width='+width+',left='+left+',top='+top+'');
	if (window.focus) {newwindow.focus()}
}

function checkUser(e){
var characterCode
	 if(e && e.which){
	 e = e
	 characterCode = e.which
	 }
	 else{
	 e = event
	 characterCode = e.keyCode
	 }	 
	 if(characterCode == 13){
 	 member_validate();
 	 return false
	 }
return true
}

function member_reset()
{
	document.frm_register.fname.value = "";
	document.frm_register.lname.value = "";
	document.frm_register.user_address.value = "";
	document.frm_register.user_city.value = "";
	document.frm_register.state.value = "";
	document.frm_register.country.value = "";
	document.frm_register.zip.value = "";
	document.frm_register.phone.value = "";
	document.frm_register.user_fax.value = "";
	document.frm_register.user_email.value = "";
	document.frm_register.user_id.value = "";
	document.frm_register.password.value = "";
	document.frm_register.repass.value = "";
	document.frm_register.Cardname.value = "";
	document.frm_register.CardexpM.value = "";
	document.frm_register.CardexpY.value = "";
	document.frm_register.Nameoncard.value = "";
	document.frm_register.cardnumber.value = "";
	document.frm_register.cvv2.value = "";
}

function member_validate()
{
	if(document.frm_register.fname.value == "")
	{
		alert("Please Enter the First Name");
		document.frm_register.fname.focus();
		return false;
	}
	if(document.frm_register.lname.value == "")
	{
		alert("Please Enter the Last Name");
		document.frm_register.lname.focus();
		return false;
	}
	if(document.frm_register.user_address.value == "")
	{
		alert("Please Enter the Address");
		document.frm_register.user_address.focus();
		return false;
	}
	if(document.frm_register.user_city.value == "")
	{
		alert("Please Enter the City");
		document.frm_register.user_city.focus();
		return false;
	}
	if(document.frm_register.state.value == "" && document.frm_register.state1.value == "" && document.frm_register.chk_state.checked == false){
		alert("Please Select or Enter the State");
		document.frm_register.state.focus();
		return false;
	}
	if(document.frm_register.country.value == "")
	{
		alert("Please Select the Country");
		document.frm_register.country.focus();
		return false;
	}
	if(document.frm_register.zip.value == "" && document.frm_register.chk_zip.checked == false){
		alert("Please Enter the Zipcode");
		document.frm_register.zip.focus();
		return false;
	}
	phone = document.frm_register.phone;
	if (checkInternationalPhone(phone.value)==false)
	{
		alert("Please Enter a Valid Phone Number")
		phone.value=""
		phone.focus()
		return false
	}
	if (!validateEmail(document.frm_register.user_email.value,1,1)) 
	{
		document.frm_register.user_email.focus();
		return false;
	}
	if(document.frm_register.user_id.value == "")
	{
		alert("Please Enter the User Id");
		document.frm_register.user_id.focus();
		return false;
	}
	var length;
	length = document.frm_register.user_id.value;
	if(length < 4)
	{
		alert("Please Enter the User Id having atleast 4 Characters");
		document.frm_register.user_id.focus();
		return false;
	}
	if(document.frm_register.password.value == "")
	{
		alert("Please Enter the Password");
		document.frm_register.password.focus();
		return false;
	}
	if(document.frm_register.password.value < 4)
	{
		alert("Please Enter the Password having atleast 4 Characters");
		document.frm_register.password.focus();
		return false;
	}
	if(document.frm_register.repass.value == "")
	{
		alert("Please Re-Enter the Password to Confirm");
		document.frm_register.repass.focus();
		return false;
	}
	if(document.frm_register.repass.value < 4)
	{
		alert("Please Enter the Confirm Password having atleast 4 Characters");
		document.frm_register.repass.focus();
		return false;
	}
	if(document.frm_register.password.value != document.frm_register.repass.value)
	{
		alert("Please Enter the Confirm Password as same as Password");
		document.frm_register.repass.value = "";
		document.frm_register.repass.focus();
		return false;
	}
/*	if (document.frm_register.Cardname.value == ""){
		alert ("Please Select your Card Name");
		document.frm_register.Cardname.focus();
		return false;
	}
	if (document.frm_register.CardexpM.value == ""){
		alert ("Please Select the Expiry Month");
		document.frm_register.CardexpM.focus();
		return false;
	}
	if (document.frm_register.CardexpY.value == ""){
		alert ("Please Select the Expiry Year ");
		document.frm_register.CardexpY.focus();
		return false;
	}
	if (document.frm_register.Nameoncard.value == ""){
		alert ("Please enter your name as shown on your credit card");
		document.frm_register.Nameoncard.focus();
		return false;
	}
	if (document.frm_register.cardnumber.value == ""){
		alert ("Please Enter the Card Number");
		document.frm_register.cardnumber.focus();
		return false;
	}
	if (isNaN(document.frm_register.cardnumber.value) || (document.frm_register.cardnumber.value.indexOf('-') > -1)){
		alert ("Card Number is invalid");
		document.frm_register.cardnumber.value = "";
		document.frm_register.cardnumber.focus();
		return false;
	}*/
	document.frm_register.action = "member_register.php";
	document.frm_register.submit();
}


function profile_validate()
{
	if(document.frm_profile.fname.value == "")
	{
		alert("Please Enter the First Name");
		document.frm_profile.fname.focus();
		return false;
	}
	if(document.frm_profile.lname.value == "")
	{
		alert("Please Enter the Last Name");
		document.frm_profile.lname.focus();
		return false;
	}
	if(document.frm_profile.user_address.value == "")
	{
		alert("Please Enter the Address");
		document.frm_profile.user_address.focus();
		return false;
	}
	if(document.frm_profile.user_city.value == "")
	{
		alert("Please Enter the City");
		document.frm_profile.user_city.focus();
		return false;
	}
	if(document.frm_profile.state.value == "" && document.frm_profile.state1.value == "" && document.frm_profile.chk_state.checked == false){
		alert("Please Select or Enter the State");
		document.frm_profile.state.focus();
		return false;
	}
	if(document.frm_profile.country.value == "")
	{
		alert("Please Select the Country");
		document.frm_profile.country.focus();
		return false;
	}
	if(document.frm_profile.zip.value == "" && document.frm_profile.chk_zip.checked == false){
		alert("Please Enter the Zipcode");
		document.frm_profile.zip.focus();
		return false;
	}
	phone = document.frm_profile.phone;
	if (checkInternationalPhone(phone.value)==false)
	{
		alert("Please Enter a Valid Phone Number")
		phone.value=""
		phone.focus()
		return false
	}
	if (!validateEmail(document.frm_profile.user_email.value,1,1)) 
	{
		document.frm_profile.user_email.focus();
		return false;
	}
	if(document.frm_profile.user_id.value == "")
	{
		alert("Please Enter the User Id");
		document.frm_profile.user_id.focus();
		return false;
	}
	var length;
	length = document.frm_profile.user_id.value;
	if(length < 4)
	{
		alert("Please Enter the User Id having atleast 4 Characters");
		document.frm_profile.user_id.focus();
		return false;
	}
	if(document.frm_profile.password.value == "")
	{
		alert("Please Enter the Password");
		document.frm_profile.password.focus();
		return false;
	}
	if(document.frm_profile.password.value < 4)
	{
		alert("Please Enter the Password having atleast 4 Characters");
		document.frm_profile.password.focus();
		return false;
	}
	document.frm_profile.action = "myprofile.php";
	document.frm_profile.submit();
}

function profile_reset()
{
	document.frm_profile.fname.value = "";
	document.frm_profile.lname.value = "";
	document.frm_profile.user_address.value = "";
	document.frm_profile.user_city.value = "";
	document.frm_profile.state.value = "";
	document.frm_profile.country.value = "";
	document.frm_profile.zip.value = "";
	document.frm_profile.phone.value = "";
	document.frm_profile.user_fax.value = "";
	document.frm_profile.user_email.value = "";
	document.frm_profile.user_id.value = "";
	document.frm_profile.password.value = "";
}

function checkProfile(e){
var characterCode
	 if(e && e.which){
	 e = e
	 characterCode = e.which
	 }
	 else{
	 e = event
	 characterCode = e.keyCode
	 }	 
	 if(characterCode == 13){
 	 profile_validate();
 	 return false
	 }
return true
}


function login_user()
{
	if(document.frm_logincheck.username.value == "username")
	{
		document.frm_logincheck.username.value = "";
	}
}
function login_pass()
{
	if(document.frm_logincheck.password.value == "password")
	{
		document.frm_logincheck.password.value = "";
	}
}

function checkUser_Pass(e){
var characterCode
	 if(e && e.which){
	 e = e
	 characterCode = e.which
	 }
	 else{
	 e = event
	 characterCode = e.keyCode
	 }	 
	 if(characterCode == 13){
 	 login_check();
 	 return false
	 }
return true
}

function login_check()
{
	if(document.frm_logincheck.username.value == "")
	{
		alert("Please Enter the Username");
		document.frm_logincheck.username.focus();
		return false;
	}
	if(document.frm_logincheck.password.value == "")
	{
		alert("Please Enter the Password");
		document.frm_logincheck.password.focus();
		return false;
	}
	document.frm_logincheck.action = "members.php";
	document.frm_logincheck.submit();
}

function cart_validate()
{
	document.frm_store.action = "addcart.php";
	document.frm_store.submit();
}
function cart1_validate()
{
	document.frm_store1.action = "addcart.php";
	document.frm_store1.submit();
}


