function ValidateForgotPassword()
{
    frm=document.form1;
    if (trim(frm.txtusername.value)=="" && trim(frm.txtemailId.value)=="")
    {	
        alert("Enter User Name /Email Id.");
        frm.txtusername.focus();
        return false
    }
    if (trim(frm.txtusername.value)!="")
    {
         if (!checkAuthentication(frm.txtusername.value))
        {
          alert("Enter valid Username.");
          frm.txtusername.focus();
          return false;
        }
    } 
    if (trim(frm.txtemailId.value)!="")
    {
         if(!checkEmailAddress(frm.txtemailId.value))
        {
            alert("Enter valid Email Id.");
            frm.txtemailId.focus()
            return false
        }
    }
    return true;
}

function ValidateCaretRates()
{
var frm = document.form1;

    if(document.getElementById('drpCarets').value=="")
    {
        alert("Select carets.");
        document.getElementById('drpCarets').focus();
        return false
    }
    if (document.getElementById('txtRates').value=="")
    {
        alert("Enter valid rates.");
        document.getElementById('txtRates').focus();
        return false
    }
    else if(!isFloat(document.getElementById('txtRates').value))
    {
        alert("Enter valid rates.");
        document.getElementById('txtRates').focus();
        return false
    }
    return true;
}

function Validatediscount()
{
var frm = document.form1;
    if(document.getElementById('drpCarets').value=="")
    {
        alert("Select Category.");
        document.getElementById('drpCarets').focus();
        return false
    }
    if (document.getElementById('txtpercent').value=="")
    {
        alert("Enter Discount Percent.");
        document.getElementById('txtpercent').focus();
        return false
    }
    else if(!isFloat(document.getElementById('txtpercent').value))
    {
        alert("Enter valid Discount Percent.");
        document.getElementById('txtpercent').focus();
        return false
    }
    return true;
}


//Validate Date.
function ValidateDate()
{
    frm=document.form1;
    if (document.getElementById('txtStart').value!="")
    {
        if(!checkdate(document.getElementById('txtStart').value))
        {
            alert("Enter valid start date");
            frm.txtStart.focus();
            return false
        }
    }
   
    if (document.getElementById('txtEnd').value!="")
    {
        if(!checkdate(document.getElementById('txtEnd').value))
        {
            alert("Enter valid end date");
            frm.txtStart.focus();
            return false
        }
    }
   
}


//Validate user change password
function ValidateChangePassword()
{
    frm=document.form1;
    if (document.getElementById('txtPwd').value=="")
    {
        alert("Enter Password.");
        document.getElementById('txtPwd').focus();
        return false
    }
    else if (!checkAuthentication(document.getElementById('txtPwd').value))
    {
        alert("Enter Valid Password.");
        document.getElementById('txtPwd').focus();
        return false;
    }
    if (document.getElementById('txtNew').value=="")
    {
        alert("Enter New Password.");
        document.getElementById('txtNew').focus();
        return false    
    }
    else if (!checkAuthentication(document.getElementById('txtNew').value))
    {
        alert("Enter Valid Password.");
        document.getElementById('txtNew').focus();
        return false;
    }
    if (document.getElementById('txtNew').value != document.getElementById('txtConfirm').value)
    {
        alert("Confirm Password Should Be Same As New Password.");
        document.getElementById('txtConfirm').focus();
        return false
    }
    return true;
}

// Validate Edit Info

function ValidateEditInfo()
{
    frm=document.form1;
    if (trim(frm.txtPwd.value)=="")
    {
        alert("Enter Old Password.");
        frm.txtPwd.focus();
        return false
    }
    else if (!checkAuthentication(frm.txtPwd.value))
    {
        alert("Enter Valid Old Password.");
        frm.txtPwd.focus();
        return false;
    }
    if (trim(frm.txtNew.value)=="")
    {
        alert("Enter New Password.");
        frm.txtNew.focus();
        return false    
    }
    else if (!checkAuthentication(frm.txtNew.value))
    {
        alert("Enter Valid New Password.");
        frm.txtNew.focus();
        return false;
    }
    if (trim(frm.txtNew.value)!=trim(frm.txtConfirm.value))
    {
        alert("Confirm Password Should Be Same As New Password.");
        frm.txtConfirm.focus();
        return false
    }
    return true;
}

