function ChkNum()
{
	if(event.keyCode != 0)
	{
		if (event.keyCode==36 || event.keyCode==37 || event.keyCode==39  || event.keyCode==45|| event.keyCode==46)
		{
			event.returnValue = true;
			return;
		}
		
		if(event.keyCode == 9 || event.keyCode == 16 || event.keyCode == 13 || event.keyCode == 8) 
		{
			event.returnValue = true;
			return;
		}

		if (event.keyCode < 48 || event.keyCode > 57) {
			event.returnValue = false;
			return;
		}
	}
}





function ups_view()
{

	var Frm = document.upsform

	if (Frm.ups.value == "") { alert("Please enter correct tracking number."); Frm.ups.focus(); return false;}


	var u = "http://wwwapps.ups.com/WebTracking/processInputRequest?HTMLVersion=5.0&sort_by=status&tracknums_displayed=1&TypeOfInquiryNumber=T&loc=en_us&AgreeToTermsAndConditions=yes&InquiryNumber1="+document.upsform.ups.value+"&NumberDetailLines=1";
	w = window.open(u, "WEBMAIL" ,"width=800,height=600,titlebar=no,status=no,toolbar=no,resizable=no,scrollbars=1, menubar=no")
}

function Login_Check()
{
	var Frm = document.LoginForm ;

	if (Frm.Mem_Id.value == "") { alert("Please retype User Id."); Frm.Mem_Id.focus(); return false;}

	var e_mail=document.LoginForm.Mem_Id.value;	
    if(e_mail.indexOf("@")=="-1" || e_mail.indexOf(".")=="-1"){
		alert("Please type email address correctly.");
		document.LoginForm.Mem_Id.value="";
		document.LoginForm.Mem_Id.focus();
		return false;
    }


	if (Frm.Mem_Pwd.value == "") { alert("Please retype Password."); Frm.Mem_Pwd.focus(); return false;}
}

function Pwd_Check()
{
	var Frm = document.LoginForm ;

	if (Frm.Mem_Id.value == "") { alert("Please retype User Id."); Frm.Mem_Id.focus(); return false;}

	var e_mail=document.LoginForm.Mem_Id.value;	
    if(e_mail.indexOf("@")=="-1" || e_mail.indexOf(".")=="-1"){
		alert("Please type email address correctly.");
		document.LoginForm.Mem_Id.value="";
		document.LoginForm.Mem_Id.focus();
		return false;
    }

}


function MemberAd_Check()
{
	var Frm = document.Mem_From;

	if (Frm.txtFirstName.value == "") { alert("Please retype First Name."); Frm.txtFirstName.focus(); return false;}
	if (Frm.txtLastName.value == "") { alert("Please retype Last Name."); Frm.txtLastName.focus(); return false;}
	if (Frm.phone.value == "") { alert("Please retype Phone No."); Frm.phone.focus(); return false;}
	if (Frm.cdUserId.value == "") { alert("Please type Email Address."); Frm.cdUserId.focus(); return false;}


	var e_mail=document.Mem_From.cdUserId.value;	
    if(e_mail.indexOf("@")=="-1" || e_mail.indexOf(".")=="-1"){
		alert("Please type email address correctly.");
		document.Mem_From.cdUserId.value="";
		document.Mem_From.cdUserId.focus();
		return false;
    }


	if (Frm.cdUserIdOk.value == "") { alert("Please type Email Address."); Frm.cdUserIdOk.focus(); return false;}


	var e_mail=document.Mem_From.cdUserIdOk.value;	
    if(e_mail.indexOf("@")=="-1" || e_mail.indexOf(".")=="-1"){
		alert("Please type email address correctly.");
		document.Mem_From.cdUserIdOk.value="";
		document.Mem_From.cdUserIdOk.focus();
		return false;
    }

	
	if (Frm.cdUserId.value != Frm.cdUserIdOk.value)
	{
		alert("Retype Email.")
		Frm.cdUserId.value = "";
		Frm.cdUserIdOk.value = "";
		Frm.cdUserId.focus();
		return false;
	}
	

	if (Frm.cdPasswd.value == "") { alert("Please type Password."); Frm.cdPasswd.focus(); return false;}
	if (Frm.cdPasswd1.value == "") { alert("Please retype Password."); Frm.cdPasswd1.focus(); return false;}

	if (Frm.cdPasswd.value != Frm.cdPasswd1.value)
	{
		alert("Retype Password.")
		Frm.cdPasswd.value = "";
		Frm.cdPasswd1.value = "";
		Frm.cdPasswd.focus();
		return false;
	}



	if (Frm.txtAddress1.value == "") { alert("Please retype Address."); Frm.txtAddress1.focus(); return false;}
	if (Frm.txtCity.value == "") { alert("Please retype City."); Frm.txtCity.focus(); return false;}
	if (Frm.txtZipCode.value == "") { alert("Please retype ZipCode."); Frm.txtZipCode.focus(); return false;}
	
}


