function ChangePage1(id)
{
        document.getElementById("ctl00_user_PageNumber1").value=id;
		if(id==1)
		{					
			document.getElementById("ctl00_user_PageStart1").value="";
		}
		// call the __doPostBack function to post back the form and execute the PageClick event
		__doPostBack('ctl00$user$PageClick1','');
		
}
function SetError(errorcontrolid,errormessage)
{
  document.getElementById('ctl00_user_'+errorcontrolid).innerHTML=errormessage;
}
function MakeItEmpty(id)
{

   document.getElementById('ctl00_user_'+id).innerHTML=""; 
}
function SetFocus(id)
{

   document.getElementById('ctl00_user_'+id).focus(); 
}
function SetEmpty(id)
{
   document.getElementById('ctl00_user_'+id).value=""; 
}
function  GetValue(id)
{
document.getElementById('ctl00_user_'+id).value=trim(document.getElementById('ctl00_user_'+id).value);
  return trim(document.getElementById('ctl00_user_'+id).value); 
}

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 CheckNo()
{

   if(GetValue("txtRefNo")=="")
   {
      alert("Please Enter Reference Booking No.");
      document.getElementById("ctl00_user_txtRefNo").focus();
      return false;  
   }
   return true;

}

function CheckForInd(i)
{
  if(i=='c')
  {
     document.getElementById("ctl00_user_Turnshow").style.display="";
     for(k=1;k<=34;k++){
       if(k!=14&&k!=15&&k!=16&&k!=17&&k!=18)
          document.getElementById("ctl00_user_tr"+k).style.display="";   
     }
     BindCategory(i)
  }
  else
  {
     document.getElementById("ctl00_user_Turnshow").style.display="none";
      for(k=1;k<=34;k++){
       if(k!=14&&k!=15&&k!=16&&k!=17&&k!=18)
          document.getElementById("ctl00_user_tr"+k).style.display="none";   
     }
     BindCategory(i)
  }
  

  return true
}

function searchKeyPress(e)
{

// look for window.event in case event isn't passed in
//alert(e.keyCode);
if (window.event) { e = window.event; }
if (e.keyCode == 13)
{
document.getElementById("ctl00_user_btnSubmit").focus();
if(Validateregister())
document.getElementById("ctl00_user_btnSubmit").click();
else
return false;
}
}

function HideAll(i)
{
      for(k=1;k<=47;k++){
      
          document.getElementById("ctl00_user_tr"+k).style.display="none";   
       }
  if(i=='c')
  {
     document.getElementById("ctl00_user_Turnshow").style.display="";
     BindCategory(i)
  }
  else
  {
     document.getElementById("ctl00_user_Turnshow").style.display="none";
     BindCategory(i)
  }
     
  return true
}


function Valimemdec(i)
{
   if(document.getElementById("ctl00_user_chkMem_"+i).checked)
      document.getElementById("ctl00_user_liMemDesc").style.display=""; 
   else
      document.getElementById("ctl00_user_liMemDesc").style.display="none";
}

function Valiinddec(i)
{
   if(document.getElementById("ctl00_user_chkInd_"+i).checked)
      document.getElementById("ctl00_user_liInd").style.display=""; 
   else
      document.getElementById("ctl00_user_liInd").style.display="none";
}

function Valilegaldec(i)
{
   if(document.getElementById("ctl00_user_chkLegal_"+i).checked)
      document.getElementById("ctl00_user_liLegal").style.display=""; 
   else
      document.getElementById("ctl00_user_liLegal").style.display="none";
}

function clearcombo(cbo)
 {
    for (var i=document.getElementById("ctl00_user_"+cbo).options.length-1; i>=0; i--)
    {
      document.getElementById("ctl00_user_"+cbo).options[i] = null;
    }
      document.getElementById("ctl00_user_"+cbo).selectedIndex = -1;
}




function BindCategory(f)
{
    clearcombo('drpCat')
    document.getElementById('ctl00_user_drpCat').options[document.getElementById('ctl00_user_drpCat').options.length]=new Option('--- Select ---','')
    arr=document.getElementById('ctl00_user_hdnMember').value.split("|")
    for (var i = 0; i <= arr.length-1; i++)
    {
        parr=arr[i].split("~")
       
        if(f=="c"){
                 if(parr[0]=="L" || parr[0]=="O")
                  document.getElementById('ctl00_user_drpCat').options[document.getElementById('ctl00_user_drpCat').options.length]=new Option(parr[2],parr[1]);
        }   
        else{
                if(parr[0]=="I" || parr[0]=="L" )
                  document.getElementById('ctl00_user_drpCat').options[document.getElementById('ctl00_user_drpCat').options.length]=new Option(parr[2], parr[1]);
        }   
    }
    return true
 }

function BindSlabTr()
{ 
var selIndex = document.getElementById('ctl00_user_drpSlab').selectedIndex;
	

   if (document.getElementById('ctl00_user_drpSlab').options[selIndex].text.indexOf("Life Member") !=-1) {
      document.getElementById('ctl00_user_yearTr').style.display="none";
    }
    else
      document.getElementById('ctl00_user_yearTr').style.display="";
      
      
      return true;
      
}

function BindSlab()
{
    if(document.getElementById('ctl00_user_drpCat').value=="")
    {
      alert("Select Membership Category.");
      document.getElementById('ctl00_user_drpCat').focus();
      return false;
    }
  
   // if(document.getElementById('ctl00_user_rdoCgrompany').checked){
    
    
    //}
    clearcombo('drpSlab')
    document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option('--- Select ---','')
    arr=document.getElementById('ctl00_user_hdnSMember').value.split("|")
    for (var i = 0; i <= arr.length-1; i++)
    {
        parr=arr[i].split("~")
        if(document.getElementById('ctl00_user_rdoCgrompany').checked)
        {
            if(parr[0]=="L")
            {
            if(parr[1]==document.getElementById('ctl00_user_drpCat').value)
              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
            }
            else if(parr[0]=="N")
            {
            if(parr[1]==document.getElementById('ctl00_user_drpCat').value)
              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
            }
            else
            {
            
                if(parr[1]==document.getElementById('ctl00_user_drpCat').value)
                {   
                    if(document.getElementById('ctl00_user_drpTYear').value=="")
                    {
                      alert("Select Year for Turnover.");
                      document.getElementById('ctl00_user_drpTYear').focus();
                      return false;
                    }
                    else{
                    if(document.getElementById('ctl00_user_txtTurn').value=="")
                    {
                      alert("Enter Turnover for Year.");
                      document.getElementById('ctl00_user_txtTurn').focus();
                      return false;
                    }
                    else if(!isFloat(document.getElementById('ctl00_user_txtTurn').value))
                    {
                      alert("Enter Valid Turnover for Year.");
                      document.getElementById('ctl00_user_txtTurn').focus();
                      return false;
                    }
                    else{

                         if(GetValue("TYPE")=="")
                         {
                              if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>100)
                              {
                                                   if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>100)
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="100" || parr[0]=="N"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                }

                                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>80)
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="80" || parr[0]=="N"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                }

                                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>60 )
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="60" || parr[0]=="N"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                }

                                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>50 )
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="50" || parr[0]=="N"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                }
                              }
                         
                              else if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>20)
                         
                              {  
                                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>100)
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="100" || parr[0]=="N"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                }

                                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>80)
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="80" || parr[0]=="N"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                }

                                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>60 )
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="60" || parr[0]=="N"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                }

                                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>50 )
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="50" || parr[0]=="N"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                }

                                          
                                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>40)
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="40" || parr[0]=="N"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                }

                                                 if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>30)
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="30" || parr[0]=="N"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                
                                                }
                                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>25)
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="25" || parr[0]=="N"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                }
                                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>20 && parseFloat(document.getElementById('ctl00_user_txtTurn').value)<40)
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="20" || parr[0]=="N"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                }
                                }
                                else if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>10)
                                {
                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="10" || parr[0]=="N"))
                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                
                                }
                                  else if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>5)
                                {
                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="5" || parr[0]=="N") )
                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                
                                }
                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>3 && parseFloat(document.getElementById('ctl00_user_txtTurn').value)<=10) 
                                {
                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="3" || parr[0]=="N"))
                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                
                                }
                                else if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>1)
                                {
                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="1" || parr[0]=="N") && parr[4]=="A")
                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                
                                }
                                else if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>=0)
                                {
                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="0" || parr[0]=="N") && parr[4]=="A")
                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                }
                         
                         }
                         else
                         {
                        
                              if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>20)
                         
                              {  
                              
                                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>100)
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="100" || parr[0]=="N") && parr[4]==GetValue("TYPE"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                }

                                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>80)
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="80" || parr[0]=="N") && parr[4]==GetValue("TYPE"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                }

                                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>60 )
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="60" || parr[0]=="N") && parr[4]==GetValue("TYPE"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                }

                                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>50 )
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="50" || parr[0]=="N") && parr[4]==GetValue("TYPE"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                }

                                          if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)<60){
                                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>40)
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="40" || parr[0]=="N") && parr[4]==GetValue("TYPE"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                }

                                                 if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>30)
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="30" || parr[0]=="N") && parr[4]==GetValue("TYPE"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                
                                                }
                                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>25)
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="25" || parr[0]=="N") && parr[4]==GetValue("TYPE"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                }
                                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>20 && parseFloat(document.getElementById('ctl00_user_txtTurn').value)<40)
                                                {
                                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="20" || parr[0]=="N") && parr[4]==GetValue("TYPE"))
                                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                                
                                                }
                                                }
                                }
                                else if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>10)
                                {
                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="10" || parr[0]=="N") && parr[4]==GetValue("TYPE"))
                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                
                                }
                                  else if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>5)
                                {
                                   if(GetValue("TYPE")=="A")
                                   {
                                    if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)<10)
                                    {
                                       if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="3" || parr[0]=="N") && parr[4]==GetValue("TYPE"))
                                           document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                    }
                                    else if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="10" || parr[0]=="N") && parr[4]==GetValue("TYPE"))
                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                   
                                   }
                                   else{
                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="5" || parr[0]=="N")  && parr[4]==GetValue("TYPE"))
                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                              }
                                
                                }
                                else if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>3)
                                {
                                
                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="3" || parr[0]=="N") && parr[4]==GetValue("TYPE"))
                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                
                                }
                                else 
                                {
                             
                                   if(GetValue("TYPE")!="A")
                                   {
                                   
                                   if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>1){
                                   if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="3" || parr[0]=="N") && parr[4]==GetValue("TYPE"))
                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                   else if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="1" || parr[0]=="N") && parr[4]==GetValue("TYPE"))
                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                    }
                                    else{
                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="0" || parr[0]=="N") && parr[4]=="M")
                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);                       
                                              }
                                   }
                                   else{    
                                if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>1)
                                {
                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="1" || parr[0]=="N") && parr[4]=="A")
                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                
                                }
                                else if(parseFloat(document.getElementById('ctl00_user_txtTurn').value)>=0)
                                {
                                    if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="0" || parr[0]=="N") && parr[4]=="A")
                                              document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
                                }
                                }
                                }
                         }

               }   }    }     
            }                 
        }
        else
        {
            if(parr[1]==document.getElementById('ctl00_user_drpCat').value && (parr[0]=="N" || parr[0]=="L"))
                      document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[3],parr[2]);
        
        }          
    }
    
    return false;
 }