function ValidateCustomerEditInfo()
{
    frm=document.form1;
    if (document.getElementById('drpSalutation').value=="")
    {
        alert("Select salutation.");
        frm.drpSalutation.focus();
        return false
    }
    if (trim(frm.txtfname.value)=="")
    {
        alert("Enter First name.");
        frm.txtfname.focus();
        return false
    }
    else if(!checkname(frm.txtfname.value))
    {
        alert("Enter valid First name.");
        frm.txtfname.focus();
        return false
    }
     if (trim(frm.txtMname.value)!="")
    {
        if(!checkname(frm.txtMname.value))
        {
            alert("Enter valid middle name.");
            frm.txtMname.focus();
            return false
        }
    }
   
     if (trim(frm.txtLname.value)=="")
    {
        alert("Enter last name.");
        frm.txtLname.focus();
        return false    
    }
    else if(!checkname(frm.txtLname.value))
    {
        alert("Enter valid last name.");
        frm.txtLname.focus();
        return false
    }
   
    if(document.getElementById('drpGender').Value=="")
    {
        alert("Select gender");
        frm.drpGender.focus();
        return false
    }
    if (trim(frm.txtaddress.value)=="")
    {
        alert("Enter address.");
        frm.txtaddress.focus();
        return false;
    }
    if (trim(frm.txtCity.value)=="")
    {
        alert("Enter city.");
        frm.txtCity.focus();
        return false
    }
    if(!checkcity(frm.txtCity.value))
    {
        alert("Enter valid city.");
        frm.txtCity.focus();
        return false
    }
    if (trim(frm.txtstate.value)=="")
    {
        alert("Enter State.");
        frm.txtstate.focus();
        return false
    }
    if(!checkcity(frm.txtstate.value))
    {
        alert("Enter valid State.");
        frm.txtstate.focus();
        return false
    }
     if (trim(frm.txtCountry.value)=="")
    {
        alert("Enter country.");
        frm.txtCountry.focus();
        return false
    }
    if(!checkcity(frm.txtCountry.value))
    {
        alert("Enter valid Country.");
        frm.txtCountry.focus();
        return false
    }
     if (trim(frm.txtmailId.value)=="")
    {
        alert("Enter Email Id.");
        frm.txtmailId.focus();
        return false
    }
    if(!checkEmailAddress(frm.txtmailId.value))
    {
        alert("Enter valid Email Id.");
        frm.txtmailId.focus()
        return false
    }
     if (trim(frm.txtPhoneNo.value)=="")
    {
        alert("Enter phone number.");
        frm.txtPhoneNo.focus();
        return false
    }
    if(!checkPhone(frm.txtPhoneNo.value))
    {
        alert("Enter valid phone number.");
        frm.txtPhoneNo.focus();
        return false
    }
     if (trim(frm.txtzipcode.value)=="")
    {
        alert("Enter Zipcode.");
        frm.txtzipcode.focus();
        return false
    }
   else if(!inValidCharZip(frm.txtzipcode.value))
    {
        alert("Enter valid Zipcode.");
        frm.txtzipcode.focus();
        return false
    }   
    return true;
}

