﻿// JScript File
//MasterPage Script

function Show(id)
{
    document.getElementById("tblReply"+id).style.display='block';
}
function Hide(id)
{
    document.getElementById("tblReply"+id).style.display='none';
}
//Product Search UserControl
        function setSearchFocus(type)
        {        
            if(type=="fp")
            {
                 if (document.getElementById("txtSearch").value=="Search...")
                    {
                    document.getElementById("txtSearch").value='';
                    }     
            }
            else
            {
                if (document.getElementById("ctl00_Header_productSearch_txtSearch").value=="Search...")
                    {
                    document.getElementById("ctl00_Header_productSearch_txtSearch").value='';
                    }
            }        
        }
        function removeSearchFocus(type)
        {
            if(type=="fp")
            {
                if (document.getElementById("txtSearch").value=='')
                    {
                    document.getElementById("txtSearch").value="Search...";
                    }
            }
            else
            {            
                if (document.getElementById("ctl00_Header_productSearch_txtSearch").value=='')
                    {
                    document.getElementById("ctl00_Header_productSearch_txtSearch").value="Search...";
                    }
            }        
        }


// Thanks Page



//Header UserControl

    function opens(prod,qty)
    {
        var ProductItems=prod;        
        var QuantityItems=qty;
        var msg='';
        if(ProductItems=='' || QuantityItems=='')
            {
                 msg="Are you sure, you want to logout?";
            }
        else
            {
                 msg="There are items in Cart. Are you sure, you want to logout?";	    
            }
        if(confirm(msg))
        {
            document.location.href='ConfirmWindow.aspx';
        }
        else
        {
            return false;
        }
    }



//QuickContact UserControl

function restrictinput(maxlength,e,placeholder)
{
   if (window.event && placeholder.value.length>=maxlength)
   {
        return false
   }
    else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength)
    {
        var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
        if (pressedkey.test(String.fromCharCode(e.which)))
            e.stopPropagation()
    }
}
function textLimit(field, maxlen)
{
    if (field.value.length > maxlen)
    {
        
        field.value = field.value.substring(0, maxlen + 1);
    }
}
function ValidPhone(sender, args)
{
    var str=args.Value;
    var strValidChars="0123456789()-/ +";
    
    if(str !='Your Phone:')
    {
        if (str.length == 0)
        {
            args.IsValid = true;
            return;
        }
        // test strString consists of valid characters listed above
        for (i = 0; i < str.length; i++)
        {
            var strChar = str.charAt(i);
            if (strValidChars.indexOf(strChar) == -1)
            {
                args.IsValid = false;
                return;
            }
        }
    }
    args.IsValid = true;
}
function CountChar(sender, args)
{
 var str=args.Value;
  if (str.length <5)
  {
     args.IsValid = false;
     return;
  }
   args.IsValid = true;
}
function RequiredRegularfunName(sender,args)
{   
     var str=args.Value;
     var strValidChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&_ ',.-"; 
     if(str =='Your Name:')
     {  
       
        document.getElementById('ctl00_QuickContact_CSVFirstName').innerHTML="&nbsp;&nbsp;&nbsp;Please enter name.";
        document.getElementById('ctl00_QuickContact_CSVFirstName').style.display = '';
        args.IsValid = false;
        return;
     }
     else
     {
        for (i = 0; i < str.length; i++)
        {
            var strChar = str.charAt(i);
            if (strValidChars.indexOf(strChar) == -1)
            {
                 document.getElementById('ctl00_QuickContact_CSVFirstName').innerHTML="&nbsp;&nbsp;&nbsp;Please enter valid name.";
                 document.getElementById('ctl00_QuickContact_CSVFirstName').style.display = '';
                 args.IsValid = false;
                 return;
            }
        }
        args.IsValid = true;
        return;
     }
}
function RequiredRegularfunNameOnFp(sender,args)
{   
     var str=args.Value;
     var strValidChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&_ ',.-"; 
     if(str =='Your Name:')
     {  
       
        document.getElementById('CSVFirstName').innerHTML="&nbsp;&nbsp;&nbsp;Please enter name.";
        document.getElementById('CSVFirstName').style.display = '';
        args.IsValid = false;
        return;
     }
     else
     {
        for (i = 0; i < str.length; i++)
        {
            var strChar = str.charAt(i);
            if (strValidChars.indexOf(strChar) == -1)
            {
                 document.getElementById('CSVFirstName').innerHTML="&nbsp;&nbsp;&nbsp;Please enter valid name.";
                 document.getElementById('CSVFirstName').style.display = '';
                 args.IsValid = false;
                 return;
            }
        }
        args.IsValid = true;
        return;
     }
}
function RequiredfunVCode(sender,args)
{
     var str=args.Value;   
     if(str =='Verification Code:')
     {  
       document.getElementById('ctl00_QuickContact_CSVVerificationCode').innerHTML="<br/>&nbsp;&nbsp;&nbsp;Please enter verification code.";
       document.getElementById('ctl00_QuickContact_CSVVerificationCode').style.display = '';
       args.IsValid = false;
     }
     else
     {
        args.IsValid = true;
     }
}