function ShowRef(frm)
{
   if(frm=="R")
     document.getElementById("ctl00_user_Tr2").style.display="none"
   else
     document.getElementById("ctl00_user_Tr2").style.display=""
     
}

function FillSlab()
{
    clearcombo("ctl00_user_drpSlab")
   // alert(document.getElementById('hdnData').value);
    document.getElementById("ctl00_user_drpSlab").options[document.getElementById("ctl00_user_drpSlab").options.length]=new Option('--- Select ---','')
    arr=document.getElementById("ctl00_user_hdnData").value.split("*")
    p=0;
    for (var i = 0; i <= arr.length-1; i++)
    {
        parr=arr[i].split("~")
      
        if(parr[2]==document.getElementById("ctl00_user_drpCat").value){
            p=p+1;
            document.getElementById('ctl00_user_drpSlab').options[document.getElementById('ctl00_user_drpSlab').options.length]=new Option(parr[0],parr[1]);
            if(p==1)
               document.getElementById('ctl00_user_idVal').value=parr[1];
            }
    }
    // Change by Manasi on 18th Feb 2012
    
     
    
    //
    if(p>1)
     document.getElementById("ctl00_user_slabTr").style.display="";
    else
     document.getElementById("ctl00_user_slabTr").style.display="none";    
   
    
 }


function Showfeatured(id,frm)
{
   ExData=GetValue("hdnExData");
   Arr1=GetValue("hdnData").split(":");
   for(k=0;k<Arr1.length;k++)
   {

           Arr=Arr1[k].split("*");
           
           for (i=0;i<Arr.length;i++)
           {
             // id=Arr[0], title=Arr[1], link=Arr[2], image= Arr[3], desc=Arr[4]
             if(ExData==Arr[0]){

               document.getElementById("li"+frm).innerHTML="<a href='"+Arr[2]+"' onmouseover=Showfeatured('"+Arr[0]+"','1')>"+Arr[1]+"</a>";
               }
             else if(id==Arr[0])
             {
               document.getElementById("ctl00_user_hdnExData").value=Arr[0];
               document.getElementById("titlen").innerHTML= "<img width=70 height=121 src=\"featured/"+Arr[3]+"\" align=\"right\" /><span class=\"title\">"+Arr[1] +"</span><br /><br />";
               document.getElementById("titlen").innerHTML=document.getElementById("titlen").innerHTML + Arr[4]               
             }  
          } 
   }
}

function CalWtotal()
{
  total=0;
  if(GetValue("txtWorker")=="") {document.getElementById("ctl00_user_txtWorker").value="0"} else if(!isInteger(GetValue("txtWorker"))){alert("Enter valid Number."); document.getElementById("ctl00_user_txtWorker").focus(); return false};
  if(GetValue("txtstaff")=="") {document.getElementById("ctl00_user_txtstaff").value="0";} else if(!isInteger(GetValue("txtstaff"))){alert("Enter valid Number."); document.getElementById("ctl00_user_txtstaff").focus(); return false};
  if(GetValue("txtMag")=="") {document.getElementById("ctl00_user_txtMag").value="0";} else if(!isInteger(GetValue("txtMag"))){alert("Enter valid Number."); document.getElementById("ctl00_user_txtMag").focus();  return false};
  total=parseFloat(GetValue("txtWorker")) +parseFloat(GetValue("txtstaff"))+parseFloat(GetValue("txtMag"));
  document.getElementById("ctl00_user_txtWTotal").value=total;
   return true;
}

function CalRtotal()
{
  total=0;
  if(GetValue("txtPRs")=="") {document.getElementById("ctl00_user_txtPRs").value="0"} else if(!isFloat(GetValue("txtPRs"))){alert("Enter valid Number."); document.getElementById("ctl00_user_txtPRs").focus(); return false };
  if(GetValue("txtLRS")=="") {document.getElementById("ctl00_user_txtLRS").value="0";} else if(!isFloat(GetValue("txtLRS"))){alert("Enter valid Number."); document.getElementById("ctl00_user_txtLRS").focus();  return false};
  total=parseFloat(GetValue("txtPRs")) +parseFloat(GetValue("txtLRS"))
  document.getElementById("ctl00_user_txtTotal").value=total;
   return true
}