function ValidateRegistrationDetails()
{
    frm=document.form1;
//    if (document.getElementById('drpSalutation').value=="")
//    {
//        alert("Select salutation.");
//        frm.drpSalutation.focus();
//        return false
//    }
    if (trim(frm.txtfname.value)=="")
    {
        alert("Enter First name.");
        frm.txtfname.focus();
        return false
    }
    if(!checkname(frm.txtfname.value))
    {
        alert("Enter valid First name.");
        frm.txtfname.focus();
        return false
    }
    else if (trim(frm.txtMname.value)!="")
    {
          if(!checkname(frm.txtMname.value))
        {
            alert("Enter valid middle name.");
            frm.txtMname.focus();
            return false
        }
    }
   
     if (trim(frm.txtLname.value)=="")
    {
        alert("Enter  last name.");
            frm.txtLname.focus();
            return false 
    }
    else  if(!checkname(frm.txtLname.value))
        {
            alert("Enter valid last name.");
            frm.txtLname.focus();
            return false
        }
//    if(trim(document.getElementById('drpGender').value)=="")
//    {
//        alert("Select gender");
//        frm.drpGender.focus();
//        return false
//    }
    if (trim(frm.txtaddress.value)=="")
    {
        alert("Enter address.");
        frm.txtaddress.focus();
        return false;
    }
    if (trim(frm.txtCity.value)=="")
    {
        alert("Enter city.");
        frm.txtCity.focus();
        return false
    }
    if(!checkcity(frm.txtCity.value))
    {
        alert("Enter valid city.");
        frm.txtCity.focus();
        return false
    }
    if (trim(frm.txtstate.value)=="")
    {
        alert("Enter State.");
        frm.txtstate.focus();
        return false
    }
    if(!checkcity(frm.txtstate.value))
    {
        alert("Enter valid State.");
        frm.txtstate.focus();
        return false
    }
     if (trim(frm.txtzipcode.value)=="")
    {
        alert("Enter Zipcode.");
        frm.txtzipcode.focus();
        return false
    }
    if(!inValidCharZip(frm.txtzipcode.value))
    {
        alert("Enter valid Zipcode.");
        frm.txtzipcode.focus();
        return false
    }   
    
    
//     if (trim(frm.txtCountry.value)=="")
//    {
//        alert("Enter country.");
//        frm.txtCountry.focus();
//        return false
//    }
//    if(!checkcity(frm.txtCountry.value))
//    {
//        alert("Enter valid Country.");
//        frm.txtCountry.focus();
//        return false
//    }
     if (trim(frm.txtmailId.value)=="")
    {
        alert("Enter Email Id.");
        frm.txtmailId.focus();
        return false
    }
    if(!checkEmailAddress(frm.txtmailId.value))
    {
        alert("Enter valid Email Id.");
        frm.txtmailId.focus()
        return false
    }
     if (trim(frm.txtPhoneNo.value)=="")
    {
        alert("Enter phone number.");
        frm.txtPhoneNo.focus();
        return false
    }
    if(!checkPhone(frm.txtPhoneNo.value))
    {
        alert("Enter valid phone number.");
        frm.txtPhoneNo.focus();
        return false
    } 
    
  
    if(document.getElementById('trusername').style.display=="")
    {
        if (trim(frm.txtusername.value)=="")
        {	
            alert("Enter User Name.");
            frm.txtusername.focus();
            return false;
        }
        if (!checkAuthentication(frm.txtusername.value))
        {
          alert("Enter valid Username.");
          frm.txtusername.focus();
          return false;
        }
    } 
    if(document.getElementById('trpassword').style.display!="none")
    {
        if (trim(frm.txtpassword.value)=="")
        {	
            alert("Enter Password.");
            frm.txtpassword.focus();
            return false
        }
        if (!checkPwd(frm.txtpassword.value))
        {
          alert("Enter valid Password.");
          frm.txtpassword.focus();
          return false;
        }
    }
    if(document.getElementById('trconfirmpassword').style.display!="none")
    {
        if (trim(frm.txtconfirmpassword.value)=="")
        {	
            alert("Enter Confirm Password.");
            frm.txtconfirmpassword.focus();
            return false
        }
    //    if (!checkPwd(frm.txtconfirmpassword.value))
    //    {
    //      alert("Enter valid confirm Password.");
    //      frm.txtconfirmpassword.focus();
    //      return false;
    //    }
        if (trim(frm.txtconfirmpassword.value) != trim(frm.txtpassword.value))
        {
          alert("Password and confirm Password does not match.");
          frm.txtconfirmpassword.focus();
          return false;
        }
    }
  return true;
}

// Validate Login-----------------------------------
 