function SetCodeFocus(type)
{
    if(type=="fp")
    {
        if(document.getElementById('txtVerificationCode').value=="Verification Code:")
                {
                     document.getElementById('txtVerificationCode').focus();
                     document.getElementById('txtVerificationCode').value='';            
                }
    }
    else
    {        
          if(document.getElementById('ctl00_QuickContact_txtVerificationCode').value=="Verification Code:")
                {
                     document.getElementById('ctl00_QuickContact_txtVerificationCode').focus();
                     document.getElementById('ctl00_QuickContact_txtVerificationCode').value='';            
                }
    }
}
function RemoveCodeFocus(type)
{
    if(type=="fp")
    {
        if(document.getElementById('txtVerificationCode').value=="")
            {            
                 document.getElementById('txtVerificationCode').value="Verification Code:";            
            }
    }
    else
    {
        if(document.getElementById('ctl00_QuickContact_txtVerificationCode').value=="")
            {            
                 document.getElementById('ctl00_QuickContact_txtVerificationCode').value="Verification Code:";            
            }
    }
}

function RequiredfunVCodeOnFp(sender,args)
{
     var str=args.Value;   
     if(str =='Verification Code:')
     {  
       document.getElementById('CSVVerificationCode').innerHTML="<br/>&nbsp;&nbsp;&nbsp;Please enter verification code.";
       document.getElementById('CSVVerificationCode').style.display = '';
       args.IsValid = false;
     }
     else
     {
        args.IsValid = true;
     }
}
function CheckISValid_email(emailStr) 
{
	var emailPat=/^(.+)@(.+)$/
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
	var validChars="\[^\\s" + specialChars + "\]"
	var quotedUser="(\"[^\"]*\")"
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	var atom=validChars + '+'
	var word="(" + atom + "|" + quotedUser + ")"
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
	var matchArray=emailStr.match(emailPat)
	
	if (matchArray==null) 
	{  
		//alert("Email address seems incorrect (check @ and .'s)")
		return false
	}
	var user=matchArray[1]
	var domain=matchArray[2]
	if (user.match(userPat)==null) 
	{
	   // alert("The username doesn't seem to be valid.")
	    return false
	}
	var IPArray=domain.match(ipDomainPat)
	if (IPArray!=null) 
	{  
		  for (var i=1;i<=4;i++) 
		  {
		    if (IPArray[i]>255) 
			{
		      //  alert("Destination IP address is invalid!")
				return false
		    }
	    }
	    return true
	}
	var domainArray=domain.match(domainPat)
	if (domainArray==null) 
	{
		//alert("The domain name doesn't seem to be valid.")
	    return false
	}
	var atomPat=new RegExp(atom,"g")
	var domArr=domain.match(atomPat)
	var len=domArr.length
	if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) 
	{   
	  // alert("The address must end in a three-letter domain, or two letter country.")
	   return false
	}
	if (len<2) 
	{
	   var errStr="This address is missing a hostname!"	 
	   return false
	}
	return true;
}
function RequiredRegularfunEmail(sender,args)
{
    var str=args.Value;
    if(str == 'Your E-mail:')
    {
        document.getElementById('ctl00_QuickContact_CSVEmail').innerHTML="&nbsp;&nbsp;&nbsp;Please enter e-mail.";
        document.getElementById('ctl00_QuickContact_CSVEmail').style.display = '';
        args.IsValid = false;
        return;        
    }
    else
    {
        if(CheckISValid_email(str) == true)
        {        
            args.IsValid=true;
            return;
        }
        else
        {   
             document.getElementById('ctl00_QuickContact_CSVEmail').innerHTML="&nbsp;&nbsp;&nbsp;Please enter valid e-mail.";
             document.getElementById('ctl00_QuickContact_CSVEmail').style.display = '';
             args.IsValid=false;
             return;
        }
    }
}
function RequiredRegularfunEmailOnFp(sender,args)
{
    var str=args.Value;
    if(str == 'Your E-mail:')
    {
        document.getElementById('CSVEmailCheck').innerHTML="&nbsp;&nbsp;&nbsp;Please enter e-mail.";
        document.getElementById('CSVEmailCheck').style.display = '';
        args.IsValid = false;
        return;
    }
    else
    {
        if(CheckISValid_email(str) == true)
        {
            args.IsValid=true;
            return;
        }
        else
        {   
             document.getElementById('CSVEmailCheck').innerHTML="&nbsp;&nbsp;&nbsp;Please enter valid e-mail.";
             document.getElementById('CSVEmailCheck').style.display = '';
             args.IsValid=false;
             return;
        }
    }
}
function SetNameFocus(type)
{
    if(type=="fp")
    {
         if(document.getElementById('txtName').value=="Your Name:")
            {
                document.getElementById('txtName').focus();
                document.getElementById('txtName').value='';
            }
    }
    else
    {    
        if(document.getElementById('ctl00_QuickContact_txtName').value=="Your Name:")
            {
                document.getElementById('ctl00_QuickContact_txtName').focus();
                document.getElementById('ctl00_QuickContact_txtName').value='';
            }
    }
}