function ShowFields()
{

  val=GetValue("drpPart")
    document.getElementById("ctl00_user_hdnDrp").value = val;
    for(i=1;i<=10;i++)
  {
     document.getElementById("ctl00_user_main"+i).style.display="none";
     document.getElementById("ctl00_user_maininn"+i).style.display="none";
  }
  for(i=1;i<=val;i++)
  {
     document.getElementById("ctl00_user_main"+i).style.display="";
     document.getElementById("ctl00_user_maininn"+i).style.display="";
     
  }
// alert(GetValue("hdnAmount"))
// if(document.getElementById("ctl00_user_Pay").style.display==""){
  discount=0;
  if(GetValue("hdnAmount")!="" &&  GetValue("hdnAmount")!="0")
  {
 
     TOTAL=parseFloat(val*GetValue("hdnOPayAmount"))
     document.getElementById("ctl00_user_lblTotal").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'> " + parseFloat(val*GetValue("hdnAmount"));
             document.getElementById("ctl00_user_lblAmount").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " + parseFloat((val*GetValue("hdnAmount"))-discount);
             document.getElementById("ctl00_user_hdnPayDisc").value=discount;
             document.getElementById("ctl00_user_hdnPayAmount").value=parseFloat((val*GetValue("hdnAmount"))-discount);
             document.getElementById("ctl00_user_hdnTotAmount").value=parseFloat(val*GetValue("hdnAmount"));
              totamount=parseFloat((val*GetValue("hdnAmount"))-discount)
           //   alert(totamount)
              tot=totamount;
              servicetax=Math.round(parseFloat((val*GetValue("hdnAmount"))-discount)*parseFloat( document.getElementById("ctl00_user_dservice").innerHTML)/100)
             document.getElementById("ctl00_user_hdnService").value=servicetax
              document.getElementById("ctl00_user_lblServicetax").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +servicetax
              edcess=Math.round(parseFloat(servicetax)*parseFloat( document.getElementById("ctl00_user_dedu").innerHTML)/100)
             document.getElementById("ctl00_user_hdnEdu").value=edcess
              document.getElementById("ctl00_user_lblEdu").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +edcess
              sedcess=Math.round(parseFloat(servicetax)*parseFloat( document.getElementById("ctl00_user_dsedu").innerHTML)/100)
             document.getElementById("ctl00_user_hdnSecEdu").value=sedcess
              document.getElementById("ctl00_user_lblSEdu").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +sedcess
             totamount=Math.round(parseFloat(totamount) + parseFloat(servicetax)+parseFloat(edcess)+parseFloat(sedcess))
             
             if(parseFloat(totamount)%5!=0)
             {  totamount=tot;
             
                servicetax=Math.ceil(parseFloat((val*GetValue("hdnAmount"))-discount)*parseFloat( document.getElementById("ctl00_user_dservice").innerHTML)/100)
             document.getElementById("ctl00_user_hdnService").value=servicetax
              document.getElementById("ctl00_user_lblServicetax").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +servicetax
              edcess=Math.ceil(parseFloat(servicetax)*parseFloat( document.getElementById("ctl00_user_dedu").innerHTML)/100)
             document.getElementById("ctl00_user_hdnEdu").value=edcess
              document.getElementById("ctl00_user_lblEdu").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +edcess
              sedcess=Math.ceil(parseFloat(servicetax)*parseFloat( document.getElementById("ctl00_user_dsedu").innerHTML)/100)
             document.getElementById("ctl00_user_hdnSecEdu").value=sedcess
              document.getElementById("ctl00_user_lblSEdu").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +sedcess
             totamount=Math.ceil(parseFloat(totamount) + parseFloat(servicetax)+parseFloat(edcess)+parseFloat(sedcess))
             if(totamount%5==0) totamount=totamount;
             else if((totamount+1)%5==0) totamount=totamount+1;
             else if((totamount-1)%5==0) totamount=totamount-1;
             else if((totamount-2)%5==0) totamount=totamount-2;
             else if((totamount+2)%5==0) totamount=totamount+2;
             }
             document.getElementById("ctl00_user_lblAmount").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " + Math.round(parseFloat(totamount));
             document.getElementById("ctl00_user_hdnPayAmount").value=Math.round(parseFloat(totamount));
     if(GetValue("hdnDiscount")!="")
     {
         disc = GetValue("hdnDiscount").split("|");
         
         flg=true
         for( k=(disc.length)-1;k>=0;k--)
         {
           discdet=disc[k].split(":")
           if(discdet[0]<=val && flg)
           {
              flg=false
              totamount=parseFloat(TOTAL)
              discount=Math.round( parseFloat(parseFloat(TOTAL)* discdet[1] )/100);
               document.getElementById("ctl00_user_hdnPayDisc").value=Math.round(discount);
               
               document.getElementById("ctl00_user_per").innerHTML=discdet[1] ;
                      document.getElementById("ctl00_user_lblDiscount").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " + Math.round(discount)
                      document.getElementById("ctl00_user_disc").style.display="";
                                   totamount=totamount-discount;
           
             tot=totamount
           
             if(parseFloat(totamount)%5!=0){
                totamount=Math.ceil(totamount)
                if(parseFloat(totamount)%5!=0)
                   totamount=totamount-2
                }
                
             else
                totamount=Math.round(totamount)
                   
                                   
             document.getElementById("ctl00_user_lblAmount").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " + Math.round(parseFloat(totamount));
             document.getElementById("ctl00_user_hdnPayAmount").value=Math.round(parseFloat(totamount));
             Edu='0.'+document.getElementById("ctl00_user_dedu").innerHTML;    
             SEdu='0.'+document.getElementById("ctl00_user_dsedu").innerHTML;    
             NetAmount=Math.round(parseFloat(GetValue("hdnPayAmount"))*100/(100+parseFloat( document.getElementById("ctl00_user_dservice").innerHTML)+parseFloat(Edu )+parseFloat(SEdu)));
             document.getElementById("ctl00_user_hdnNAmount").value=NetAmount
            servicetax=Math.round(parseFloat(NetAmount)*parseFloat( document.getElementById("ctl00_user_dservice").innerHTML)/100)
             document.getElementById("ctl00_user_hdnService").value=servicetax
              document.getElementById("ctl00_user_lblServicetax").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +servicetax
              edcess=Math.round(parseFloat(servicetax)*parseFloat( document.getElementById("ctl00_user_dedu").innerHTML)/100)
             document.getElementById("ctl00_user_hdnEdu").value=edcess
              document.getElementById("ctl00_user_lblEdu").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +edcess
              sedcess=Math.round(parseFloat(servicetax)*parseFloat( document.getElementById("ctl00_user_dsedu").innerHTML)/100)
             document.getElementById("ctl00_user_hdnSecEdu").value=sedcess
              document.getElementById("ctl00_user_lblSEdu").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +sedcess  
                   }
                 }
             }
      if(discount==0)   document.getElementById("ctl00_user_disc").style.display="none";
          

 // }
  }
  return false;
}
function SpotShowFields()
{

  val=GetValue("drpPart")
    document.getElementById("ctl00_user_hdnDrp").value = val;
    for(i=1;i<=10;i++)
  {
     document.getElementById("ctl00_user_main"+i).style.display="none";
     document.getElementById("ctl00_user_maininn"+i).style.display="none";
  }
  for(i=1;i<=val;i++)
  {
     document.getElementById("ctl00_user_main"+i).style.display="";
     document.getElementById("ctl00_user_maininn"+i).style.display="";
     
  }
  discount=0;
  if(GetValue("hdnAmount")!="")
  {
     TOTAL=parseFloat(val*GetValue("hdnOPayAmount"))
     document.getElementById("ctl00_user_lblTotal").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'> " + parseFloat(val*GetValue("hdnAmount"));
             document.getElementById("ctl00_user_lblAmount").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " + parseFloat((val*GetValue("hdnAmount"))-discount);
             document.getElementById("ctl00_user_hdnPayDisc").value=discount;
             document.getElementById("ctl00_user_hdnPayAmount").value=parseFloat((val*GetValue("hdnAmount"))-discount);
             document.getElementById("ctl00_user_hdnTotAmount").value=parseFloat(val*GetValue("hdnAmount"));
              totamount=parseFloat((val*GetValue("hdnAmount"))-discount)
           //   alert(totamount)
              tot=totamount;
              servicetax=Math.round(parseFloat((val*GetValue("hdnAmount"))-discount)*parseFloat( document.getElementById("ctl00_user_dservice").innerHTML)/100)
             document.getElementById("ctl00_user_hdnService").value=servicetax
              document.getElementById("ctl00_user_lblServicetax").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +servicetax
              edcess=Math.round(parseFloat(servicetax)*parseFloat( document.getElementById("ctl00_user_dedu").innerHTML)/100)
             document.getElementById("ctl00_user_hdnEdu").value=edcess
              document.getElementById("ctl00_user_lblEdu").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +edcess
              sedcess=Math.round(parseFloat(servicetax)*parseFloat( document.getElementById("ctl00_user_dsedu").innerHTML)/100)
             document.getElementById("ctl00_user_hdnSecEdu").value=sedcess
              document.getElementById("ctl00_user_lblSEdu").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +sedcess
             totamount=Math.round(parseFloat(totamount) + parseFloat(servicetax)+parseFloat(edcess)+parseFloat(sedcess))
             
             if(parseFloat(totamount)%5!=0)
             {  totamount=tot;
             
                servicetax=Math.ceil(parseFloat((val*GetValue("hdnAmount"))-discount)*parseFloat( document.getElementById("ctl00_user_dservice").innerHTML)/100)
             document.getElementById("ctl00_user_hdnService").value=servicetax
              document.getElementById("ctl00_user_lblServicetax").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +servicetax
              edcess=Math.ceil(parseFloat(servicetax)*parseFloat( document.getElementById("ctl00_user_dedu").innerHTML)/100)
             document.getElementById("ctl00_user_hdnEdu").value=edcess
              document.getElementById("ctl00_user_lblEdu").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +edcess
              sedcess=Math.ceil(parseFloat(servicetax)*parseFloat( document.getElementById("ctl00_user_dsedu").innerHTML)/100)
             document.getElementById("ctl00_user_hdnSecEdu").value=sedcess
              document.getElementById("ctl00_user_lblSEdu").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +sedcess
             totamount=Math.ceil(parseFloat(totamount) + parseFloat(servicetax)+parseFloat(edcess)+parseFloat(sedcess))
              if((totamount+1)%5==0) totamount=totamount+1;
             else if((totamount-1)%5==0) totamount=totamount-1;    
             }
             document.getElementById("ctl00_user_lblAmount").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " + Math.round(parseFloat(totamount));
             document.getElementById("ctl00_user_hdnPayAmount").value=Math.round(parseFloat(totamount));
     if(GetValue("hdnDiscount")!="")
     {
         disc = GetValue("hdnDiscount").split("|");
         
         flg=true
         for( k=(disc.length)-1;k>=0;k--)
         {
           discdet=disc[k].split(":")
           if(discdet[0]<=val && flg)
           {
              flg=false
              totamount=parseFloat(TOTAL)
              discount=Math.round( parseFloat(parseFloat(TOTAL)* discdet[1] )/100);
               document.getElementById("ctl00_user_hdnPayDisc").value=Math.round(discount);
               
               document.getElementById("ctl00_user_per").innerHTML=discdet[1] ;
                      document.getElementById("ctl00_user_lblDiscount").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " + Math.round(discount)
                      document.getElementById("ctl00_user_disc").style.display="";
                                   totamount=totamount-discount;
           
             tot=totamount
           
             if(parseFloat(totamount)%5!=0){
                totamount=Math.ceil(totamount)
                if(parseFloat(totamount)%5!=0)
                   totamount=totamount-2
                }
                
             else
                totamount=Math.round(totamount)
                   
                                   
             document.getElementById("ctl00_user_lblAmount").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " + Math.round(parseFloat(totamount));
             document.getElementById("ctl00_user_hdnPayAmount").value=Math.round(parseFloat(totamount));
             Edu='0.'+document.getElementById("ctl00_user_dedu").innerHTML;    
             SEdu='0.'+document.getElementById("ctl00_user_dsedu").innerHTML;    
             NetAmount=Math.round(parseFloat(GetValue("hdnPayAmount"))*100/(100+parseFloat( document.getElementById("ctl00_user_dservice").innerHTML)+parseFloat(Edu )+parseFloat(SEdu)));
             document.getElementById("ctl00_user_hdnNAmount").value=NetAmount
            servicetax=Math.round(parseFloat(NetAmount)*parseFloat( document.getElementById("ctl00_user_dservice").innerHTML)/100)
             document.getElementById("ctl00_user_hdnService").value=servicetax
              document.getElementById("ctl00_user_lblServicetax").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +servicetax
              edcess=Math.round(parseFloat(servicetax)*parseFloat( document.getElementById("ctl00_user_dedu").innerHTML)/100)
             document.getElementById("ctl00_user_hdnEdu").value=edcess
              document.getElementById("ctl00_user_lblEdu").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +edcess
              sedcess=Math.round(parseFloat(servicetax)*parseFloat( document.getElementById("ctl00_user_dsedu").innerHTML)/100)
             document.getElementById("ctl00_user_hdnSecEdu").value=sedcess
              document.getElementById("ctl00_user_lblSEdu").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +sedcess  
                   }
                 }
             }
      if(discount==0)   document.getElementById("ctl00_user_disc").style.display="none";
      
  }
  return false;
}
function CheckPayment(frm)
{
   if(frm=="C"){
      document.getElementById("ctl00_user_PayAll").style.display="none";
       document.getElementById("ctl00_user_PayChq").style.display="none";
      document.getElementById("ctl00_user_PayChqB").style.display="none";
      }
   else
   {
      document.getElementById("ctl00_user_pMode").innerHTML="Cheque";
      document.getElementById("ctl00_user_PayAll").style.display="";
      document.getElementById("ctl00_user_PayChq").style.display="";
      document.getElementById("ctl00_user_PayChqB").style.display="";
      
      }
}


function ShowSpotPayment(frm)
{
val=1;discount=0
   if(frm=="M"){
   document.getElementById("ctl00_user_txtAdd").value=""
  document.getElementById("ctl00_user_lblMem").innerHTML=""
     document.getElementById("ctl00_user_txtAdd").value=""
  
            document.getElementById("ctl00_user_limem").style.display="";
            document.getElementById("ctl00_user_limem1").style.display="";
            document.getElementById("ctl00_user_linon").style.display="none";
             }
   else
   {
   document.getElementById("ctl00_user_txtAdd").value=""
  document.getElementById("ctl00_user_lblMem").innerHTML=""
     document.getElementById("ctl00_user_txtAdd").value=""
  
         document.getElementById("ctl00_user_limem").style.display="none";
               document.getElementById("ctl00_user_limem1").style.display="none";
            document.getElementById("ctl00_user_linon").style.display="";
       
      }
}