function ValidateLogindetail()
{
  frm=document.form;
  if (document.getElementById('txtUsername').value=="")
	{	
		alert("Enter User Name.");
		document.getElementById('txtUsername').focus();
		return false
	}
	else if (!checkAuthentication(document.getElementById('txtUsername').value))
	{
      alert("Enter valid Username.");
	  document.getElementById('txtUsername').focus();
      return false;
    } 
	if (document.getElementById('txtPwd').value=="")
	{	
		alert("Enter Password.");
		document.getElementById('txtPwd').focus();
		return false
	}
    else if (!checkAuthentication(document.getElementById('txtPwd').value))
    {
      alert("Enter valid Password.");
  	  document.getElementById('txtPwd').focus();
      return false;
    }
   return true;
}



function OpenEachCustomersWishDetails()
{
    window.open('viewwishlistdetails.aspx')
}

function checkLogin()
{
    frm = document.form;
    
    if(frm.hdnLoginUser.value=="")
    {
       alert("Please login first before viewing your shopping cart");
       return false;
    }
    return true;
}

function checkLoginforshopping()
{
    frm = document.form;
    
    if(frm.hdnLoginUser.value=="")
    {
       alert("Please login first before adding the selected items to your shopping cart");
       return false;
    }
    return true;
}

function checkLoginforWishCart()
{
    frm = document.form;
    
    if(frm.hdnLoginUser.value=="")
    {
       alert("Please login first before adding the selected items to your wish list");
       return false;
    }
    return true;
}

function checkLoginPay()
{
    frm = document.form1;
    
    if(frm.hdnLoginUser.value=="")
    {
       alert("Please login first before viewing your shopping cart");
       return false;
    }
    if(frm.txtTrnNo.value=="")
    {
        alert("Please enter transaction number.");
        frm.txtTrnNo.focus();
       return false;
    }
    return true;
}

function checkSearch()
{
    frm = document.form;
    
    if(trim(frm.txtSearch.value)=="")
    {
       alert("Please enter the search string.");
       frm.txtSearch.focus();
        return false;
    }
    return true;
}

function openWindow(ProductBarCodeNumber)
{
    var opt = '';
   
    
    if (window.showModalDialog) {
        opt = 'dialogWidth:348px; dialogHeight:560px; scroll:off; channelmode:yes; closed:no; status:no; titlebar:no; directories=no; unadorned:yes; help:no;';
         window.showModalDialog("wishlistdetails.aspx?ProductCode="+ProductBarCodeNumber,'',opt); 
    } 
    else
    {
         opt = 'dialogWidth:348px; dialogHeight:560px; scroll:off; channelmode:yes; closed:no; status:no; titlebar:no; directories=no; unadorned:yes; help:no;';
        window.open("wishlistdetails.aspx?ProductCode="+ProductBarCodeNumber,'',opt);
    }
} 


function ValidateAdvacedSearch()

{

    if(!checkAlphaNum(document.getElementById('txtproductname').value))

    {

        alert("Please enter valid string.");

        document.getElementById('txtproductname').focus();

        return false

    }

    return true;

}




function Show()
{
 var frm=document.form1;
 if(document.getElementById('chkStatus').checked==true)
 {

   
     frm.drpSSalutation.value= frm.drpSalutation.value;
     frm.txtSFName.value= frm.txtfname.value;
     frm.txtSMName.value=frm.txtMname.value;
     frm.txtSLName.value=frm.txtLname.value;
     frm.txtSState.value= frm.txtstate.value;
     frm.txtSCountry.value=frm.txtCountry.value;
     frm.txtSCity.value=frm.txtCity.value;
     frm.txtSEmailID.value= frm.txtmailId.value;
     frm.txtSAddr.value=frm.txtaddress.value;
     frm.txtSPhoneNo.value=frm.txtPhoneNo.value;
      frm.txtzipcode.value=frm.txtbzipcode.value;
    
 
 } 
 else
 {
 
     frm.drpSSalutation.value= "";
     frm.txtSFName.value=  "";
     frm.txtSMName.value= "";
     frm.txtSLName.value= "";
     frm.txtSState.value=  "";
     frm.txtSCountry.value= "";
     frm.txtSCity.value= "";
     frm.txtSEmailID.value=  "";
     frm.txtSAddr.value= "";
     frm.txtSPhoneNo.value= "";
    
         
 }
 return true;
}