function RemoveNameFocus(type)
{
    if(type=="fp")
    {
        if(document.getElementById('txtName').value=="")
            {     
                document.getElementById('txtName').value="Your Name:";
            }
    }
    else
    {        
        if(document.getElementById('ctl00_QuickContact_txtName').value=="")
            {     
                document.getElementById('ctl00_QuickContact_txtName').value="Your Name:";
            }
    }
}

function SetPhoneFocus(type)
{
    if(type=="fp")
    {
       if(document.getElementById('txtPhone').value=="Your Phone:")
        {
             document.getElementById('txtPhone').focus();
             document.getElementById('txtPhone').value='';            
        }
    }
    else
    {   
      if(document.getElementById('ctl00_QuickContact_txtPhone').value=="Your Phone:")
        {
             document.getElementById('ctl00_QuickContact_txtPhone').focus();
             document.getElementById('ctl00_QuickContact_txtPhone').value='';            
        }
    }
}
function RemovePhoneFocus(type)
{
    if(type=="fp")
    {
        if(document.getElementById('txtPhone').value=="")
        {    
             document.getElementById('txtPhone').value="Your Phone:";            
        }
    }
    else
    {
        if(document.getElementById('ctl00_QuickContact_txtPhone').value=="")
        {    
             document.getElementById('ctl00_QuickContact_txtPhone').value="Your Phone:";            
        }
    }   
}