function ShowPayment(frm)
{
val=1;discount=0
   if(frm=="M"){
   document.getElementById("ctl00_user_hdnOPayAmount").value=document.getElementById("ctl00_user_MemberAMOUNT").value
            document.getElementById("limem").style.display="";
            document.getElementById("limem1").style.display="";
            document.getElementById("linon").style.display="none";
           document.getElementById("ctl00_user_hdnAmount").value=document.getElementById("ctl00_user_hdnMAmount").value
           document.getElementById("ctl00_user_disc").style.display="none";
             document.getElementById("ctl00_user_lblTotal").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'> " + parseFloat(val*GetValue("hdnAmount"));
             document.getElementById("ctl00_user_lblAmount").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " + parseFloat((val*GetValue("hdnAmount"))-discount);
             document.getElementById("ctl00_user_hdnPayDisc").value=discount;
             document.getElementById("ctl00_user_hdnPayAmount").value=parseFloat((val*GetValue("hdnAmount"))-discount);
             document.getElementById("ctl00_user_hdnTotAmount").value=parseFloat(val*GetValue("hdnAmount"));
              totamount=parseFloat((val*GetValue("hdnAmount"))-discount)
              servicetax=Math.round(parseFloat((val*GetValue("hdnAmount"))-discount)*parseFloat( document.getElementById("ctl00_user_dservice").innerHTML)/100)
             document.getElementById("ctl00_user_hdnService").value=servicetax
              document.getElementById("ctl00_user_lblServicetax").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +servicetax
              edcess=Math.round(parseFloat(servicetax)*parseFloat( document.getElementById("ctl00_user_dedu").innerHTML)/100)
             document.getElementById("ctl00_user_hdnEdu").value=edcess
              document.getElementById("ctl00_user_lblEdu").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +edcess
              sedcess=Math.round(parseFloat(servicetax)*parseFloat( document.getElementById("ctl00_user_dsedu").innerHTML)/100)
             document.getElementById("ctl00_user_hdnSecEdu").value=sedcess
              document.getElementById("ctl00_user_lblSEdu").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +sedcess
             totamount=parseFloat(totamount) + parseFloat(servicetax)+parseFloat(edcess)+parseFloat(sedcess)
             
             document.getElementById("ctl00_user_lblAmount").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " + parseFloat(totamount);
             document.getElementById("ctl00_user_hdnPayAmount").value=parseFloat(totamount); 
   }
   else
   {
   document.getElementById("ctl00_user_hdnOPayAmount").value=document.getElementById("ctl00_user_NonMemberAMOUNT").value
         document.getElementById("limem").style.display="none";
               document.getElementById("limem1").style.display="none";
            document.getElementById("linon").style.display="";
            document.getElementById("ctl00_user_hdnAmount").value=document.getElementById("ctl00_user_hdnNAmount").value
       document.getElementById("ctl00_user_disc").style.display="none";
             document.getElementById("ctl00_user_lblTotal").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'> " + parseFloat(val*GetValue("hdnAmount"));
             document.getElementById("ctl00_user_lblAmount").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " + parseFloat((val*GetValue("hdnAmount"))-discount);
             document.getElementById("ctl00_user_hdnPayDisc").value=discount;
             document.getElementById("ctl00_user_hdnPayAmount").value=parseFloat((val*GetValue("hdnAmount"))-discount);
             document.getElementById("ctl00_user_hdnTotAmount").value=parseFloat(val*GetValue("hdnAmount"));
              totamount=parseFloat((val*GetValue("hdnAmount"))-discount)
              servicetax=Math.round(parseFloat((val*GetValue("hdnAmount"))-discount)*parseFloat( document.getElementById("ctl00_user_dservice").innerHTML)/100)
             document.getElementById("ctl00_user_hdnService").value=servicetax
              document.getElementById("ctl00_user_lblServicetax").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +servicetax
              edcess=Math.round(parseFloat(servicetax)*parseFloat( document.getElementById("ctl00_user_dedu").innerHTML)/100)
             document.getElementById("ctl00_user_hdnEdu").value=edcess
              document.getElementById("ctl00_user_lblEdu").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +edcess
              sedcess=Math.round(parseFloat(servicetax)*parseFloat( document.getElementById("ctl00_user_dsedu").innerHTML)/100)
             document.getElementById("ctl00_user_hdnSecEdu").value=sedcess
              document.getElementById("ctl00_user_lblSEdu").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +sedcess
             totamount=parseFloat(totamount) + parseFloat(servicetax)+parseFloat(edcess)+parseFloat(sedcess)
             
             document.getElementById("ctl00_user_lblAmount").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " + parseFloat(totamount);
             document.getElementById("ctl00_user_hdnPayAmount").value=parseFloat(totamount); 
      }
}

function Validateproduct()
{
   if(GetValue("drpIndustry")=="")
   {
       alert("Please select Inductry Type.");
    SetFocus("drpIndustry");
    return false;
   }
   if(GetValue("txtTitle")=="")
   {
       alert("Please enter Title.");
    SetFocus("txtTitle");
    return false;
   }
   else if(!checkAlphaNum(GetValue("txtTitle")))
   {
       alert("Please enter valid Title.");
    SetFocus("txtTitle");
    return false;
   }
   if(GetValue("txtDesc")=="")
   {
       alert("Please enter Description.");
    SetFocus("txtDesc");
    return false;
   }
  
  return true;
}

function ValidateEventReg(frm)
{
if(frm!="s"){
  if(GetValue("txtOrg")=="")
  {
    alert("Please enter Name of Organization / Individual.");
    SetFocus("txtOrg");
    return false;
  }
  else if(! checkAlphaNum(GetValue("txtOrg")))
  {
    alert("Please enter valid Name of Organization / Individual.");
    SetFocus("txtOrg");
    return false;
  }
  }
  else
  {
      if(document.getElementById("ctl00_user_rdoMember").checked)
      {
          if(GetValue("drpMember")=="")
          {
            alert("Please select Name of Organization / Individual.");
            SetFocus("drpMember");
            return false;
          }
      }  
      else
      {
        if(GetValue("txtOrg")=="")
          {
            alert("Please enter Name of Organization / Individual.");
            SetFocus("txtOrg");
            return false;
          }
          else if(! checkAlphaNum(GetValue("txtOrg")))
          {
            alert("Please enter valid Name of Organization / Individual.");
            SetFocus("txtOrg");
            return false;
          }
      }
  
  }
//  if(frm!="s"){
//  if(GetValue("txtMemno")=="")
//  {
//    alert("Please enter Membership No.");
//    SetFocus("txtMemno");
//    return false;
//  }
//  else if(! checkAlphaNum(GetValue("txtMemno")))
//  {
//    alert("Please enter valid Membership No.");
//    SetFocus("txtMemno");
//    return false;
//  }
//  }
    if(frm!="s"){
    if(GetValue("txtAdd")=="")
  {
    alert("Please enter Address.");
    SetFocus("txtAdd");
    return false;
  }
}
  if(GetValue("txtName")!="")
  {
 if(! checkname(GetValue("txtName")))
  {
    alert("Please enter valid Name of Contact person.");
    SetFocus("txtName");
    return false;
  }  }
  if(GetValue("txtEmail")!="")
  {
 if(!isEmail(GetValue("txtEmail")))
  {
    alert("Please enter valid Email id.");
    SetFocus("txtEmail");
    return false;
  }}
  if(GetValue("txtNo")!="")
  {
if(!checkAlphaNum(GetValue("txtNo")))
      {
        alert("Please enter valid Contact No.");
        SetFocus("txtNo");
        return false;
      }}
  p=1;
  while(p<=10)
  {

     if(document.getElementById("ctl00_user_main"+p).style.display=="")
     {
  //     alert(checkname(GetValue("txtName"+p)));
      if(GetValue("txtName"+p)=="")
      {
        alert("Please enter Name of Participant's Name "+ p + "."  );
         SetFocus("txtName"+p);
        return false;
      }
      else if(!checkname(GetValue("txtName"+p)))
      {
        alert("Please enter valid Name of Participant's Name "+ p + "."  );
           SetFocus("txtName"+p);
        return false;
      }
      
       if(frm!="s"){
          if(GetValue("txtEmail"+p)=="")
           {
             alert("Please enter Email id "+ p + "." );
            SetFocus("txtEmail"+p)
            return false;
           }
           else if(!isEmail(GetValue("txtEmail"+p)))
          {
            alert("Please enter valid Email id "+ p + "." );
            SetFocus("txtEmail"+p)
            return false;
          
          }
           if(GetValue("txtDesg"+p)=="")
          {
            alert("Please enter Designation."  );
             SetFocus("txtDesg"+p);
            return false;
          }
          else if(!checkname(GetValue("txtDesg"+p)))
          {
            alert("Please enter valid Designation."  );
               SetFocus("txtDesg"+p);
            return false;
          }
        
          if(GetValue("txtNo"+p)=="")
          {
             alert("Please enter Contact No. "+ p + "." );
                SetFocus("txtNo"+p)
                return false;
          
                         }
                         else if(!checkAlphaNum(GetValue("txtNo"+p)))
              {
                alert("Please enter valid Contact No. "+ p + "." );
                SetFocus("txtNo"+p)
                return false;
              }

        
        }  
      }
      
        p=p+1;
  }
  
//  val=GetValue("hdnDrp")
//     if(frm!="e"){
//  if(document.getElementById("ctl00_user_hdnDrp").value==1)
//  {
//     if(document.getElementById("ctl00_user_Pay").style.display=="")
//     {
//        discount=0;
//          if(GetValue("hdnAmount")!="")
//          {
//          
//             document.getElementById("ctl00_user_lblTotal").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'> " + parseFloat(val*GetValue("hdnAmount"));
//             document.getElementById("ctl00_user_lblAmount").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " + parseFloat((val*GetValue("hdnAmount"))-discount);
//             document.getElementById("ctl00_user_hdnPayDisc").value=discount;
//             document.getElementById("ctl00_user_hdnPayAmount").value=parseFloat((val*GetValue("hdnAmount"))-discount);
//             document.getElementById("ctl00_user_hdnTotAmount").value=parseFloat(val*GetValue("hdnAmount"));
//              totamount=parseFloat((val*GetValue("hdnAmount"))-discount)
//              servicetax=Math.round(parseFloat((val*GetValue("hdnAmount"))-discount)*parseFloat( document.getElementById("ctl00_user_dservice").innerHTML)/100)
//             document.getElementById("ctl00_user_hdnService").value=servicetax
//              document.getElementById("ctl00_user_lblServicetax").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +servicetax
//              edcess=Math.round(parseFloat(servicetax)*parseFloat( document.getElementById("ctl00_user_dedu").innerHTML)/100)
//             document.getElementById("ctl00_user_hdnEdu").value=edcess
//              document.getElementById("ctl00_user_lblEdu").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +edcess
//              sedcess=Math.round(parseFloat(servicetax)*parseFloat( document.getElementById("ctl00_user_dsedu").innerHTML)/100)
//             document.getElementById("ctl00_user_hdnSecEdu").value=sedcess
//              document.getElementById("ctl00_user_lblSEdu").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " +sedcess
//             totamount=parseFloat(totamount) + parseFloat(servicetax)+parseFloat(edcess)+parseFloat(sedcess)
//             
//             document.getElementById("ctl00_user_lblAmount").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " + parseFloat(totamount);
//             document.getElementById("ctl00_user_hdnPayAmount").value=parseFloat(totamount);
//             
//             if(GetValue("hdnDiscount")!="")
//             {
//                 disc = GetValue("hdnDiscount").split("|");
//                 
//                 flg=true
//                 for( k=(disc.length)-1;k>=0;k--)
//                 {
//                   discdet=disc[k].split(":")
//                   if(discdet[0]<=val && flg)
//                   {
//                      flg=false
//                      discount= parseFloat(parseFloat(GetValue("hdnPayAmount")* discdet[1] )/100);
//                      document.getElementById("ctl00_user_per").innerHTML=discdet[1];
//                      document.getElementById("ctl00_user_lblDiscount").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " + discount
//                      document.getElementById("ctl00_user_disc").style.display="";
//                      totamount=totamount-discount;
//                        document.getElementById("ctl00_user_lblAmount").innerHTML="<img src='" + document.getElementById("ctl00_user_pathhdn").value + "/images/rupee.png'>  " + parseFloat(totamount);
//             document.getElementById("ctl00_user_hdnPayAmount").value=parseFloat(totamount);
//                   }
//                 }
//             }
//                 if(discount==0)   document.getElementById("ctl00_user_disc").style.display="none";
//             
//          }
//     }
//  }

//}
 if(frm=="s"){
 if(document.getElementById("ctl00_user_PayChq").style.display=="")
 {
    if(document.getElementById("ctl00_user_txtCHNo").value=="")
   {
    alert("Enter Cheque No.");
     document.getElementById("ctl00_user_txtCHNo").focus();
     return false
   } 
   else if(!checkAlphaNum(document.getElementById("ctl00_user_txtCHNo").value))
   {
     alert("Enter Valid Cheque No.");
     document.getElementById("ctl00_user_txtCHNo").focus();
     return false
   }
     if(document.getElementById("ctl00_user_txtFDate").value=="")
   {
    alert("Select Cheque Date.");
     document.getElementById("ctl00_user_txtFDate").focus();
     return false
   } 
     if(document.getElementById("ctl00_user_txtDet").value=="")
   {
    alert("Enter Bank Details.");
     document.getElementById("ctl00_user_txtDet").focus();
     return false
   } 

 }  
else
{
document.getElementById("ctl00_user_txtCHNo").value="";
} 
}

  return true;
}