function chkCheckOut()
{
    var frm=document.form1;
//    if (document.getElementById('drpSalutation').value=="")
//    {
//        alert("Select billing salutation.");
//        frm.drpSalutation.focus();
//        return false
//    }
    if (trim(frm.txtfname.value)=="")
    {
        alert("Enter billing First name.");
        frm.txtfname.focus();
        return false
    }
    else if(!checkname(frm.txtfname.value))
    {
        alert("Enter valid billing First name.");
        frm.txtfname.focus();
        return false
    }
    if (trim(frm.txtMname.value)!="")
    {
        if(!checkname(frm.txtMname.value))
        {
            alert("Enter valid billing middle name.");
            frm.txtMname.focus();
            return false
        }
    }
     if (trim(frm.txtLname.value)=="")
    {
        alert("Enter billing last name.");
        frm.txtLname.focus();
        return false    
    }
     if(!checkname(frm.txtLname.value))
    {
        alert("Enter valid billing last name.");
        frm.txtLname.focus();
        return false
    }
   
   
    if (trim(frm.txtaddress.value)=="")
    {
        alert("Enter billing address.");
        frm.txtaddress.focus();
        return false;
    }
    if (trim(frm.txtCity.value)=="")
    {
        alert("Enter billing city.");
        frm.txtCity.focus();
        return false
    }
    if(!checkcity(frm.txtCity.value))
    {
        alert("Enter valid billing city.");
        frm.txtCity.focus();
        return false
    }
    if (trim(frm.txtstate.value)=="")
    {
        alert("Enter billing State.");
        frm.txtstate.focus();
        return false
    }
    if(!checkcity(frm.txtstate.value))
    {
        alert("Enter valid billing State.");
        frm.txtstate.focus();
        return false
    }
     if (trim(frm.txtbzipcode.value)=="")
    {
        alert("Enter Zipcode.");
        frm.txtbzipcode.focus();
        return false
    }
    if(!inValidCharZip(frm.txtbzipcode.value))
    {
        alert("Enter valid Zipcode.");
        frm.txtbzipcode.focus();
        return false
    }    
     if (trim(frm.txtCountry.value)=="")
    {
        alert("Enter billing country.");
        frm.txtCountry.focus();
        return false
    }
    if(!checkcity(frm.txtCountry.value))
    {
        alert("Enter valid billing Country.");
        frm.txtCountry.focus();
        return false
    }
     if (trim(frm.txtmailId.value)=="")
    {
        alert("Enter billing Email Id.");
        frm.txtmailId.focus();
        return false
    }
    if(!checkEmailAddress(frm.txtmailId.value))
    {
        alert("Enter valid billing Email Id.");
        frm.txtmailId.focus()
        return false
    }
     if (trim(frm.txtPhoneNo.value)=="")
    {
        alert("Enter billing phone number.");
        frm.txtPhoneNo.focus();
        return false
    }
 
    
//    if (document.getElementById('drpSSalutation').value=="")
//    {
//        alert("Select shipping salutation.");
//        frm.drpSSalutation.focus();
//        return false
//    }
    if (trim(frm.txtSFName.value)=="")
    {
        alert("Enter shipping First name.");
        frm.txtSFName.focus();
        return false
    }
    else if(!checkname(frm.txtSFName.value))
    {
        alert("Enter valid shipping First name.");
        frm.txtSFName.focus();
        return false
    }
     if (trim(frm.txtSMName.value)!="")
    {
         if(!checkname(frm.txtSMName.value))
        {
            alert("Enter valid shipping middle name.");
            frm.txtSMName.focus();
            return false
        }
    }
    
     if (trim(frm.txtSLName.value)=="")
    {
        alert("Enter shipping last name.");
        frm.txtSLName.focus();
        return false    
    }
     if(!checkname(frm.txtSLName.value))
    {
        alert("Enter valid shipping last name.");
        frm.txtSLName.focus();
        return false
    }
   
   
    if (trim(frm.txtSAddr.value)=="")
    {
        alert("Enter shipping address.");
        frm.txtSAddr.focus();
        return false;
    }
    if (trim(frm.txtSCity.value)=="")
    {
        alert("Enter shipping city.");
        frm.txtSCity.focus();
        return false
    }
    if(!checkcity(frm.txtSCity.value))
    {
        alert("Enter valid shipping city.");
        frm.txtSCity.focus();
        return false
    }
    if (trim(frm.txtSState.value)=="")
    {
        alert("Enter shipping State.");
        frm.txtSState.focus();
        return false
    }
    if(!checkcity(frm.txtSState.value))
    {
        alert("Enter valid shipping State.");
        frm.txtSState.focus();
        return false
    }
     if (trim(frm.txtzipcode.value)=="")
    {
        alert("Enter Zipcode.");
        frm.txtzipcode.focus();
        return false
    }
    if(!inValidCharZip(frm.txtzipcode.value))
    {
        alert("Enter valid Zipcode.");
        frm.txtzipcode.focus();
        return false
    }        
     if (trim(frm.txtSCountry.value)=="")
    {
        alert("Enter shipping country.");
        frm.txtSCountry.focus();
        return false
    }
    if(!checkcity(frm.txtSCountry.value))
    {
        alert("Enter valid shipping Country.");
        frm.txtSCountry.focus();
        return false
    }
     if (trim(frm.txtSEmailID.value)=="")
    {
        alert("Enter shipping Email Id.");
        frm.txtSEmailID.focus();
        return false
    }
    if(!checkEmailAddress(frm.txtSEmailID.value))
    {
        alert("Enter valid shipping Email Id.");
        frm.txtSEmailID.focus()
        return false
    }
     if (trim(frm.txtSPhoneNo.value)=="")
    {
        alert("Enter shipping phone number.");
        frm.txtSPhoneNo.focus();
        return false
    }
 
    
 return true;
}