function SetEmailFocus(type)
{
    if(type=="fp")
    {
        if(document.getElementById('txtEmail').value=="Your E-mail:")
            {
                 document.getElementById('txtEmail').focus();
                 document.getElementById('txtEmail').value='';            
            }
    }
    else
    {
        if(document.getElementById('ctl00_QuickContact_txtEmail').value=="Your E-mail:")
        {
             document.getElementById('ctl00_QuickContact_txtEmail').focus();
             document.getElementById('ctl00_QuickContact_txtEmail').value='';            
        }
    }   
}

function RemoveEmailFocus(type)
{
    if(type=="fp")
    {
        if(document.getElementById('txtEmail').value=="")
            {
                
                 document.getElementById('txtEmail').value="Your E-mail:";            
            }
    }
    else
    {
        if(document.getElementById('ctl00_QuickContact_txtEmail').value=="")
        {
            
             document.getElementById('ctl00_QuickContact_txtEmail').value="Your E-mail:";            
        }
    }    
}

function SetCommentFocus(type)
{
    if(type=="fp")
    {
        if(document.getElementById('txtComment').value=="Your Comment:")
                 {
                      document.getElementById('txtComment').focus();
                      document.getElementById('txtComment').value='';            
                 }
    }
    else
    {
        if(document.getElementById('ctl00_QuickContact_txtComment').value=="Your Comment:")
             {
                  document.getElementById('ctl00_QuickContact_txtComment').focus();
                  document.getElementById('ctl00_QuickContact_txtComment').value='';            
             }
    }
}

function RemoveCommentFocus(type)
{
    if(type=="fp")
    {
         if(document.getElementById('txtComment').value=="")
            {            
                 document.getElementById('txtComment').value="Your Comment:";            
            }
    }
    else
    {
        if(document.getElementById('ctl00_QuickContact_txtComment').value=="")
        {            
             document.getElementById('ctl00_QuickContact_txtComment').value="Your Comment:";            
        }
    }
}


//ForgotPassword & ClientForgotPassword
function validate()
{
  lstrpath = window.document.form1

    if (f_isEmpty(lstrpath.txtUsrname.value))
    {
	    window.alert("Please Enter UserName");
	    lstrpath.txtUsrname.focus();
	    return false;
    }

    if (f_isEmpty(lstrpath.txtPassword.value))
    {
	    window.alert("Please Enter Password");
	    lstrpath.txtPassword.focus();
	    return false;
    }
    if((document.forms["form1"].txtUsrname.value)==""){
		    alert("Please Enter Email Address");
		    document.forms["form1"].txtUsrname.focus();
		    return false;
	     }
    if (!(Check_email(document.forms["form1"].txtUsrname.value)))
    {
	    document.forms["form1"].txtUsrname.value='';
	    document.forms["form1"].txtUsrname.focus();
	    return false;
    } 
}

function validateforgot()
{
    if((document.forms["form1"].txtforgotusername.value)=="")
        {
		    alert("Please Enter Email Address");
		    document.forms["form1"].txtforgotusername.focus();
		    return false;
	     }
    if (!(Check_email(document.forms["form1"].txtforgotusername.value)))
    {
	    document.forms["form1"].txtforgotusername.value='';
	    document.forms["form1"].txtforgotusername.focus();
	    return false;
    } 
    lstrpath = window.document.form1
    if (f_isEmpty(lstrpath.txtforgotusername.value))
    {
	    window.alert("Please Enter UserName");
	    lstrpath.txtforgotusername.focus();
	    return false;
    }
}
//ForgotPassword & ClientForgotPassword