function GetNo()
{
document.getElementById("ctl00_user_txtAdd").value=""
  document.getElementById("ctl00_user_lblMem").innerHTML=""
     document.getElementById("ctl00_user_txtAdd").value=""
  if(document.getElementById("ctl00_user_drpMember").value!="")
  {
  
     arr=document.getElementById("ctl00_user_drpMember").value.split('*')
     document.getElementById("ctl00_user_lblMem").innerHTML=arr[0]
     document.getElementById("ctl00_user_txtAdd").value=arr[2]
   } 
}
function FocusSearch()
{
  if(GetValue("txtSearch")=="Search for keyword")
    document.getElementById("ctl00_user_txtSearch").value="";
}

function ShowResult(Path)
{
  if(GetValue("txtSearch")!="Search for keyword")
    window.location=Path+"/world-business-keyword/"+GetValue("txtSearch")+".aspx";
  return false;  
}

function BlurSearch()
{
  if(GetValue("txtSearch")=="")
    document.getElementById("ctl00_user_txtSearch").value="Search for keyword";
}

function ValidationVisaRecommendation()
{
  if(GetValue("drpCountry")=="")
  {
    alert("Please select Country.");
    SetFocus("drpCountry");
    return false;
  }
  if(GetValue("drpEmbassy")=="")
  {
    alert("Please select Place of Embassy.");
    SetFocus("drpEmbassy");
    return false;
  }
  if(GetValue("txtName")=="")
  {
    alert("Please enter your Name.");
    SetFocus("txtName");
    return false;
  }
  else if(! checkname(GetValue("txtName")))
  {
    alert("Please enter valid Name.");
    SetFocus("txtName");
    return false;
  }
  if(GetValue("txtDesg")=="")
  {
    alert("Please enter your Designation.");
    SetFocus("txtDesg");
    return false;
  }
  else if(! checkname(GetValue("txtDesg")))
  {
    alert("Please enter valid Name of Contact person.");
    SetFocus("txtDesg");
    return false;
  }
  if(GetValue("txtEmail")=="")
  {
    alert("Please enter your Email Id.");
    SetFocus("txtEmail");
    return false;
  }
  else if(! isEmail(GetValue("txtEmail")))
  {
    alert("Please enter valid Email Id.");
    SetFocus("txtEmail");
    return false;
  }
  if(GetValue("txtVisit")=="")
  {
    alert("Please enter Pupose of Visit.");
    SetFocus("txtVisit");
    return false;
  }
 else if(GetValue("txtVisit").length >500)
  {
    alert("Details for Purpose of Visit should have max 500 characters.");
    SetFocus("txtVisit");
    return false;
  }   
  if(GetValue("txtFDate")=="")
  {
        alert("Please select From Date.");
        SetFocus("txtFDate");
        return false;
  }
  if(GetValue("type")=="")
  {
    alert("Please select Type of Visit.");
    SetFocus("type");
    return false;
  }

  if(GetValue("type")=="S"){
  if(GetValue("Week")=="" && GetValue("txtdays")=="" && GetValue("txtMonth")=="")
  {
    alert("select Duration Week/Days/Month.");
    SetFocus("Week");
    return false;
  }
  }
  else
  {
      if(GetValue("drpMonth")=="")
      {
           alert("Select Duration.");
    SetFocus("drpMonth");
    return false;
      }
  }
  if(GetValue("txtPassportNo")=="")
  {
        alert("Please enter Passport No.");
        SetFocus("txtPassportNo");
        return false;
  }
  else if(!checkAlphaNum(GetValue("txtPassportNo")))
  {
        alert("Please enter valid Passport No.");
        SetFocus("txtPassportNo");
        return false;
   }
// if(GetValue("txtPassCopy")=="")
//  {
//        alert("Please upload Copy of your Passport.");
//        SetFocus("txtPassCopy");
//        return false;
//  }

  return true;
}

function Validationproduct()
{
  if(GetValue("drpIndustry")=="")
  {
    alert("Please select Industry Type.");
    SetFocus("drpIndustry");
    return false;
  }
  if(GetValue("txtDesc")=="")
  {
    alert("Please enter Description.");
    SetFocus("txtDesc");
    return false;
  }
  return true;
}
function ChkContent()
{
   if(GetValue("type")=="S")
   {
     document.getElementById('single').style.display="";document.getElementById('multi').style.display="none";
   }
   else if(GetValue("type")=="M")
      {
     document.getElementById('single').style.display="none";document.getElementById('multi').style.display="";
   }
   else
   {
     document.getElementById('single').style.display="none";document.getElementById('multi').style.display="none";
   }
}

function ShowChkDet(f)
{
   if(f=="Y")
   {
       document.getElementById("browse").style.display="";document.getElementById("message").style.display="none";
   }
   else
   {
       document.getElementById("browse").style.display="none";document.getElementById("message").style.display="";
   }
   

}

function ValidateSubscribeOnline(Path)
{
frm=document.frmOnline;
if(frm.txtContact.value=="")
  {
    alert("Please enter your Name.");
    frm.txtContact.focus();
    return false;
  }
  else if(! checkname(frm.txtContact.value))
  {
    alert("Please enter valid Name.");
    frm.txtContact.focus();
    return false;
  }
  
  if(frm.txtAdd.value=="")
  {
    alert("Please enter your Address.");
    frm.txtAdd.focus();
    return false;
  }
  else if(! checkAlphaNum(frm.txtAdd.value))
  {
    alert("Please enter valid Address.");
     frm.txtAdd.focus();
    return false;
  }
  if(frm.txtNo.value=="")
  {
    alert("Please enter your Tel /Mobile No.");
    frm.txtNo.focus();
    return false;
  }
  else if(! checkAlphaNum(frm.txtNo.value))
  {
    alert("Please enter valid Tel /Mobile No.");
     frm.txtNo.focus();
    return false;
  }
   if(frm.txtEmail.value=="")
  {
    alert("Please enter your Email Id.");
    frm.txtEmail.focus();
    return false;
  }
  else if(! isEmail(frm.txtEmail.value))
  {
    alert("Please enter valid Email Id.");
   frm.txtEmail.focus();
    return false;
  }
  if(frm.txtName.value!="")
  {
if(! checkAlphaNum(frm.txtName.value))
  {
    alert("Please enter valid Name of your Company.");
    frm.txtName.focus();
    return false;
  }

  if(frm.txtProduct.value=="")
  {
    alert("Please enter Product or Service details.");
    frm.txtProduct.focus();
    return false;
  }
  }
  document.frmOnline.action=Path+'/subscribe_online.aspx';
  document.frmOnline.submit();
 return true;
}