function confirmChkAvail()
{
    var frm=document.form1;
    if(trim(document.getElementById("txttaxamount").value)=="")
      document.getElementById("txttaxamount").value="0";
    else if(!isFloat(trim(document.getElementById("txttaxamount").value)))
    {
       alert("Enter valid Tax Amount.");
       document.getElementById("txttaxamount").value="0";
       return false;
    }
    if(trim(document.getElementById("txtshippingcharges").value)=="")
    {  
     document.getElementById("txtshippingcharges").value="0";
      //document.getElementById("txtshippingcharges").focus();
       //return false;
    }
    else if(!isFloat(trim(document.getElementById("txtshippingcharges").value)))
    {
       alert("Enter valid Shipping Amount.");
       document.getElementById("txtshippingcharges").focus();
       return false;
    }
    if(confirm("Have you checked this order?")==false)
    {
        return false;
    }
    return true;
}

function confirmWishlistMove()
{
    var frm=document.form1;
    if(confirm("Do you want to shift selected items to the customer's wishlist?")==false)
    {
        return false;
    }
    return true;
}
function confirmPayReq()
{
    var frm=document.form1;
    if(confirm("Do you want to send payment request to the customer?")==false)
    {
        return false;
    }
    return true;
}

function FillSubcategory()

{ 
frm=document.form1;
var flg=false; 
var check="";
arr=document.getElementById('HiddenCatSubCat').value.split("|")
clearcombo('drpSubcategory')
document.getElementById('drpSubcategory').options[document.getElementById('drpSubcategory').options.length]=new Option('-All-','')
//debugger;

if(document.getElementById('drpCategory').value=="")
{
    for (var i = 0; i <= arr.length-1; i++)
    { 
    parr=arr[i].split("$")
    document.getElementById('drpSubcategory').options[document.getElementById('drpSubcategory').options.length]=new Option(parr[1],parr[1]);
    }
}
else
{
    for (var i = 0; i <= arr.length-1; i++)
    { 
        parr=arr[i].split("$")
        if((parr[0].toUpperCase())==document.getElementById('drpCategory').value)
        {
        document.getElementById('drpSubcategory').options[document.getElementById('drpSubcategory').options.length]=new Option(parr[1],parr[1]);
        }

    }
}

}