//Display Categories & Product Search

    function openwindow(show)
    {
        var win1 = window.open("blank.html",null,"height=300,width=350,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,left=0,top=0")
        win1.document.open()
        win1.document.write("<html><body background='../media/page_bg.gif' text='#000000'> <center><table border='0' bordercolor='#C87F52' cellpadding='0' cellspacing='0'><tr><td><img src='" + show + "' align=center ImageResize(fPath, 200, 200)></center></td></tr></table>")
        win1.document.write("<br><center><a href='javascript:window.close()'><b><font face='Verdana' size='2'>Close Window</font></b></a></center></body></html>")
        win1.document.close()
    }
    
    function ConfirmRemove()
    {
        var l_select=0;
        var l_quantity=0;
        var ProductCheckIds='<%=CheckProduct%>';
        var ProductQuantityValue='<%=ProductQuantityValue%>'
        var SplitProductCheckIds=ProductCheckIds.split(',');
        var SplitProductQuantityValue=ProductQuantityValue.split(',');
       
        for(i=0;i<SplitProductCheckIds.length;i++)
        {
            if(document.getElementById(SplitProductCheckIds[i]).checked==true && document.getElementById(SplitProductCheckIds[i]).disabled==false)
            {
                l_select = l_select +1;
            }
        }
        if(l_select ==0 )
        {
            alert("Please Select a Product.");
            return false;
        }
    }   
    
       function ConfirmSelect(frm)
       {   
            var l_select=0;
            var l_quantity=0;
            var ProductCheckIds='<%=CheckProduct%>';
            var ProductQuantityValue='<%=ProductQuantityValue%>';
            var SplitProductCheckIds=ProductCheckIds.split(',');
            var SplitProductQuantityValue=ProductQuantityValue.split(',');
            
           for(i=0;i<SplitProductCheckIds.length;i++)
           {
                if(document.getElementById(SplitProductCheckIds[i]).checked==true && document.getElementById(SplitProductCheckIds[i]).disabled==false)
                {
                    l_select = l_select +1;
                }
           }
            
            for(j=0;j<SplitProductQuantityValue.length;j++)
            {
                  if(document.getElementById(SplitProductQuantityValue[j]).value !='' && document.getElementById(SplitProductQuantityValue[j]).disabled == false)
                  {
                       l_quantity = l_quantity +1;
                       if(Check_Numeric(document.getElementById(SplitProductQuantityValue[j]).value)==true)
                        {
                            if(document.getElementById(SplitProductQuantityValue[j]).value >0)
                            {
                                //return true;
                            }
                            else
                            {
                                alert("Please Enter Quantity Greater than Zero");
                                document.getElementById(SplitProductQuantityValue[j]).focus();
                                return false;
                            }
                        }
                        else
                        {
                            alert("Please Enter Numeric Value");
                            document.getElementById(SplitProductQuantityValue[j]).value='';
                            document.getElementById(SplitProductQuantityValue[j]).focus();
                            return false;
                        }
                  }
                 else
                 {
                    for(k=0;k<SplitProductCheckIds.length;k++)
                    {
                        if(document.getElementById(SplitProductCheckIds[k]).checked==true && document.getElementById(SplitProductQuantityValue[k]).value == '')
                        {
                              alert("Please Enter Quantity.");
                              document.getElementById(SplitProductQuantityValue[k]).focus();
                              return false;
                        }
                        if(document.getElementById(SplitProductCheckIds[k]).checked==false && document.getElementById(SplitProductQuantityValue[k]).value != '')
                        {
                             alert("Please Select a Product.");
                             document.getElementById(SplitProductQuantityValue[k]).focus();
                             return false;
                        }
                    }
                }
            }
            
            if(l_select ==0)
            {
                alert("Please Select a Product.");
                return false;
            }
            
     }  