function ValidateApplyOnline(Path,det)
{
frm=document.frmOnline;
if(det!="P"){
  if(frm.txtName.value=="")
  {
    alert("Please enter Name of your Company.");
    frm.txtName.focus();
    return false;
  }
  else if(! checkname(frm.txtName.value))
  {
    alert("Please enter valid Name of your Company.");
    frm.txtName.focus();
    return false;
  }
  if(frm.txtAdd.value=="")
  {
    alert("Please enter your Address.");
    frm.txtAdd.focus();
    return false;
  }
  else if(! checkAlphaNum(frm.txtAdd.value))
  {
    alert("Please enter valid Address.");
     frm.txtAdd.focus();
    return false;
  }
  if(frm.txtNo.value=="")
  {
    alert("Please enter your Tel /Mobile No.");
    frm.txtNo.focus();
    return false;
  }

  else if(! checkAlphaNum(frm.txtNo.value))
  {
    alert("Please enter valid Tel /Mobile No.");
     frm.txtNo.focus();
    return false;
  }
  if(frm.txtWeb.value!="")
  {
 if(! checkAlphaNum(frm.txtWeb.value))
  {
    alert("Please enter valid Website.");
     frm.txtWeb.focus();
    return false;
  }}
   if(frm.txtContact.value=="")
  {
    alert("Please enter your Contact Person.");
    frm.txtContact.focus();
    return false;
  }
  else if(! checkname(frm.txtContact.value))
  {
    alert("Please enter valid Contact Person name.");
     frm.txtContact.focus();
    return false;
  }
  if(frm.txtEmail.value=="")
  {
    alert("Please enter your Email Id.");
    frm.txtEmail.focus();
    return false;
  }
  else if(! isEmail(frm.txtEmail.value))
  {
    alert("Please enter valid Email Id.");
   frm.txtEmail.focus();
    return false;
  }
  if(frm.txtProduct.value=="")
  {
    alert("Please enter Product or Service details.");
    frm.txtProduct.focus();
    return false;
  }
  }
  else
  {
   if(frm.txtContact.value=="")
  {
    alert("Please enter your Contact Person.");
    frm.txtContact.focus();
    return false;
  }
  else if(! checkname(frm.txtContact.value))
  {
    alert("Please enter valid Contact Person name.");
     frm.txtContact.focus();
    return false;
  }

  
  if(frm.txtName.value!="")
  {
     if(! checkname(frm.txtName.value))
  {
    alert("Please enter valid Name of your Company.");
    frm.txtName.focus();
    return false;
  }
  }
  if(frm.txtAdd.value=="")
  {
    alert("Please enter your Address.");
    frm.txtAdd.focus();
    return false;
  }
  else if(! checkAlphaNum(frm.txtAdd.value))
  {
    alert("Please enter valid Address.");
     frm.txtAdd.focus();
    return false;
  }
  if(frm.txtNo.value=="")
  {
    alert("Please enter your Tel /Mobile No.");
    frm.txtNo.focus();
    return false;
  }

  else if(! checkAlphaNum(frm.txtNo.value))
  {
    alert("Please enter valid Tel /Mobile No.");
     frm.txtNo.focus();
    return false;
  }
    if(frm.txtEmail.value=="")
  {
    alert("Please enter your Email Id.");
    frm.txtEmail.focus();
    return false;
  }
  else if(! isEmail(frm.txtEmail.value))
  {
    alert("Please enter valid Email Id.");
   frm.txtEmail.focus();
    return false;
  }
  if(frm.txtWeb.value!="")
  {
 if(! checkAlphaNum(frm.txtWeb.value))
  {
    alert("Please enter valid Website.");
     frm.txtWeb.focus();
    return false;
  }}
 
  }
  
  if(det=="A")
     document.frmOnline.action=Path+'/apply_online.aspx';
  else if(det=="P")   
     document.frmOnline.action=Path+'/process-query.aspx';
  else if(det=="D")   
     document.frmOnline.action=Path+'/download-form.aspx';
  document.frmOnline.submit();
 return true;
}


function ValidatePostEnquiry()
{
if(GetValue("txtContact")=="")
  {
    alert("Please enter your Contact Person.");
    SetFocus("txtContact")
    return false;
  }
  else if(! checkname(GetValue("txtContact")))
  {
    alert("Please enter valid Contact Person name.");
     SetFocus("txtContact");
    return false;
  }
  if(GetValue("txtDesg")=="")
  {
    alert("Please enter your Designation.");
    SetFocus("txtDesg")
    return false;
  }
  else if(! checkname(GetValue("txtDesg")))
  {
    alert("Please enter valid Designation.");
     SetFocus("txtDesg");
    return false;
  }
  if(GetValue("txtName")=="")
  {
    alert("Please enter Name of your Company.");
    SetFocus("txtName");
    return false;
  }
  else if(! checkname(GetValue("txtName")))
  {
    alert("Please enter valid Name of your Company.");
     SetFocus("txtName");
    return false;
  }

  if(GetValue("txtNo")=="")
  {
    alert("Please enter your Tel No.");
    SetFocus("txtNo")
    return false;
  }
  else if(! checkAlphaNum(GetValue("txtNo")))
  {
    alert("Please enter valid Tel No.");
     SetFocus("txtNo")
    return false;
  }
   
  if(GetValue("txtEmail")=="")
  {
    alert("Please enter your Email Id.");
    SetFocus("txtEmail");
    return false;
  }
  else if(! isEmail(GetValue("txtEmail")))
  {
    alert("Please enter valid Email Id.");
    SetFocus("txtEmail");
    return false;
  }

  if(GetValue("txtWeb")=="")
  {
    alert("Please enter your Website.");
    SetFocus("txtWeb")
    return false;
  }
  else if(! checkAlphaNum(GetValue("txtWeb")))
  {
    alert("Please enter valid Website.");
     SetFocus("txtWeb")
    return false;
  }

   if(GetValue("txtEnquiry")=="")
  {
    alert("Please enter Enquiry Details.");
    SetFocus("txtEnquiry")
    return false;
  }
 return true;
}


function ValidateFeedbackEnquiry()
{
if(GetValue("txtName")=="")
  {
    alert("Please enter your Contact Person.");
    SetFocus("txtName")
    return false;
  }
  else if(! checkname(GetValue("txtName")))
  {
    alert("Please enter valid Contact Person name.");
     SetFocus("txtName");
    return false;
  }
 
  if(GetValue("txtContact")=="")
  {
    alert("Please enter your Tel No.");
    SetFocus("txtContact")
    return false;
  }
  else if(! checkAlphaNum(GetValue("txtContact")))
  {
    alert("Please enter valid Tel No.");
     SetFocus("txtContact")
    return false;
  }
   
  if(GetValue("txtEmail")=="")
  {
    alert("Please enter your Email Id.");
    SetFocus("txtEmail");
    return false;
  }
  else if(! isEmail(GetValue("txtEmail")))
  {
    alert("Please enter valid Email Id.");
    SetFocus("txtEmail");
    return false;
  }

 

   if(GetValue("txtMod")=="")
  {
    alert("Please enter Useful Modules.");
    SetFocus("txtMod")
    return false;
  }
  
     if(GetValue("txtCom")=="")
  {
    alert("Please enter Comments.");
    SetFocus("txtCom")
    return false;
  }
  
     if(GetValue("txtSug")=="")
  {
    alert("Please enter your Suggestions.");
    SetFocus("txtSug")
    return false;
  }
 return true;
}

function ValidateSEFEnquiry()
{
if(GetValue("txtContact")=="")
  {
    alert("Please enter your Contact Person.");
    SetFocus("txtContact")
    return false;
  }
  else if(! checkname(GetValue("txtContact")))
  {
    alert("Please enter valid Contact Person name.");
     SetFocus("txtContact");
    return false;
  }
  if(GetValue("txtDesg")=="")
  {
    alert("Please enter your Address.");
    SetFocus("txtDesg")
    return false;
  }
  else if(! checkname(GetValue("txtDesg")))
  {
    alert("Please enter valid Address.");
     SetFocus("txtDesg");
    return false;
  }
   if(GetValue("txtNo")=="")
  {
    alert("Please enter your Tel No.");
    SetFocus("txtNo")
    return false;
  }
  else if(! checkAlphaNum(GetValue("txtNo")))
  {
    alert("Please enter valid Tel No.");
     SetFocus("txtNo")
    return false;
  }
   
  if(GetValue("txtEmail")=="")
  {
    alert("Please enter your Email Id.");
    SetFocus("txtEmail");
    return false;
  }
  else if(! isEmail(GetValue("txtEmail")))
  {
    alert("Please enter valid Email Id.");
    SetFocus("txtEmail");
    return false;
  }

  if(GetValue("txtProduct")=="")
  {
    alert("Please enter your service details.");
    SetFocus("txtProduct")
    return false;
  }


 return true;
}


// Code for validating Login Page
function ValidateLogin()
{
   if (trim(document.getElementById('ctl00_userName').value)==""  || trim(document.getElementById('ctl00_userName').value)=="User Name")
   { 
       alert("Enter Membership No.");
       document.getElementById('ctl00_userName').focus();
       return false;
   }
   else if (!checkAlphaNum(document.getElementById('ctl00_userName').value))
    {
       alert("Enter Valid Membership No.");
       document.getElementById('ctl00_userName').focus();
       return false;
    } 
    else if (trim(document.getElementById('ctl00_password').value)=="")
    { 
    
       alert("Enter Password.");
       document.getElementById('ctl00_password').focus();
       return false;
    }
    else if (!checkAuthentication(document.getElementById('ctl00_password').value))
    {
    
       alert("Enter Valid Password.");
       document.getElementById('ctl00_password').focus();
       return false;
    }
    return true;
}
//

// Code for validating Login Page
function ValidateForgot()
{
   if (trim(document.getElementById('ctl00_txtUsername').value)=="" || trim(document.getElementById('ctl00_txtUsername').value)=="User Name")
   { 
       alert("Enter Membership No.");
       document.getElementById('ctl00_txtUsername').focus();
       return false;
   }
   else if (!checkAlphaNum(document.getElementById('ctl00_txtUsername').value))
    {
       alert("Enter Valid Membership No.");
       document.getElementById('ctl00_txtUsername').focus();
       return false;
    } 
  
    return true;
}
//

// Code for validating Change Password Form
function ValidateChangePassword()
{
  if(document.getElementById('ctl00_user_txtpassword').value=="")
  { 
    alert("Enter Existing Password."); 
    document.getElementById('ctl00_user_txtpassword').focus();
    return false;
  }
  else if(!checkAuthentication(document.getElementById('ctl00_user_txtpassword').value))
  { 
     alert("Special characters like $%^&#`..etc are not allowed. Enter Valid Existing Password."); 
    document.getElementById('ctl00_user_txtpassword').focus();
    return false; 
    
  }
  if(document.getElementById('ctl00_user_txtnew').value=="")
  {  
    alert("Enter Existing Password."); 
    document.getElementById('ctl00_user_txtpassword').focus();
    return false;
  }
  else if(!checkAlphaNum(document.getElementById('ctl00_user_txtnew').value))
  {  
     alert("Special characters like $%^&#`..etc are not allowed. Enter Valid Existing Password."); 
    document.getElementById('ctl00_user_txtpassword').focus();
    return false; 
    
  }
  if(document.getElementById('ctl00_user_txtconfirm').value=="")
  {
   alert("Confirm password should be same as new password."); 
    document.getElementById('ctl00_user_txtpassword').focus();
    return false; 
  }
  
  if(flg)
    return false;
  else
    return true;  
}
//