function clearcombo(cbo)

{

for (var i=document.getElementById(cbo).options.length-1; i>=0; i--)

{

document.getElementById(cbo).options[i] = null;

}

document.getElementById(cbo).selectedIndex = -1;

}

function FillHiddenSubcategory()

{

var Str = document.getElementById('drpSubcategory').value;

document.getElementById('HiddenSubCat').value = Str;

}

function ValidateTerms()
{
    if(document.getElementById('chkTerms').checked == true)
    {
        document.getElementById('submitBut').disabled = false;
    }
    else
    {
        document.getElementById('submitBut').disabled = true;
    }
} 

function ValidateTerms()

{

    if(document.getElementById('chkTerms').checked == true)

    {

        document.getElementById('submitBut').disabled = false;

    }

    else

    {
        document.getElementById('submitBut').disabled = true;

    }

} 
function validatecard()
{
    frm=document.form1;
     if (trim(frm.txtname.value)=="")
    {
        alert("Enter Name.");
        frm.txtname.focus();
        return false
    }
    else if(!checkname(frm.txtname.value))
    {
     alert("Enter Valid Name.");
        frm.txtname.focus();
        return false
    }
    if (trim(frm.txtcardnumber.value)=="")
    {
        alert("Enter card Number.");
        frm.txtcardnumber.focus();
        return false
    }
    else if(!checkNum(frm.txtcardnumber.value))
    {
        alert("Enter valid card Number.");
        frm.txtcardnumber.focus();
        return false
    }
     if (trim(frm.txtcvmvalue.value)=="")
    {
        alert("Enter Security Code.");
        frm.txtcvmvalue.focus();
        return false    
    }
     else if(!checkNum(frm.txtcvmvalue.value))
    {
        alert("Enter valid Security Code.");
        frm.txtcvmvalue.focus();
        return false
    }
    if (trim(frm.txtexpiremonth.value)=="Month")
    {
        alert("Enter Card Expire Month.");
        frm.txtexpiremonth.focus();
        return false;
    }
     if (trim(frm.txtcardexpyear.value)=="Year")
    {
        alert("Enter Card Expire Year.");
        frm.txtcardexpyear.focus();
        return false    
    }
    
  return true;
}

function validatebhishicard()
{
    frm=document.form1;
     if (trim(frm.txtname.value)=="")
    {
        alert("Enter Name.");
        frm.txtname.focus();
        return false
    }
    else if(!checkname(frm.txtname.value))
    {
     alert("Enter Valid Name.");
        frm.txtname.focus();
        return false
    }
    if (trim(frm.txtcardnumber.value)=="")
    {
        alert("Enter card Number.");
        frm.txtcardnumber.focus();
        return false
    }
    else if(!checkNum(frm.txtcardnumber.value))
    {
        alert("Enter valid card Number.");
        frm.txtcardnumber.focus();
        return false
    }
     if (trim(frm.txtcvmvalue.value)=="")
    {
        alert("Enter Security Code.");
        frm.txtcvmvalue.focus();
        return false    
    }
     else if(!checkNum(frm.txtcvmvalue.value))
    {
        alert("Enter valid Security Code.");
        frm.txtcvmvalue.focus();
        return false
    }
    if (trim(frm.txtexpiremonth.value)=="Month")
    {
        alert("Enter Card Expire Month.");
        frm.txtexpiremonth.focus();
        return false;
    }
     if (trim(frm.txtcardexpyear.value)=="Year")
    {
        alert("Enter Card Expire Year.");
        frm.txtcardexpyear.focus();
        return false    
    }
     if (trim(frm.txtAddNum.value)=="")
    {
        alert("Enter Address number.");
        frm.txtAddNum.focus();
        return false;
    }
       if (trim(frm.txtZip.value)=="")
    {
        alert("Enter Zip Code.");
        frm.txtZip.focus();
        return false;
    } 
  return true;
}