function MemberUp_Check()
{
	var Frm = document.Mem_From;

	if (Frm.txtFirstName.value == "") { alert("Please retype First Name."); Frm.txtFirstName.focus(); return false;}
	if (Frm.txtLastName.value == "") { alert("Please retype Last Name."); Frm.txtLastName.focus(); return false;}
	if (Frm.phone.value == "") { alert("Please retype Phone No."); Frm.phone.focus(); return false;}

	

	if (Frm.cdPasswd.value == "") { alert("Please type Password."); Frm.cdPasswd.focus(); return false;}
	if (Frm.cdPasswd1.value == "") { alert("Please retype Password."); Frm.cdPasswd1.focus(); return false;}

	if (Frm.cdPasswd.value != Frm.cdPasswd1.value)
	{
		alert("Retype Password.")
		Frm.cdPasswd.value = "";
		Frm.cdPasswd1.value = "";
		Frm.cdPasswd.focus();
		return false;
	}



	if (Frm.txtAddress1.value == "") { alert("Please retype Address."); Frm.txtAddress1.focus(); return false;}
	if (Frm.txtCity.value == "") { alert("Please retype City."); Frm.txtCity.focus(); return false;}
	if (Frm.txtZipCode.value == "") { alert("Please retype ZipCode."); Frm.txtZipCode.focus(); return false;}
	
}


function Reset_Click(thisForm)
{
	thisForm.reset();
}


function  Image_Popup(Img_Url)
{
	var Img_Url = document.all.Main_Img.src

	window.open("productzoom.asp?Img_Url="+Img_Url+"","popup","left=0, top=0, width=120, height=100")
}


function  ImagePopup(Img_Url)
{

	window.open("productzoom.asp?Img_Url="+Img_Url+"","popup","left=0, top=0, width=120, height=100")

}


function  Main_Image(Img_Url)
{
	document.all["Main_Img"].src = Img_Url;
}

function WishList_Check()
{
	var Frm = document.Pr_Detail;

	if (Frm.QTY.value == "") { alert("Please retype QTY."); Frm.QTY.focus(); return false;}

	Frm.action = "WishListAction.asp";

	Frm.submit();
}


function WishlistDel(Number)
{
	var delte
	delte=confirm("Do you want to delete Wish List?");
	if (delte != false)
	{
		location.href = "/Product/WishListAction.asp?Number="+Number+"&WishList_Type=WishDel";
	}
}

function ProductLi()
{
	location.href = "/"
}

function WishListCart()
{
	var Frm = document.WishForm;

	Frm.action="/Product/WishListAction.asp";

	Frm.submit();
}



function CheckOutLi()
{
	location.href = "/account/checkout.asp"
}


function Cart_Del(product_number,product_item)
{
	location.href="CartAction.asp?product_item="+product_item+"&product_number="+product_number+"&Cart_Type=CartDel";
}


function CheckOut_Check()
{
	var Frm = document.Pr_Detail;

	if (Frm.QTY.value == "") { alert("Please retype QTY."); Frm.QTY.focus(); return false;}

	Frm.Url_Type.value = "Checkout"

	Frm.action = "/account/CartAction.asp";

	Frm.submit();
}


function Cart_Check(PID, cdCode, Number)
{
	var Frm = document.Pr_Detail;

	Frm.PID.value = PID;
	Frm.cdCode.value = cdCode;
	Frm.Number.value = Number;
	Frm.Url_Type.value = "Cart";

	Frm.action = "/account/CartAction.asp";

	Frm.submit();
}