function ConfirmResetInCategories()
{
    var l_select=0;
    var l_quantity=0;
    var ProductCheckIds='<%=CheckProduct%>';
    var ProductQuantityValue='<%=ProductQuantityValue%>';
    var SplitProductCheckIds=ProductCheckIds.split(',');
    var SplitProductQuantityValue=ProductQuantityValue.split(',');
        
    for(i=0;i<SplitProductCheckIds.length;i++)
     {
        if(document.getElementById(SplitProductCheckIds[i]).checked==true && document.getElementById(SplitProductCheckIds[i]).disabled==false)
        {
            document.getElementById(SplitProductCheckIds[i]).checked=false;
        }
     }
     for(j=0;j<SplitProductQuantityValue.length;j++)
     {
        if(document.getElementById(SplitProductQuantityValue[j]).value !='' && document.getElementById(SplitProductQuantityValue[j]).disabled == false)
        {
            document.getElementById(SplitProductQuantityValue[j]).value='';
        }
     }
     return false;
}

function ConfirmResetInProduct(frm)
{
var l_select=0;
var l_quantity=0;
var ProductCheckIds='<%=CheckProduct%>';
var ProductQuantityValue='<%=ProductQuantityValue%>';
var SplitProductCheckIds=ProductCheckIds.split(',');
var SplitProductQuantityValue=ProductQuantityValue.split(',');

        for(i=0;i<SplitProductCheckIds.length;i++)
            {
                if(document.getElementById(SplitProductCheckIds[i]).checked==true && document.getElementById(SplitProductCheckIds[i]).disabled==false)
                {
                    l_select = l_select +1;
                    document.getElementById(SplitProductCheckIds[i]).checked=false;
                }
            }

        for(j=0;j<SplitProductQuantityValue.length;j++)
            {
                if(document.getElementById(SplitProductQuantityValue[j]).value !='' && document.getElementById(SplitProductQuantityValue[j]).disabled == false)
                {
                    l_quantity = l_quantity +1;
                    document.getElementById(SplitProductQuantityValue[j]).value='';
                }
            }
            return false;
}

function ConfirmWishListSelect(frm)
    {
   
            var l_select=0;
            var l_quantity=0;
            var ProductCheckIds='<%=CheckProduct%>';
            var ProductQuantityValue='<%=ProductQuantityValue%>';
            var SplitProductCheckIds=ProductCheckIds.split(',');
            var SplitProductQuantityValue=ProductQuantityValue.split(',');
         
            for(i=0;i<SplitProductCheckIds.length;i++)
            {
                if(document.getElementById(SplitProductCheckIds[i]).checked==true && document.getElementById(SplitProductCheckIds[i]).disabled==false)
                {
                    l_select = l_select +1;
                }
            }
            for(j=0;j<SplitProductQuantityValue.length;j++)
            {
                  if(document.getElementById(SplitProductQuantityValue[j]).value !='' && document.getElementById(SplitProductQuantityValue[j]).disabled == false)
                  {
                       l_quantity = l_quantity +1;
                       if(Check_Numeric(document.getElementById(SplitProductQuantityValue[j]).value)==true)
                        {
                            if(document.getElementById(SplitProductQuantityValue[j]).value >0)
                            {
                            }
                            else
                            {
                                alert("Please Enter Quantity Greater than Zero");
                                document.getElementById(SplitProductQuantityValue[j]).focus();
                                return false;
                            }
                        }
                        else
                        {
                            alert("Please Enter Numeric Value");
                            document.getElementById(SplitProductQuantityValue[j]).value='';
                            document.getElementById(SplitProductQuantityValue[j]).focus();
                            return false;
                        }
                 }
           }
            
            if(l_select ==0 )
            {
                alert("Please Select a Product.");
                return false;
            }
    }
    
    