function OnClickhere(shid,hideid)
{

  document.getElementById("Div"+shid).style.display="";
  document.getElementById("Div"+hideid).style.display="none";
}



function ValidateHallBookingForm(frm)
{
if(frm!="s"){
    if(GetValue("txtCompany")=="")
  {
    alert("Please enter Name of Organization / Individual.");
    SetFocus("txtCompany");
    return false;
  }
  else if(! checkAlphaNum(GetValue("txtCompany")))
  {
    alert("Please enter valid Name of Organization / Individual.");
    SetFocus("txtCompany");
    return false;
  }

  }
  else
  {
   if(GetValue("lblBook")=="")
          {
            alert("Please select Hall.");
            SetFocus("lblBook");
            return false;
          }
      if(document.getElementById("ctl00_user_linon").style.display=="none")
      {
          if(GetValue("drpMember")=="")
          {
            alert("Please select Name of Organization / Individual.");
            SetFocus("drpMember");
            return false;
          }
      }  
      else
      {
        if(GetValue("txtCompany")=="")
          {
            alert("Please enter Name of Organization / Individual.");
            SetFocus("txtCompany");
            return false;
          }
          else if(! checkAlphaNum(GetValue("txtCompany")))
          {
            alert("Please enter valid Name of Organization / Individual.");
            SetFocus("txtCompany");
            return false;
          }
      }
  
  }
  
  if(GetValue("txtContactPerson")=="")
  {
    alert("Please enter Contact Person.");
    SetFocus("txtContactPerson");
    return false;
  }
  else if(! checkname(GetValue("txtContactPerson")))
  {
    alert("Please enter valid Contact Person.");
    SetFocus("txtContactPerson");
    return false;
  }
  if(GetValue("txtDesg")!=""){
  if(! checkname(GetValue("txtDesg")))
  {
    alert("Please enter valid Designation.");
    SetFocus("txtDesg");
    return false;
  }
  }
  if(GetValue("txtTel_O")=="" && GetValue("txtTel_R")=="" && GetValue("txtMobile")=="" )
  {
    alert("Please enter Telephone No/ Mobile No.");
    SetFocus("txtTel_O");
    return false;
  }
  if(GetValue("txtTel_O")!="")
  {
      if(! checkAlphaNum(GetValue("txtTel_O")))
      {
        alert("Please enter valid Telephone No.");
        SetFocus("txtTel_O");
        return false;
      }
  }
  if(GetValue("txtTel_R")!="")
  {
      if(! checkAlphaNum(GetValue("txtTel_R")))
      {
        alert("Please enter valid Telephone No.");
        SetFocus("txtTel_R");
        return false;
      }
  }
  if(GetValue("txtMobile")!="")
  {
      if(! checkAlphaNum(GetValue("txtMobile")))
      {
        alert("Please enter valid Mobile No.");
        SetFocus("txtMobile");
        return false;
      }
  }
 
  if(GetValue("txtEmail")=="")
  {
 alert("Please enter Email id.");
    SetFocus("txtEmail");
    return false;
  }
  else if(!isEmail(GetValue("txtEmail")))
  {
    alert("Please enter valid Email id.");
    SetFocus("txtEmail");
    return false;
  }
   
  if(GetValue("txtEvent")=="")
  {
    alert("Please enter Event Title.");
    SetFocus("txtEvent");
    return false;
  }
  else if(!checkAlphaNum(GetValue("txtEvent")))
  {
    alert("Please enter valid Event Title.");
    SetFocus("txtEvent");
    return false;
  }
  
//  if(document.getElementById("ctl00_user_paydetails").style.display=="")
//  {
//      if(GetValue("txtDet")=="")
//      {
//        alert("Please enter Offline Payment details.");
//        SetFocus("txtDet");
//        return false;
//      }
//  }   

  return true;
}


function ValidateMember(f)
{
   if(f=="r"){
   
    if(GetValue("drpCat")=="")
     {
         alert("Please Select Applicable Membership Category.");
        SetFocus("drpCat");
        return false;
     }

     if(GetValue("drpSlab")=="")
         {
            alert("Please Select Applicable Slab.");
            SetFocus("drpSlab");
            return false;
         }
     }
     else{    

  if(GetValue("txtCompany")=="")
  {
    alert("Please enter Name of Company/ Applicant.");
    SetFocus("txtCompany");
    return false;
  }
  else if(! checkAlphaNum(GetValue("txtCompany")))
  {
    alert("Please enter valid Name of Company/ Applicant.");
    SetFocus("txtCompany");
    return false;
  }
  if(document.getElementById("ctl00_user_rdoCgrompany").checked)
  {
  if(GetValue("txtName")=="")
  {
    alert("Please enter Name of CEO.");
    SetFocus("txtName");
    return false;
  }
  else if(! checkAlphaNum(GetValue("txtName")))
  {
    alert("Please enter valid Name of CEO.");
    SetFocus("txtName");
    return false;
  }
  }
  if(GetValue("txtEmail")=="")
  {
    alert("Please enter CEO Email.");
    SetFocus("txtEmail");
    return false;
  }
  else if(! isEmail(GetValue("txtEmail")))
  {
    alert("Please enter valid CEO Email.");
    SetFocus("txtEmail");
    return false;
  }
  if(GetValue("txtCAdd")=="")
  {
    alert("Please enter Correspondence Address.");
    SetFocus("txtCAdd");
    return false;
  }
 
if(GetValue("txtTel1")=="")
  {
    alert("Please enter Tel No.");
    SetFocus("txtTel1");
    return false;
  }
  else if(! checkAlphaNum(GetValue("txtTel1")))
  {
    alert("Please enter valid Tel No.");
    SetFocus("txtTel1");
    return false;
  }
if(GetValue("txtTel2")=="")
  {
    if(! checkAlphaNum(GetValue("txtTel2")))
  {
    alert("Please enter valid Tel No.");
    SetFocus("txtTel2");
    return false;
  }
  }
if(GetValue("txtFax1")!="")
  { if(! checkAlphaNum(GetValue("txtFax1")))
  {
    alert("Please enter valid Fax No.");
    SetFocus("txtFax1");
    return false;
  }
}
if(GetValue("txtFax2")!="")
  { if(! checkAlphaNum(GetValue("txtFax2")))
  {
    alert("Please enter valid Fax No.");
    SetFocus("txtFax2");
    return false;
  }
}
if(GetValue("txtCell1")!="")
  { if(! checkAlphaNum(GetValue("txtCell1")))
  {
    alert("Please enter valid Cell No.");
    SetFocus("txtCell1");
    return false;
  }
}
if(GetValue("txtCell2")!="")
  { if(! checkAlphaNum(GetValue("txtCell2")))
  {
    alert("Please enter valid Cell No.");
    SetFocus("txtCell2");
    return false;
  }
}

  if(GetValue("txtEmail1")!="")
  {
     if(! isEmail(GetValue("txtEmail1")))
      {
        alert("Please enter valid Email.");
        SetFocus("txtEmail1");
        return false;
      }
  }
  if(GetValue("txtEmail2")!="")
  {
     if(! isEmail(GetValue("txtEmail2")))
      {
        alert("Please enter valid Email.");
        SetFocus("txtEmail2");
        return false;
      }
  }
   if(GetValue("txtCity1")!="")
  {
     if(! checkname(GetValue("txtCity1")))
      {
        alert("Please enter valid City.");
        SetFocus("txtCity1");
        return false;
      }
  }
    if(GetValue("txtCity2")!="")
  {
     if(! checkname(GetValue("txtCity2")))
      {
        alert("Please enter valid City.");
        SetFocus("txtCity2");
        return false;
      }
  }
    if(GetValue("txtPin1")!="")
  {
     if(! isInteger(GetValue("txtPin1")))
      {
        alert("Please enter valid Pin.");
        SetFocus("txtPin1");
        return false;
      }
  }

    if(GetValue("txtPin2")!="")
  {
     if(! isInteger(GetValue("txtPin2")))
      {
        alert("Please enter valid Pin.");
        SetFocus("txtPin2");
        return false;
      }
  }
if(f=="a"){
     if(GetValue("drpCat")=="")
     {
         alert("Please Select Applicable Membership Category.");
        SetFocus("drpCat");
        return false;
     }

     if(GetValue("drpSlab")=="")
         {
            alert("Please Select Applicable Slab.");
            SetFocus("drpSlab");
            return false;
         }
  if(document.getElementById("ctl00_user_rdoCgrompany").checked)
  {

  if(GetValue("txtEst")!="" && GetValue("txtEst")!="YYYY" )
  {
     if(!isInteger(GetValue("txtEst")))
      {
        alert("Please enter Valid Year of Establishment.");
        SetFocus("txtEst");
        return false;
      }
      else if(parseFloat(GetValue("txtEst"))>parseFloat(GetValue("hdnYear")))
      {
        alert("Please enter Year of Establishment should be less than current year.");
        SetFocus("txtEst");
        return false;
      }
      
  }
   if(GetValue("txtTurn")=="" )
  {
    alert("Please enter Annual Sales Turnover.");
    SetFocus("txtTurn");
    return false;
  }
  } 

 
  
   if(GetValue("txtMag")!="")
  {
     if(! isInteger(GetValue("txtMag")))
      {
        alert("Please enter valid No. of Managerial Staff.");
        SetFocus("txtMag");
        return false;
      }
  }
   if(GetValue("txtstaff")!="")
  {
     if(! isInteger(GetValue("txtstaff")))
      {
        alert("Please enter valid No. of Staff.");
        SetFocus("txtstaff");
        return false;
      }
  }
   if(GetValue("txtWorker")!="")
  {
     if(! isInteger(GetValue("txtWorker")))
      {
        alert("Please enter valid No. of Workers.");
        SetFocus("txtWorker");
        return false;
      }
  }

 if(GetValue("txtWTotal")!="")
  {
     if(! isInteger(GetValue("txtWTotal")))
      {
        alert("Please enter valid No. of Total Staff.");
        SetFocus("txtWTotal");
        return false;
      }
  }  
  
  for(p=1;p<9;p++)
  {
     if(GetValue("txtN"+p)!=="")
     {
        if(!checkname(GetValue("txtN"+p)))
        {
           alert("Enter valid Name.");
           SetFocus("txtN"+p);
           return false;
        }
     }
       if(GetValue("txtE"+p)!=="")
     {
        if(GetValue("txtN"+p)=="")
        {
           alert("Enter Name.");
           SetFocus("txtN"+p);
           return false;
        }
        else if(!checkname(GetValue("txtN"+p)))
        {
           alert("Enter valid Name.");
           SetFocus("txtN"+p);
           return false;
        }
        if(!isEmail(GetValue("txtE"+p)))
        {
           alert("Enter valid Email.");
           SetFocus("txtE"+p);
           return false;
        }
     }
      
  }
  }
  }
  document.getElementById("ctl00_user_idVal").value=document.getElementById("ctl00_user_drpSlab").value
  document.getElementById("ctl00_user_idCat").value=document.getElementById("ctl00_user_drpCat").value
  
  return true;
}