function Size_Price(PID, cdCode, DisPlayCode, DisPlaySubCode)
{
	var Frm = document.Pr_Detail;

	var Size_Pr = Frm.Size.value;

	location.href = "Product_detail.asp?PID="+PID+"&DisPlayCode="+DisPlayCode+"&DisPlaySubCode="+DisPlaySubCode+"&ItemCode="+cdCode+"&Size_Price="+Size_Pr+""

}


function CheckOutOrder()
{
	var Frm = document.CheckOutForm


	if (Frm.ShipFirstName.value == "") { alert("Please retype Shipping First Name."); Frm.ShipFirstName.focus(); return false;}
	if (Frm.ShipLastName.value == "") { alert("Please retype Shipping Last Name."); Frm.ShipLastName.focus(); return false;}
	if (Frm.Shipphone.value == "") { alert("Please retype Shipping Phone No."); Frm.Shipphone.focus(); return false;}
	if (Frm.ShipAddress1.value == "") { alert("Please retype Shipping Address."); Frm.ShipAddress1.focus(); return false;}
	if (Frm.ShipCity.value == "") { alert("Please retype Shipping City."); Frm.ShipCity.focus(); return false;}
	if (Frm.ShipZipCode.value == "") { alert("Please retype Shipping Phone No."); Frm.ShipZipCode.focus(); return false;}



	if (Frm.BILLFirstName.value == "") { alert("Please retype BILLING First Name."); Frm.BILLFirstName.focus(); return false;}
	if (Frm.BILLLastName.value == "") { alert("Please retype BILLING Last Name."); Frm.BILLLastName.focus(); return false;}
	if (Frm.BILLphone.value == "") { alert("Please retype BILLING Phone No."); Frm.BILLphone.focus(); return false;}
	if (Frm.BILLAddress1.value == "") { alert("Please retype BILLING Address."); Frm.BILLAddress1.focus(); return false;}
	if (Frm.BILLCity.value == "") { alert("Please retype BILLING City."); Frm.BILLCity.focus(); return false;}
	if (Frm.BILLZipCode.value == "") { alert("Please retype BILLING Phone No."); Frm.BILLZipCode.focus(); return false;}

	if (Frm.nmCardNum1.value == "") { alert("Please retype Card No."); Frm.nmCardNum1.focus(); return false;}
	if (Frm.nmCardNum2.value == "") { alert("Please retype Card No."); Frm.nmCardNum2.focus(); return false;}
	if (Frm.nmCardNum3.value == "") { alert("Please retype Card No."); Frm.nmCardNum3.focus(); return false;}
	if (Frm.nmCardNum4.value == "") { alert("Please retype Card No."); Frm.nmCardNum4.focus(); return false;}
	if (Frm.cvv.value == "") { alert("Please retype CVV."); Frm.cvv.focus(); return false;}
	

	Frm.action = "/account/OrderAction.asp";

	Frm.submit();
}


function autotab1(I)
{
	if (document.CheckOutForm.cdBillingType.value != "AMEX")
	{
		if (I == 4)
		{
			document.CheckOutForm.nmCardNum2.focus();
		}
	}
}

function autotab2(I)
{
	if (document.CheckOutForm.cdBillingType.value != "AMEX")
	{
		if (I == 4)
		{
			document.CheckOutForm.nmCardNum3.focus();
		}
	}
	
}

function autotab3(I)
{

	if (document.CheckOutForm.cdBillingType.value != "AMEX")
	{
		if (I == 4)
		{
			document.CheckOutForm.nmCardNum4.focus();
		}
	}
	
	
}


function OrderHistoryLi()
{
	history.go(-1);
}

function OrderPrint(OrderNo, OrderPID)
{
	window.open("order_print.asp?OrderNo="+OrderNo+"&OrderPID="+OrderPID+"","OrderPrint","width=645, height=500, Left=0, Top=0, titlebar=no,status=no,toolbar=no,resizable=no,scrollbars=1, menubar=no")
}


function goUrl(Url)
{
	location.href = Url;
}


function Search_Check()
{
	var Frm = document.SearchFrom

	if (Frm.KeySearch.value == "") { alert("Please retype Search."); Frm.KeySearch.focus(); return false;}

	Frm.submit();
}