//Product Details

    function openwindowinProductDetails(show)
    {
        var win1 = window.open("blank.html",null,"height=300,width=350,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,left=0,top=0")
        win1.document.open()
        win1.document.write("<html><body background='../media/page_bg.gif' text='#000000'> <center><table border='0' bordercolor='#C87F52' cellpadding='0' cellspacing='0'><tr><td><img src='../ProdImages/" + show + "' align=center ImageResize(fPath, 200, 200)></center></td></tr></table>")
        win1.document.write("<br><center><a href='javascript:window.close()'><b><font face='Verdana' size='2'>Close Window</font></b></a></center></body></html>")
        win1.document.close()
    }
    
 function Clickheretoprint()
    { 
            var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
                disp_setting+="scrollbars=yes,width=800, height=1000, left=100, top=25"; 
            var content_vlue = document.getElementById("print_content").innerHTML;
            var docprint=window.open("","",disp_setting); 
	            docprint.document.open(); 
	            docprint.document.write('<html><head>');
	            docprint.document.write('<link rel="stylesheet" href="../Includes/CSS/HWE.css" />'); 
	            docprint.document.write('</head><body onLoad="self.print()"><center>');          
	            docprint.document.write(content_vlue);          
	            docprint.document.write('</center></body></html>'); 
	            docprint.document.close(); 
	            docprint.focus(); 
    }
    
//SalesPersonInfo

 function setFocus(ss)
        {
           document.getElementById(ss).focus();
        }
        function GetTop()
        {
            window.top;
        }
        
        
 //Registration Form
 
    function EnableDisable()
    {
    //   alert('dvvsv');
       if(document.getElementById('rdSPyes').checked==true)
       {
            document.getElementById('DdlSalesPerson').style.display=''; 
       }
       if(document.getElementById('rdSPno').checked==true)
       {
               document.getElementById('DdlSalesPerson').style.display='none'; 
       }  
    }
    
    function validate()
    {  

        var Vrification = '<%=  Session["Verifivation"].ToString()%>' 
        if(f_isEmpty(window.document.getElementById("txtFirstname").value)){
	        window.alert("Please Enter First Name");
	        window.document.getElementById("txtFirstname").focus();
	        return false;
            }
            if(f_isEmpty(window.document.getElementById("txtLastname").value)){
	        window.alert("Please Enter Last Name");
	        window.document.getElementById("txtLastname").focus();
	        return false;
            }
           if(f_isEmpty(window.document.getElementById("txtAddress").value))
             {
	        window.alert("Please Enter Address");
	        window.document.getElementById("txtAddress").focus();
	        return false;
            }   
            if(f_isEmpty(window.document.getElementById("txtCity").value))
             {
	        window.alert("Please Enter City");
	        window.document.getElementById("txtCity").focus();
	        return false;
            }   
            if(f_isEmpty(window.document.getElementById("txtState").value))
             {
	        window.alert("Please Enter State");
	        window.document.getElementById("txtState").focus();
	        return false;
            }   
                   if(f_isEmpty(window.document.getElementById("txtZipcode").value))
             {
	        window.alert("Please Enter Zipcode");
	        window.document.getElementById("txtZipcode").focus();
	        return false;
            }   
             if(document.form1.ddlCountry.options[document.form1.ddlCountry.selectedIndex].value==0)
            {

            window.alert("Please Select Country ");
            document.form1.ddlCountry.focus();
            return false;
            }  
            if(f_isEmpty(window.document.getElementById("txtEmail").value)){
	        window.alert("Please Enter Email ID");
	        window.document.getElementById("txtEmail").focus();
	        return false;
            }  
             if(f_isEmpty(window.document.getElementById("txtPassword").value))
             {
	        window.alert("Please Enter Password");
	        window.document.getElementById("txtPassword").focus();
	        return false;
            }   
            if(f_isEmpty(window.document.getElementById("txtConfirmpassword").value)){
	        window.alert("Please Enter Confirm Password");
	        window.document.getElementById("txtConfirmpassword").focus();
	        return false;
            } 
         if( Vrification == "Y")
         {
                 if(f_isEmpty(window.document.getElementById("txtVrificationCode").value))
                 {
	                window.alert("Please Enter Verification Code");
	                window.document.getElementById("txtVrificationCode").focus();
	                return false;
                } 
        }
    }