function ValidateConfirm(){  
//  if(document.getElementById("ctl00_user_paydetails").style.display=="")
//  {
//      if(GetValue("txtDet")=="")
//      {
//        alert("Please enter Offline Payment details.");
//        SetFocus("txtDet");
//        return false;
//      }
//  }   

 if(document.getElementById("ctl00_user_PayChq").style.display=="")
 {
    if(document.getElementById("ctl00_user_txtCHNo").value=="")
   {
    alert("Enter Cheque No.");
     document.getElementById("ctl00_user_txtCHNo").focus();
     return false
   } 
   else if(!checkAlphaNum(document.getElementById("ctl00_user_txtCHNo").value))
   {
     alert("Enter Valid Cheque No.");
     document.getElementById("ctl00_user_txtCHNo").focus();
     return false
   }
     if(document.getElementById("ctl00_user_txtFDate").value=="")
   {
    alert("Select Cheque Date.");
     document.getElementById("ctl00_user_txtFDate").focus();
     return false
   } 
     if(document.getElementById("ctl00_user_txtDet").value=="")
   {
    alert("Enter Bank Details.");
     document.getElementById("ctl00_user_txtDet").focus();
     return false
   } 

 }  
else
{
document.getElementById("ctl00_user_txtCHNo").value="";
} 
  return true;
}

function AddToText(frm)
{
   
   if(frm=="e")
   {
      if(GetValue("empCon")!=""){
       Arr=GetValue("txtExport").split(",")
     L=0;
      for(k=0;k<Arr.length;k++)
      {
          if(Arr[k]==GetValue("empCon"))  L=1;
      } 
      if(L==0){
          if(GetValue("txtExport") =="" )
                     document.getElementById("ctl00_user_txtExport").value= GetValue("empCon");
         else 
          document.getElementById("ctl00_user_txtExport").value=document.getElementById("ctl00_user_txtExport").value+","+ GetValue("empCon");
         } 
      }   
   }
   else  if(frm=="i")
   {
        Arr=GetValue("txtImport").split(",")
     L=0;
      for(k=0;k<Arr.length;k++)
      {
          if(Arr[k]==GetValue("impCon"))  L=1;
      } 
      if(L==0){
          if(GetValue("impCon")!=""){
         if(GetValue("txtImport") =="" )       
             document.getElementById("ctl00_user_txtImport").value= GetValue("impCon");
         else
              document.getElementById("ctl00_user_txtImport").value=document.getElementById("ctl00_user_txtImport").value+","+ GetValue("impCon");
             } 
         }
   }
  
}



function ShowFrontDiv(frm)
{
   if(frm=="F")
     {
         document.getElementById("divFor").style.display="";  document.getElementById("login_form").style.display="none";
     }
     else
     {
       document.getElementById("divFor").style.display="none";  document.getElementById("login_form").style.display="";
     }
   
   return false;
}

//To validate Hour-Time
function validateTime(hid,mid)
    {    
       
        hour=document.getElementById(hid);
        minute=document.getElementById(mid);
        var temp=hour.value ;
        if(temp=="HH")
        {
            hour.value="";  
        }
        if(temp!=1 && temp!=0 && temp<10 && temp>1)
        {   
            if(temp.length!=2)
            {
                  hour.value="0"+temp;
                  minute.focus();            
            }      
        }        
        if(!isInteger(hour.value))
        {
           alert("Please Special characters like $%^&#`..etc are not allowed. Enter valid Time");
           hour.value="";
           hour.focus();
           return false;
        }          
        if(temp>12)
        {       
            hour.value="";  
            hour.focus();
        } 
     
        return true;
    }
    
// to validate minute-Time    
    function validateMinute(hid,mid)
    {
          
        hour=document.getElementById(hid);
        minute=document.getElementById(mid);
       var temp1=minute.value;
        if(temp1=="MM")
        {
           minute.value="";  
        }                          
        if(!isInteger(minute.value))
        {
            alert("Please Special characters like $%^&#`..etc are not allowed. Enter valid Time");
           minute.value="00";
            minute.focus();
            return false;
        }   
        if(temp1.length==2)
        {
            if(temp1>59)
            {       
                minute.value="";  
              
            } 
            else if(temp1 != 0 && temp1 !=30)
              {
            alert("Please do not enter odd times.");
           minute.value="";
            minute.focus();
            return false;
        }   
              minute.focus();    
        }
        else
        {
            if(temp1>5)
            {   
                minute.value="0"+temp1;
                hour.focus();
            }
        }
        return true;
    }



function ValidateDates(frm)
{
if(frm=="s"){
    if(ValidateHallBookingForm(frm)){
        if(GetValue("txtFDate")=="")
  {
    alert("Please select From Date.");
    SetFocus("txtFDate");
    return false;
  }
  if(GetValue("txtTDate")=="")
  {
    alert("Please select To Date.");
    SetFocus("txtTDate");
    return false;
  }
      
      return true;
      }
    else 
      return false  
}
else{
  if(ValidateHallBookingForm(frm)){
  if(GetValue("txtFDate")=="")
  {
    alert("Please select From Date.");
    SetFocus("txtFDate");
    return false;
  }
  if(GetValue("txtTDate")=="")
  {
    alert("Please select To Date.");
    SetFocus("txtTDate");
    return false;
  }
    var str1 = GetValue('txtFDate');
    var str2 =GetValue('txtTDate');
        var str3 =GetValue('hdnToday');
    var dt1 = parseFloat(str1.substring(0,2),10);
    var mon1 = parseFloat(str1.substring(3,5),10);
    var yr1 = parseFloat(str1.substring(6,10),10);
    var dt2 = parseFloat(str2.substring(0,2),10);
    var mon2 = parseFloat(str2.substring(3,5),10);
    var yr2 = parseFloat(str2.substring(6,10),10);
    var dt3 = parseFloat(str3.substring(0,2),10);
    var mon3 = parseFloat(str3.substring(3,5),10);
    var yr3 = parseFloat(str3.substring(6,10),10);
    var date1 = new Date(yr1, mon1, dt1);
    var date2 = new Date(yr2, mon2, dt2);
    var date3 = new Date(yr3, mon3, dt3);
 if(date1 > date2)
    {
        alert("To Date should be greater than From Date.");
        SetFocus("txtTDate");
        return false;
    }
    
    if(date3 > date1)
    {
        alert("From Date should be greater than Today's Date.");
        SetFocus("txtFDate");
        return false;
    } 
  return true;
  }
  else
   return false
  } 
}


function ConfirmDates()
{

  val=GetValue('idVal');
  p=0;
  for(l=0;l<val; l++)
  {
    k=l+2;
    Fhh=document.getElementById("ctl00_user_grd_ctl0"+k+"_txtFhour").value;
    Fmm=document.getElementById("ctl00_user_grd_ctl0"+k+"_txtFMin").value;
    FFor=document.getElementById("ctl00_user_grd_ctl0"+k+"_drpFFormat").value;
  
    Thh=document.getElementById("ctl00_user_grd_ctl0"+k+"_txtThour").value;
    Tmm=document.getElementById("ctl00_user_grd_ctl0"+k+"_txtTMin").value;
    TFor=document.getElementById("ctl00_user_grd_ctl0"+k+"_drpTFormat").value;
    
    
    
    if(Fhh!="HH" && Fmm!="MM" && Thh!="HH" && Tmm !="MM")
    {
         FTime=Fhh+"."+Fmm
       if(FFor=="PM") 
       {
          if( Fhh !=12)
            Fhh =parseFloat(Fhh) +12;
          FTime=Fhh+"."+Fmm;
       }
       TTime=Thh+"."+Tmm
       if(TFor=="PM") 
       {
       if( Thh !=12) 
          Thh = parseFloat(Thh) +12;
          TTime=Thh+"."+Tmm;
       }
   // alert(parseFloat(TTime))
       if((parseFloat(FTime)<7.30 || parseFloat(FTime)==12.00)  && FFor=="AM") 
       {
         alert("Event time should be greater than 7:30 AM")
         document.getElementById("ctl00_user_grd_ctl0"+k+"_txtFhour").focus();
         return false;
          
       } 
        else if(parseFloat(TTime)==12.00 && TFor=="AM") 
       {
         alert("Event end time should be less than 10:30 PM")
         document.getElementById("ctl00_user_grd_ctl0"+k+"_txtThour").value;
         return false;
       } 
       else if(parseFloat(TTime)>22.30 && TFor=="PM") 
       {
         alert("Event end time should be less than 10:30 PM")
         document.getElementById("ctl00_user_grd_ctl0"+k+"_txtThour").value;
         return false;
       } 
  
      diff=parseFloat(TTime)- parseFloat(FTime)  

       if(parseFloat(TTime)<parseFloat(FTime))
       {
         alert("Event end time should be greater than start time")
         document.getElementById("ctl00_user_grd_ctl0"+k+"_txtThour").focus();
         return false;
       }
      else if(diff<1)
      {
            alert("Event should be of atleast 1 hr.")
         document.getElementById("ctl00_user_grd_ctl0"+k+"_txtThour").focus();
         return false;
      }
       p=1
    }
  } 
  
  if(p==0)
   {
         alert("Please confim atleast 1 booking date with time")
         document.getElementById("ctl00_user_grd_ctl02_txtThour").focus();
         return false;
  }
  return true;
  
}


