﻿// JScript File

        var strMessage="";
        var strInetrnalID="";
        var divID="";
        var flag="0";
        var fileCounter = 0;
        var tcClickCounter=0;
        var filePath = '';
        var filecount;
        var counter=-1;
        var popup_window;
        var strClientID;
        // debugger;

         function removeAdminElement(counter)
         {
           
            filecount=document.getElementById('ctl00_ContentPlaceHolder1_locResumeCount').value
            filecount=filecount-2;
            document.getElementById('ctl00_ContentPlaceHolder1_locResumeCount').value=filecount;
            // alert(filecount);
            if (filecount==0)
            {
               document.getElementById("ctl00_ContentPlaceHolder1_uploadResume").disabled=false;
            }
            var hidDeletedFile = document.getElementById('ctl00_ContentPlaceHolder1_hidDeletedFile');
            var hidSavedFile = document.getElementById('ctl00_ContentPlaceHolder1_hidSavedFile');
            var arrSavedFile = hidSavedFile.value.split(',');
            var deleteElement = "";
            var saveFile = "";
            var rowNumber,count;
            count=0;
            rowNumber=0;
            var found=0;
                        
            for(i=0;i<arrSavedFile.length;i+=2)
            {
                    
                 if(arrSavedFile[i] != "" && arrSavedFile[i] != undefined)
                   {
                    //var element = arrSavedFile[i].substring(arrSavedFile[i].lastIndexOf('_')+1); 
                    element=arrSavedFile[i+1]
                    if(element == counter)
                    { 
                       deleteElement = deleteElement + arrSavedFile[i] + ",";
                       deleteElement = deleteElement + arrSavedFile[i+1] + ",";
                       rowNumber=count;
                       found=1;
                     }
                    else
                    {
                       saveFile = saveFile + arrSavedFile[i] + ",";
                       saveFile = saveFile + arrSavedFile[i+1] + ",";
                    }
                   count+=1;
                }
                
            }
                if(found==1)
                {
                        hidDeletedFile.value += deleteElement;
                        hidSavedFile.value = '';
                        hidSavedFile.value = saveFile             
                        document.getElementById('myTable').deleteRow(rowNumber);
                        //document.getElementById('myTable').focus();
               }
           
        }
         
        function PopulateList() 
        {
                fnUploadResume("ctl00_ContentPlaceHolder1_hidFileName","hidFileName");
        }
      
       
       function fnUploadResume(ID,controlID)
       {
        
            var assignId = ID;
            strClientID=ID.substring(0,ID.length-controlID.length);
            //get the FileUpload Control
            var obj=document.getElementById(strClientID + "uploadResume");
                      
            filePath =  obj.value;
            obj.value = "";
            
            if(filePath == "")
            {
                alert("Select a file to upload!");
                return false;
            }
            
            if(filePath!=undefined && filePath!="")
            {
                //acess the div control
                var parentDiv = document.getElementById("fileName");
                            
                var divFile = document.createElement('div');
                            
                var divID = Math.floor(Math.random()*11);
                divFile.setAttribute('id',divID);
            
                var hidFileName = "";
                hidFileName = document.getElementById(strClientID + "hidFileName") ; 
                           
                //var pos = obj.value.lastIndexOf("\\")+1;
                //hidFileName.value += obj.value.substring(pos) + ",";
                var encodeFileName = "";
                var encodeFilePathName = "";
                var hidFilePath = ""; 
                
                if(filePath != "" && filePath != null)
                {
                    hidFilePath = document.getElementById("ctl00_ContentPlaceHolder1_hidFilePath");
                    hidFilePath.value += filePath + ",";
                    var pos = filePath.lastIndexOf("\\")+1;
                    hidFileName.value += filePath.substring(pos) + ",";
                    //var value1 = obj.value.substring(pos);
                    var arg = filePath.substring(pos);
                    encodeFileName = encodeURI(arg)
                    encodeFilePathName = encodeURI(filePath);  
                }                           
                fileCounter++;
                divFile.innerHTML = arg + ' <a onclick=removeElement('+divID+');clearHidden(\''+encodeFileName+'\',\''+encodeFilePathName+'\') id='+divID+'>Remove</a>';
                //divFile.innerHTML = '<a  id='+fileCounter+' href=http://'+encodeFilePathName+'>'+arg+'</a>' + ' <a onclick=removeElement('+divID+');clearHidden(\''+encodeFileName+'\',\''+encodeFilePathName+'\') id='+divID+'>Remove</a>';
                parentDiv.appendChild(divFile);
            }
            
       }
     
      function removeElement(counter)
      {
              var div = document.getElementById("fileName");
              var olddiv = document.getElementById(counter);
              div.removeChild(olddiv);
      }
     
     function clearHidden(encodeFile,encodeFilePath)
     {
     
                   var file = decodeURI(encodeFile);
                   var filePath = decodeURI(encodeFilePath);
                  
                   var hidFileName = "";
                   var fileArray = "";
                   var hidFilePath = "";
                   hidFileName = document.getElementById(strClientID + "hidFileName") ; 
                   hidFilePath = document.getElementById("ctl00_ContentPlaceHolder1_hidFilePath");
                    
                   //split the file names in the hidden variables                
                   fileArray = hidFileName.value.split(",");
                   //fileArray.remove("");
                   
                   //clear the hidden fields containing file names
                   for( i=0; i<fileArray.length; i++)
                   {
                     if(fileArray[i] == file)
                        {
                            fileArray.splice(i,1);
                        }
                   }
                   
                   //repopulate hidden field containing file names
                   hidFileName.value = "";
                   for(i=0; i<fileArray.length; i++)
                   {
                        if(fileArray[i] != "")
                        {
                            hidFileName.value += fileArray[i] + ",";
                        }
                   }
                   
                   //split the file path in the hidden variables   
                   fileArray = hidFilePath.value.split(",");
                   
                    //clear the hidden fields containing file path
                   for( i=0; i<fileArray.length; i++)
                   {
                     if(fileArray[i] == filePath)
                        {
                            fileArray.splice(i,1);
                        }
                   }
                   
                   hidFilePath.value = "";
                   //repopulate hidden field containing file path
                   for(i=0; i<fileArray.length; i++)
                   {
                        if(fileArray[i] != "")
                        {
                            hidFilePath.value += fileArray[i] + ",";
                        }
                   }
     }
     function fnShowExpertsList(ID,controlID)
        {
            strClientID=ID.substring(0,ID.length-controlID.length);
            var expertID=document.getElementById(strClientID +"hidExpertID").value;
             var strURL="admin-expert-list.aspx?expertID=" +expertID;
            //window.open(strURL, null,'height=600,width=800,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes');
            fnOpenWindow(strURL);
        }
    function fnCallParentFunction(strText,strExpertID)
        {
            window.opener.fnSetExpertID(strText,strExpertID);
            window.close();
        }
    function fnSetExpertID(strText,strExpertID)
        {
            var objExpertID=document.getElementById(strClientID +"hidExpertID");
            var objExpertName=document.getElementById(strClientID +"txtExpertID");
             objExpertID.value=strExpertID;
             objExpertName.value=strText;
        }

       function fnCheckIndustiesList(industryID,obj)
     {
       if(obj.selectedIndex==0)
        {
           strMessage ="The following is invalid or missing:\n----Country of Residence\nPlease correct and try again.";
           return false;
       }
        var countryID=obj.options[obj.selectedIndex].value;
        window.location.href("join-circle.aspx?id=" + industryID + "&ct=" + countryID);
     }
     
     
          function fnCheckHourlyRate(ID,controlID)
       {
            
            strClientID=ID.substring(0,ID.length-controlID.length);
            var obj=document.getElementById(strClientID + "ddlCountry");
            
          if(obj.options[obj.selectedIndex].text.toLowerCase()=="india") 
          {
                 var value = document.getElementById(strClientID + "txtHourlyConsultingRate").value;
                 if( value > 4000)
                 {
                      alert("Thank you for your interest in consulting with Evalueserve Circle of Experts. \nEvalueserve Circle of Experts only pays above Rs.4000/hour for very senior executives. \n If you have at least 10 years of experience and believe you fall into this category, \n we will evaluate your rate of Rs."+ value +"/hour after reviewing your biography and resume. \n Please feel free to revise your hourly rate if appropriate.");
                      document.getElementById(strClientID + "txtHourlyConsultingRate").focus();
                                            
                 }
          }
       }
       
       function fnCheckPrimaryEmail(ID,controlID, isExpert)
       {
           
            
          //  strClientID=ID.substring(0,ID.length-controlID.length);
            var obj=document.getElementById(ID);
            var work_email=document.getElementById(strClientID + "txtWorkEmail").value;
            var home_email=document.getElementById(strClientID + "txtHomeEmail").value;
           
            var primary_email=document.getElementById(strClientID + "HiddenPrimaryEmail").value;
            
            var preText = "Lead's ";
            if(isExpert)
            {
                preText = "Expert's "
            }
        
            
              if(obj.options[obj.selectedIndex].text.toLowerCase()=="work") 
              {
                  if(primary_email!=work_email)
                  {
                  alert(preText+"Default login credentials have been changed to work email id :\n" + work_email );
                  }
                    
              }
          
              if(obj.options[obj.selectedIndex].text.toLowerCase()=="home") 
              {
                   if(primary_email!=home_email)
                      {
                       alert(preText+" default login credentials have been changed to home email id :-\n" + home_email);
                      }
                    
              }
       }
       
       //S:Rakesh       
       
       //Code added by Vikash on 17.9.2008
       //Purpose to
       function fnOpenNewWindow(strValue)
       {
         popup_window = window.open(strValue, "_blank",'height=500,width=800,status=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes');
    
         
       }
       function fnOpenWindow(strValue)
       {
     
         popup_window = window.open(strValue, "_blank",'height=600,width=800,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes');
        //  return false;
       }
       function fnCheckJoinMore(ID,controlID)
       {
            strClientID=ID.substring(0,ID.length-controlID.length);
            var status;
            fnCheckddlvalue(strClientID +"ddlJMIndustry",document.getElementById(strClientID +"ddlJMIndustry").selectedIndex,"Industry");
            fnCheckddlvalue(strClientID +"ddlJMPrimaryAreaExpertise",document.getElementById(strClientID +"ddlJMPrimaryAreaExpertise").selectedIndex,"Primary Area of Expertise");
          
            if(strMessage!="")
            {
                  strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
                  alert(strMessage);
                  strMessage = "";
                  return false;
            }
            return true;
       }

        //Change Begin
        //Change made by Vikash kumar on 6 June, 2007
        //Purpose to show and hide Panel
       function showJoinMore(ID,controlID)
       {
             //alert("hi");
            strClientID=ID.substring(0,ID.length-controlID.length);
           // alert(document.getElementById(strClientID + "pnlJoinIndustries" ).style["display"]);          
            document.getElementById(strClientID + "pnlJoinIndustries" ).style["display"] ="block";
       }
       
        function showJoinPanel(ID,controlID)
       {
           //  alert("hi on change");
            strClientID=ID.substring(0,ID.length-controlID.length);
           // alert(document.getElementById(strClientID + "pnlJoinIndustries" ).style["display"]);          
            document.getElementById(strClientID + "pnlJoinIndustries" ).style["display"] ="block";
       }
       
       //Change End
        //function to update the count of chars entered
        function textCounter(ID, controlID, maxlimit)
        {
             strClientID=ID.substring(0,ID.length-controlID.length);
                          
             var bios = document.getElementById(strClientID + "txtBriefBiography").value;
             var charRemain = document.getElementById(strClientID + "txtCharRemain").value;
             
             if(bios.length > maxlimit)
             {
                document.getElementById(strClientID + "txtBriefBiography").value = bios.substring(0,maxlimit);
             }
             else
             {
                document.getElementById(strClientID + "txtCharRemain").value = maxlimit - bios.length
             }
                          
        }
       
        //function to validate controls on contact us
        function fnCheckContactUs(ID,controlID)
        {
             strMessage="";            
             strClientID=ID.substring(0,ID.length-controlID.length);
             fnCheckInput(strClientID + "txtMail",document.getElementById(strClientID + "txtMail").value,"email","Email","1");
             fnCheckInput(strClientID + "txtMessage",document.getElementById(strClientID + "txtMessage").value,"","Message","1");
             fnCheckddlvalue(strClientID +"ddlSubject",document.getElementById(strClientID +"ddlSubject").selectedIndex,"Subject");
             
             if(strMessage!="")
             {
                   strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
                   alert(strMessage);
                   return false;
             }
             return true;
        }
        
        function fnCheckExpertID(ID,controlID)
        {
             strMessage="";
             strClientID=ID.substring(0,ID.length-controlID.length);
             fnCheckInput(strClientID + "txtExpertID",document.getElementById(strClientID + "txtExpertID").value,"integer","Expert ID","1");
             if(strMessage!="")
             {
                   strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
                   alert(strMessage);
                   return false;
             }
             return true;
        }
        
       function fnCheckLeadID(ID,controlID)
        {
             strMessage="";
             strClientID=ID.substring(0,ID.length-controlID.length);
             fnCheckInput(strClientID + "txtExpertID",document.getElementById(strClientID + "txtExpertID").value,"integer","Lead ID","1");
             if(strMessage!="")
             {
                   strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
                   alert(strMessage);
                   return false;
             }
             return true;
        }
        function fnReferExpert(ID,controlID)
       {
             strMessage=""; 
            
             strClientID=ID.substring(0,ID.length-controlID.length);
             fnCheckInput(strClientID + "txtYourName",document.getElementById(strClientID + "txtYourName").value,"alpha","Your name","1");
             if(strMessage!="")
             {
                alert("Please provide a valid name, so that we may accept your submission.");
                return false;
             }
             strMail=document.getElementById(strClientID + "txtYourEmail").value;
             fnCheckInput(strClientID + "txtYourEmail",strMail,"email","Your e-mail address","1");
             if(strMessage!="")
             {
                alert("Please provide a valid e-mail address, so that we may accept your submission.");
                return false

             }
             var step=0;
             var myEmail = new Array()
             if(document.getElementById(strClientID + "txtColleagueEmail1").value != "")
             {
                myEmail[0] = document.getElementById(strClientID + "txtColleagueEmail1").value;
                fnCheckInput(strClientID + "txtYourEmail",document.getElementById(strClientID + "txtYourEmail").value,"email","Email 1","");
                step=step+1;
             }
             if(document.getElementById(strClientID + "txtColleagueEmail2").value != "")
             {
                 myEmail[1] = document.getElementById(strClientID + "txtColleagueEmail2").value;
                fnCheckInput(strClientID + "txtYourEmail",document.getElementById(strClientID + "txtYourEmail").value,"email","Email 2","");
                step=step+1;
             }
             if(document.getElementById(strClientID + "txtColleagueEmail3").value != "")
             {
                 myEmail[2] = document.getElementById(strClientID + "txtColleagueEmail3").value;
                fnCheckInput(strClientID + "txtColleagueEmail3",document.getElementById(strClientID + "txtYourEmail").value,"email","Email 3","");
                step=step+1;
             }
             if(document.getElementById(strClientID + "txtColleagueEmail4").value != "")
             {
                 myEmail[3] = document.getElementById(strClientID + "txtColleagueEmail4").value;
                fnCheckInput(strClientID + "txtColleagueEmail4",document.getElementById(strClientID + "txtYourEmail").value,"email","Email 4","");
                step=step+1;
             }
             if(document.getElementById(strClientID + "txtColleagueEmail5").value != "")
             {
                myEmail[4] = document.getElementById(strClientID + "txtColleagueEmail5").value;
                fnCheckInput(strClientID + "txtColleagueEmail5",document.getElementById(strClientID + "txtYourEmail").value,"email","Email 5","");
                step=step+1;
             }
            
             if(strMessage!="")
             {
               strMessage ="Please provide a valid e-mail address for:" + strMessage + "\nso that we may accept your submission.";
               alert(strMessage);
               return false;
             }
             else if(step==0)
             {
                
                alert("Please provide a valid e-mail address, so that we may accept your submission");
                return false;
             }
             
           for(var i=0;i<myEmail.length;i++)
           {
                if(strMail.toLowerCase()==myEmail[i].toLowerCase())
                {
                        alert("Please provide a valid and different e-mail address, so that we may accept your submission");
                        return false;
                }
               for(var j=0;j<myEmail.length;j++)
               {
                if(i!=j)
                {
                    if(myEmail[i].toLowerCase()==myEmail[j].toLowerCase())
                    {
                        alert("Please provide a valid and different e-mail address, so that we may accept your submission");
                        return false;
                        
                    }
                }
               }
           }
           return true;
       }
       
       /*
       function to check client id being input on client page
       
       */
       function fnCheckClientId(ID,controlID)
       {
      
             strMessage="";  
             strClientID=ID.substring(0,ID.length-controlID.length);
             fnCheckInput(strClientID + "txtClientId",document.getElementById(strClientID + "txtClientId").value,"integer","Client Id","1");
              if(strMessage!="")
                    {

                      strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
                      alert(strMessage);
                      return false;
                   }
                   return true;
       }
       
        function fnCheckForgetPassword(ID,controlID)
        {
             strMessage="";  
             strClientID=ID.substring(0,ID.length-controlID.length);
             fnCheckInput(strClientID + "txtForgetPassText",document.getElementById(strClientID + "txtForgetPassText").value,"","Email Address","1");
             fnCheckInput(strClientID + "txtForgetPassText",document.getElementById(strClientID + "txtForgetPassText").value,"email","Email Address");
             
              if(strMessage!="")
                    {

                      strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
                      alert(strMessage);
                      return false;
                   }
                   return true;
        }
        
         /*
        function to check login credentials entered by user
        */
        function fnCheckLogin(ID,controlID)
        {
            strMessage="";  
            strClientID=ID.substring(0,ID.length-controlID.length);
            fnCheckInput(strClientID + "txtName",document.getElementById(strClientID + "txtName").value,"","UserName","1");
            fnCheckInput(strClientID + "txtPassword",document.getElementById(strClientID + "txtPassword").value,"","Password","1");

            if(strMessage!="")
            {

                strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
                alert(strMessage);
                return false;
            }
            else
            {
                // check for HTML
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtName").value))
                {
                    strMessage = '\n----Username';
                    document.getElementById(strClientID +"txtName").style.backgroundColor = "#cad7ec";
                }

                if(CheckForHTMLTag(document.getElementById(strClientID +"txtPassword").value))
                {
                    strMessage += '\n----Password';
                    document.getElementById(strClientID +"txtPassword").style.backgroundColor = "#cad7ec";
                }

                if(strMessage != "")
                {
                    //strMessage ="Incorrect Password.Please correct and try again.";
                    strMessage ="The following is invalid:"  + strMessage +"\nPlease correct and try again.";
                    alert(strMessage);
                    return false;
                }
            }
            return true;
        }
        
        function fnexpertPaypalEmail(ID,controlID)
        {
             strMessage="";  
             strClientID=ID.substring(0,ID.length-controlID.length);
             fnCheckInput(strClientID + "txtPayPalEmail",document.getElementById(strClientID + "txtPayPalEmail").value,"email","PayPal Email","1");
              if(strMessage!="")
                    {

                      strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
                      alert(strMessage);
                      return false;
                   }
                   return true;
        }        
        
        /*
        function to check the password entered by the user
        */
        function fnCheckPassword(ID,controlID)
        {
                strClientID=ID.substring(0,ID.length-controlID.length);
                
               var radio = document.getElementById(strClientID+'rbdPasswordGenerationOption_1');
               var ConfirmPassword = document.getElementById(strClientID +"txtConfirmPassword").value;
              
                var newPassword = document.getElementById(strClientID +"txtNewPwd").value;
                
                strMessage="";  
                fnCheckInput(strClientID +"txtCurrentPassword",document.getElementById(strClientID +"txtCurrentPassword").value,"","Current Password","2");
               
                if(strMessage!="")
                   {
                      strMessage ="Incorrect Password.Please correct and try again.";
                      alert(strMessage);
                      return false;
                   }
              else if(radio.checked)
               {
                  
                     if(newPassword.length == 0)   
                     {
                        strMessage ="New Password can not be blank. Please correct and try again.";
                        alert(strMessage);
                        return false;
                     }                     
                     else if(ConfirmPassword.length == 0)
                     {
                        strMessage ="Confirm Password can not be blank. Please correct and try again.";
                        alert(strMessage);
                        return false;
                     }
                     else if(newPassword.length < 6)
                     {
                        strMessage ="New Password is too short. Please correct and try again.";
                        alert(strMessage);
                        return false;
                     }
                     else if(ConfirmPassword.length < 6)
                     {
                       strMessage ="Confirm Password is too short. Please correct and try again.";
                        alert(strMessage);
                        return false;
                     }
                     else if(newPassword != ConfirmPassword)
                     {
                        strMessage ="Confirm Password does not match new password. Please correct and try again.";
                        alert(strMessage);
                        return false;
                     }
               }
               
               return true;
        }
        
     

        
        /*
        function to put validation on join the circle page 
        */
        function fnJoinTheCircle(ID,controlID)
        {
          strClientID=ID.substring(0,ID.length-controlID.length);
          strMessage=""; 
          fnCheckddlvalue(strClientID +"ddlCountry",document.getElementById(strClientID +"ddlCountry").selectedIndex,"Country of Residence");
           if(strMessage!="")
            {

              strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
              alert(strMessage);
              return false;
            }

            return true;
        }
        //Change Begin
        //Code by Vikash kumar on 19 June, 2007
       function fnCurrencyChange(ID,controlID,oldcurrency)
       {
       
         strClientID=ID.substring(0,ID.length-controlID.length);
         var obj=document.getElementById(strClientID + "ddlCurrency")
          alert("To change your currency of payment,"+"\n"+" please write to CoEexpertquestions@evalueserve.com."+"\n"+" Thank you.");
          obj.selectedIndex=oldcurrency;
           
         return false;
       }
       
        
        //Change End
        
        //Change Begin
        //Code by Vikash kumar on 5 June, 2007
        /*
        function to put validation on  if Expert Wish to join more ciercles        */
        function fnJoinMoreCircle(ID,controlID)
        {
          strClientID=ID.substring(0,ID.length-controlID.length);
          strMessage=""; 
         
           fnCheckddlvalue(strClientID +"ddlJMIndustry",document.getElementById(strClientID +"ddlJMIndustry").selectedIndex,"Industry");
           fnCheckddlvalue(strClientID +"ddlJMPrimaryAreaExpertise",document.getElementById(strClientID +"ddlJMPrimaryAreaExpertise").selectedIndex,"Primary Area Expertise");
           if(strMessage!="")
            {

              strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
              alert(strMessage);
              return false;
            }

            return true;
        }
        
        
        function fnAddExpertOpinion(ID,controlID)
        {    
     
            strClientID=ID.substring(0,ID.length-controlID.length);
            strMessage="";
            
             if(!document.getElementById("rdOptions_0").checked && ! document.getElementById("rdOptions_1").checked && ! document.getElementById("rdOptions_2").checked)
            {
                alert("Please select atleast any one of the three available options ");
                return false;
            } 
            
            fnCheckInput(strClientID + "txtFirstName",document.getElementById(strClientID + "txtFirstName").value,"string","Expert First Name","1");           
            fnCheckInput(strClientID + "txtLastName",document.getElementById(strClientID + "txtLastName").value,"string","Expert Last Name","1");        
            fnCheckInput(strClientID + "txtEmail",document.getElementById(strClientID + "txtEmail").value,"email"," Email","1");
                     

           if(strMessage!="")
            {

               strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
               alert(strMessage);
               return false;
            }     
     
         return true;  
        
        }
      
  





        
      
                                   
                              

        
        function fnAddConsultation(ID,controlID)
        {    
            strClientID=ID.substring(0,ID.length-controlID.length);
          
            // debugger;
            strMessage="";   
                 
            fnCheckInput(strClientID +"txttitle",document.getElementById(strClientID +"txttitle").value,"","Title","1");
            fnCheckddlvalue(strClientID +"ddlClients",document.getElementById(strClientID +"ddlClients").selectedIndex,"Client");
//           alert("yu7y987y97y"+document.getElementById(strClientID +"txtExpertID"));
//           fnCheckInput(strClientID +"txtExpertID",document.getElementById(strClientID +"txtExpertID").value,"","Expert","1");
            //fnCheckddlvalue(strClientID +"ddlExpert",document.getElementById(strClientID +"ddlExpert").selectedIndex,"Experts");
                                
            if(strMessage!="")
            {
             
              strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
              alert(strMessage);
              return false;
            }
          //  fnCloseWindow();
          // fnCheckExpertID();
          
          var expertid=trim(document.getElementById("ctl00_ContentPlaceHolder1_txtExpertId").value);                       

         if(expertid =='')
            {
              alert("Expert Id can not be blank. Please correct and try again.");
              return false;
            }
             

        }
        //change made by Vikash kumar on 2 August, 2007
        /*
        function  fnCheckExpertID()
        {
          var expertid=document.getElementById("ctl00_ContentPlaceHolder1_txtExpertId");
          var str=expertid.value;
        
          var regex=/^[0-9]|[a-zA-Z]*$/;
          if(regex.test(str))           
          {
            return true;
          }
            return false;           
        }*/
        function fnCheckstatusAuthorization(ID, controlID, oldstatus)
        {
            
             var checkRole=document.getElementById("ctl00_ContentPlaceHolder1_HiddenCheckRole");
            var checkWebuserID=document.getElementById("ctl00_ContentPlaceHolder1_HiddenWebUserID");
            strClientID=ID.substring(0,ID.length-controlID.length);
            var checkStatus=document.getElementById(strClientID + "ddlStatus").selectedIndex
            var obj=document.getElementById(strClientID + "ddlStatus")
            var paymentstatus=document.getElementById(strClientID + "ddlPaymentStatus")  
             
            if (checkStatus==2 && oldstatus==2)
            {
              if(paymentstatus.value=="Please Select")
              {
                   alert("Please select  the Payment Method as either Cheque or by Wire Transfer");
                   return false;
              }
            }
            else
            {
                 //document.getElementById("ctl00_ContentPlaceHolder1_ddlPaymentStatus").disabled=true;
                 //paymentstatus.selectedIndex=0;
                 //document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.visibility = 'hidden';
                 //document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.display = 'none'; 
                 //document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.visibility = 'hidden' 
                 //document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.display = 'none'; 
             } 
             
             if (checkRole!=null)
             {
                if (checkStatus==2)
                {
                       //S:Changes made by Rakesh on 20090120 for Role Change                                
                       if (checkRole.value == "super-admin" || checkRole.value =="sysadmin" || checkRole.value =="admin")
                       {
                             //do nothing;                                
                       }                                
                       else
                       {
                            obj.selectedIndex=oldstatus-1;
                            alert( "You are not authorised to change consultation status to :- Status 3 of 7. \nOnly Ops Admin and Sys Admin User is authorized to change the consultation Status to 3 of 7. ");
                            return false;
                       }
                       //E:Changes made by Rakesh on 20090120 for Role Change                                  
                  }
                  
                  //S:Added by Rakesh on 20090120 for Role Change                                
                  if (checkStatus==1)
                  {
                       if (checkRole.value == "finance-admin")
                       {
                            obj.selectedIndex=oldstatus-1;
                            alert( "You are not authorised to change consultation status to :- Status 2 of 7.");
                            return false;                                
                       }  
                                              
                  }
                  //E:Added by Rakesh on 20090120 for Role Change                                                                            
                  
                }
                 
                if (checkRole.value=="finance-admin" && oldstatus <=3)   
                {            
                    if (checkStatus>oldstatus)
                    {
                       if ((checkStatus -oldstatus)!=0)
                       {
                           obj.selectedIndex=oldstatus-1;
                           alert( "The new Consultation Status must be increased in order of one.");
                           return false;
                       }
                    }
                }
                          
                if (checkRole!=null)
                
                  //S:Added by Rakesh on 20090120 for Role Change
                if (checkRole.value=="researcher"||checkRole.value=="csm"||checkRole.value=="team lead"||checkRole.value=="admin" || checkRole.value=="finance-admin" ||checkRole.value=="finance-general"|| checkRole.value=="super-admin" || checkRole.value=="datamanager" || checkRole.value=="sysadmin")
                {     
                  if (checkStatus<oldstatus && (checkRole.value!="sysadmin") && (checkRole.value!="admin"))
                  {
                      obj.selectedIndex=oldstatus-1;
                      alert( "The new Consultation Status can not be less than the Current Status.");
                      return false;
                  }
                  //E:Added by Rakesh on 20090120 for Role Change
                  
                  if (checkRole.value=="researcher"||checkRole.value=="csm"||checkRole.value=="team lead"||checkRole.value=="admin" ||checkRole.value=="finance-general"|| checkRole.value=="super-admin")
                  {        
                      if (checkStatus>oldstatus)
                      {
                         if ((checkStatus -oldstatus)!=0)
                         {
                           obj.selectedIndex=oldstatus-1;
                           alert( "The new Consultation Status must be increased in order of one.");
                           return false;
                         }
                      }
                  }
                      
                         
                         if (checkRole.value!="finance-admin" && checkRole.value!="sysadmin" && checkRole.value!="admin")
                         { 
                          if (checkStatus!=0 && checkStatus!=1 && checkStatus!=2 )
                           {
                               obj.selectedIndex=oldstatus-1;
                               alert( "You are not authorised to change consultation status to :- \nStatus 4 of 7 – Processed by India or \nStatus 5 of 7 – Being paid by cheque  or \nStatus 6 of 7 – Being paid by wire transfer or \nStatus 7 of 7 – Paid via Wire Transfer/ Cheque ");
                               return false;
                               }
                              
                              }
                                 if (oldstatus==1 && checkStatus==2)
                             {
                            
                               obj.selectedIndex=oldstatus-1;
                               alert( "The " + checkRole.value +" role do not have the rights to\n change consultation status to :- \nStatus 3 of 7 – when the current status is Status 1 of 7.\nOnly Super Admin User  is authorized to change the consultation Status to 3 of 7 from status 2 of 7. ");
                               return false;
                             }
                        
                             
                             
                               
                           }
             
             if (checkRole.value=="finance-general")
                     {
                           
                               obj.selectedIndex=oldstatus-1;
                               alert("The finance general role do not have rights to \n change consultation status to  :- \nStatus 1 of 7 – Consultation Assigned  or \nStatus 2 of 7 – Consultation Over  or\nStatus 3 of 7 – Duration Confirmed \nStatus 4 of 7 – Processed by India or \nStatus 5 of 7 – Being paid by cheque  or \nStatus 6 of 7 – Being paid by wire transfer or \nStatus 7 of 7 – Paid via Wire Transfer/ Cheque " );
                               return false;
                          
                     }
         }
         
         
         
        function fnEditConsultation(ID,controlID)
        {    
       
            strClientID = ID.substring(0,ID.length-controlID.length);
            strMessage = "";
            

                //fnCheckInput(strClientID +"txttitle",document.getElementById(strClientID +"txttitle").value,"","Title","1");
                
                fnCheckInput(strClientID + "txtLangReq",document.getElementById(strClientID +"txtLangReq").value,"alpha","Language Requirement");            
                
                fnCheckInput(strClientID + "txtClientDuration",document.getElementById(strClientID + "txtClientDuration").value,"integer","Client Duration");
                fnCheckInput(strClientID + "txtExpertDuration",document.getElementById(strClientID + "txtExpertDuration").value,"integer","Expert Duration");
                fnCheckInput(strClientID + "txtActualDuration",document.getElementById(strClientID + "txtActualDuration").value,"integer","Actual Duration");

                fnCheckInput(strClientID + "txtOverallrating",document.getElementById(strClientID + "txtOverallrating").value,"integer","OverAll Rating");
                fnCheckInput(strClientID + "txtProfRating",document.getElementById(strClientID + "txtProfRating").value,"integer","Professionalism Rating");
                fnCheckInput(strClientID + "txtCommRating",document.getElementById(strClientID + "txtCommRating").value,"integer","Communication Rating");
                fnCheckInput(strClientID + "txtRating",document.getElementById(strClientID + "txtRating").value,"integer","Subject Matter knowledge Rating");
                fnCheckInput(strClientID + "txtConsultation",document.getElementById(strClientID + "txtConsultation").value,"time","Start Consultation");
                fnCheckInput(strClientID + "txtHourlyRate",document.getElementById(strClientID + "txtHourlyRate").value,"integer","Hourly Rate");
                
                //fnCheckddlvalue(strClientID +"ddlClients",document.getElementById(strClientID +"ddlClients").selectedIndex,"Client");

                
                var spanSSNRequireObj =  document.getElementById(strClientID+"spanSSNR");
                if(spanSSNRequireObj.style.display == 'inline')
                {
                    fnCheckInput(strClientID + "txtSSN",document.getElementById(strClientID + "txtSSN").value,"","Tax ID / Social Security Number","1");
                }
                
                var spanPaymentStatusRObj =  document.getElementById(strClientID+"spanPaymentStatusR");   
                if(spanPaymentStatusRObj.style.display == 'inline')
                {
                    fnCheckddlvalue(strClientID +"ddlPaymentStatus",document.getElementById(strClientID +"ddlPaymentStatus").selectedIndex,"Payment Type","1");
                }
                
                var spanPaymentAccountRObj =  document.getElementById(strClientID+"spanPaymentAccountR");
                if(spanPaymentAccountRObj.style.display == 'inline')
                {
                    fnCheckddlvalue(strClientID +"ddlPaymnetAccount",document.getElementById(strClientID +"ddlPaymnetAccount").selectedIndex,"Payment Account","1");
                }
                
                
            


                if(strMessage!="")
                {

                    strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
                    alert(strMessage);
                    return false;
                }
                return true;
                
            
            
//            var expertid = trim(document.getElementById("ctl00_ContentPlaceHolder1_txtExpertId").value);                       
//            if(expertid =='')
//            {
//                alert("Expert Id can not be blank. Please correct and try again.");
//                return false;
//            }
            
//            var checkStatus=document.getElementById(strClientID + "ddlStatus").selectedIndex;
//            var oldstatus=document.getElementById("ctl00_ContentPlaceHolder1_HiddenOldStatus");

//            var paymentstatus=document.getElementById(strClientID + "ddlPaymentStatus")   
//            if (checkStatus==2 && oldstatus.value==2)
//            {
//                var  hiddenpaymentcheck = document.getElementById("ctl00_ContentPlaceHolder1_HiddenPaymentCheck");

//                if(paymentstatus.value=="Please Select")
//                {
//                    alert("Please select  the Payment method as either Wire Transfer or Cheque or by Paypal");
//                    return false;
//                }

//                if (hiddenpaymentcheck.value=="0")
//                {
//                    alert("Please first confirm  the Expert Payment details as either Wire Transfer or Cheque or by Paypal");
//                    return false;

//                }

//                if(document.getElementById("ctl00_ContentPlaceHolder1_txtSSN")!=null && document.getElementById("ctl00_ContentPlaceHolder1_HiddenExpertCountryID")!=null)
//                {
//                    var ssn=trim(document.getElementById("ctl00_ContentPlaceHolder1_txtSSN").value); 
//                    var ExpertCountryID=document.getElementById("ctl00_ContentPlaceHolder1_HiddenExpertCountryID").value;
//                    

//                    if(ssn =='' && ExpertCountryID==217)
//                    {
//                        alert("Duration can not be confirmed as Tax ID/Social Security Number is mandatory for a US Citizen.\nPlease correct and try again.");
//                        return false;
//                    }
//                }
//            }             
//            return false;
        }
        
        function fnCheckClientData(ID,controlID)
        { 
               
            strClientID=ID.substring(0,ID.length-controlID.length);
            /*
            Order of Validation: 
            Company Name *
            Website *
            Phone *
            Address#1 *
            City *
            State *
            Zip/Postal Code *
            Country *
            */
           
            strMessage="";    
                    
            fnCheckInput(strClientID + "txtHourThisBillingCycle",document.getElementById(strClientID + "txtHourThisBillingCycle").value,"integer","Hours Available Till This Billing Cycle");
            
            //1. Company Name
            fnCheckInput(strClientID +"txtCompanyName",document.getElementById(strClientID +"txtCompanyName").value,"","Company Name","1");
            
            //2. Website
            fnCheckInput(strClientID +"txtWebsite",document.getElementById(strClientID +"txtWebsite").value,"url","Website","1");
            
            //3. Phone
            fnCheckInput(strClientID + "txtCountryCode",document.getElementById(strClientID + "txtCountryCode").value,"integer","STD Code","1");
            fnCheckInput(strClientID + "txtPhone",document.getElementById(strClientID + "txtPhone").value,"MobilePhoneNumber","Phone","1");
            
            //4.  Address#1
            fnCheckInput(strClientID + "txtAddress1",document.getElementById(strClientID + "txtAddress1").value,"","Address 1","1");
            
            //5. City
            fnCheckInput(strClientID + "txtCity",document.getElementById(strClientID + "txtCity").value,"string","City","1");
            
            //6. State
            fnCheckInput(strClientID + "txtState",document.getElementById(strClientID + "txtState").value,"","State","1");
            
            //7. Postal Code
            fnCheckInput(strClientID +"txtZip",document.getElementById(strClientID +"txtZip").value,"","Postal Code","1");
            
            //8. Country
            fnCheckddlvalue(strClientID +"ddlCountry",document.getElementById(strClientID +"ddlCountry").selectedIndex,"Country");                      

            if(strMessage != "")
            {
                strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
                alert(strMessage);
                return false;
            }
            else
            {
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtCompanyName").value))
                {
                    strMessage += '\n----Company';
                    document.getElementById(strClientID +"txtCompanyName").style.backgroundColor = "#cad7ec";
                } 
                
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtWebsite").value))
                {
                    strMessage += '\n----Website';
                    document.getElementById(strClientID +"txtWebsite").style.backgroundColor = "#cad7ec";
                } 
                
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtCountryCode").value))
                {
                    strMessage += '\n----Country Code';
                    document.getElementById(strClientID +"txtCountryCode").style.backgroundColor = "#cad7ec";
                }
            
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtPhone").value))
                {
                    strMessage += '\n----Phone';
                    document.getElementById(strClientID +"txtPhone").style.backgroundColor = "#cad7ec";
                } 
                
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtAddress1").value))
                {
                    strMessage += '\n----Address 1';
                    document.getElementById(strClientID +"txtAddress1").style.backgroundColor = "#cad7ec";
                } 
                
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtAddress2").value))
                {
                    strMessage += '\n----Address 2';
                    document.getElementById(strClientID +"txtAddress2").style.backgroundColor = "#cad7ec";
                } 
                
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtCity").value))
                {
                    strMessage += '\n----City';
                    document.getElementById(strClientID +"txtCity").style.backgroundColor = "#cad7ec";
                } 
                
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtState").value))
                {
                    strMessage += '\n----State';
                    document.getElementById(strClientID +"txtState").style.backgroundColor = "#cad7ec";
                } 
                
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtZip").value))
                {
                    strMessage += '\n----txtZip';
                    document.getElementById(strClientID +"txtZip").style.backgroundColor = "#cad7ec";
                }
                
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtComment").value))
                {
                    strMessage += '\n----Comments';
                    document.getElementById(strClientID +"txtComment").style.backgroundColor = "#cad7ec";
                }
                
                if(strMessage != "")
                {
	                //strMessage ="Incorrect Password.Please correct and try again.";
	                strMessage ="The following is invalid:"  + strMessage +"\nPlease correct and try again.";
	                alert(strMessage);
	                return false;
                }
            }
            return true;

        }
        
       
        
           function fnRequestSearch(ID,controlID)
        {    
             strClientID=ID.substring(0,ID.length-controlID.length);

              //alert("strclientID " + strClientID);

               strMessage="";
               fnCheckddlvalue(strClientID + "ddlRequestID",document.getElementById(strClientID + "ddlRequestID").selectedIndex,"Request ID","1");
               fnCheckddlvalue(strClientID + "ddlVersionNumber",document.getElementById(strClientID + "ddlVersionNumber").selectedIndex,"Version Number","1");
                  if(strMessage!="")
            {

              strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
               alert(strMessage);
               return false;
            }
           
            return true;
               
            
        }
        
        function fnCheckPaymentByCheque(ID,controlID)
        {    
            strClientID=ID.substring(0,ID.length-controlID.length);
            
            //alert("strclientID " + strClientID);
            
            strMessage="";
            
           fnCheckInput(strClientID + "txtPaymentName",document.getElementById(strClientID + "txtPaymentName").value,"","Cheque Issued To","1")
           fnCheckInput(strClientID +"txtPaymentStreetAddress1",document.getElementById(strClientID +"txtPaymentStreetAddress1").value,"","Street Address","1");
           fnCheckInput(strClientID +"txtPaymentState",document.getElementById(strClientID +"txtPaymentState").value,"","State","1");
           fnCheckInput(strClientID + "txtPaymentCity",document.getElementById(strClientID + "txtPaymentCity").value,"string","City","1");
           fnCheckInput(strClientID + "txtPaymentPostalCode",document.getElementById(strClientID + "txtPaymentPostalCode").value,"","Postal Code","");
           fnCheckddlvalue(strClientID + "ddlPaymentCountry",document.getElementById(strClientID + "ddlPaymentCountry").selectedIndex,"Country","1");
           fnCheckInput(strClientID + "txtPaymentRTCode",document.getElementById(strClientID + "txtPaymentRTCode").value,"alpha","RT Code");
           fnCheckInput(strClientID + "txtPaymentABACode",document.getElementById(strClientID + "txtPaymentABACode").value,"alpha","ABA Code");
           //fnCheckInput(strClientID + "txtPaymentSSN",document.getElementById(strClientID + "txtPaymentSSN").value,"alpha","Social Security Number ");
           if(strMessage!="")
           {
              strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
              alert(strMessage);
              return false;
           }
           
             var answer = confirm("Have you filled in all the required  payment details for an Expert correctly?"); 
              {
                if (!answer) 
                         {
                                
                                  document.getElementById('ctl00_ContentPlaceHolder1_HiddenPaymentCheck').value="0";  
                                  return false;
                         }
              }   
            return true;

        }
        
         function fnCheckPaymentByPaypal(ID,controlID)
        {    
             strClientID=ID.substring(0,ID.length-controlID.length);
          
            strMessage="";
            
           fnCheckInput(strClientID + "txtPaypalEmailId",document.getElementById(strClientID + "txtPaypalEmailId").value,"email","Paypal Email ID","1")
            if(strMessage!="")
            {

              strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
               alert(strMessage);
               return false;
            }
           
            var answer = confirm("Have you filled in the Payment Email Id for an Expert correctly?"); 
              {
                if (!answer) 
                         {
                                
                                  document.getElementById('ctl00_ContentPlaceHolder1_HiddenPaymentCheck').value="0";  
                                  return false;
                         }
              }   
            return true;

        }
        
        
               //Change Begin
        //Function changed by Vikash Kumar on 2nd August, 2008
        //Purpose : To validate Paypal reference number 
       function  fnEditPaypalReferenceNumberConsultation(ID,controlID)
        {   
    
             strClientID=ID.substring(0,ID.length-controlID.length);
          
             strMessage="";
             
             var paypalreferencenumber=trim(document.getElementById(strClientID + "txtPaypalReferenceNumber").value);  
             
              hasscheck =  paypalreferencenumber.substring(0, 1);
              alphanumericcheck=paypalreferencenumber.substring(1, 127);
              if(paypalreferencenumber!="")
              {
                  if(hasscheck!="#")
                    {
                             alert("In Paypal Reference number, the first character can only be '#'"); 
                             return false;
                           
                    }
                          
                                
                       if(alphanumericcheck!="")
                    {
                         var regex1=/^[a-zA-Z0-9]*$/;
                         
                            if(!regex1.test(alphanumericcheck))
                            {
                             alert("In Paypal Reference number after '#' only alphanumeric characters are acceptable" ); 
                             return false;
                            }
                    }
        }
                   
          
            return true;

        }     
        
        
        
        
        
        //Change End
        
        
        
        //Change Begin
        //Function changed by Vikash Kumar on 2nd August, 2008
        //Purpose : To check for Country and Currency validation  for  payment by wire transfer 
        
         String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };
        function fnCheckPaymentByWireTransfer(ID,controlID,expert_country_name,wiretransfer_country_bit,wiretransfer_currency_bit,expert_currency,expert_geography_id)
        {  
          
           strClientID=ID.substring(0,ID.length-controlID.length);
                   if (wiretransfer_country_bit=="False")
                 {
                       var obj=document.getElementById(strClientID + "ddlPaymentStatus")
                       obj.selectedIndex=0;
                       alert("Expert's country is " +  expert_country_name + ", which is not a valid country\nfor payment through Wire Transfer.Please select some other mode of payment.")
                    //   alert ( expert_country_name +" is not a valid country for payment by Wire Transfer.Please select some other mode of payment");
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.visibility = 'hidden';
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.display = 'none'; 
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.visibility = 'hidden' 
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.display = 'none'; 
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.visibility = 'hidden';
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.display = 'none';
                       return false; 
                 
                 }
                   if (wiretransfer_currency_bit=="False")
                 {
                       var obj=document.getElementById(strClientID + "ddlPaymentStatus")
                       obj.selectedIndex=0;
                       alert("Expert's currency is " +  expert_currency + ", which is not a valid currency\nfor payment through Wire Transfer.Please select some other mode of payment.")
                    //   alert ( expert_currency +" is not a valid currency for payment by Wire Transfer.Please select some other mode of payment");
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.visibility = 'hidden';
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.display = 'none'; 
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.visibility = 'hidden' 
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.display = 'none'; 
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.visibility = 'hidden';
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.display = 'none'; 
                       return false;
                   }
        
       
          
         
            strMessage="";            
            fnCheckInput(strClientID + "txtBankExpertName",document.getElementById(strClientID + "txtBankExpertName").value,"","Account Name","1")
            fnCheckInput(strClientID +"txtBankAccountNumber",document.getElementById(strClientID +"txtBankAccountNumber").value,"","Account Number","1");
           // fnCheckInput(strClientID + "txtSwiftCode",document.getElementById(strClientID + "txtSwiftCode").value,"alpha","Swift Code");
            fnCheckInput(strClientID + "txtSwiftCode",document.getElementById(strClientID + "txtSwiftCode").value,"","Swift Code","1");
            fnCheckInput(strClientID +"txtBankName",document.getElementById(strClientID +"txtBankName").value,"","Bank Name","1");
            fnCheckInput(strClientID + "txtBankStreetAddress1",document.getElementById(strClientID + "txtBankStreetAddress1").value,"","Street Address","1");
            fnCheckInput(strClientID +"txtBankState",document.getElementById(strClientID +"txtBankState").value,"","State","1");
            fnCheckInput(strClientID + "txtBankCity",document.getElementById(strClientID + "txtBankCity").value,"string","City","1");
            fnCheckInput(strClientID + "txtBankPostalCode",document.getElementById(strClientID + "txtBankPostalCode").value,"","Postal Code","");
            fnCheckddlvalue(strClientID + "ddlBankCountry",document.getElementById(strClientID + "ddlBankCountry").selectedIndex,"Country","1");
            fnCheckInput(strClientID + "txtBankRTCode",document.getElementById(strClientID + "txtBankRTCode").value,"alpha","IFSC Code");
            fnCheckInput(strClientID + "txtBankABACode",document.getElementById(strClientID + "txtBankABACode").value,"alpha","ABA Code");
         

            if (expert_geography_id=="6" ||expert_geography_id=="7" ||expert_geography_id=="14")
            {
               if(document.getElementById(strClientID + "txtBankIBANCode")!=null)
                 {
                    str=document.getElementById(strClientID + "txtBankIBANCode").value.trim();
                    fnCheckInput(strClientID + "txtBankIBANCode",str,"","IBAN Code","1");
                  // fnCheckInput(strClientID + "txtBankIBANCode",str,"alpha","IBAN Code","1");
                  }
            }
            if(strMessage!="")
            {
               strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
               alert(strMessage);
               return false;
            }
            var swiftcode=trim(document.getElementById("ctl00_ContentPlaceHolder1_txtSwiftCode").value);    
         
             if(swiftcode.length==0)
            {
              alert("Swift Code can not be blank. Please correct and try again.");
              return false;
            }
            if (swiftcode.length < 8)
             {
              alert("Length of swift code should not be less than 8 characters"); 
             return false;
              } 
             if (swiftcode.length > 11)
             {
              alert("Length of swift code should not be greater than 11 characters"); 
              return false;
              } 
                alphacheck =  swiftcode.substring(0, 6);
                alphanumericcheck=swiftcode.substring(6, 11);
                            
                if(alphacheck!="")
                    {
                       var regex=/^[a-zA-Z ]+$/;        
                            if(!regex.test(alphacheck))
                            {
                               alert("In swift code, first 6 characters should only be alphabets"); 
                                return false;
                            }
                    }
                    
                       if(alphanumericcheck!="")
                    {
                         var regex1=/^[a-zA-Z0-9]*$/;
                         
                            if(!regex1.test(alphanumericcheck))
                            {
                             alert("In swift code, last 5 characters should only be aplhanumeric, out of which last 3 characters are optional"); 
                             return false;
                            }
                    }
               
            if(document.getElementById(strClientID + "txtBankIBANCode")!=null)
         {
            var ibancode=document.getElementById(strClientID + "txtBankIBANCode").value.trim();
            var regex1=/^[a-zA-Z0-9]*$/;                   
          
                         if(ibancode!="")
                    {
                      
                            if(!regex1.test(ibancode))
                            {
                             alert("IBAN code should be alphanumeric"); 
                             return false;
                            }
                    }
                     if (ibancode.length < 16)
                     {
                      alert("Length of IBAN code should not be less than 16 characters"); 
                     return false;
                      } 
                    
              
          }
              var answer = confirm("Have you filled in all the required  payment details for an Expert correctly?"); 
              {
                    if (!answer) 
                    {
                        document.getElementById('ctl00_ContentPlaceHolder1_HiddenPaymentCheck').value="0";
                        return false;
                    }
              }              
              return true;
        }
         //Change Begin
          
        function fnCheckAddExpertConsultation(ID,controlID)
        {    
            
            strClientID=ID.substring(0,ID.length-controlID.length);
            strMessage="";            
            fnCheckInput(strClientID + "txtDuration",document.getElementById(strClientID + "txtDuration").value,"integer","Duration");
                                              
            if(strMessage!="")
            {

              strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
               alert(strMessage);
               return false;
            }

            return true;

        }
        
         function fnCheckEditExpertConsultation(ID,controlID)
        {    
            
             strClientID=ID.substring(0,ID.length-controlID.length);
            
             strMessage="";
            
             fnCheckInput(strClientID + "txtExpDuration",document.getElementById(strClientID + "txtExpDuration").value,"integer","Expert Duration");
            
                                   
            if(strMessage!="")
            {

              strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
               alert(strMessage);
               return false;
            }

            return true;

        }

   function fnCheckAuthorizedClientData(ID,controlID)
        {    
            
             strClientID=ID.substring(0,ID.length-controlID.length);
            
            strMessage="";
            //alert("skjdhjksdh");
            //alert(document.getElementById(strClientID + "txtAuthorizedEmail").value + "   " + document.getElementById(strClientID + "txtAuthorizedFirstName").value);
         
            fnCheckInput(strClientID + "txtAuthorizedFirstName",document.getElementById(strClientID + "txtAuthorizedFirstName").value,"string","First Name","1");
            fnCheckInput(strClientID + "txtAuthorizedLastName",document.getElementById(strClientID + "txtAuthorizedLastName").value,"string","Last Name","1");
            fnCheckInput(strClientID + "txtAuthorizedEmail",document.getElementById(strClientID + "txtAuthorizedEmail").value,"email","Email","1");
            fnCheckInput(strClientID + "txtAuthorizedPhoneCountryCode",document.getElementById(strClientID + "txtAuthorizedPhoneCountryCode").value,"integer","Phone Country Code","1");
            fnCheckInput(strClientID + "txtAuthorizedPhone",document.getElementById(strClientID + "txtAuthorizedPhone").value,"MobilePhoneNumber","Phone","1");
            
            if(strMessage!="")
            {

              strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
               alert(strMessage);
               return false;
            }

            return true;

        }
        
       
       //Added by Vishal for the Authorized Client Contact
       function fnCheckAuthorizedClientUserData(ID,controlID)
        {    

             strClientID=ID.substring(0,ID.length-controlID.length);

            //alert(document.getElementById((strClientID + "hdPrimaryUserId")).value);
            
            if((document.getElementById((strClientID + "hdPrimaryUserId")).value)!="0")
               {
              //   alert(document.getElementById((strClientID + "chkIsPrimary")).checked);
                if(document.getElementById((strClientID + "chkIsPrimary")).checked)
                   {
                            if(!confirm("Are you sure to update the current client's Primary User to current one"))
                            {
                                 return false;
                            }
                   }
               }
            
            strMessage="";
            //alert("skjdhjksdh");
            //alert(document.getElementById(strClientID + "txtAuthorizedEmail").value + "   " + document.getElementById(strClientID + "txtAuthorizedFirstName").value);
         
            fnCheckInput(strClientID + "txtAuthorizedFirstName",document.getElementById(strClientID + "txtAuthorizedFirstName").value,"string","First Name","1");
            fnCheckInput(strClientID + "txtAuthorizedLastName",document.getElementById(strClientID + "txtAuthorizedLastName").value,"string","Last Name","1");
            fnCheckInput(strClientID + "txtAuthorizedEmail",document.getElementById(strClientID + "txtAuthorizedEmail").value,"email","Email","1");
            fnCheckInput(strClientID + "txtAuthorizedPhoneCountryCode",document.getElementById(strClientID + "txtAuthorizedPhoneCountryCode").value,"integer","Phone Country Code","1");
            fnCheckInput(strClientID + "txtAuthorizedPhone",document.getElementById(strClientID + "txtAuthorizedPhone").value,"MobilePhoneNumber","Phone","1");
            
            
//            if(document.getElementById(strClientID + "txtAuthorizedPhone").value)
//            ConfirmChangePrimaryUser();
            
            if(strMessage!="")
            {

              strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
               alert(strMessage);
               return false;
            }
            else
            {
                // check for HTML
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtAuthorizedFirstName").value))
                {
                    strMessage = '\n----First Name';
                    document.getElementById(strClientID +"txtAuthorizedFirstName").style.backgroundColor = "#cad7ec";
                }
                
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtAuthorizedLastName").value))
                {
                    strMessage += '\n----Last Name';
                    document.getElementById(strClientID +"txtAuthorizedLastName").style.backgroundColor = "#cad7ec";
                }
                
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtAuthorizedPhone").value))
                {
                    strMessage += '\n----Phone';
                    document.getElementById(strClientID +"txtAuthorizedPhone").style.backgroundColor = "#cad7ec";
                }  
                
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtAuthorizedCoverageSector").value))
                {
                    strMessage += '\n----Coverage Sector';
                    document.getElementById(strClientID +"txtAuthorizedCoverageSector").style.backgroundColor = "#cad7ec";
                }  
                
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtContractPhase").value))
                {
                    strMessage += '\n----Contract Phase';
                    document.getElementById(strClientID +"txtContractPhase").style.backgroundColor = "#cad7ec";
                }  
                
                if(strMessage != "")
                {
	                //strMessage ="Incorrect Password.Please correct and try again.";
	                strMessage ="The following is invalid:"  + strMessage +"\nPlease correct and try again.";
	                alert(strMessage);
	                return false;
                }
            }
            
            return true;
        }
        
        
        
        //Added by Anjali for Client Feedback on 6th August 2008
        function fnCheckRequestorData(ID,controlID)
        {
            
            alert('test');
            alert(document.getElementById(strClientID + "txt_EmailId").value);
            
            //debugger;
            strMessage="";
            strClientID=ID.substring(0,ID.length-controlID.length);
            
                     
                      alert(document.getElementById(strClientID + "txt_EmailId").value);
                      
            fnCheckInput(strClientID + "txt_EmailId",document.getElementById(strClientID + "txt_EmailId").value,"email","Client Email Id","1"); 
            fnCheckInput(strClientID + "txt_rEmailId",document.getElementById(strClientID + "txt_rEmailId").value,"email","Requestor Email Id","1");
           
            
            
//            fnCheckInput(strClientID + "txt_rEmailId1",document.getElementById(strClientID + "txt_rEmailId1").value,"email","Second Requestor Email Id");                       
//            fnCheckInput(strClientID + "txt_rEmailId2",document.getElementById(strClientID + "txt_rEmailId2").value,"email","Third Requestor Email");                       
//            fnCheckInput(strClientID + "txt_rEmailId3",document.getElementById(strClientID + "txt_rEmailId3").value,"email","Fourth Requestor Email");                       
//            fnCheckInput(strClientID + "txt_rEmailId4",document.getElementById(strClientID + "txt_rEmailId4").value,"email","Fifth Requestor Email");                       
//            
            alert(strMessage);
            
            if(strMessage!="")
            {
                strMessage="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
                alert(strMessage);
                return false;
            }
            return true;
        }
        
      
        
        function echeck(str) 
        {        
        if(str != null && str != "")
         {
		    var at="@"
		    var dot="."
		    var lat=str.indexOf(at)
		    var lstr=str.length
		    var ldot=str.indexOf(dot)
		    if (str.indexOf(at)==-1){
		       //alert("Invalid E-mail ID")
		       return false;
		    }

		    if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		       //alert("Invalid E-mail ID")
		       return false;
		    }

		    if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		        //alert("Invalid E-mail ID")
		        return false;
		    }

		     if (str.indexOf(at,(lat+1))!=-1){
		        //alert("Invalid E-mail ID")
		        return false;
		     }

		     if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		        //alert("Invalid E-mail ID")
		        return false;
		     }

		     if (str.indexOf(dot,(lat+2))==-1){
		        //alert("Invalid E-mail ID")
		        return false;
		     }
    		
		     if (str.indexOf(" ")!=-1){
		        //alert("Invalid E-mail ID");
		        return false;
		     }
             
 		     return true	
 		 }				
	 }
        //The code added for Client Feedback ends here
        
        function fnCheckIndustryData(ID,controlID)
        {
         strClientID=ID.substring(0,ID.length-controlID.length);

            //alert("strclientID " + strClientID);
            strMessage="";
            fnCheckInput(strClientID +"txtName",document.getElementById(strClientID +"txtName").value,"alpha","Industry Name","1");
            if(strMessage!="")
            {
               strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
               alert(strMessage);
               return false;
            }
            return true;
        }
        
        
        //Code added by Vikash kumar on 25 June 2007 
        //Purpose to validate IIT data
    function fnCheckIITData(ID,controlID)
    {
            strClientID=ID.substring(0,ID.length-controlID.length);
            strMessage="";
            fnCheckInput(strClientID + "txtName",document.getElementById(strClientID + "txtName").value,"alpha","name","1");
            fnCheckddlvalue(strClientID + "ddlCountry",document.getElementById(strClientID + "ddlCountry").selectedIndex,"Country","1");
            fnCheckInput(strClientID + "txtPhone",document.getElementById(strClientID + "txtPhone").value,"","Phone","1");
            fnCheckInput(strClientID + "txtEmail",document.getElementById(strClientID + "txtEmail").value,"email"," Email","1");
             if(strMessage!="")
            {
            //  alert(" for STD");
               strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
              
               alert(strMessage);
               return false;
            }

            return true;
            
    }
    //Change End
    function fnCheckExpertData(ID,controlID)
    {
           strClientID=ID.substring(0,ID.length-controlID.length);
           strMessage="";
           fnCheckInput(strClientID +"txtTotalConsultations",document.getElementById(strClientID +"txtTotalConsultations").value,"integer","Total consultations");
           
            var obj=document.getElementById(strClientID + "ddlCountry");
            var ContValue=document.getElementById(strClientID + "ddlCountry").value;
            var objPrimary=document.getElementById(strClientID + "ddlPrimaryEmail");
            var primaryemail=objPrimary.options[objPrimary.selectedIndex].value;
            fnCheckddlvalue(strClientID + "ddlPrefix",document.getElementById(strClientID + "ddlPrefix").selectedIndex,"Prefix","1");
            if(obj.options[obj.selectedIndex].text.toLowerCase()=="india")                
            {
                fnCheckInput(strClientID + "txtFirstName",document.getElementById(strClientID + "txtFirstName").value,"alpha","First name","1");
                fnCheckInput(strClientID + "txtMiddleName",document.getElementById(strClientID + "txtMiddleName").value,"alpha","Middle name");
                fnCheckInput(strClientID + "txtLastName",document.getElementById(strClientID + "txtLastName").value,"alpha","Last name","1");
              //  fnCheckInput(strClientID + "txtPostalCode",document.getElementById(strClientID + "txtPostalCode").value,"","Postal Code","1");
                fnReachMethodChanged(ID,controlID,"std",primaryemail);
               
               }
            else
            {
                fnCheckInput(strClientID + "txtFirstName",document.getElementById(strClientID + "txtFirstName").value,"alpha","First name","1");
                fnCheckInput(strClientID + "txtMiddleName",document.getElementById(strClientID + "txtMiddleName").value,"alpha","Middle name");
                fnCheckInput(strClientID + "txtLastName",document.getElementById(strClientID + "txtLastName").value,"alpha","Last name","1");
              //  fnCheckInput(strClientID + "txtPostalCode",document.getElementById(strClientID + "txtPostalCode").value,"","Postal Code","1");
                fnReachMethodChanged(ID,controlID,"code",primaryemail);
                
            }//txtReferralSource
            fnCheckInput(strClientID + "txtLifetimeEmail",document.getElementById(strClientID + "txtLifetimeEmail").value,"email","Lifetime Email");
            fnCheckInput(strClientID + "txtAlternativeEmail",document.getElementById(strClientID + "txtAlternativeEmail").value,"email","Alternate Email");
            //fnCheckInput(strClientID + "txtCity",document.getElementById(strClientID + "txtCity").value,"","City","1");
            fnCheckInput(strClientID +"txtReferrals",document.getElementById(strClientID +"txtReferrals").value,"integer","Referrals");
            fnCheckInput(strClientID +"txtReferralSource",document.getElementById(strClientID +"txtReferralSource").value,"integer","Referral Source");
            fnCheckInput(strClientID +"txtReferralName",document.getElementById(strClientID +"txtReferralName").value,"string","Referral Name");
            fnCheckInput(strClientID +"txtReferralsAccepted",document.getElementById(strClientID +"txtReferralsAccepted").value,"integer","Referrals Accepted");
            fnCheckInput(strClientID +"txtReferralsPaid",document.getElementById(strClientID +"txtReferralsPaid").value,"integer","Refferrals Paid");
            fnCheckInput(strClientID + "txtSuffix",document.getElementById(strClientID + "txtSuffix").value,"string","Suffix");
            //fnCheckInput(strClientID + "txtCompany",document.getElementById(strClientID + "txtCompany").value,"","Company","1");
            //Commented by Anjali for changing the input fields taken by Title field - 21 Jan 2009
            //fnCheckInput(strClientID + "txtTitle",document.getElementById(strClientID + "txtTitle").value,"string","Title");
            // Commented by Vikash Kumar on 26.02.2008
            //Purpose to link all future Paypal Email with Account details.
           // fnCheckInput(strClientID + "txtPayPalEmail",document.getElementById(strClientID + "txtPayPalEmail").value,"email","Paypal email");
           // fnCheckInput(strClientID + "txtStreetAddress1",document.getElementById(strClientID + "txtStreetAddress1").value,"","Street address","1");
           
               if (ContValue==217)//Country is  US
                    {
                        fnCheckInput(strClientID + "txtState",document.getElementById(strClientID + "txtState").value,"","State","1");      
                    }
                    
                    else
                    
                    {
                     fnCheckInput(strClientID + "txtState",trim(document.getElementById(strClientID + "txtState").value),"string","State");       
                    }
           
           
           
         //   fnCheckInput(strClientID + "txtState",document.getElementById(strClientID + "txtState").value,"","State","1");
            fnCheckInput(strClientID + "txtBriefBiography",document.getElementById(strClientID + "txtBriefBiography").value,"","Brief Biography");
            
             //Change Begin
            //Commented by Vikash kumar on 08.12.2008
            
           // fnCheckddlvalue(strClientID + "ddlIndustry",document.getElementById(strClientID + "ddlIndustry").selectedIndex,"Industry","1");
            
            //Change End
            fnCheckddlvalue(strClientID + "ddlPrimaryIndustry",document.getElementById(strClientID + "ddlPrimaryIndustry").selectedIndex,"Primary Industry","1");
            
           
            
            fnCheckddlvalue(strClientID +"ddlFunctionalRole",document.getElementById(strClientID +"ddlFunctionalRole").selectedIndex,"Functional Area","1");
            fnCheckddlvalue(strClientID +"ddlExperience",document.getElementById(strClientID +"ddlExperience").selectedIndex,"Experience","1");
            
            
              if (document.getElementById(strClientID + "ddlFunctionalRole").selectedIndex!=-1)
                    {
                      var text = document.getElementById(strClientID + "ddlFunctionalRole").options[document.getElementById(strClientID + "ddlFunctionalRole").selectedIndex].text;
                  
                        if (text=="Others")
                        {
                      
                         fnCheckInput(strClientID + "txtOtherFunctionalRole",trim(document.getElementById(strClientID + "txtOtherFunctionalRole").value),"string","Other Functional Area","1");       
                        }  
                    }      
                    
              var IndusValue=document.getElementById(strClientID + "ddlPrimaryIndustry").value;
              
                
                    if (IndusValue=="17")
                    {
                     fnCheckInput(strClientID + "txtOtherPrimaryIndustry",document.getElementById(strClientID +"txtOtherPrimaryIndustry").value,"string","Other Primary Industry","1"); 
                     fnCheckInput(strClientID + "txtOtherSubIndustry",document.getElementById(strClientID + "txtOtherSubIndustry").value,"string","Other Sub Industry","1"); 
                    }
                    
              var chkList1= document.getElementById (strClientID +"chkBoxListSubIndustry");   
              if(chkList1!=null)
              {
                    if (IndusValue!=0)//Industry is Selected-->check for subindustry
                    {   
                        
                        var blnChkListSelected=0;
                   //     var chkList1= document.getElementById (strClientID +"chkBoxListSubIndustry");
                        
                        var arrayOfCheckBoxes= chkList1.getElementsByTagName("input");
                        
                        
                        for(var i=0;i<arrayOfCheckBoxes.length;i++)
                        //do as you wish with each arrayOfCheckBoxes[i] element
                        {
                          if(arrayOfCheckBoxes[i].checked)
                          {
                            blnChkListSelected=1;
                            break;
                            //alert(arrayOfCheckBoxes[i].value);
                            //would echo the control's ID
                          }
                        
                         
                        }
                        if(!blnChkListSelected)
                        {
                         strMessage=strMessage +"\n----" + "SubIndustry"; 
                        }
                     
                    }
                 }
         if(document.getElementById(strClientID + "ddlFunction")!=null)
         {
           var intValueFunction=document.getElementById(strClientID + "ddlFunction").selectedIndex;
           var functionOthers=trim(document.getElementById("ctl00_ContentPlaceHolder1_txtFunctionOthers").value);                       
           var functioncontrol=document.getElementById("ctl00_ContentPlaceHolder1_txtFunctionOthers");
           
           if (intValueFunction!=null)
           {
               if (intValueFunction==11)
               {
                 
                       if(functionOthers =='')
                       {
                       functioncontrol.style.backgroundColor = "#cad7ec";
                       functioncontrol.focus();
                       alert("Please enter text for Function Others");
                       return false;
                       //fnCheckInput(strClientID + "txtFunctionOthers",document.getElementById(strClientID + "txtFunctionOthers").value,"","Function Others","1");
                       // document.getElementById(strClientID +"txtFunctionOthers").style["display"]="inline";  
                       }
                       else
                       {
                       functioncontrol.style.backgroundColor ="White";
                       }
               }
           }
          }
       
         if(document.getElementById(strClientID + "ddllevel")!=null)
         {
           var intValueLevel=document.getElementById(strClientID + "ddllevel").selectedIndex;
           var levelcontrol=document.getElementById("ctl00_ContentPlaceHolder1_txtLevelOthers");
           var levelOthers=trim(document.getElementById("ctl00_ContentPlaceHolder1_txtLevelOthers").value); 
           if (intValueLevel!=null)
           {
               if (intValueLevel==8)
               {
                           if(levelOthers =='')
                           {
                            levelcontrol.style.backgroundColor = "#cad7ec";
                            levelcontrol.focus();
                            alert("Please enter text for Level Others");
                            return false;
                           }
                          else
                           {
                           levelcontrol.style.backgroundColor = "White";
                           }
          
               }
           }
           }
        /*    if(document.getElementById(strClientID + "ddlPrimaryAreaExpertise").selectedIndex==0)
            {
                if(document.getElementById(strClientID + "txtOtherPrimary").value=="")
                {
                    fnCheckInput(strClientID + "txtOtherPrimary",document.getElementById(strClientID + "txtOtherPrimary").value,"","Primary Areas of Expertise","1");
                }
                
            }
            else
                {
                   fnCheckddlvalue(strClientID + "ddlPrimaryAreaExpertise",document.getElementById(strClientID + "ddlPrimaryAreaExpertise").selectedIndex,"Primary Areas of Expertise");
                } */
           
            fnCheckddlvalue(strClientID + "ddlCountry",document.getElementById(strClientID + "ddlCountry").selectedIndex,"Country");
                /* Change begin */
                /*Change made by Vikash Kumar  on 13.8.2008 to make currency mandatory */
            fnCheckddlvalue(strClientID + "ddlCurrency",document.getElementById(strClientID + "ddlCurrency").selectedIndex,"Currency");
            /*Change End */
            fnCheckInput(strClientID +"txtHourlyConsultingRate",document.getElementById(strClientID +"txtHourlyConsultingRate").value,"integer","Hourly Consulting rate","1");
            fnCheckInput(strClientID +"txtDailyConsultingRate",document.getElementById(strClientID +"txtDailyConsultingRate").value,"integer","Daily Consulting rate");
            
            fnCheckInput(strClientID +"txtPagerNumber",document.getElementById(strClientID +"txtPagerNumber").value,"integer","Pager number");
            fnCheckInput(strClientID + "txtLanguage1",document.getElementById(strClientID + "txtLanguage1").value,"","Language1");
            fnCheckInput(strClientID + "txtLanguage2",document.getElementById(strClientID + "txtLanguage2").value,"","Language2");
            fnCheckInput(strClientID + "txtLanguage3",document.getElementById(strClientID + "txtLanguage3").value,"","Language3");
            fnCheckInput(strClientID + "txtLanguage4",document.getElementById(strClientID + "txtLanguage4").value,"","Language4");
            fnCheckInput(strClientID + "txtLanguage5",document.getElementById(strClientID + "txtLanguage5").value,"","Language5");
            fnCheckInput(strClientID + "txtLanguage6",document.getElementById(strClientID + "txtLanguage6").value,"","Language6");
            fnCheckInput(strClientID + "txtLanguage7",document.getElementById(strClientID + "txtLanguage7").value,"","Language7");
            fnCheckInput(strClientID + "txtBoardCertifications1",document.getElementById(strClientID + "txtBoardCertifications1").value,"","BoardCertifications1");
            fnCheckInput(strClientID + "txtBoardCertifications2",document.getElementById(strClientID + "txtBoardCertifications2").value,"","BoardCertifications2");
            fnCheckInput(strClientID + "txtBoardCertifications3",document.getElementById(strClientID + "txtBoardCertifications3").value,"","BoardCertifications3");
            fnCheckInput(strClientID + "txtBoardCertifications4",document.getElementById(strClientID + "txtBoardCertifications4").value,"","BoardCertifications4");
            fnCheckInput(strClientID + "txtCompanyOfExpertise1",document.getElementById(strClientID + "txtCompanyOfExpertise1").value,"","CompanyOfExpertise1");
            fnCheckInput(strClientID + "txtCompanyOfExpertise2",document.getElementById(strClientID + "txtCompanyOfExpertise2").value,"","CompanyOfExpertise2");
            fnCheckInput(strClientID + "txtCompanyOfExpertise3",document.getElementById(strClientID + "txtCompanyOfExpertise3").value,"","CompanyOfExpertise3");
            fnCheckInput(strClientID + "txtCompanyOfExpertise4",document.getElementById(strClientID + "txtCompanyOfExpertise4").value,"","CompanyOfExpertise4");
            fnCheckInput(strClientID + "txtCompanyOfExpertise5",document.getElementById(strClientID + "txtCompanyOfExpertise5").value,"","CompanyOfExpertise5");
            fnCheckInput(strClientID + "txtProductServices1",document.getElementById(strClientID + "txtProductServices1").value,"","ProductServices1");
            fnCheckInput(strClientID + "txtProductServices2",document.getElementById(strClientID + "txtProductServices2").value,"","ProductServices2");
            fnCheckInput(strClientID + "txtProductServices3",document.getElementById(strClientID + "txtProductServices3").value,"","ProductServices3");
            fnCheckInput(strClientID + "txtProductServices4",document.getElementById(strClientID + "txtProductServices4").value,"","ProductServices4");
            fnCheckInput(strClientID + "txtProductServices5",document.getElementById(strClientID + "txtProductServices5").value,"","ProductServices5");
           
            //Commented by Vikash Kumar on 18.02.2008
            
           //  fnCheckInput(strClientID +"txtTaxIDNumber",document.getElementById(strClientID +"txtTaxIDNumber").value,"integer","Tax ID Number");
           
           //End
                      
            
            if(strMessage!="")
            {
            //  alert(" for STD");
               strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
              
               alert(strMessage);
               return false;
            }
           // fnConfirm("Do You want to send Expert Credentials now");
            confirmation();
           
            fnCheckInput(strClientID + "txtTitle",document.getElementById(strClientID + "txtTitle").value,"title","Title");
             if(strMessage!="")
            {
            //  alert(" for STD");
               strMessage ="The following is invalid:"  + strMessage +"\nPlease correct and try again.";
              
               alert(strMessage);
               return false;
            }
             fnCheckPrimaryEmail(strClientID + "ddlPrimaryEmail",document.getElementById(strClientID + "ddlPrimaryEmail"),true);
             
            //expert DNC Check 
            var dncChkNewOnj = document.getElementById(strClientID + "chkExpertDNC");
            var dncCommentOnj = document.getElementById(strClientID + "txtDNCComments");
            var dncChkOldObj = document.getElementById(strClientID + "txtDNCOldVal");
            var newDncValue = dncChkNewOnj.checked? "1": "0";
            
            if(dncChkOldObj.value != newDncValue 
                && trim(dncCommentOnj.value) == '')
            {
                if(strMessage == '')                 
                    strMessage ="The following is invalid or missing:\n---Do Not Consult(Comments)\nPlease correct and try again.";
                else
                    strMessage += "\n---Do Not Consult(Comments)";
                
                
                dncCommentOnj.focus();
                dncCommentOnj.style.backgroundColor = "#cad7ec";
                alert(strMessage);
                
                return false;
            }
            //experte dnc check - end
            
            /*
            
            if(!CheckForExpertDataHTML(strClientID))
            {
                return false;
            }
            
            */
            
            fnCloseWindow();
            return true;
    }
    
    function CheckForExpertDataHTML()
    {
        alert('CheckForExpertDataHTML');
        return false;
    }
    
    function OnDncRejectClick(ID,controlID)
    {
        strClientID=ID.substring(0,ID.length-controlID.length);
        var dncCommentOnj = document.getElementById(strClientID + "txtDNCComments");
        if(trim(dncCommentOnj.value) == '')
        {
            strMessage ="The following is invalid or missing:\n---Do Not Consult(Comments)\nPlease correct and try again.";
            dncCommentOnj.focus();
            dncCommentOnj.style.backgroundColor = "#cad7ec";
            alert(strMessage);
            return false;
        }
        return true;
    }
    
       function confirmation()
         {
              var checkifexpert=document.getElementById("ctl00_ContentPlaceHolder1_HiddenCheckIfExpert");
              if (checkifexpert!=null)
              {
                 if (checkifexpert.value=="TBD")
               {
               
                 var intValue=document.getElementById(strClientID + "ddlIsExpert").selectedIndex;
                     if (intValue=="1")
                     {
                     
                     var answer = confirm("Do you want to send Expert Extranet credentials now!");
                     var  hiddenconfirm = document.getElementById("ctl00_ContentPlaceHolder1_HiddenConfirm");
                                 
	                            if (answer)
	                            {
		                             hiddenconfirm.value =1;
	                            }
	                            else
	                            {
		                             hiddenconfirm.value =0;
	                            }
                     }
               }
          }
             
        }
        
    function fnReachMethodChanged(ID,controlID,check,primaryemail)
    {
       strClientID=ID.substring(0,ID.length-controlID.length);
       var intValue=document.getElementById(strClientID + "ddlBestWayToReach").selectedIndex;
       var country=document.getElementById(strClientID + "ddlCountry").options[document.getElementById(strClientID + "ddlCountry").selectedIndex].text.toLowerCase();
      
        document.getElementById(strClientID + "txtCellPhone").style.backgroundColor = 'white';
        document.getElementById(strClientID + "txtCellCountryCode").style.backgroundColor = 'white';
        document.getElementById(strClientID + "txtWorkPhone").style.backgroundColor = 'white';
        document.getElementById(strClientID + "txtWorkCountryCode").style.backgroundColor = 'white';
        document.getElementById(strClientID + "txtHomePhone").style.backgroundColor = 'white';
        document.getElementById(strClientID + "txtHomeCountryCode").style.backgroundColor = 'white';
        document.getElementById(strClientID + "txtWorkEmail").style.backgroundColor = 'white';
        document.getElementById(strClientID + "txtHomeEmail").style.backgroundColor = 'white';
         
       switch(intValue)
        {
           
            case 0:
               
                //Check for Work and Home country code for length
                 fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"std","Work Country code");
                 fnCheckInput(strClientID + "txtHomeCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"std","Home Country code");
                
                //Check for Home Email
                if(check=="std")
                {
                    
                  fnCheckInput(strClientID + "txtWorkSTDCode",document.getElementById(strClientID + "txtWorkSTDCode").value,"stdcode","Work STD code");
                  fnCheckInput(strClientID + "txtHomeSTDCode",document.getElementById(strClientID + "txtHomeSTDCode").value,"stdcode","Home STD  code");
               
                 }
                
                 fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"std","Cell Country Code");
                 fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email","1");
                 if(primaryemail=="work")
                 {
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email","1");          
                 }
                 else
                 {
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email");          
                 }
                 break;
                     
            case 1:
               //Check for Work and Home country code for length
                fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"std","Work Country code");
                fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"std","Home Country code");
       
                if(check=="std")
                {
                   fnCheckInput(strClientID + "txtWorkSTDCode",document.getElementById(strClientID + "txtWorkSTDCode").value,"stdcode","Work STD code");
                   fnCheckInput(strClientID + "txtHomeSTDCode",document.getElementById(strClientID + "txtHomeSTDCode").value,"stdcode","Home STD  code");
                }
               
                fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"std","Cell Country Code");
                if(primaryemail=="home")
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email","1");    
                  }
                  else
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email");    
                  }
                  
                  fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email","1");
                
                break;
                            
            case 2:
                fnCheckInput(strClientID + "txtCellPhone",document.getElementById(strClientID + "txtCellPhone").value,"","Cell Phone Number","1");
                if(check=="std")
                {
                    fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"stdcode","Cell Country Code","1");
                    fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"stdcode","Work Country  code");
                    fnCheckInput(strClientID + "txtHomeCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"stdcode","Home Country  code");
                    fnCheckInput(strClientID + "txtWorkSTDCode",document.getElementById(strClientID + "txtWorkSTDCode").value,"stdcode","Work STD code");
                    fnCheckInput(strClientID + "txtHomeSTDCode",document.getElementById(strClientID + "txtHomeSTDCode").value,"stdcode","Home STD  code");
                 }
                 else
                 {
                    fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"std","Cell Country Code","1");
                    fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"std","Work Country  code");
                    fnCheckInput(strClientID + "txtHomeCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"std","Home Country  code");
                 }
                 if(primaryemail=="home")
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email","1");
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email");
                  }
                  else
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email");
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email","1");
                  }
                break;
                
                
                
            case 3:
              
                                               
               fnCheckInput(strClientID + "txtWorkPhone",document.getElementById(strClientID + "txtWorkPhone").value,"","Work Phone Number","1");
                 
                 if(check=="std")
                {
                    fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"stdcode","Work Country Code","1");
                    fnCheckInput(strClientID + "txtHomeCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"stdcode","Home Country  code");
                    fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"stdcode","Cell Country  code");
                    fnCheckInput(strClientID + "txtWorkSTDCode",document.getElementById(strClientID + "txtWorkSTDCode").value,"stdcode","Work STD code","1");
                    fnCheckInput(strClientID + "txtHomeSTDCode",document.getElementById(strClientID + "txtHomeSTDCode").value,"stdcode","Home STD  code");
                 }
                 else
                 {
                    fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"std","Work Country Code","1");
                    fnCheckInput(strClientID + "txtHomeCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"std","Home Country  code");
                    fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"std","Cell Country  code");
                 }
                if(primaryemail=="home")
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email","1");
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email");
                  }
                  else
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email");
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email","1");
                  }
                break;
            case 4:
                                              
                  fnCheckInput(strClientID + "txtHomePhone",document.getElementById(strClientID + "txtHomePhone").value,"","Home Phone Number","1");
                 
                 if(check=="std")
                {
                    fnCheckInput(strClientID + "txtHomeCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"stdcode","Home Country Code","1");
                    fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"stdcode","Work Country  code");
                    fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"stdcode","Cell Country  code");
                    fnCheckInput(strClientID + "txtWorkSTDCode",document.getElementById(strClientID + "txtWorkSTDCode").value,"stdcode","Work STD code");
                   fnCheckInput(strClientID + "txtHomeSTDCode",document.getElementById(strClientID + "txtHomeSTDCode").value,"stdcode","Home STD  code","1");
                   
                 }
                 else
                 {
                    fnCheckInput(strClientID + "txtHomeCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"std","Home Country Code","1");
                    fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"std","Work Country  code");
                    fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"std","Cell Country  code");
                 }
                 if(primaryemail=="home")
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email","1");
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email");
                  }
                  else
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email");
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email","1");
                  }
               
                
                break;
            case 5:
               if(check=="std")
                {
                    
                    fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"stdcode","Work Country  code");
                    fnCheckInput(strClientID + "txtHomeCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"stdcode","Home Country  code");
                    fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"stdcode","Cell Country Code");
                    fnCheckInput(strClientID + "txtWorkSTDCode",document.getElementById(strClientID + "txtWorkSTDCode").value,"stdcode","Work STD code");
                    fnCheckInput(strClientID + "txtHomeSTDCode",document.getElementById(strClientID + "txtHomeSTDCode").value,"stdcode","Home STD  code");
                 }
                 else
                 {
                    fnCheckInput(strClientID + "txtHomeCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"std","Home Country Code");
                    fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"std","Work Country  code");
                    fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"std","Cell Country  code");
                 }
                 if(primaryemail=="home")
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email","1");
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email");
                  }
                  else
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email");
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email","1");
                  }
                 fnCheckInput(strClientID + "txtOther",document.getElementById(strClientID + "txtOther").value,"","Other way to reach","1");
                 break;
          
        }
    }
    
function fnPersonalData(ID,controlID)
    {
             //fnCheckInput(strClientID +"txtHourlyConsultingRate",document.getElementById(strClientID +"txtHourlyConsultingRate").value,"integer","Hourly Consulting rate");
            var strClientID=ID.substring(0,ID.length-controlID.length);
            strMessage="";
            var country=document.getElementById(strClientID + "ddlCountry").options[document.getElementById(strClientID + "ddlCountry").selectedIndex].text.toLowerCase();
            var primaryemail="home";
            if(document.getElementById(strClientID + "rblPrimaryEmail_1").checked)
            {
                primaryemail="work"
               
            } 
           
            if (country=="india")
            {
              
                fnCheckInput(strClientID + "txtFirstName",document.getElementById(strClientID + "txtFirstName").value,"alpha","First name","1");
                fnCheckInput(strClientID + "txtLastName",document.getElementById(strClientID + "txtLastName").value,"alpha","Last name","1");
                fnCheckInput(strClientID + "txtMiddleName",document.getElementById(strClientID + "txtMiddleName").value,"alpha","Middle name");
                fnCheckInput(strClientID + "txtSuffix",document.getElementById(strClientID + "txtSuffix").value,"alpha","Suffix");
                fnReachMethodChanged(ID,controlID,"std",primaryemail);
              
               
            }
            else
            {
                fnCheckInput(strClientID + "txtFirstName",document.getElementById(strClientID + "txtFirstName").value,"","First name","1");
                fnCheckInput(strClientID + "txtLastName",document.getElementById(strClientID + "txtLastName").value,"","Last name","1");
                fnCheckInput(strClientID + "txtMiddleName",document.getElementById(strClientID + "txtMiddleName").value,"","Middle name");
                fnCheckInput(strClientID + "txtSuffix",document.getElementById(strClientID + "txtSuffix").value,"","Suffix");
                fnReachMethodChanged(ID,controlID,"code",primaryemail);
               
            }
           fnCheckInput(strClientID + "txtLifetimeEmail",document.getElementById(strClientID + "txtLifetimeEmail").value,"email","Lifetime Email");
           fnCheckInput(strClientID + "txtAlternativeEmail",document.getElementById(strClientID + "txtAlternativeEmail").value,"email","Alternate Email");
            //validate entries in state textbox
           if(document.getElementById(strClientID + "txtState") != null)
               {
                  fnCheckInput(strClientID + "txtState",document.getElementById(strClientID + "txtState").value,"string","State","1");
               }
           fnCheckInput(strClientID + "txtCompany",document.getElementById(strClientID + "txtCompany").value,"","Company","1");
           fnCheckInput(strClientID + "txtTitle",document.getElementById(strClientID + "txtTitle").value,"","Title","1");
           fnCheckddlvalue(strClientID + "ddlCurrency",document.getElementById(strClientID + "ddlCurrency").selectedIndex,"Currency");
           fnCheckInput(strClientID + "txtHourlyConsultingRate",document.getElementById(strClientID + "txtHourlyConsultingRate").value,"integer","Hourly Consulting Rate","1");
           fnCheckInput(strClientID + "txtStreetAddress1",document.getElementById(strClientID + "txtStreetAddress1").value,"","Street address","1");
           fnCheckInput(strClientID + "txtRecruiterName",document.getElementById(strClientID + "txtRecruiterName").value,"string","Referral Name");
           fnCheckInput(strClientID + "txtCity",document.getElementById(strClientID + "txtCity").value,"","City","1");
           fnCheckInput(strClientID + "txtPostalCode",document.getElementById(strClientID + "txtPostalCode").value,"","Postal Code","1");
           fnCheckInput(strClientID + "txtRecruiterID",document.getElementById(strClientID + "txtRecruiterID").value,"integer","Recruiter ID","");
            
            if (country=="india")
            {
              if(strMessage!="")
                    {

                       strMessage ="Please enter the following missing/ invalid information:"  + strMessage +"\nPlease correct and try again. If you have any queries,\n";
                       strMessage +="send an email to CoEexpertquestions@evalueserve.com.";
                       alert(strMessage);
                       return false;
                    }
            }
            else
            {
              if(strMessage!="")
                {

                   strMessage ="Please enter the following missing/ invalid information:"  + strMessage +"\nPlease correct and try again. If you have any queries,\n";
                   //Rakesh on 27-05-2008
                   //Changed format of contact number. 
                   strMessage +="contact us at +1-(212)-682-6676.";
                   //Rakesh wrk end
                   alert(strMessage);
                   return false;
                }
                
            }
        
            return true;
    }
     //change for Primary Area of Expertise
   function fnPrimaryAreaExpertise(ID,controlID)
   {
        strClientID=ID.substring(0,ID.length-controlID.length);
         var obj=document.getElementById(strClientID + "ddlPrimaryAreaOfExpertise")
        if(obj!=null)
        {
            if(obj.options[obj.selectedIndex].text.toLowerCase()=="other")
            {
                document.getElementById(strClientID + "locOtherPrimaryExpertise").style["display"]="inline";
                document.getElementById(strClientID +"txtOtherPrimaryExpertise").style["display"]="inline";
            }
            else
            {
                 if(document.getElementById(strClientID + "locOtherPrimaryExpertise") != null)
                 {
                    document.getElementById(strClientID + "locOtherPrimaryExpertise").style["display"]="none";
                    document.getElementById(strClientID +"txtOtherPrimaryExpertise").style["display"]="none";
                 }
            }
        }
   }
   function fnSecondaryAreaExpertise(ID,controlID)
   {
        strClientID=ID.substring(0,ID.length-controlID.length);
        var obj=document.getElementById(strClientID + "ddlSecondaryAreaOfExpertise")
        if(obj!=null)
        {
            if(obj.options[obj.selectedIndex].text.toLowerCase()=="other")
            {
                document.getElementById(strClientID + "locOtherSecondaryExpertise").style["display"]="inline";
                document.getElementById(strClientID +"txtOtherSecondaryExpertise").style["display"]="inline";
            }
            else
            {
                  document.getElementById(strClientID + "locOtherSecondaryExpertise").style["display"]="none";
                 document.getElementById(strClientID +"txtOtherSecondaryExpertise").style["display"]="none";
            }
        }
   }
   
    function fnFunctionOthers(ID,controlID)
   {
        
        strClientID=ID.substring(0,ID.length-controlID.length);
        
        var intValue=document.getElementById(strClientID + "ddlFunction").selectedIndex;
        
        if (intValue==11)
         {
         document.getElementById(strClientID +"txtFunctionOthers").style["display"]="inline";  
         }
         else
         {
         document.getElementById(strClientID +"txtFunctionOthers").style["display"]="none";
         }
        
   }
     function fnFunctionalRoleOthers(ID,controlID)
   {
       
        strClientID=ID.substring(0,ID.length-controlID.length);
       if (document.getElementById(strClientID + "ddlFunctionalRole").selectedIndex!=-1)
                    {
        var text = document.getElementById(strClientID + "ddlFunctionalRole").options[document.getElementById(strClientID + "ddlFunctionalRole").selectedIndex].text;
        
                if(document.getElementById(strClientID +"pnlOtherFunctionalRole")!=null)
                {
                       
                         if (text=="Others")
                            {
                             document.getElementById(strClientID +"pnlOtherFunctionalRole").style["display"]="inline";  
                            }  
                      
                       
                         else
                         {
                         document.getElementById(strClientID +"pnlOtherFunctionalRole").style["display"]="none";
                         }
              }
              
              else
              {
              
                 if (text=="Others")
                            {
                             document.getElementById(strClientID +"txtOtherFunctionalRole").style["display"]="inline";  
                            }  
                      
                       
                         else
                         {
                         document.getElementById(strClientID +"txtOtherFunctionalRole").style["display"]="none";
                         }
              }
              
              
        }
   }
    function fnLevelOthers(ID,controlID)
   {
      
        strClientID=ID.substring(0,ID.length-controlID.length);
        var intValue=document.getElementById(strClientID + "ddllevel").selectedIndex;
        if (intValue==8)
         {
         document.getElementById(strClientID +"txtLevelOthers").style["display"]="inline";  
         }
         
         else
         {
         document.getElementById(strClientID +"txtLevelOthers").style["display"]="none";
         }
        
   }
   
     function fnPaymentStatus(ID,controlID,expert_country_name,paypal_country_bit,wiretransfer_country_bit,paypal_currency_bit,wiretransfer_currency_bit,expert_currency)
   {

         strClientID=ID.substring(0,ID.length-controlID.length);
        var intValue=document.getElementById(strClientID + "ddlPaymentStatus").selectedIndex;
        
           if (intValue==3)
         {
         document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.display = 'block'; 
         document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.visibility = 'visible';
         document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.visibility = 'hidden';
         document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.display = 'none'; 
         document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.visibility = 'hidden';
         document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.display = 'none'; 
         
               if (paypal_country_bit=="False")
                 {
                       var obj=document.getElementById(strClientID + "ddlPaymentStatus")
                       obj.selectedIndex=0;
                       alert("Expert's country is " +  expert_country_name + ", which is not a valid country\nfor payment through Paypal.Please select some other mode of payment.")
                      // alert ( expert_country_name +" is not a valid country for payment by paypal . Please select some other mode of payment");
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.visibility = 'hidden';
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.display = 'none'; 
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.visibility = 'hidden' 
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.display = 'none'; 
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.visibility = 'hidden';
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.display = 'none'; 
                       return false;
                   }
                      if (paypal_currency_bit=="False")
                 {
                       var obj=document.getElementById(strClientID + "ddlPaymentStatus")
                       obj.selectedIndex=0;
                       alert("Expert's currency is " +  expert_currency + ", which is not a valid currency\nfor payment through Paypal.Please select some other mode of payment.")
                   //    alert ( expert_currency +" is not a valid currency for payment by paypal . Please select some other mode of payment");
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.visibility = 'hidden';
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.display = 'none'; 
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.visibility = 'hidden' 
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.visibility = 'hidden';
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.display = 'none'; 
                        return false;
                   }
         
              
         }
           if (intValue==2)
         {
         document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.display = 'block';
         document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.visibility = 'visible'; 
         document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.visibility = 'hidden' 
         document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.display = 'none'; 
         document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.visibility = 'hidden';
         document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.display = 'none'; 
              
         alert("Wire Transfer and Paypal is the preferred and faster mode of Payment"); 
             
         
          }
         
         if (intValue==1)
         {
         document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.display = 'block'; 
         document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.visibility = 'visible';
         document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.visibility = 'hidden';
         document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.display = 'none'; 
         document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.visibility = 'hidden';
         document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.display = 'none';  
         
           if (wiretransfer_country_bit=="False")
                 {
                       var obj=document.getElementById(strClientID + "ddlPaymentStatus")
                       obj.selectedIndex=0;
                        alert("Expert's country is " +  expert_country_name + ", which is not a valid country\nfor payment through Wire Transfer.Please select some other mode of payment.")
                      // alert ( expert_country_name +" is not a valid country for payment by Wire Transfer.Please select some other mode of payment");
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.visibility = 'hidden';
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.display = 'none'; 
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.visibility = 'hidden' 
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.display = 'none'; 
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.visibility = 'hidden';
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.display = 'none';
                       return false; 
                 
                }
                   if (wiretransfer_currency_bit=="False")
                 {
                       var obj=document.getElementById(strClientID + "ddlPaymentStatus")
                       obj.selectedIndex=0;
                        alert("Expert's currency is " +  expert_currency + ", which is not a valid currency\nfor payment through Wire Transfer.Please select some other mode of payment.")
                    //   alert ( expert_currency +" is not a valid currency for payment by Wire Transfer.Please select some other mode of payment");
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.visibility = 'hidden';
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.display = 'none'; 
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.visibility = 'hidden' 
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.display = 'none'; 
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.visibility = 'hidden';
                       document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.display = 'none'; 
                       return false;
                   }

         }
         
         if (intValue==0)
         {
         document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.visibility = 'hidden';
         document.getElementById('ctl00_ContentPlaceHolder1_PanelCheque').style.display = 'none'; 
         document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.visibility = 'hidden' 
         document.getElementById('ctl00_ContentPlaceHolder1_PanelWireTransfer').style.display = 'none'; 
         document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.visibility = 'hidden';
         document.getElementById('ctl00_ContentPlaceHolder1_PanelPaypal').style.display = 'none';  
         }
        
   }
   //change for best way to reach
   function fnChangeBestWay(ID,controlID)
   {
      
        strClientID=ID.substring(0,ID.length-controlID.length);
        var primaryEmail="work";
        var object=document.getElementById(strClientID +"rblPrimaryEmail_0")
        if(object!=null)
        {
            if(object.checked==true)
             {
                primaryEmail="home";
             }
         }
         else
         {
                if(document.getElementById(strClientID + "ddlPrimaryEmail").selectedIndex==1)
                {
                    primaryEmail="home";
                }
                
            
         }
        
     
        var intValue=document.getElementById(strClientID + "ddlBestWayToReach").selectedIndex;
        
         document.getElementById(strClientID + "imgWorkPhone").style["display"]="none";
         document.getElementById(strClientID +"imgHomePhone").style["display"]="none";
         document.getElementById(strClientID +"imgCellPhone").style["display"]="none";
         document.getElementById(strClientID + "imgOther").style["display"]="none";
         document.getElementById(strClientID +"locOther").style["display"]="none";
         document.getElementById(strClientID +"txtOther").style["display"]="none";
         if(document.getElementById(strClientID +"trOther")!=null)
         {
            document.getElementById(strClientID +"trOther").style["display"]="none";
         }
         switch(intValue)
        {
             case 0:
               document.getElementById(strClientID + "home").style["visibility"]="visible";
              //Change Begin
              //Change made by Vikash  Kumar on 31 May, 2007
               if(primaryEmail=="home")
                 {
                    document.getElementById(strClientID + "work").style["visibility"]="hidden";
                 }
              else
                 {
                   document.getElementById(strClientID + "work").style["visibility"]="visible";
                 }
             //Change End
             break;
             
             
             case 1:
             
              document.getElementById(strClientID + "work").style["visibility"]="visible";
          
              if(primaryEmail=="work")
                 {
                    document.getElementById(strClientID + "home").style["visibility"]="hidden";
                 }
              else
                 {
                   document.getElementById(strClientID + "home").style["visibility"]="visible";
                 }
           
             
             
             break;
             case 2:
              document.getElementById(strClientID + "imgCellPhone").style["display"]="inline";
            
              //vikash 31 may
              
               if(primaryEmail=="home")
                 {
                    document.getElementById(strClientID +"work").style["visibility"]="hidden";
                 }
                else
                {
                     document.getElementById(strClientID +"home").style["visibility"]="hidden";
                }
             break;
             
             case 3:
             document.getElementById(strClientID + "imgWorkPhone").style["display"]="inline";
             
              //vikash 31 may
               if(primaryEmail=="home")
                 {
                 document.getElementById(strClientID + "work").style["visibility"]="hidden";
                 }
              else
                {
                     document.getElementById(strClientID + "home").style["visibility"]="hidden";
                }
         
             break;
             
             case 4:
             document.getElementById(strClientID +"imgHomePhone").style["display"]="inline";
             
             
              //vikash 31 may
               if(primaryEmail=="home")
                 {
                 document.getElementById(strClientID + "work").style["visibility"]="hidden";
                 }
             else
                {
                     document.getElementById(strClientID + "home").style["visibility"]="hidden";
                }
             break;
             
             case 5:
            document.getElementById(strClientID + "imgOther").style["display"]="inline";
            document.getElementById(strClientID +"locOther").style["display"]="inline";
            document.getElementById(strClientID +"txtOther").style["display"]="inline";  
             if(document.getElementById(strClientID +"trOther")!=null)
             {
                document.getElementById(strClientID +"trOther").style["display"]="inline";
             }
              //vikash 31 may
               if(primaryEmail=="home")
                 {
                 document.getElementById(strClientID + "work").style["visibility"]="hidden";
                 }
                  else
                {
                     document.getElementById(strClientID + "home").style["visibility"]="hidden";
                }
             break;
             
             
        }
        
   }
   
   
   //Function to tracke the radio button change of password.
  function fnRadioOptionChanged(bestwayID,strValue)
  {
       var obj=document.getElementById(strValue+"_1");
       controlID="ddlBestWayToReach";
       strClientID=bestwayID.substring(0,bestwayID.length-controlID.length);
    
       
       if(obj==null)
       {
            obj=document.getElementById(strValue);
            if(obj.selectedIndex==1)
            {
                primaryEmail="home";
            }
            else
            {
                primaryEmail="work";
            }
       }
       else
       {
            if(obj.checked)
               {
                    primaryEmail="work";
               }
               else
               {
                primaryEmail="home";
               }
           
       }
     
       var intValue=document.getElementById(bestwayID).selectedIndex;
       if(primaryEmail=="work")
       {
            document.getElementById(strClientID + "work").style["visibility"]="visible";
             alert("Expert's default login credentials would be changed to work email id.");
            
            if(intValue!="0")
            {
             document.getElementById(strClientID + "home").style["visibility"]="hidden";
            }
       }
       else
       {
            document.getElementById(strClientID + "home").style["visibility"]="visible";
             alert("Expert's default login credentials would be changed to home email id .");
            if(intValue!="1")
            {
               document.getElementById(strClientID + "work").style["visibility"]="hidden";
            }
          
       }
               
      
  }
  function fnBIOExpertData(ID,controlID)
    {
            strClientID=ID.substring(0,ID.length-controlID.length);
            strMessage="";
            fnCheckddlvalue(strClientID + "ddlPrimaryAreaOfExpertise",document.getElementById(strClientID + "ddlPrimaryAreaOfExpertise").selectedIndex,"Primary Area of Expertise");
            if(strMessage!="")
            {
                var strOriginalMessage=strMessage;
                strMessage="";
                fnCheckInput(strClientID + "txtOtherPrimaryExpertise",document.getElementById(strClientID + "txtOtherPrimaryExpertise").value,"","Primary Area of Expertise","1");
               
            }
            
            if(strMessage!="")
            {
               strMessage ="Please enter the following missing/ invalid information:"  + strMessage +"\nPlease correct and try again.";
               alert(strMessage);
               return false;
            }

           return true;
    }
    
    function fnTermsExpertData(ID,controlID)
    {
            strClientID=ID.substring(0,ID.length-controlID.length);
            strMessage="";
            var obj=document.getElementById(strClientID + "ddlCountry")
           
            if(document.getElementById(strClientID + "chkTnC").checked==false)
            {

                if(obj.options[obj.selectedIndex].text.toLowerCase()=="india")          
                          {
                          
                           strMessage ="Please select the 'Terms and Conditions' checkbox.\r\n"
	                       strMessage=strMessage +"            - All members of the Circle of Experts must accept our terms and conditions.\n If you have any questions about them, send an email to CoEexpertquestions@evalueserve.com.\r\n"
                  
                    }
                else
                {
                    strMessage ="Please select the 'Terms and Conditions' checkbox.\r\n"
	               strMessage=strMessage +"            - All members of the Circle of Experts must accept our terms and conditions.\n If you have any questions about them, contact us at +1-(212)-682-6676.\r\n"
                  
                }
               
               alert(strMessage);
               return false;
            }
            
            
           return true;
    }
    function fnJoinExpertData(ID,controlID)
       {
      // debugger;
       
       
           var blnCheckTnC;
       
           if(fnPersonalData(ID,controlID))
           {
               // if(fnBIOExpertData(ID,controlID))
                 //   {
                        if(fnTermsExpertData(ID,controlID))
                        {
                        
                          //  alert("Hourly Consulting Rate " + document.getElementById(strClientID + "txtHourlyConsultingRate").value);
                            strClientID=ID.substring(0,ID.length-controlID.length);
                            document.getElementById(strClientID + "btnSubmit").disabled=false;
                            if(document.getElementById('ctl00_ContentPlaceHolder1_CountTCClick')!=null)
                            {
                                document.getElementById('ctl00_ContentPlaceHolder1_CountTCClick').value=tcClickCounter;
                            }
                            return true;
                        }
                  //  }
           }
        return false;    
       }
       
      function OnJoinLoad(strID)
      {
           document.getElementById(strID + 'divTnC').style["display"]="none";
           document.getElementById(strID + 'divExpertiseBio').style["display"]="none";
           
      } 
      
      //Vikash kumar
      
    function changeSelection(strID,clientID,controlID)
    {
    //  debugger;
     
        var blnGo;
        var strOrginalID=strID;
        
         strNewID=clientID.substring(0,clientID.length-controlID.length);
        if(strID=="divExpertiseBio")
        {
              
              blnGo=fnPersonalData(clientID,controlID)
             // AutoSave();
             
        }
        else 
        {
            if(strID=="divTnC")
              {
                  tcClickCounter++;
                           
                   if (fnPersonalData(clientID,controlID))
                    {
                        blnGo=fnBIOExpertData(clientID,controlID)
                   }
               }
            else
            {
                blnGo=true;
            }
        }
       
       if(blnGo)
        {
            
           
            document.getElementById(strNewID +'divPersonalInfo').style["display"]="none";
            document.getElementById(strNewID +'divTnC').style["display"]="none";
            document.getElementById(strNewID +'divExpertiseBio').style["display"]="none";
            

                              
            document.getElementById(strNewID +'tdPersonalInfo').className="regular_white";
            document.getElementById(strNewID +'tdTnC').className="regular_white";
            document.getElementById(strNewID+'tdExpertiseBio').className="regular_white";
           
            document.getElementById(strNewID +'tdPersonalInfo').style.backgroundImage="url(images/tab2_bg.gif)";
            document.getElementById(strNewID +'tdTnC').style.backgroundImage="url(images/tab2_bg.gif)";
            document.getElementById(strNewID +'tdExpertiseBio').style.backgroundImage="url(images/tab2_bg.gif)";
            
            document.getElementById(strNewID +'aPersonalInfo').className="regular";
            document.getElementById(strNewID +'aTnC').className="regular";
            document.getElementById(strNewID +'aExpertiseBio').className="regular";
            
            document.getElementById(strNewID +"l1ExpertiseBio").src="images/tab2_left.gif";
            document.getElementById(strNewID +"l1PersonalInfo").src="images/tab2_left.gif";
            document.getElementById(strNewID +"l1TnC").src="images/tab2_left.gif";
            
            document.getElementById(strNewID +"l2ExpertiseBio").src="images/tab2_right.gif";
            document.getElementById(strNewID +"l2PersonalInfo").src="images/tab2_right.gif";
            document.getElementById(strNewID +"l2TnC").src="images/tab2_right.gif";
            
            document.getElementById(strNewID + strID).style["display"]="inline";
         
            
            strID=strID.replace("div","td") 
            document.getElementById(strNewID + strID).className="regular_white";
            document.getElementById(strNewID + strID).style.backgroundImage="url(images/tab1_bg.gif)";
            //document.getElementById(strNewID + strID).background="images/tab1_bg.gif";
          
            strID=strID.replace("td","a") 
            document.getElementById(strNewID +strID).className="regular_white";
            strID=strID.replace("a","l1") 
            document.getElementById(strNewID +strID).src="images/tab1_left.gif";
            strID=strID.replace("l1","l2") 
            document.getElementById(strNewID +strID).src="images/tab1_right.gif";
            if(strOrginalID=="divExpertiseBio")
            {          
                /*alert(getY(document.getElementById("FTBContainer")));
                document.getElementById("FTB_div").style.top = parseInt(getY(document.getElementById("FTBContainer")))+"px";
                alert(document.getElementById("FTB_div").style.top);
                document.getElementById("FTB_div").style.left = parseInt(getX(document.getElementById("FTBContainer")))+"px";
                alert(document.getElementById("FTB_div").style.left);*/
                
               if(navigator.appName=="Netscape")
                {
                 setTimeout('resetHTMLFTB()',500);             
                 }
             }
           scrollTo(0, 0); 
           return true;
        }
        return false;
    }
    
    function getY( oElement )
    {
        var iReturnValue = 0;
        while( oElement != null ) {
            iReturnValue += oElement.offsetTop;
            oElement = oElement.offsetParent;
        }
        return iReturnValue;
    }
    
    function getX( oElement )
    {
        var iReturnValue = 0;
        while( oElement != null ) {
            iReturnValue += oElement.offsetLeft;
            oElement = oElement.offsetParent;
        }
        return iReturnValue;
    }
    
    function resetHTMLFTB()
    {

        FTB_API['ctl00_ContentPlaceHolder1_FreeTextBox1'].readOnly=false;
        FTB_API['ctl00_ContentPlaceHolder1_FreeTextBox1'].GoToHtmlMode();
        setTimeout('resetDesignFTB()',10);   
    }
    function resetDesignFTB()
    {
        FTB_API['ctl00_ContentPlaceHolder1_FreeTextBox1'].enableToolbars=true;
        FTB_API['ctl00_ContentPlaceHolder1_FreeTextBox1'].SetToolbarItemsEnabledState();
        FTB_API['ctl00_ContentPlaceHolder1_FreeTextBox1'].GoToDesignMode ();
    }
     function fnCurrenyChanged(ID,controlID)
     {
        strClientID=ID.substring(0,ID.length-controlID.length);
        obj= document.getElementById(strClientID + 'ddlCurrency')
        objText=document.getElementById(strClientID + 'txtHourlyConsultingRate');
      
       if(obj.options[obj.selectedIndex].text=="INR - rupee")
       {
       
            // Comment  Begin
            // Code Commented by vikash kumar on 22 May , 2007 as from now onwards 
            // Consulting rate for india will be entered by the User
            
            //objText.value="4000";
            
            //Comment End
            
            //objText.disabled=true;
       }
       else
       {
            objText.value="";
            objText.disabled=false;
       }      
     }


 
 
    function fnAddExpertConsultation(ID,controlID)
        {    
            strClientID=ID.substring(0,ID.length-controlID.length);
            strMessage="";             
            fnCheckInput(strClientID +"txtTitle",document.getElementById(strClientID +"txtTitle").value,"","Title","1");
            fnCheckInput(strClientID +"txtClient",document.getElementById(strClientID +"txtClient").value,"integer","Client");
            fnCheckInput(strClientID +"txtExpDuration",document.getElementById(strClientID +"txtExpDuration").value,"integer","Duration");
            fnCheckInput(strClientID + "txtTime",document.getElementById(strClientID + "txtTime").value,"time","Time");
            if(strMessage!="")
            {

              strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
              alert(strMessage);
              return false;
            }

            return true;

        }
        
        function fnEditExpertConsultation(ID,controlID)
        {    
           
            strClientID=ID.substring(0,ID.length-controlID.length);
            strMessage="";
            //alert(document.getElementById(ID)+'\n'+document.getElementById(strClientID+controlID)+'\n'+strClientID+'\n'+controlID);
            
            fnCheckInput(strClientID +"txtTitle",document.getElementById(strClientID +"txtTitle").value,"","Title","1");            
            fnCheckInput(strClientID +"txtClient",document.getElementById(strClientID +"txtClient").value,"integer","Client");
            fnCheckInput(strClientID + "txtExpDuration",document.getElementById(strClientID + "txtExpDuration").value,"integer","Expert Duration");
            fnCheckInput(strClientID + "txtTime",document.getElementById(strClientID + "txtTime").value,"time","Time");
            //Change made by Vikash Kumar on 18.2.2008
            
            // fnCheckInput(strClientID +"txtSSN",document.getElementById(strClientID +"txtSSN").value,"alpha","Social Security Number"); 
           
            //End
            if(strMessage != "")
            {

               strMessage = "The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
               alert(strMessage);
               return false;
            }

            return true;

        }

  
    function fnCheckSearchData(ID,controlID)
    {
      
    strClientID=ID.substring(0,ID.length-controlID.length);
    strMessage = "";
    var strParameter = document.getElementById(strClientID +"txtParameter").value;
    strParameter=trim(strParameter);
    fnCheckInput(strClientID +"txtParameter",strParameter,"","Search Expression","1");            
          if(strMessage != "")
            {
              strMessage ="Please enter search parameter.";
              alert(strMessage);
              return false;
            }      
      var Step=0;
                 
      if(document.getElementById(strClientID + "chkIdentity") != null)
      {
         if(document.getElementById(strClientID +"chkIdentity").checked)
         {
              Step=1;
         }
      }
     if(document.getElementById(strClientID +"chkTitle").checked)
     {
        Step=1;
     }
     if(document.getElementById(strClientID +"chkEmail").checked)
     {
        Step=1;
     }
     if(document.getElementById(strClientID +"chkTopic").checked)
     {
        Step=1;
     }
     if(document.getElementById(strClientID +"chkLocation").checked)
     {
        Step=1;
     }
     if(document.getElementById(strClientID +"chkExpertise").checked)
     {
        Step=1;
     }
     if(document.getElementById(strClientID +"chkCompanies").checked)
     {
        Step=1;
     }
      if(document.getElementById(strClientID +"chkProduct").checked)
     {
        Step=1;
     }
     if(document.getElementById(strClientID +"chkResume").checked)
     {
        Step=1;
     }
     if(document.getElementById(strClientID +"chkBreif").checked)
     {
        Step=1;
     }
     
     if(document.getElementById(strClientID +"chkLanguages").checked)
     {
        Step=1;
     }
     if(document.getElementById(strClientID +"chkBoard").checked)
     {
        Step=1;
     }
     //Start: Changes done by Vishal on 1st Feb 2008
     
     if(document.getElementById(strClientID +"chkLevel").checked)
     {
        Step=1;
     }
     if(document.getElementById(strClientID +"chkFunction").checked)
     {
        Step=1;
     }
  /*  if(document.getElementById(strClientID + "chkEmpstatus") != null)
        {
             if(document.getElementById(strClientID +"chkEmpstatus").checked)
             {
                Step=1;
             }
         }*/
     //End: Changes done by Vishal on 1st Feb 2008
     
     if(Step==0)
     {
        alert("Please select at least one search option.")
        return false;
     }
     return true;
    }
    
    // Change Begin
    //code by Vikash kumar on 28 may to validate file extension
function fnCheckFileExtension(ID,controlID)
        {  
         strClientID=ID.substring(0,ID.length-controlID.length);
         var fileName = document.getElementById(strClientID+"uploadResume").value;
         //alert(fileName);
         var arySplit=fileName.split(".");
         extension=arySplit[arySplit.length-1]
     
        
        
        if ((extension==null) &&(fileName!=""))
        {
            alert("Please first select a file with either of the following extensions to upload: rtf, doc, txt, htm or html");
            return false;
        }
         
         if ((extension!='txt'&& extension!='doc'&& extension!='rtf' && extension!='htm' && extension!='html')&&(fileName!=""))
        {
            alert("Please select a file with either of the following extensions to upload:  rtf, doc, txt, htm or html ");
            return false;
        }
        
         
        return true;

        }
    function fnCloseWindow()
    {
   // alert("in close");
    if (popup_window!=null)
    {
    popup_window.close ();
    }
    }

//Change End

// Function To check User "Ashutosh"


function fnadduser(ID,controlID)
    {
             
             var strClientID=ID.substring(0,ID.length-controlID.length);
             var userpass = document.getElementById(strClientID +"txt_Pass").value;
             var username= document.getElementById(strClientID +"txt_user").value;
             //alert(userpass);
             strMessage="";
             //Change made by Vikash Kumar on 11 July, 2007
            //fnCheckInput(strClientID + "txt_user",document.getElementById(strClientID + "txt_user").value,"email","User name should be a valid email id","1");
            fnCheckInput(strClientID + "txt_user",document.getElementById(strClientID + "txt_user").value,"","User name ","1");
           
            //Change End 
            
            //fnCheckInput(strClientID + "txt_user",document.getElementById(strClientID + "txt_user").value,"User name","1");
            
            //fnCheckInput(strClientID + "txt_Pass",document.getElementById(strClientID + "txt_Pass").value,"","Password","1");
            //fnCheckInput(strClientID + "txt_Pass",document.getElementById(strClientID + "txt_Pass").value,"alpha","Password","2");
            fnCheckInput(strClientID + "txt_fname",document.getElementById(strClientID + "txt_fname").value,"alpha","First name","1");
            fnCheckInput(strClientID + "txt_lname",document.getElementById(strClientID + "txt_lname").value,"alpha","Last name","1");
            fnCheckddlvalue(strClientID +"ddl_role",document.getElementById(strClientID +"ddl_role").selectedIndex,"Role");
            fnCheckInput(strClientID + "txt_emailID",document.getElementById(strClientID + "txt_emailID").value,"email","Email id","1");
            
            if(strMessage!="")
            {

               strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
               alert(strMessage);
               return false;
            }
            
              if(trim(username).length =='')
            {
              alert("User Name can not be blank. Please correct and try again.");
              return false;
            }
            
               if(userpass.length =='')
            {
              alert("Password can not be blank. Please correct and try again.");
              return false;
            }
            
            if(userpass.length < 6)
            {
              alert("User Password is too short. Please correct and try again.");
              return false;
            }
            

            return true;

    }
    // Function to Update User
    function fnUpdateuser(ID,controlID)
    {
            var strClientID=ID.substring(0,ID.length-controlID.length);
            strMessage="";
            fnCheckddlvalue(strClientID +"ddl_user",document.getElementById(strClientID +"ddl_user").selectedIndex,"User Name");
           // fnCheckInput(strClientID + "Utxt_Pass",document.getElementById(strClientID + "Utxt_Pass").value,"alpha","Password","1");
            fnCheckInput(strClientID + "Utxt_fname",document.getElementById(strClientID + "Utxt_fname").value,"alpha","First name","1");
            fnCheckInput(strClientID + "Utxt_lname",document.getElementById(strClientID + "Utxt_lname").value,"alpha","Last name","1");
            fnCheckddlvalue(strClientID +"ddl_role",document.getElementById(strClientID +"ddl_role").selectedIndex,"Role");
            
            if(strMessage!="")
            {

               strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
               alert(strMessage);
               return false;
            }
            return true;

    }
     // Function to switch  User role
    function fnswitchuser(ID,controlID)
    {
            var strClientID=ID.substring(0,ID.length-controlID.length);
            strMessage="";
            var currentrole = document.getElementById(strClientID +"ddl_role").value;
            var switchroleto = document.getElementById(strClientID +"ddl_switch_role").value;
            fnCheckddlvalue(strClientID +"ddl_role",document.getElementById(strClientID +"ddl_role").selectedIndex,"Role");
            fnCheckddlvalue(strClientID +"ddl_user",document.getElementById(strClientID +"ddl_user").selectedIndex,"User Name");
            fnCheckddlvalue(strClientID +"ddl_switch_role",document.getElementById(strClientID +"ddl_switch_role").selectedIndex,"Switch Role To");
            if(strMessage!="")
            {
               strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
               alert(strMessage);
               return false;
            }            
            
            if (currentrole==switchroleto)
            {
              alert("Role and Switch Role To can not be same. Please correct and try again.");
              return false;
            }            
            return true;

    }
    
    
    
    // Function to Check Validate Expert Currency Log information
    function fnExpertCurrencyLog(ID,controlID)
    {
            var strClientID=ID.substring(0,ID.length-controlID.length);
            strMessage="";
            var currentcurrency = document.getElementById(strClientID +"ddlCurrencyFrom").value;
            var switchtocurrency = document.getElementById(strClientID +"ddlCurrencyTo").value;
            fnCheckddlvalue(strClientID +"ddlUserName",document.getElementById(strClientID +"ddlUserName").selectedIndex,"User Name");
            fnCheckddlvalue(strClientID +"ddlCurrencyFrom",document.getElementById(strClientID +"ddlCurrencyFrom").selectedIndex,"Currency From");
            fnCheckddlvalue(strClientID +"ddlCurrencyTo",document.getElementById(strClientID +"ddlCurrencyTo").selectedIndex,"Currency To");
           
            if(strMessage!="")
            {

               strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
               alert(strMessage);
               return false;
            }
            
            if (currentcurrency==switchtocurrency)
            {
            alert("Please select different currencies as Currency From and Curency To can not be the same.");
              return false;
            }
            
           var expertid=trim(document.getElementById("ctl00_ContentPlaceHolder1_txtExpertId").value);                       

             if(expertid =='')
            {
              alert("Expert Id can not be blank. Please correct and try again.");
              return false;
            }
            
            return true;

    }
    
     // Function to check password
    function fnchangepassword(ID,controlID)
    {
            var strClientID=ID.substring(0,ID.length-controlID.length);
            strMessage="";
            var newpass = document.getElementById(strClientID +"txNewPassord").value;
            var confirmpass = document.getElementById(strClientID +"txConfirmPassord").value;
            fnCheckddlvalue(strClientID +"ddl_role",document.getElementById(strClientID +"ddl_role").selectedIndex,"Role");
            fnCheckddlvalue(strClientID +"ddl_user",document.getElementById(strClientID +"ddl_user").selectedIndex,"User Name");
            //fnCheckInput(strClientID + "txNewPassord",document.getElementById(strClientID + "txNewPassord").value,"","New Password","1");
            //fnCheckInput(strClientID + "txConfirmPassord",document.getElementById(strClientID + "txConfirmPassord").value,"","Confirm Password","1");
            if(strMessage!="")
            {

               strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
               alert(strMessage);
               return false;
            }
             if(trim(newpass).length =='')
            {
              alert("New Password can not be blank. Please correct and try again.");
              return false;
            }
             if(trim(confirmpass).length =='')
            {
              alert("Confirm Password can not be blank. Please correct and try again.");
              return false;
            }
            if(trim(newpass).length < 6)
            {
              alert("New Password is too short. Please correct and try again.");
              return false;
            }            
            
            if(trim(confirmpass).length < 6)
            {
              alert("Confirm Password is too short. Please correct and try again.");
              return false;
            }
            
            if (trim(newpass)!=trim(confirmpass))
            {
             alert("New Password and Confirm Password do not match. Please correct and try again.");
              return false;
            }            
            return true;

    }
    
     // hiddenDateTo.Value = DateTime.Now.ToString();
        //    hiddenDateFrom.Value
    
     function fnValidateDateValidation()
     {
       var dateto="";
       var datefrom="";
       dateto=document.getElementById("ctl00_ContentPlaceHolder1_DateTo_textBox");
       datefrom=document.getElementById("ctl00_ContentPlaceHolder1_DateFrom_textBox");
     
      
                   if (Date.parse(datefrom.value) > Date.parse(dateto.value)) 
                       {
                        alert("From Date can not be greater than To Date.Please correct and try again.");
                        
                        return false;
                       
                       }
           return true;
     }
     
//Function to auto save partial data for experts in the expert join page
//Created by : Vikash Kumar on 14.12.2007
 
 function AutoSave()
  { 
        
    var fname = document.getElementById("ctl00_ContentPlaceHolder1_txtFirstName").value;
    var lname = document.getElementById("ctl00_ContentPlaceHolder1_txtLastName").value;
    var cellcountry_code = document.getElementById("ctl00_ContentPlaceHolder1_txtCellCountryCode").value;
    var cellphone = document.getElementById("ctl00_ContentPlaceHolder1_txtCellPhone").value;
    var homeemail = document.getElementById("ctl00_ContentPlaceHolder1_txtHomeEmail").value;
    var workemail = document.getElementById("ctl00_ContentPlaceHolder1_txtWorkEmail").value;
    var email=homeemail;
            if(document.getElementById("ctl00_ContentPlaceHolder1_rblPrimaryEmail_1").checked)
            {
                email=workemail
            } 
              if(email.match(/^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/))
            {
                 if (fname!="" && lname!="" && email!="")
                   {
                   //alert(fname+','+lname+','+email+','+cellcountry_code+','+ cellphone);
                   xmlHttp.open( 'GET', "autosave.aspx?"+ fname+','+lname+','+email+','+cellcountry_code+','+ cellphone, true );
	               xmlHttp.send( null );
	               }
	          }
     
  } 
  
  function fnAdminFinanceData(ID,controlID)
    {

     
        var strClientID=ID.substring(0,ID.length-controlID.length);
        strMessage="";
        
        
        fnCheckInput(strClientID + "txtNewCheckNumber",document.getElementById(strClientID + "txtNewCheckNumber").value,"integer","Cheque Number")
        fnCheckInput(strClientID + "txtNewBankName",document.getElementById(strClientID + "txtNewBankName").value,"alphaOnly","Bank Name")
        fnCheckInput(strClientID + "txtNewWTRefencenumber",document.getElementById(strClientID + "txtNewWTRefencenumber").value,"alphanumericwithspaces","WT Refence Number")
        fnCheckInput(strClientID + "txtNewWtBankName",document.getElementById(strClientID + "txtNewWtBankName").value,"alphaOnly","WT Bank Name")
        
        //fnCheckInput(strClientID + "txtPaymentRTCode",document.getElementById(strClientID + "txtPaymentRTCode").value,"alpha","RT Code");
        //alert(document.getElementById(strClientID + "txtNewBankName").value);
        //fnCheckInput(strClientID +"txtLangReq",document.getElementById(strClientID +"txtLangReq").value,"alpha","Language Requirement");            
        
        fnCheckInput(strClientID + "txtNewAmountpaid",document.getElementById(strClientID + "txtNewAmountpaid").value,"decimal","Amount Paid")
        fnCheckInput(strClientID + "txtNewAmountDebited",document.getElementById(strClientID + "txtNewAmountDebited").value,"decimal","Amount Debited")
        fnCheckInput(strClientID + "txtNewForm1099Number",document.getElementById(strClientID + "txtNewForm1099Number").value,"alphanumericwithspaces","Form-1099 Number")
        fnCheckInput(strClientID + "txtNewW2FormNumber",document.getElementById(strClientID + "txtNewW2FormNumber").value,"alphanumericwithspaces","W2 Form Number")
        fnCheckInput(strClientID + "txtNewInvoicenumber",document.getElementById(strClientID + "txtNewInvoicenumber").value,"alphanumericwithspaces","Invoice Number")
        //fnCheckInput(strClientID + "txtNewRemarks",document.getElementById(strClientID + "txtNewRemarks").value,"alphanumericwithspaces","Remarks")
        
        //added  by Vikash Kumar on 12.9.2008
        //Change Begin
          var paypalreferencenumber=trim(document.getElementById(strClientID + "txtPaypalReferenceNumber").value);  
             
              hasscheck =  paypalreferencenumber.substring(0, 1);
              alphanumericcheck=paypalreferencenumber.substring(1, 127);
            
                if(paypalreferencenumber!="" && paypalreferencenumber!=null)
              {
              
                  if(hasscheck!="#")
                    {
                             alert("In Paypal Reference number, the first character can only be '#'"); 
                             return false;
                         
                    }
                          
                                
                       if(alphanumericcheck!="")
                    {
                         var regex1=/^[a-zA-Z0-9]*$/;
                         
                            if(!regex1.test(alphanumericcheck))
                            {
                             alert("In Paypal Reference number after '#' only alphanumeric characters are acceptable" ); 
                             return false;
                            }
                    }
                }
           //Change End         
        if(strMessage!="")
        {
           strMessage ="Please enter the following missing/ invalid information:"  + strMessage +"\nPlease correct and try again.";
           alert(strMessage);
           return false;
        }
        return true;
    }

// admin-request-data.aspx - start
/**
* Function To hide/Unhide div for "admin-request-data.aspx" page
* Combination of value of the span[innerHTML] and div[style.display], hides/unhide the div.
* @spanObjId id of span
* @divBlockObjId id of div to hide/Unhide
*/
function HideUnhideBlock(spanObjId, divBlockObjId)
{
    var spanObj = document.getElementById(spanObjId);
    var divBlockObj = document.getElementById(divBlockObjId);        
    
    if(spanObj.innerHTML == '--' && divBlockObj.style.display == 'inline')
    {
        spanObj.innerHTML = '+';
        divBlockObj.style.display = 'none';
    }
    else
    {
        
        spanObj.innerHTML = '--';
        divBlockObj.style.display = 'inline';
    }    
}

// admin-request-data.aspx - end
  
/**
* the purpose of this function is to allow the enter key to point to the correct button to click.
* @buttonName id of span
* @e id of div to hide/Unhide
*/
function doClick(buttonName,e)
{
  //the purpose of this function is to allow the enter key to 
  //point to the correct button to click.
  
    var evt = e ? e : window.event;
	var bt = document.getElementById(buttonName);

	if (bt)
	{

		if (evt.keyCode == 13)
		{
			bt.click();
			return false;

		}

	} 
  /*
  
    var key;
    
    if(window.event)
    {
         key = window.event.keyCode;     //IE
    }
    else
    {
         key = e.which;     //firefox          
    }
    
    if (key == 13)
    {
        var btn = document.getElementById(buttonName);
        if (btn != null)
        { //If we find the button click it
    
            btn.click();
            event.keyCode = 0
        }
    }*/
}

// admin-consultations.aspx 
/**
* the purpose of this function is to allow correct ID values on Edit Consultation button to click.
*/

function fnCheckConsultationId(ID,controlID)
{
          strMessage=""; 
          strClientID=ID.substring(0,ID.length-controlID.length);
          fnCheckInput(strClientID + "txtConsultationID",document.getElementById(strClientID + "txtConsultationID").value,"integer","Consultation ID","1");
           
           if(strMessage!="")
             {
                  strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
                  alert(strMessage);
                  return false;
             }
             return true;
}

// admin-consultations.aspx 
/**
* the purpose of this function is to allow correct search condition to be selected for consultation.
*/
function fnCheckConsultationSearchData(ID,controlID)
{
      
    strClientID=ID.substring(0,ID.length-controlID.length);
    strMessage = "";
    var strParameter = document.getElementById(strClientID +"txtParameter").value;
    strParameter=trim(strParameter);
    fnCheckInput(strClientID +"txtParameter",strParameter,"","Search Expression","1");            
    if(strMessage != "")
    {
         strMessage ="Please enter search parameter.";
         alert(strMessage);
         return false;
    }      
    var Step=0;                 
    if(document.getElementById(strClientID + "chkTitle") != null)
    {
       if(document.getElementById(strClientID +"chkTitle").checked)
       {
            Step=1;
       }
    }
    if(document.getElementById(strClientID +"chkIdentity").checked)
    {
       Step=1;
    }     
    if(Step==0)
    {
       alert("Please select at least one search option.")
       return false;
    }
    return true;
}

//Function added by Rakesh K Jha on 14-05-2008 --> 
//Purpose: To validate textbox -->
//Begin-->
function textAreaCounter(ID, controlID, maxlimit)
{
       strClientID=ID.substring(0,ID.length-controlID.length);
       var topics = document.getElementById(strClientID + "txtTopicsExpertCannotDiscuss").value;       
       if(topics.length > maxlimit)
       {
            document.getElementById(strClientID + "txtTopicsExpertCannotDiscuss").value = topics.substring(0,maxlimit);
            alert('Topics can not exceed 500 characters!!');        
       }                   
}
function funTextAreaCounterClientExternal(ID, controlID, maxlimit)
{
       var strClientID = ID.substring(0,ID.length-controlID.length);
       var content = document.getElementById(strClientID + controlID).value;       
       if(content.length > maxlimit-1 )
       {
            document.getElementById(strClientID + controlID).value = content.substring(0,maxlimit-1);
            alert('Content can not exceed ' + maxlimit + ' characters!!');        
       }                   
}
function textAreaCounter(ID, controlID)
{
   strClientID=ID.substring(0,ID.length-controlID.length);
   var topics = document.getElementById(strClientID + controlID).value;       
   if(topics.length > 499)
   {
       alert('Content can not exceed 500 characters!!');        
       document.getElementById(strClientID + controlID).value = topics.substring(0,499);
       //alert('Content cannot exceed 500 characters!!');        
   }                   
}

//End-->
//Function added by Rakesh K Jha on 21-04-2008. --> 
//For showing message after adding a record -->
//Begin-->
function getMessage(URL)
{
   var ans;        
   ans=window.confirm(' Consultation added successfully!! \n Press OK to add new consultation. ');
   if (ans==true) 
   { 
      //do nothing                      
   } 
   else
   { 
      document.location.href = URL;
      return false;                  
   } 
}

//Begin change by Anjali to add new Lead - 13th Feb 2009
function getMessageforLead(URL,ID, controlID)
{
   var ans; 
    strClientID=ID.substring(0,ID.length-controlID.length);
           
   ans=window.confirm(' Lead added successfully!! \n Press OK to add new Lead.  \n else \n Press Cancel to redirect to Admin-Leads. ');
   if (ans==true) 
   { 
      //do nothing  
         var control = document.getElementById(strClientID + controlID);
         control.focus();
                          
   } 
   else
   { 
      document.location.href = URL;
      return false;                  
   } 
}
//End change by Anjali to add new Lead - 13th Feb 2009

//End

//Function added by Rakesh K Jha on 23-04-2008.  --> 
//For refreshing Parent window from child window -->
//Begin-->
function refreshParent()
{
  window.opener.location.href = window.opener.location.href;
  if (window.opener.progressWindow)
  {
     window.opener.progressWindow.close();
  }  
     window.close();          
}  
 
//For firing click event from child window -->
function clickParentButton()
{
   var btn = window.opener.document.getElementById("ctl00_ContentPlaceHolder1_btSearchConsultation");     
   btn.click();
   window.close();
}

//For redirecting to any different page -->
function redirectTo(URL)
{
    document.location.href = URL ;                         
    return false; 
}  
//End-->

//Function added by Rakesh K Jha on 22-09-2008.  --> 
//To validate numeric value -->
//Begin-->

function isNaturalNumber (ID, controlID) 
{
	var pattern = /^(0|([1-9]\d*))$/;
	
	 var strClientID = ID.substring(0,ID.length - controlID.length);
         var str = document.getElementById(strClientID + "txtNoofExperts").value;     
         if(str != "")
         {
        
         }
	return pattern.test(str);
}

function checkNumberCustom(ID, controlID)
{
   try{
         var strClientID = ID.substring(0,ID.length - controlID.length);
         var str = document.getElementById(strClientID + "txtNoofExperts").value;     
         if(str != "")
         {
            if(str.match(/^\d+$/)) 
             {
                 return true;
             }
             else
             { 
                 alert("Please enter a numeric value");
                 document.getElementById(strClientID + controlID).value = "";                 
             }  
         }
         return true;
                 
      }
      catch(ex)
      {
            alert(ex);
            return false;
      }
            
}
//End-->

//Function added by Rakesh K Jha on 22-09-2008.  --> 
//To validate page "Client --> client-request-for-proactive-screen.aspx -->
//Begin-->

function fnCheckRequestForProactiveScreen(ID,controlID)
{
   strClientID=ID.substring(0,ID.length-controlID.length);
    strMessage="";   
    fnCheckInput(strClientID + "txtFirstName",document.getElementById(strClientID + "txtFirstName").value,"alpha","First name","1");
    fnCheckInput(strClientID + "txtLastName",document.getElementById(strClientID + "txtLastName").value,"alpha","Last Name","1");
    fnCheckInput(strClientID + "txtEmail",document.getElementById(strClientID + "txtEmail").value,"email","E-mail","1");
    fnCheckInput(strClientID + "txtPhone",document.getElementById(strClientID + "txtPhone").value,"","Phone","1");
    fnCheckInput(strClientID + "txtCompany",document.getElementById(strClientID + "txtCompany").value,"","Company","1");       
    fnCheckListBoxValue(strClientID +"lstIndustry", document.getElementById(strClientID +"lstIndustry").value ,"Industry of Research"); 
    fnCheckListBoxValue(strClientID +"lstGeography", document.getElementById(strClientID +"lstGeography").value ,"Geography of Research");           
    fnCheckInput(strClientID + "txtReqDescription",document.getElementById(strClientID + "txtReqDescription").value,"","Request Description","1");    
    fnCheckInput(strClientID + "txtNoofExperts",document.getElementById(strClientID + "txtNoofExperts").value,"integer","Number of Experts","1");    
    fnCheckAlteastOnecCheckBox(strClientID + "chkModeOfConsultation", "Mode Of Consultation");    
    
    if(strMessage == "")
        return true;
    else
    {
        strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";      
        alert(strMessage);
        return false;
    }
}
//End-->



//AJAX LOADER PROGRESS BAR
//Created On : 1/May/2008
//Created By : Abhinav Kant

//Get the size of the viewable browser
window.size = function()
{
	var w = 0;
	var h = 0;

	//IE
	if(!window.innerWidth)
	{
		//strict mode
		if(!(document.documentElement.clientWidth == 0))
		{
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		}
		//quirks mode
		else
		{
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
	}
	//w3c
	else
	{
		w = window.innerWidth;
		h = window.innerHeight;
	}
	return {width:w,height:h};
}

//Get the center of the viewable browser
window.center = function()
{
	var hWnd = (arguments[0] != null) ? arguments[0] : {width:0,height:0};

	var _x = 0;
	var _y = 0;
	var offsetX = 0;
	var offsetY = 0;

	//IE
	if(!window.pageYOffset)
	{
		//strict mode
		if(!(document.documentElement.scrollTop == 0))
		{
			offsetY = document.documentElement.scrollTop;
			offsetX = document.documentElement.scrollLeft;
		}
		//quirks mode
		else
		{
			offsetY = document.body.scrollTop;
			offsetX = document.body.scrollLeft;
		}
	}
	//w3c
	else
	{
		offsetX = window.pageXOffset;
		offsetY = window.pageYOffset;
	}

	_x = ((this.size().width-hWnd.width)/2)+offsetX;
	_y = ((this.size().height-hWnd.height)/2)+offsetY;

	return{x:_x,y:_y};
}

/* set the postion of the div
*@point position where the five has to be placed
*@divId id of the div
*@imgWidth width of the div
*/
function showCenter(point,divId,imgWidth)
{
	var div = document.getElementById(divId);
    try{
        imgWidth = imgWidth/ 2;
	    div.style.position = "absolute";
	    div.style.top = point.y + "px";
	    div.style.left = (point.x-imgWidth) + "px";
	}catch(e)
	{
	    alert(e);
	}
}	
//AJAX LOADER PROGRESS BAR :: END


//Function added by Rakesh K Jha on 04-06-2008 --> 
//Purpose: To validate primerus-request  
//Begin-->
        function fnCheckPrimerusRequest(ID,controlID)
        {
             strMessage="";            
             strClientID=ID.substring(0,ID.length-controlID.length);
             fnCheckInput(strClientID + "txtName",document.getElementById(strClientID + "txtName").value,"","Your Name","1");
             fnCheckInput(strClientID + "txtTitle",document.getElementById(strClientID + "txtTitle").value,"","Title","1");
             fnCheckInput(strClientID + "txtPhone",document.getElementById(strClientID + "txtPhone").value,"","Phone Number","1");
             fnCheckInput(strClientID + "txtFirm",document.getElementById(strClientID + "txtFirm").value,"","Firm Name","1");
             fnCheckInput(strClientID + "txtMail",document.getElementById(strClientID + "txtMail").value,"email","Email Address","1");                                                                                          
             if(strMessage!="")
             {
                   strMessage ="The following is/are invalid or missing:"  + strMessage +"\nPlease correct and try again.";
                   alert(strMessage);
                   return false;
             }
                                                               
             return true;
        }
        
        function primerusalert()        
        {
          alert('Your request has been sent successfully. You will be \n contacted shortly. Thanks for your interest in Evalueserve.');
          redirectTo('./primerus.aspx');                  
        }       
        
//Rakesh wrk end

//Rakesh on 12-06-2008
function funCalculateAmount(ID, controlID)
{
   strClientID=ID.substring(0,ID.length-controlID.length);                          
   var actualDuration = document.getElementById(strClientID + "txtActualDuration").value;   
   var hourlyRate = document.getElementById(strClientID + "txtHourlyRate").value;
   var moneyOwed = (actualDuration * hourlyRate)/60 ;   
   document.getElementById(strClientID + "txtMoneyOwed").value = moneyOwed.toFixed(2);   
}
//Rakesh wrk end

/*
*Page Name : admin-request-consultation-external.aspx [START]
*
*/



function fnCheckRequestForConsultationExternalData(ID,controlID)
{

    strClientID=ID.substring(0,ID.length-controlID.length);
    strMessage="";   
    fnCheckInput(strClientID + "txtFirstName",document.getElementById(strClientID + "txtFirstName").value,"alpha","First name","1");
    fnCheckInput(strClientID + "txtLastName",document.getElementById(strClientID + "txtLastName").value,"alpha","Last Name","1");
    fnCheckInput(strClientID + "txtEmail",document.getElementById(strClientID + "txtEmail").value,"email","E-mail","1");
    fnCheckInput(strClientID + "txtPhone",document.getElementById(strClientID + "txtPhone").value,"","Phone","1");
    fnCheckInput(strClientID + "txtCompany",document.getElementById(strClientID + "txtCompany").value,"","Company","1");       
    fnCheckListBoxValue(strClientID +"lstIndustry", document.getElementById(strClientID +"lstIndustry").value ,"Industry of Research"); 
    fnCheckListBoxValue(strClientID +"lstGeography", document.getElementById(strClientID +"lstGeography").value ,"Geography of Research");           
    fnCheckInput(strClientID + "txtReqDescription",document.getElementById(strClientID + "txtReqDescription").value,"","Request Description","1");    
    fnCheckInput(strClientID + "txtNoofExperts",document.getElementById(strClientID + "txtNoofExperts").value,"integer","Number of Experts","1");    
    fnCheckAlteastOnecCheckBox(strClientID + "chkModeOfConsultation", "Mode Of Consultation");
    
    if(strMessage == "")
    {
        strMessage = "";
        /*check for HTML */
        if(CheckForHTMLTag(document.getElementById(strClientID +"txtPhone").value))
        {
            strMessage += '\n----Phone';
            document.getElementById(strClientID +"txtPhone").style.backgroundColor = "#cad7ec";
        }
        
        if(CheckForHTMLTag(document.getElementById(strClientID +"txtCompany").value))
        {
            strMessage += '\n----Company';
            document.getElementById(strClientID +"txtCompany").style.backgroundColor = "#cad7ec";
        }
        
        if(CheckForHTMLTag(document.getElementById(strClientID +"txtReqDescription").value))
        {
            strMessage += '\n----Request Description';
            document.getElementById(strClientID +"txtReqDescription").style.backgroundColor = "#cad7ec";
        }
        
        if(CheckForHTMLTag(document.getElementById(strClientID +"txtTypeOfExpert").value))
        {
            strMessage += '\n----Type of Expert';
            document.getElementById(strClientID +"txtTypeOfExpert").style.backgroundColor = "#cad7ec";
        }
        
        if(CheckForHTMLTag(document.getElementById(strClientID +"txtKeyQuestions").value))
        {
            strMessage += '\n----Key Questions to be Researched';
            document.getElementById(strClientID +"txtKeyQuestions").style.backgroundColor = "#cad7ec";
        }
        
          if(CheckForHTMLTag(document.getElementById(strClientID +"txtInstructions").value))
        {
            strMessage += '\n----Other Special Instructions';
            document.getElementById(strClientID +"txtInstructions").style.backgroundColor = "#cad7ec";
        }
        
        if(CheckForHTMLTag(document.getElementById(strClientID +"txtClientPref").value))
        {
            strMessage += '\n----IDs of Experts Requested';
            document.getElementById(strClientID +"txtClientPref").style.backgroundColor = "#cad7ec";
        }
        
        if(CheckForHTMLTag(document.getElementById(strClientID +"txtPeriod").value))
        {
            strMessage += '\n----Period per Consultation';
            document.getElementById(strClientID +"txtPeriod").style.backgroundColor = "#cad7ec";
        }
        
        if(CheckForHTMLTag(document.getElementById(strClientID +"txtCompanyAddress").value))
        {
            strMessage += '\n----Company Address';
            document.getElementById(strClientID +"txtCompanyAddress").style.backgroundColor = "#cad7ec";
        }
        
        
           if(CheckForHTMLTag(document.getElementById(strClientID +"txtCompanyWebsite").value))
        {
            strMessage += '\n----Company Website';
            document.getElementById(strClientID +"txtCompanyWebsite").style.backgroundColor = "#cad7ec";
        }
        
        if(strMessage != "")
        {
            //strMessage ="Incorrect Password.Please correct and try again.";
            strMessage ="The following is invalid:"  + strMessage +"\nPlease correct and try again.";
            alert(strMessage);
            return false;
        }
        return true;
    }
    else
    {
        strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";      
        alert(strMessage);
        return false;
    }
}


function fnCheckAlteastOnecCheckBox(controlID,strName)
{

    var containerObj = document.getElementById(controlID);
    var checkBoxArray = containerObj.getElementsByTagName('input');
    var bChecked = false;
    for(var i = 0;i < checkBoxArray.length;i++)
    {
        var currCtrl = checkBoxArray[i];
        if(currCtrl.type == 'checkbox' && currCtrl.checked)
        {
            bChecked = true;
            break;
        }
    }       
    
    if(!bChecked)
    {
        var control = document.getElementById(controlID);
        control.style.backgroundColor = "#cad7ec";//"#cad7ec";
        control.focus();
        strMessage = strMessage +"\n----" + strName;   
    }
    else
    {
        document.getElementById(controlID).style.backgroundColor = "white";
    }
    
}

function fnCheckTextAreaLength(controlID, strName, maxLength)
{       
        alert(ctrlObj);
       //var ctrlObj = document.getElementById(controlID)
       
       //alert(ctrlObj.tagName);
}

/*
*Page Name : admin-request-consultation-external.aspx [END]
*
*/

/*
*Page Name : admin-request-consultation-internal.aspx[START]
*
*/

function fnCheckRequestForConsultationInternalData(ID,controlID)
{

    strClientID=ID.substring(0,ID.length-controlID.length);
    strMessage="";    
    fnCheckInput(strClientID + "txtLastName",document.getElementById(strClientID + "txtFirstName").value,"alpha","Last Name","1");    
    fnCheckInput(strClientID + "txtFirstName",document.getElementById(strClientID + "txtFirstName").value,"alpha","First name","1");
    fnCheckInput(strClientID + "txtPhone",document.getElementById(strClientID + "txtPhone").value,"","Phone","1");
    //fnCheckInput(strClientID + "txtMobile",document.getElementById(strClientID + "txtMobile").value,"alphanumericwithspaces","Mobile Phone","1");
    fnCheckInput(strClientID + "txtEvsEndClient",document.getElementById(strClientID + "txtEvsEndClient").value,"","Evalueserve End Client","1");
    
    fnCheckddlvalue(strClientID +"ddlEvsGroup",document.getElementById(strClientID +"ddlEvsGroup").selectedIndex,"Evalueserve Group");
    
    fnCheckInput(strClientID + "txtPidCode",document.getElementById(strClientID + "txtPidCode").value,"","Project Charge Code","1");
    
    fnCheckddlvalue(strClientID +"ddlPrimaryIndustryToResearch",document.getElementById(strClientID +"ddlPrimaryIndustryToResearch").selectedIndex,"Industry of Research");
    fnCheckddlvalue(strClientID +"ddlGeogOfResearch",document.getElementById(strClientID +"ddlGeogOfResearch").selectedIndex,"Geography of Research");
    
    fnCheckInput(strClientID + "txtWhen",document.getElementById(strClientID + "txtWhen").value,"","When would you want to use the Expert?","1");
    
    fnCheckInput(strClientID + "txtReqDescription",document.getElementById(strClientID + "txtReqDescription").value,"","Description","1");
    
    //fnCheckInput(strClientID + "txtTypeOfExpert",document.getElementById(strClientID + "txtTypeOfExpert").value,"","Type of Expert","1");
    
    fnCheckInput(strClientID + "txtKeyQuestions",document.getElementById(strClientID + "txtKeyQuestions").value,"","Key Questions","1");
    
    fnCheckInput(strClientID + "txtNoofExperts",document.getElementById(strClientID + "txtNoofExperts").value,"integer","Number of experts","1");
    
    
    fnCheckInput(strClientID + "txtPeriod",document.getElementById(strClientID + "txtPeriod").value,"","Period of Consultation","1");
   
    fnCheckAlteastOnecCheckBox(strClientID + "chkModeOfConsultation", "Mode Of Consultation");
    
    fnCheckInput(strClientID + "txtEstimateBudget",document.getElementById(strClientID + "txtEstimateBudget").value,"integer","Estimated Budget","1");
    //fnCheckddlvalue(strClientID +"ddlCurrency",document.getElementById(strClientID +"ddlCurrency").selectedIndex,"Estimate Budgets");
        
    fnCheckInput(strClientID + "txtUserGuide",document.getElementById(strClientID + "txtUserGuide").value,"","UserGuide","1");
    
    
    if(document.getElementById(strClientID +"chkAgree").checked == false && strMessage == "")
    {
        alert('Please confirm to the mentioned COE usage.');
        return false;
    }
    
    

    if(strMessage == "")
        return true;
    else
    {
       
        strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";      
        alert(strMessage);
        return false;
    }
}



/*
*Page Name : admin-request-consultation-internal.aspx [END]
*
*/



/*
*Page Name : easy-singUp.aspx [Start]
*
*/
		function showTbl_1()
		{
			document.getElementById('tbl_1').style.display='';
			document.getElementById('tbl_2').style.display='none';
		}
		function showTbl_2()
		{
	
		if(document.getElementById('tbl_2').style.display=='none')
		{
	
		document.getElementById('tbl_2').style.display='inline';
		return false;
		}
	     	if(document.getElementById('tbl_2').style.display=='inline')
	     	{
	     	document.getElementById('tbl_2').style.display='none';
	     	return false;
	     	}
		
	//	document.getElementById('tbl_1').style.display='none';
			
		
		}

    
        function addEvent(objId)
        {
           var PageIdPrefix = objId.substring(0,objId.lastIndexOf('_')+1);
           var currentSubCount=0;   

           
           for(var rowStep=2;rowStep<=10;rowStep++)
           {
               var currRow=document.getElementById('trSubIndus'+rowStep);
               
                if(rowStep == 10 && currRow.style.display == "inline")
                {          
                    alert('No more filter can be added');
                }
                    
                if(currRow.style.display == 'none')
                {
                    currRow.style.display = "inline";
                     
                    currentSubCount=document.getElementById(PageIdPrefix+'hdSubCounter').value;
                    ++currentSubCount;
                    document.getElementById(PageIdPrefix+'hdSubCounter').value=currentSubCount;
//                    alert(currentSubCount);
                    break;
                }
           
           }
        
        }
        
        
        function removeElement(objId)
        {

           var PageIdPrefix = objId.substring(0,objId.lastIndexOf('_')+1);
           
           var currentSubCount=0; 
           for(var rowStep=10;rowStep>=1;rowStep--)
           {
               var currRow=document.getElementById('trSubIndus'+rowStep);
                              
                if(rowStep == 2 && currRow.style.display == "none")
                {          
                    alert('No more SubIndustry can be removed;Select atleast one SubIndustry');
                }
                    
                if(currRow.style.display == 'inline')
                {
                    currRow.style.display = "none"; 
                    currentSubCount=document.getElementById(PageIdPrefix+'hdSubCounter').value;
                    currentSubCount=currentSubCount-1;
                    document.getElementById(PageIdPrefix+'hdSubCounter').value=currentSubCount;

                    break;
                }
//                else
//                {
//                  alert('no condition');
//                }
             }
              
        }


        function showElement(objId)
        {
              var PageIdPrefix = objId.substring(0,objId.lastIndexOf('_')+1);

              var currentSubCount=0; 
            
           currentSubCount=document.getElementById(PageIdPrefix+'hdSubCounter').value;

           var count=0;
           for(count=2;count<=currentSubCount;count++)
           {
             var rowname=document.getElementById('trSubIndus'+count); 
           
             rowname.style.display ="inline";
          
           }
      
         
        }
        
        function ShowSubIndustry(objId)
        {
           // alert('reached ShowSubIndustry');
           var PageIdPrefix = objId.substring(0,objId.lastIndexOf('_')+1);
           var currentSubCount; 
            
           currentSub=document.getElementById(PageIdPrefix+'ddlPrimaryIndustry').value;
           //alert(currentSub);
           var tdname=document.getElementById('tdSubIndusComb');
           var tdSubIndusLab= document.getElementById('tdSubIndusLab'); 
         
           if(currentSub=="0")
           {
             tdname.style.display ="none";
             tdSubIndusLab.style.display ="none";
             
           }
//         else if(currentSub=="17")
//           {
//             tdname.style.display ="none";
//             tdSubIndusLab.style.display ="none";
//             
//             
//           }
           else
           {           
            tdname.style.display ="inline";
            tdSubIndusLab.style.display ="inline";
           }
           
        
        }
        

        //////////For Tool Tip  Start//
        // JScript File
        //////////For Tool Tip  End//

        //            function show_help222() {
        //              alert('reached show_help function coescipt page');
        //            }




                var offsetx = 12;
                var offsety =  8;

                function newelement(newid)
                { 
                    if(document.createElement)
                    { 
                        var el = document.createElement('div'); 
                        el.id = newid;     
                        with(el.style)
                        { 
                            display = 'none';
                            position = 'absolute';
                        } 
                        el.innerHTML = '&nbsp;'; 
                        document.body.appendChild(el); 
                    } 
                } 
                var ie5 = (document.getElementById && document.all); 
                var ns6 = (document.getElementById && !document.all); 
                var ua = navigator.userAgent.toLowerCase();
                var isapple = (ua.indexOf('applewebkit') != -1 ? 1 : 0);
                function getmouseposition(e)
                {
                    if(document.getElementById)
                    {
                        var iebody=(document.compatMode && 
        	                document.compatMode != 'BackCompat') ? 
        		                document.documentElement : document.body;
                        pagex = (isapple == 1 ? 0:(ie5)?iebody.scrollLeft:window.pageXOffset);
                        pagey = (isapple == 1 ? 0:(ie5)?iebody.scrollTop:window.pageYOffset);
                        mousex = (ie5)?event.x:(ns6)?clientX = e.clientX:false;
                        mousey = (ie5)?event.y:(ns6)?clientY = e.clientY:false;

                        var lixlpixel_tooltip = document.getElementById('tooltip');
                        lixlpixel_tooltip.style.left = (mousex+pagex+offsetx) + 'px';
                        lixlpixel_tooltip.style.top = (mousey+pagey+offsety) + 'px';
                    }
                }
                function tooltip(tip)
                {
                    if(!document.getElementById('tooltip')) newelement('tooltip');
                    var lixlpixel_tooltip = document.getElementById('tooltip');
                    lixlpixel_tooltip.innerHTML = tip;
                    lixlpixel_tooltip.style.display = 'block';
                    document.onmousemove = getmouseposition;
                }
                function exit()
                {
                    document.getElementById('tooltip').style.display = 'none';
                }

                function test()
                {
                 alert('test reached');
                }





//---- Vishal Narula --  Date 09-Sept-08 [Start]

                function fnCountryOthers(ID,controlID)
                   {
                      
                       // debugger;
                       // alert('reached fnCountryOthers' );
                        
                        
                        strClientID=ID.substring(0,ID.length-controlID.length);
                        
                        var obj=document.getElementById(strClientID + "lstCountry");
                        

                        var intValue=document.getElementById(strClientID + "lstCountry").value;
                        
                        // alert(intValue);
//                        if (intValue==217) //Country is India 98 , UK 216, US
//                        {
//                         document.getElementById(strClientID +"txtOtherState").style["display"]="none";
//                         document.getElementById(strClientID +"ddlState").style["display"]="inline";  
//                        }
//                        else
//                        {
//                         document.getElementById(strClientID +"txtOtherState").style["display"]="inline";  
//                         document.getElementById(strClientID +"ddlState").style["display"]="none";  
//                         }
                        if (intValue==217) //Country is India 98 , UK 216, US
                        {
                         document.getElementById(strClientID +"imgState").style["display"]="inline";
                      
                        }
                        else
                        {
                      
                         document.getElementById(strClientID +"imgState").style["display"]="none";  
                         }

                        
                   }

function ClickHandler()
{
alert("hi");
}

                function fnEasySignUp(ID,controlID)
                {
                   var blnAcceptedCond=false;
                  
                   if(pgESU_ValidateControls(ID,controlID))
                   {
                    blnAcceptedCond=fnTermsExpertDataEasySignup(ID,controlID);
                   }
                   return blnAcceptedCond
                }
                
                function pgESU_ValidateControls(ID,controlID)
                {
                    strClientID=ID.substring(0,ID.length-controlID.length);
                    
                    strMessage=""; 


                    fnCheckddlvalue(strClientID +"lstCountry",document.getElementById(strClientID +"lstCountry").selectedIndex,"Country","1");
                    
                    
                    
                    var ContValue=document.getElementById(strClientID + "lstCountry").value;
                    var MobilePhone=trim(document.getElementById(strClientID + "txtMobile").value);
                    var TelephonePhone=trim(document.getElementById(strClientID + "txtTelephone").value);
                    var MobileCode=trim(document.getElementById(strClientID + "txtMobileCode").value);
                    var TelephoneCode=trim(document.getElementById(strClientID + "txtTelephoneCode").value);
                  
//                    if (!(ContValue==217))//Country is not US
//                    {
//                     fnCheckInput(strClientID + "txtOtherState",trim(document.getElementById(strClientID + "txtOtherState").value),"string","State","1");       
//                    }
//                    else
//                    {
//                     fnCheckddlvalue(strClientID +"ddlState",document.getElementById(strClientID +"ddlState").selectedIndex,"State");
//                    }
                    
                    if (ContValue==217)//Country is  US
                    {
                         fnCheckInput(strClientID + "txtOtherState",trim(document.getElementById(strClientID + "txtOtherState").value),"string","State","1");       
                    }
                    
                    else
                    
                    {
                     fnCheckInput(strClientID + "txtOtherState",trim(document.getElementById(strClientID + "txtOtherState").value),"string","State");       
                    }
                  
               
                    fnCheckddlvalue(strClientID +"ddlPrefix",document.getElementById(strClientID +"ddlPrefix").selectedIndex,"Prefix");

                    fnCheckInput(strClientID + "txtfirstname",document.getElementById(strClientID + "txtfirstname").value,"string","First name","1");    
                    fnCheckInput(strClientID + "txtlastname",document.getElementById(strClientID + "txtlastname").value,"string","Last name","1");    
                    
                    
                     //Change by Anjali 5/2/2009
                     if(MobilePhone=="" && TelephonePhone=="")
                     {
                     fnCheckInput(strClientID + "txtMobile",document.getElementById(strClientID + "txtMobile").value,"MobilePhoneNumber","Mobile Number/Telephone Number","1");
                     }
                     //Change completed by Anjali 5/2/2009 
                     
//                    //Change  by Anjali 5/2/2009 
                    if(MobilePhone !="" && TelephonePhone!="")
                    {
                    fnCheckInput(strClientID + "txtMobile",document.getElementById(strClientID + "txtMobile").value,"MobilePhoneNumber","Mobile Number","1");    
                    fnCheckInput(strClientID + "txtTelephone",document.getElementById(strClientID + "txtTelephone").value,"MobilePhoneNumber","Telephone Number","1");    
                    }
                    else if(MobilePhone !=""&& TelephonePhone=="")
                    {
                     fnCheckInput(strClientID + "txtMobile",document.getElementById(strClientID + "txtMobile").value,"MobilePhoneNumber","Mobile Number","1");    
                    }
                    else if(TelephonePhone==""&& TelephonePhone!="")
                    {
                    fnCheckInput(strClientID + "txtTelephone",document.getElementById(strClientID + "txtTelephone").value,"MobilePhoneNumber","Telephone Number","1");    
                    }
                    
                    
                     
//                    
                    fnCheckInput(strClientID + "txtMobileCode",document.getElementById(strClientID + "txtMobileCode").value,"std","Mobile Country code");
                   // fnCheckInput(strClientID + "txtMobile",document.getElementById(strClientID + "txtMobile").value,"integer","Mobile Number","1");
                       
                    fnCheckInput(strClientID + "txtTelephoneCode",document.getElementById(strClientID + "txtTelephoneCode").value,"std","Telephone Country code");
                    //Change completed by Anjali 5/2/2009 
                  //  fnCheckInput(strClientID + "txtTelephone",document.getElementById(strClientID + "txtTelephone").value,"integer","Telephone Number","1");
                  
//                    if(MobilePhone!="" && TelephonePhone!="")
//                  {
//                     fnCheckInput(strClientID + "txtMobile",document.getElementById(strClientID + "txtMobile").value,"integer","Mobile Number");
//                     fnCheckInput(strClientID + "txtTelephone",document.getElementById(strClientID + "txtTelephone").value,"integer","Telephone Number");
//                  }
                    
                                         
//                  if(MobilePhone!="" && TelephonePhone=="")
//                  {
//                   fnCheckInput(strClientID + "txtMobile",document.getElementById(strClientID + "txtMobile").value,"integer","Mobile Number");
//                  }
                     
//                       if(MobilePhone=="" && TelephonePhone!="")
//                  {
//                   fnCheckInput(strClientID + "txtTelephone",document.getElementById(strClientID + "txtTelephone").value,"integer","Telephone Number");
//                  }  
                  
                    if(MobileCode!="" && TelephoneCode=="")
                     {
                     fnCheckInput(strClientID + "txtMobileCode",document.getElementById(strClientID + "txtMobileCode").value,"","Mobile Code");
                     }
                     
                      if(MobileCode=="" && TelephoneCode!="")
                     {
                     fnCheckInput(strClientID + "txtTelephoneCode",document.getElementById(strClientID + "txtTelephoneCode").value,"","Telephone Code");
                     }
                     
                      if(MobileCode=="" && TelephoneCode=="")
                     {
                     fnCheckInput(strClientID + "txtMobileCode",document.getElementById(strClientID + "txtMobileCode").value,"","Mobile Code/Telephone Code","1");
                     }
                     
                    
                  
                    
                    fnCheckInput(strClientID + "txtEmail",document.getElementById(strClientID + "txtEmail").value,"email","Email","1");
                    


                    fnCheckddlvalue(strClientID +"ddlPrimaryIndustry",document.getElementById(strClientID +"ddlPrimaryIndustry").selectedIndex,"Primary Industry","1");
                    
                    var IndusValue=document.getElementById(strClientID + "ddlPrimaryIndustry").value;
                    
                    if (IndusValue=="17")
                    {
                     fnCheckInput(strClientID + "txtOtherPrimaryIndustry",document.getElementById(strClientID + "txtOtherPrimaryIndustry").value,"string","Other Primary Industry","1"); 
                     fnCheckInput(strClientID + "txtOtherSubIndustry",document.getElementById(strClientID + "txtOtherSubIndustry").value,"string","Sub Industry","1"); 
                    }
                    
                  
                    
                    if (IndusValue!=0)//Industry is Selected-->check for subindustry
                    {   
                        
                        var blnChkListSelected=0;
                        var chkList1= document.getElementById (strClientID +"chkBoxListSubIndustry");
                        
                     if(chkList1!=null)
                        {
                        var arrayOfCheckBoxes= chkList1.getElementsByTagName("input");
                        
                        
                        for(var i=0;i<arrayOfCheckBoxes.length;i++)
                        //do as you wish with each arrayOfCheckBoxes[i] element
                        {
                          if(arrayOfCheckBoxes[i].checked)
                          {
                            blnChkListSelected=1;
                            break;
                            //alert(arrayOfCheckBoxes[i].value);
                            //would echo the control's ID
                          }
                        
                         
                        }
                        if(!blnChkListSelected)
                        {
                         strMessage=strMessage +"\n----" + "SubIndustry"; 
                        }
                      }
                     
                    }
                    
                    
                                        
                    
                  //  fnCheckddlvalue(strClientID +"ddlFunction",document.getElementById(strClientID +"ddlFunction").selectedIndex,"Functional Area");
                    fnCheckddlvalue(strClientID +"ddlFunctionalRole",document.getElementById(strClientID +"ddlFunctionalRole").selectedIndex,"Functional Area","1");
                    
                /*    if (document.getElementById(strClientID + "ddlFunction").selectedIndex==11)
                    {
                  
                     fnCheckInput(strClientID + "txtFunctionOthers",trim(document.getElementById(strClientID + "txtFunctionOthers").value),"string","Function Others","1");       
                    } */
              //      alert(document.getElementById(strClientID + "ddlFunctionalRole").selectedIndex);
                    
                    if (document.getElementById(strClientID + "ddlFunctionalRole").selectedIndex!=-1)
                    {
                      var text = document.getElementById(strClientID + "ddlFunctionalRole").options[document.getElementById(strClientID + "ddlFunctionalRole").selectedIndex].text;
                   //   alert(text);
                        if (text=="Others")
                    {
                  
                     fnCheckInput(strClientID + "txtOtherFunctionalRole",trim(document.getElementById(strClientID + "txtOtherFunctionalRole").value),"string","Other Functional Area","1");       
                    }  
                    }                                   
                    fnCheckddlvalue(strClientID +"ddlExperience",document.getElementById(strClientID +"ddlExperience").selectedIndex,"Experience","1");
                    
                    fnCheckddlvalue(strClientID +"ddlCurrency",document.getElementById(strClientID +"ddlCurrency").selectedIndex,"Currency");
                    fnCheckInput(strClientID +"txtHourlyConsultingRate",document.getElementById(strClientID +"txtHourlyConsultingRate").value,"integer","Hourly Consulting rate","1");
 
                    fnCheckInput(strClientID +"txtReferrerName",document.getElementById(strClientID +"txtReferrerName").value,"string","Referrer Name");
                   //  document.getElementById("ctl00_ContentPlaceHolder1_uploadResume").value;
                     
                     var allowedExtensions = new Array(".doc",".DOC",".rtf",".RTF",".txt",".TXT",".pdf",".PDF",".html",".HTML",".htm",".HTM",".docx",".DOCX");
                     var strPath =  document.getElementById("ctl00_ContentPlaceHolder1_uploadResume").value;
                     var flag = false;



                     var eresume = document.getElementById(strClientID + "FreeTextBox1").value;
                     
                    if(strPath == '' && eresume=='')
                    {
                        fnCheckInput(strClientID + "uploadResume",document.getElementById(strClientID + "uploadResume").value,"","Upload your CV/ Paste your CV","1");
                    }
                    if (strPath!='')
                    {
                     var FileName = strPath.substr(strPath.lastIndexOf('\\')+1);

                     strPath = strPath.substr(strPath.lastIndexOf('.'));
                     
                     for(var i=0; i<allowedExtensions.length;i++)
                       {
                           if(strPath == allowedExtensions[i])
                             {
                                flag = true;
                                break;
                             }
                       } 
                         if(flag!=true)
                         {
                          alert("Please select a file with either of the following extensions to upload:- \n rtf, doc,docx,txt,htm or html or pdf.");
                          return false;
                         }
                     } 
                    
                    
                     if(strMessage!="")
            {
             
              strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
              alert(strMessage);
              return false;
            }
               

           
                 return true;
                }

                       
                    function fnTermsExpertDataEasySignup(ID,controlID)
                        {
                                strClientID=ID.substring(0,ID.length-controlID.length);
                                strMessage="";
                                var obj=document.getElementById(strClientID + "lstCountry")
                               
                                if(document.getElementById(strClientID + "chkTermsCond").checked==false)
                                {

                                    if(obj.options[obj.selectedIndex].text.toLowerCase()=="india")          
                                              {
                                              
                                               strMessage ="Please select the 'Terms and Conditions' checkbox.\r\n"
	                                           strMessage=strMessage +"            - All members of the Circle of Experts must accept our terms and conditions.\n If you have any questions about them, send an email to CoEexpertquestions@evalueserve.com.\r\n"
                                      
                                        }
                                    else
                                    {
                                        strMessage ="Please select the 'Terms and Conditions' checkbox.\r\n"
	                                   strMessage=strMessage +"            - All members of the Circle of Experts must accept our terms and conditions.\n If you have any questions about them, contact us at +1-(212)-682-6676.\r\n"
                                      
                                    }
                                   
                                   alert(strMessage);
                                   return false;
                                }
                                
                                if(document.getElementById(strClientID + "chkProfileShare").checked==false)
                                {

                                    if(obj.options[obj.selectedIndex].text.toLowerCase()=="india")          
                                              {
                                              
                                               strMessage ="It is mandatory to select the profile share box to proceed further.\r\n"
	                                           strMessage=strMessage +"            - All members of the Circle of Experts must accept ProfileShare.\n If you have any questions about them, send an email to CoEexpertquestions@evalueserve.com.\r\n"
                                      
                                        }
                                    else
                                    {
                                        strMessage ="It is mandatory to select the profile share box to proceed further.\r\n"
	                                   strMessage=strMessage +"            - All members of the Circle of Experts must accept our ProfileShare.\n If you have any questions about them, contact us at +1-(212)-682-6676.\r\n"
                                      
                                    }
                                   
                                   alert(strMessage);
                                   return false;
                                }
                                
                                
                               return true;
                        }
                       
          function fnCheckHourlyRateEasySignup(ID,controlID)
           {
              
                strClientID=ID.substring(0,ID.length-controlID.length);
                
                var obj=document.getElementById(strClientID + "lstCountry");
                
                for (var i=0; i<obj.options.length; i++)
                {
                      if ( obj.options[i].selected )
                       { 
                          var optionText = obj.options[i].text;
                       }
                }
                
                if(optionText!=null)
                {
                 
                  if(optionText.toLowerCase()=="india") 
                  {
                         var value = document.getElementById(strClientID + "txtHourlyConsultingRate").value;
                         if( value > 4000)
                         {
                              alert("Thank you for your interest in consulting with Evalueserve Circle of Experts. \nEvalueserve Circle of Experts only pays above Rs.4000/hour for very senior executives. \n If you have at least 10 years of experience and believe you fall into this category, \n we will evaluate your rate of Rs."+ value +"/hour after reviewing your biography and resume. \n Please feel free to revise your hourly rate if appropriate.");
                              document.getElementById(strClientID + "txtHourlyConsultingRate").focus();
                                                    
                         }
                  }
                }  
           }
                       

//---- Vishal Narula --  Date 09-Sept-08 [End]

/*
*Page Name : easy-singUp.aspx [End]
*
*/

       
 
//S: Rakesh on 09 Nov 2008

function ddpanel(setting){
	setting.dir="up" //initial state of panel (up="contracted")
	if (setting.stateconfig.persiststate && ddpanel.getCookie(setting.ids[0])=="down"){
		setting.dir="down"
	}
	if (setting.dir=="up"){ //if "up", output CSS to hide panel contents
		document.write('<style type="text/css">\n')
		document.write('#'+setting.ids[1]+'{height:' + parseInt(setting.stateconfig.initial) + 'px; overflow:hidden}\n')
		document.write('</style>\n')
	}
	setting.stateconfig.initial=parseInt(setting.stateconfig.initial)
	this.setting=setting
	var thispanel=this
	if (window.addEventListener) //if non IE browsers, initialize panel window.onload
		ddpanel.addEvent(window, function(e){thispanel.initpanel(setting)}, "load")
	else //else if IE, add 100 millisec after window.onload before initializing
		ddpanel.addEvent(window, function(e){setTimeout(function(){thispanel.initpanel(setting)}, 100)}, "load")
	ddpanel.addEvent(window, function(e){thispanel.uninit(setting)}, "unload")
}

ddpanel.events_array=[] //object array to contain events created by script

ddpanel.addEvent=function(target, functionref, tasktype){
	var evtmodel=target.addEventListener? "w3c" : "ie"
	var evtaction=evtmodel=="w3c"? "addEventListener" : "attachEvent"
	var i=this.events_array.push({ //store event info in ddpanel.events_array[] and return current event's index within array
		target: target,
		tasktype: (evtmodel=="ie"? "on" : "")+tasktype,
		listener: evtmodel=="ie"? function(){return functionref.call(target, window.event)} : functionref
	})-1
	target[evtaction](this.events_array[i].tasktype, this.events_array[i].listener, evtmodel=="w3c"? false : null)
}

ddpanel.removeEvent=function(target, functionref, tasktype){
	var evtmodel=target.removeEventListener? "w3c" : "ie"
	var evtaction=evtmodel=="w3c"? "removeEventListener" : "detachEvent"
	target[evtaction](tasktype, functionref, evtmodel=="w3c"? false : null)
}

ddpanel.getCookie=function(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return null
}

ddpanel.setCookie=function(name, value){
	document.cookie = name+"=" + value + ";path=/"
}

ddpanel.addpointer=function(target, className, imagesrc){
	var pointer=document.createElement("img")
	pointer.src=imagesrc
	pointer.className=className
	pointer.style.borderWidth=0
	target.appendChild(pointer)
	return pointer
}

ddpanel.prototype={

togglepanel:function(dir){ //public function that toggles the panel's state. Optional dir parameter ("up" or "down") to explicitly set state.
	var setting=this.setting
	setting.dir=dir || ((setting.dir=="up")? "down" : "up")
	var pcontent=setting.pcontent, dir=setting.dir
	pcontent._currentheight=(dir=="down")? pcontent._actualheight : setting.stateconfig.initial
	pcontent.style.height=pcontent._currentheight+"px"
	if (setting.pointerimage.enabled){
		setting.arrow.src=setting.pointerimage.src[(setting.dir=="down")? 1 : 0]
		setting.arrow.style.visibility="visible"
	}
	ddpanel.setCookie(setting.ids[0], setting.dir)
},

togglepanelplus:function(dir){ //public function that toggles the panel's state w/ animation. Optional dir parameter ("up" or "down") to explicitly set state.
	var setting=this.setting
	setting.dir=dir || ((setting.dir=="up")? "down" : "up")
	if (setting.pointerimage.enabled)
		setting.arrow.style.visibility="hidden"
	clearTimeout(setting.revealtimer)
	this.revealcontent()
},

revealcontent:function(){
	var setting=this.setting
	var pcontent=setting.pcontent, curH=pcontent._currentheight, maxH=pcontent._actualheight, minH=setting.stateconfig.initial, steps=setting.animate.steps, dir=setting.dir
	if (dir=="down" && curH<maxH || dir=="up" && curH>minH){
		var newH = curH + (Math.round((maxH-curH)/steps)+1) * (dir=="up"? -1 : 1)
		newH=(dir=="down")? Math.min(maxH, newH) : Math.max(minH, newH)
		pcontent.style.height=newH+"px"
		pcontent._currentheight=newH
	}
	else{
		if (setting.pointerimage.enabled){
			setting.arrow.src=setting.pointerimage.src[(setting.dir=="down")? 1 : 0]
			setting.arrow.style.visibility="visible"
		}
		return
	}
	var thispanel=this
	setting.revealtimer=setTimeout(function(){thispanel.revealcontent()}, 10)
},

initpanel:function(){
	var setting=this.setting
	var pcontainer=setting.pcontainer=document.getElementById(setting.ids[0])
	var pcontent=setting.pcontent=document.getElementById(setting.ids[1])
	var tdiv=setting.tdiv=document.getElementById(setting.ids[2])
	if(pcontent==null)
	return;
	pcontent.style.overflow="scroll"
	pcontent._actualheight=pcontent.scrollHeight
	setTimeout(function(){pcontent._actualheight=pcontent.scrollHeight}, 100)
	pcontent.style.overflow="hidden"
	pcontent._currentheight=(setting.dir=="down")? pcontent._actualheight : setting.stateconfig.initial
	var thispanel=this
	ddpanel.addEvent(tdiv, function(e){ //assign click behavior when toggle DIV tab is clicked on
		if (setting.animate.enabled)
			thispanel.togglepanelplus()
		else
			thispanel.togglepanel()
		if (e.preventDefault) e.preventDefault()
		return false
	}, "click")
	if (setting.pointerimage.enabled){
		var pointer1=new Image(), pointer2=new Image()
		pointer1.src=setting.pointerimage.src[0]
		pointer2.src=setting.pointerimage.src[1]
		setting.arrow=ddpanel.addpointer(tdiv.getElementsByTagName("span")[0], "pointerimage", setting.pointerimage.src[setting.dir=="down"? 1:0])
	}
	if (setting.closepanelonclick.enabled){ //assign click behavior when panel content is clicked on (links within panel or elements with class "closepanel"
			ddpanel.addEvent(pcontent, function(e){
				var target=e.srcElement || e.target
				if (/(^|\s+)closepanel($|\s+)/.test(target.className) || target.tagName=="A" || (target.parentNode && target.parentNode.tagName=="A")){
					thispanel.togglepanel("up")
				}
			}, "click")
	}
},

uninit:function(){
	var setting=this.setting
	if (setting.stateconfig.persiststate){
		ddpanel.setCookie(setting.ids[0], setting.dir)
	}
	for (prop in setting){
		setting[prop]=null
	}
}



} //end of ddpanel object


//initialize instance of DD Drop Down Panel:

var defaultpanel=new ddpanel({
	ids: ["mypanel", "mypanelcontent", "mypaneltab"], // id of main panel DIV, content DIV, and tab DIV
	stateconfig: {initial: "5px", persiststate: true}, // initial: initial reveal amount in pixels (ie: 5px)
	animate: {enabled: true, steps: 1}, //steps: number of animation steps. Int between 1-20. Smaller=faster.
	pointerimage: {enabled: true, src: ["images/arrow-down.gif", "images/arrow-up.gif"]},
	closepanelonclick: {enabled: true} // close panel when links or elements with CSS class="closepanel" within container is clicked on?
})


//E: Rakesh on 09 Nov 2008
 
 
 
 
 
 
/*
Page : request-for-consultation.aspx
Function to Hide and unhide other text box when 'Other' is selected in Industry List
@objId : id of the Industry List multi list
*/ 
function ShowOtherIndustry(objId)
{
    var listObjId = document.getElementById(objId);
    var divOtherIndustry = document.getElementById('divOtherIndustry');
    divOtherIndustry.style.display = 'none';
    
    var bIsOtherSelected = false;
    
    for(var step = 0;listObjId.options.length > step;step++)
    {
   
        var selOption = listObjId.options[step];
        //alert('hi');

        if(selOption.selected == true)
        {
            if(selOption.value == '17' && selOption.text == 'Others')
            {
                bIsOtherSelected = true;
                break;
            }
        }
    }
    
    
    
    if(bIsOtherSelected)
    {
        bIsOtherSelected = true;divOtherIndustry.style.display = 'inline';
    }
    else
    {
        var ctrlArray = divOtherIndustry.getElementsByTagName('input');
        for(step = 0;ctrlArray.length > step; step++)
        {
            //alert(ctrlArray[step].id);
            ctrlArray[step].value = '';
        }
    }
}


    //Change End
    function fnCheckLeadData(ID,controlID)
    {
         
           strClientID=ID.substring(0,ID.length-controlID.length);
           strMessage="";
          
           
            var obj=document.getElementById(strClientID + "ddlCountry");
            var ContValue=document.getElementById(strClientID + "ddlCountry").value;
            var objPrimary=document.getElementById(strClientID + "ddlPrimaryEmail");
            var primaryemail=objPrimary.options[objPrimary.selectedIndex].value;
            fnCheckddlvalue(strClientID + "ddlPrefix",document.getElementById(strClientID + "ddlPrefix").selectedIndex,"Prefix","1");
            if(obj.options[obj.selectedIndex].text.toLowerCase()=="india")                
            {
                fnCheckInput(strClientID + "txtFirstName",document.getElementById(strClientID + "txtFirstName").value,"alpha","First name","1");
                fnCheckInput(strClientID + "txtMiddleName",document.getElementById(strClientID + "txtMiddleName").value,"alpha","Middle name");
                fnCheckInput(strClientID + "txtLastName",document.getElementById(strClientID + "txtLastName").value,"alpha","Last name","1");
                fnCheckInput(strClientID + "txtCompany",document.getElementById(strClientID + "txtCompany").value,"alpha","Company","1");
              //  fnCheckInput(strClientID + "txtPostalCode",document.getElementById(strClientID + "txtPostalCode").value,"","Postal Code","1");
               fnReachMethodChangedForLead(ID,controlID,"std",primaryemail);
               
               }
            else
            {
                fnCheckInput(strClientID + "txtFirstName",document.getElementById(strClientID + "txtFirstName").value,"alpha","First name","1");
                fnCheckInput(strClientID + "txtMiddleName",document.getElementById(strClientID + "txtMiddleName").value,"alpha","Middle name");
                fnCheckInput(strClientID + "txtLastName",document.getElementById(strClientID + "txtLastName").value,"alpha","Last name","1");
                  fnCheckInput(strClientID + "txtCompany",document.getElementById(strClientID + "txtCompany").value,"alpha","Company","1");
              //  fnCheckInput(strClientID + "txtPostalCode",document.getElementById(strClientID + "txtPostalCode").value,"","Postal Code","1");
                fnReachMethodChangedForLead(ID,controlID,"code",primaryemail);
                
            }//txtReferralSource
            fnCheckInput(strClientID + "txtLifetimeEmail",document.getElementById(strClientID + "txtLifetimeEmail").value,"email","Lifetime Email");
            fnCheckInput(strClientID + "txtAlternativeEmail",document.getElementById(strClientID + "txtAlternativeEmail").value,"email","Alternate Email");
            //fnCheckInput(strClientID + "txtCity",document.getElementById(strClientID + "txtCity").value,"","City","1");
            
            fnCheckInput(strClientID +"txtReferralSource",document.getElementById(strClientID +"txtReferralSource").value,"integer","Referral Source");
            fnCheckInput(strClientID +"txtReferralName",document.getElementById(strClientID +"txtReferralName").value,"string","Referral Name");
            

            fnCheckInput(strClientID + "txtSuffix",document.getElementById(strClientID + "txtSuffix").value,"string","Suffix");
          
           
//               if (ContValue==217)//Country is  US
//                    {
//                        fnCheckInput(strClientID + "txtState",document.getElementById(strClientID + "txtState").value,"","State","1");      
//                    }
//                    
//                    else
//                    
//                    {
//                     fnCheckInput(strClientID + "txtState",trim(document.getElementById(strClientID + "txtState").value),"string","State");       
//                    }
//           
           
           
         //   fnCheckInput(strClientID + "txtState",document.getElementById(strClientID + "txtState").value,"","State","1");
            fnCheckInput(strClientID + "txtBriefBiography",document.getElementById(strClientID + "txtBriefBiography").value,"","Brief Biography");
            
             //Change Begin
            //Commented by Vikash kumar on 08.12.2008
            
           // fnCheckddlvalue(strClientID + "ddlIndustry",document.getElementById(strClientID + "ddlIndustry").selectedIndex,"Industry","1");
            
            //Change End
            fnCheckddlvalue(strClientID + "ddlPrimaryIndustry",document.getElementById(strClientID + "ddlPrimaryIndustry").selectedIndex,"Primary Industry","1");
            
        /*     var chkList1= document.getElementById (strClientID +"chkBoxListSubIndustry");   
              if(chkList1!=null)
              {
                    if (IndusValue!=0)//Industry is Selected-->check for subindustry
                    {   
                        
                        var blnChkListSelected=0;
                   //     var chkList1= document.getElementById (strClientID +"chkBoxListSubIndustry");
                        
                        var arrayOfCheckBoxes= chkList1.getElementsByTagName("input");
                        
                        
                        for(var i=0;i<arrayOfCheckBoxes.length;i++)
                        //do as you wish with each arrayOfCheckBoxes[i] element
                        {
                          if(arrayOfCheckBoxes[i].checked)
                          {
                            blnChkListSelected=1;
                            break;
                            //alert(arrayOfCheckBoxes[i].value);
                            //would echo the control's ID
                          }
                        
                         
                        }
                        if(!blnChkListSelected)
                        {
                         strMessage=strMessage +"\n----" + "Sub Industry"; 
                        }
                     
                    }
                 } */
            
            fnCheckddlvalue(strClientID +"ddlFunctionalRole",document.getElementById(strClientID +"ddlFunctionalRole").selectedIndex,"Functional Area","1");
//            fnCheckddlvalue(strClientID +"ddlExperience",document.getElementById(strClientID +"ddlExperience").selectedIndex,"Experience","1");
            
            
              if (document.getElementById(strClientID + "ddlFunctionalRole").selectedIndex!=-1)
                    {
                      var text = document.getElementById(strClientID + "ddlFunctionalRole").options[document.getElementById(strClientID + "ddlFunctionalRole").selectedIndex].text;
                  
                        if (text=="Others")
                        {
                      
                         fnCheckInput(strClientID + "txtOtherFunctionalRole",trim(document.getElementById(strClientID + "txtOtherFunctionalRole").value),"string","Other Functional Area","1");       
                        }  
                    }      
                    
              var IndusValue=document.getElementById(strClientID + "ddlPrimaryIndustry").value;
              
                
                    if (IndusValue=="17")
                    {
                     fnCheckInput(strClientID + "txtOtherPrimaryIndustry",document.getElementById(strClientID +"txtOtherPrimaryIndustry").value,"string","Other Primary Industry","1"); 
                     fnCheckInput(strClientID + "txtOtherSubIndustry",document.getElementById(strClientID + "txtOtherSubIndustry").value,"string","Other Sub Industry","1"); 
                    }
                    
            
         if(document.getElementById(strClientID + "ddlFunction")!=null)
         {
           var intValueFunction=document.getElementById(strClientID + "ddlFunction").selectedIndex;
           var functionOthers=trim(document.getElementById("ctl00_ContentPlaceHolder1_txtFunctionOthers").value);                       
           var functioncontrol=document.getElementById("ctl00_ContentPlaceHolder1_txtFunctionOthers");
           
           if (intValueFunction!=null)
           {
               if (intValueFunction==11)
               {
                 
                       if(functionOthers =='')
                       {
                       functioncontrol.style.backgroundColor = "#cad7ec";
                       functioncontrol.focus();
                       alert("Please enter text for Function Others");
                       return false;
                       //fnCheckInput(strClientID + "txtFunctionOthers",document.getElementById(strClientID + "txtFunctionOthers").value,"","Function Others","1");
                       // document.getElementById(strClientID +"txtFunctionOthers").style["display"]="inline";  
                       }
                       else
                       {
                       functioncontrol.style.backgroundColor ="White";
                       }
               }
           }
          }
       
         if(document.getElementById(strClientID + "ddllevel")!=null)
         {
           var intValueLevel=document.getElementById(strClientID + "ddllevel").selectedIndex;
           var levelcontrol=document.getElementById("ctl00_ContentPlaceHolder1_txtLevelOthers");
           var levelOthers=trim(document.getElementById("ctl00_ContentPlaceHolder1_txtLevelOthers").value); 
           if (intValueLevel!=null)
           {
               if (intValueLevel==8)
               {
                           if(levelOthers =='')
                           {
                            levelcontrol.style.backgroundColor = "#cad7ec";
                            levelcontrol.focus();
                            alert("Please enter text for Level Others");
                            return false;
                           }
                          else
                           {
                           levelcontrol.style.backgroundColor = "White";
                           }
          
               }
           }
           }
        /*    if(document.getElementById(strClientID + "ddlPrimaryAreaExpertise").selectedIndex==0)
            {
                if(document.getElementById(strClientID + "txtOtherPrimary").value=="")
                {
                    fnCheckInput(strClientID + "txtOtherPrimary",document.getElementById(strClientID + "txtOtherPrimary").value,"","Primary Areas of Expertise","1");
                }
                
            }
            else
                {
                   fnCheckddlvalue(strClientID + "ddlPrimaryAreaExpertise",document.getElementById(strClientID + "ddlPrimaryAreaExpertise").selectedIndex,"Primary Areas of Expertise");
                } */
           
            fnCheckddlvalue(strClientID + "ddlCountry",document.getElementById(strClientID + "ddlCountry").selectedIndex,"Country");
                /* Change begin */
                /*Change made by Vikash Kumar  on 13.8.2008 to make currency mandatory */
      //      fnCheckddlvalue(strClientID + "ddlCurrency",document.getElementById(strClientID + "ddlCurrency").selectedIndex,"Currency");
            /*Change End */
            fnCheckInput(strClientID +"txtHourlyConsultingRate",document.getElementById(strClientID +"txtHourlyConsultingRate").value,"integer","Hourly Consulting rate","1");
            fnCheckInput(strClientID +"txtDailyConsultingRate",document.getElementById(strClientID +"txtDailyConsultingRate").value,"integer","Daily Consulting rate");
            
            fnCheckInput(strClientID +"txtPagerNumber",document.getElementById(strClientID +"txtPagerNumber").value,"integer","Pager number");
            fnCheckInput(strClientID + "txtLanguage1",document.getElementById(strClientID + "txtLanguage1").value,"","Language1");
            fnCheckInput(strClientID + "txtLanguage2",document.getElementById(strClientID + "txtLanguage2").value,"","Language2");
            fnCheckInput(strClientID + "txtLanguage3",document.getElementById(strClientID + "txtLanguage3").value,"","Language3");
            fnCheckInput(strClientID + "txtLanguage4",document.getElementById(strClientID + "txtLanguage4").value,"","Language4");
            fnCheckInput(strClientID + "txtLanguage5",document.getElementById(strClientID + "txtLanguage5").value,"","Language5");
            fnCheckInput(strClientID + "txtLanguage6",document.getElementById(strClientID + "txtLanguage6").value,"","Language6");
            fnCheckInput(strClientID + "txtLanguage7",document.getElementById(strClientID + "txtLanguage7").value,"","Language7");
            fnCheckInput(strClientID + "txtBoardCertifications1",document.getElementById(strClientID + "txtBoardCertifications1").value,"","BoardCertifications1");
            fnCheckInput(strClientID + "txtBoardCertifications2",document.getElementById(strClientID + "txtBoardCertifications2").value,"","BoardCertifications2");
            fnCheckInput(strClientID + "txtBoardCertifications3",document.getElementById(strClientID + "txtBoardCertifications3").value,"","BoardCertifications3");
            fnCheckInput(strClientID + "txtBoardCertifications4",document.getElementById(strClientID + "txtBoardCertifications4").value,"","BoardCertifications4");
            fnCheckInput(strClientID + "txtCompanyOfExpertise1",document.getElementById(strClientID + "txtCompanyOfExpertise1").value,"","CompanyOfExpertise1");
            fnCheckInput(strClientID + "txtCompanyOfExpertise2",document.getElementById(strClientID + "txtCompanyOfExpertise2").value,"","CompanyOfExpertise2");
            fnCheckInput(strClientID + "txtCompanyOfExpertise3",document.getElementById(strClientID + "txtCompanyOfExpertise3").value,"","CompanyOfExpertise3");
            fnCheckInput(strClientID + "txtCompanyOfExpertise4",document.getElementById(strClientID + "txtCompanyOfExpertise4").value,"","CompanyOfExpertise4");
            fnCheckInput(strClientID + "txtCompanyOfExpertise5",document.getElementById(strClientID + "txtCompanyOfExpertise5").value,"","CompanyOfExpertise5");
            fnCheckInput(strClientID + "txtProductServices1",document.getElementById(strClientID + "txtProductServices1").value,"","ProductServices1");
            fnCheckInput(strClientID + "txtProductServices2",document.getElementById(strClientID + "txtProductServices2").value,"","ProductServices2");
            fnCheckInput(strClientID + "txtProductServices3",document.getElementById(strClientID + "txtProductServices3").value,"","ProductServices3");
            fnCheckInput(strClientID + "txtProductServices4",document.getElementById(strClientID + "txtProductServices4").value,"","ProductServices4");
            fnCheckInput(strClientID + "txtProductServices5",document.getElementById(strClientID + "txtProductServices5").value,"","ProductServices5");
           
            //Commented by Vikash Kumar on 18.02.2008
            
           //  fnCheckInput(strClientID +"txtTaxIDNumber",document.getElementById(strClientID +"txtTaxIDNumber").value,"integer","Tax ID Number");
           
           //End
                      
            
            if(strMessage!="")
            {
            //  alert(" for STD");
               strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
              
               alert(strMessage);
               return false;
            }
           // fnConfirm("Do You want to send Expert Credentials now");
            confirmation();
           
            fnCheckInput(strClientID + "txtTitle",document.getElementById(strClientID + "txtTitle").value,"title","Title");
             if(strMessage!="")
            {
            //  alert(" for STD");
               strMessage ="The following is invalid:"  + strMessage +"\nPlease correct and try again.";
              
               alert(strMessage);
               return false;
            }
             fnCheckPrimaryEmail(strClientID + "ddlPrimaryEmail",document.getElementById(strClientID + "ddlPrimaryEmail"),false);
            fnCloseWindow();
            return true;
    }
    
    
      
      function fnCheckAddedLeadData(ID,controlID)
    {
          
               strClientID=ID.substring(0,ID.length-controlID.length);
               strMessage="";
              
               
                var obj=document.getElementById(strClientID + "ddlCountry");
                var ContValue=document.getElementById(strClientID + "ddlCountry").value;
                fnCheckddlvalue(strClientID + "ddlPrefix",document.getElementById(strClientID + "ddlPrefix").selectedIndex,"Prefix","1");
               
                fnCheckInput(strClientID + "txtFirstName",document.getElementById(strClientID + "txtFirstName").value,"alpha","First name","1");
                fnCheckInput(strClientID + "txtMiddleName",document.getElementById(strClientID + "txtMiddleName").value,"alpha","Middle name");
                fnCheckInput(strClientID + "txtLastName",document.getElementById(strClientID + "txtLastName").value,"alpha","Last name","1");
                fnCheckInput(strClientID + "txtCompany",document.getElementById(strClientID + "txtCompany").value,"alpha","Company","1");
                fnCheckInput(strClientID + "txtTitle",document.getElementById(strClientID + "txtTitle").value,"title","Title","1");
                fnCheckInput(strClientID + "txtWorkPhone",document.getElementById(strClientID + "txtWorkPhone").value,"MobilePhoneNumber","Work Phone");
                fnCheckInput(strClientID + "txtHomePhone",document.getElementById(strClientID + "txtHomePhone").value,"MobilePhoneNumber","Home Phone");
                fnCheckInput(strClientID + "txtCellPhone",document.getElementById(strClientID + "txtCellPhone").value,"MobilePhoneNumber","Cell Phone");
                fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email");
                fnCheckddlvalue(strClientID + "ddlPrimaryIndustry",document.getElementById(strClientID + "ddlPrimaryIndustry").selectedIndex,"Primary Industry","1");
                
                
                /* Commented by Vikash on 28.05.2009  to make Sub Industry non mandatory 
                
                  var chkList1= document.getElementById (strClientID +"chkBoxListSubIndustry");   
              if(chkList1!=null)
              {
                    if (IndusValue!=0)//Industry is Selected-->check for subindustry
                    {   
                        
                        var blnChkListSelected=0;
                   //     var chkList1= document.getElementById (strClientID +"chkBoxListSubIndustry");
                        
                        var arrayOfCheckBoxes= chkList1.getElementsByTagName("input");
                        
                        
                        for(var i=0;i<arrayOfCheckBoxes.length;i++)
                        //do as you wish with each arrayOfCheckBoxes[i] element
                        {
                          if(arrayOfCheckBoxes[i].checked)
                          {
                            blnChkListSelected=1;
                            break;
                            //alert(arrayOfCheckBoxes[i].value);
                            //would echo the control's ID
                          }
                        
                         
                        }
                        if(!blnChkListSelected)
                        {
                         strMessage=strMessage +"\n----" + "Sub Industry"; 
                        }
                     
                    }
                 }*/
        
        
                fnCheckddlvalue(strClientID +"ddlFunctionalRole",document.getElementById(strClientID +"ddlFunctionalRole").selectedIndex,"Functional Area","1");
                 fnCheckddlvalue(strClientID + "ddlCountry",document.getElementById(strClientID + "ddlCountry").selectedIndex,"Country","1");
            
            
              if (document.getElementById(strClientID + "ddlFunctionalRole").selectedIndex!=-1)
                    {
                      var text = document.getElementById(strClientID + "ddlFunctionalRole").options[document.getElementById(strClientID + "ddlFunctionalRole").selectedIndex].text;
                  
                        if (text=="Others")
                        {
                      
                         fnCheckInput(strClientID + "txtOtherFunctionalRole",trim(document.getElementById(strClientID + "txtOtherFunctionalRole").value),"string","Other Functional Area","1");       
                        }  
                    }      
                    
              var IndusValue=document.getElementById(strClientID + "ddlPrimaryIndustry").value;
              
                
                    if (IndusValue=="17")
                    {
                     fnCheckInput(strClientID + "txtOtherPrimaryIndustry",document.getElementById(strClientID +"txtOtherPrimaryIndustry").value,"string","Other Primary Industry","1"); 
                   
                   /* Commented by Vikash on 28.05.2009  to make Sub Industry non mandatory */
                   //  fnCheckInput(strClientID + "txtOtherSubIndustry",document.getElementById(strClientID + "txtOtherSubIndustry").value,"string","Other Sub Industry","1"); 
                    }
                    
            
         
       
           
           
                
          
            
            if(strMessage!="")
            {
            //  alert(" for STD");
               strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
              
               alert(strMessage);
               return false;
            }
      
          return true;
    }
    

/*
Open page on a popup
@strTarget URL to Open
@srWidth height of window
@srHeight width of window
*/ 
/*    
function openFilterSearch(strTarget,srWidth, srHeight)
{
   
    params  = 'width='+srWidth;
    params += ', height='+srHeight;
    params += ', top=0, left=0';
    //params += ', fullscreen=yes';
    params += ', status=yes';
    //params += ', toolbar=no';
    params += ', menubar=no';
    //params += ', location=no';
    params += ', resizable=yes';
    params += ', scrollbars=yes';

    newwin = window.open(strTarget,'windowname4', params);
    if (window.focus) 
    {
        newwin.focus()
    }
    return false;
}*/

function openFilterSearch(strTarget,srWidth, srHeight)
{
   
    window.open("win1.html","Window1","menubar=no,width=430,height=360,toolbar=no");
    return false;
}

 function fnChangeBestWayForLead(ID,controlID)
   {
      
        strClientID=ID.substring(0,ID.length-controlID.length);
        var primaryEmail="work";
        var object=document.getElementById(strClientID +"rblPrimaryEmail_0")
        if(object!=null)
        {
            if(object.checked==true)
             {
                primaryEmail="home";
             }
         }
         else
         {
                if(document.getElementById(strClientID + "ddlPrimaryEmail").selectedIndex==0)
                {
                    primaryEmail="";
                }
                
                 if(document.getElementById(strClientID + "ddlPrimaryEmail").selectedIndex==1)
                {
                    primaryEmail="work";
                }
                
               if(document.getElementById(strClientID + "ddlPrimaryEmail").selectedIndex==2)
                {
                    primaryEmail="home";
                }
         }
        
     
        var intValue=document.getElementById(strClientID + "ddlBestWayToReach").selectedIndex;
        
         document.getElementById(strClientID + "imgWorkPhone").style["display"]="none";
         document.getElementById(strClientID +"imgHomePhone").style["display"]="none";
         document.getElementById(strClientID +"imgCellPhone").style["display"]="none";
         document.getElementById(strClientID + "imgOther").style["display"]="none";
         document.getElementById(strClientID +"locOther").style["display"]="none";
         document.getElementById(strClientID +"txtOther").style["display"]="none";
         if(document.getElementById(strClientID +"trOther")!=null)
         {
            document.getElementById(strClientID +"trOther").style["display"]="none";
         }
         switch(intValue)
        {
        
          case 0:
             
            
          
              if(primaryEmail=="work")
                 {
                    document.getElementById(strClientID + "home").style["visibility"]="hidden";
                 }
               if(primaryEmail=="home")
                 {
                   document.getElementById(strClientID + "work").style["visibility"]="hidden";
                 }
                if(primaryEmail=="")
                 {
                    document.getElementById(strClientID + "home").style["visibility"]="hidden";
                    document.getElementById(strClientID + "work").style["visibility"]="hidden";
                 }
             
             
             break;
             
             case 1:
               document.getElementById(strClientID + "home").style["visibility"]="visible";
              
             if(primaryEmail=="home" ||primaryEmail=="")
                 {
                    document.getElementById(strClientID + "work").style["visibility"]="hidden";
                 }
            
          
             break;
             
             
             case 2:
             
              document.getElementById(strClientID + "work").style["visibility"]="visible";
          
            if(primaryEmail=="work" ||primaryEmail=="")
                 {
                    document.getElementById(strClientID + "home").style["visibility"]="hidden";
                 }
            
           
             
             
             break;
             case 3:
              document.getElementById(strClientID + "imgCellPhone").style["display"]="inline";
            
              //vikash 31 may
              
               if(primaryEmail=="home")
                 {
                    document.getElementById(strClientID +"work").style["visibility"]="hidden";
                 }
                else
                {
                     document.getElementById(strClientID +"home").style["visibility"]="hidden";
                }
             break;
             
             case 4:
             document.getElementById(strClientID + "imgWorkPhone").style["display"]="inline";
             
              //vikash 31 may
               if(primaryEmail=="home")
                 {
                 document.getElementById(strClientID + "work").style["visibility"]="hidden";
                 }
              else
                {
                     document.getElementById(strClientID + "home").style["visibility"]="hidden";
                }
         
             break;
             
             case 5:
             document.getElementById(strClientID +"imgHomePhone").style["display"]="inline";
             
             
              //vikash 31 may
               if(primaryEmail=="home")
                 {
                 document.getElementById(strClientID + "work").style["visibility"]="hidden";
                 }
             else
                {
                     document.getElementById(strClientID + "home").style["visibility"]="hidden";
                }
             break;
             
             case 6:
            document.getElementById(strClientID + "imgOther").style["display"]="inline";
            document.getElementById(strClientID +"locOther").style["display"]="inline";
            document.getElementById(strClientID +"txtOther").style["display"]="inline";  
             if(document.getElementById(strClientID +"trOther")!=null)
             {
                document.getElementById(strClientID +"trOther").style["display"]="inline";
             }
              //vikash 31 may
               if(primaryEmail=="home")
                 {
                 document.getElementById(strClientID + "work").style["visibility"]="hidden";
                 }
                  else
                {
                     document.getElementById(strClientID + "home").style["visibility"]="hidden";
                }
             break;
             
             
        }
        
   }
   
   function fnRadioOptionChangedForLead(bestwayID,strValue)
  {
       var obj=document.getElementById(strValue+"_1");
       controlID="ddlBestWayToReach";
       strClientID=bestwayID.substring(0,bestwayID.length-controlID.length);
    
             
             
       if(obj==null)
       {
            obj=document.getElementById(strValue);
        
               if(obj.selectedIndex==1)
                {
                    primaryEmail="work";
                }
                if(obj.selectedIndex==2)
                {
                    primaryEmail="home";
                }
                  if(obj.selectedIndex==0)
                {
//                     document.getElementById(strClientID + "work").style["visibility"]="hidden";
//                     document.getElementById(strClientID + "home").style["visibility"]="hidden";
                      primaryEmail="";
                }
       }
      
               
     var intValue=document.getElementById(bestwayID).selectedIndex;
 
     
               if(primaryEmail=="work")
               {
                    document.getElementById(strClientID + "work").style["visibility"]="visible";
     
                    
                    if(intValue!="1")
                    {
                     document.getElementById(strClientID + "home").style["visibility"]="hidden";
                    }
               }
              if(primaryEmail=="home")
               {
                    document.getElementById(strClientID + "home").style["visibility"]="visible";
      
                    if(intValue!="2")
                    {
                       document.getElementById(strClientID + "work").style["visibility"]="hidden";
                    }
                  
               }
                 if(primaryEmail=="")
               {
                    if(intValue!="1")
                    {
                     document.getElementById(strClientID + "home").style["visibility"]="hidden";
                    }
      
                    if(intValue!="2")
                    {
                       document.getElementById(strClientID + "work").style["visibility"]="hidden";
                    }
                  
               }
             
               
          
      
  }
  
  
   function fnReachMethodChangedForLead(ID,controlID,check,primaryemail)
    {
       strClientID=ID.substring(0,ID.length-controlID.length);
       var intValue=document.getElementById(strClientID + "ddlBestWayToReach").selectedIndex;
       var country=document.getElementById(strClientID + "ddlCountry").options[document.getElementById(strClientID + "ddlCountry").selectedIndex].text.toLowerCase();
      
        document.getElementById(strClientID + "txtCellPhone").style.backgroundColor = 'white';
        document.getElementById(strClientID + "txtCellCountryCode").style.backgroundColor = 'white';
        document.getElementById(strClientID + "txtWorkPhone").style.backgroundColor = 'white';
        document.getElementById(strClientID + "txtWorkCountryCode").style.backgroundColor = 'white';
        document.getElementById(strClientID + "txtHomePhone").style.backgroundColor = 'white';
        document.getElementById(strClientID + "txtHomeCountryCode").style.backgroundColor = 'white';
        document.getElementById(strClientID + "txtWorkEmail").style.backgroundColor = 'white';
        document.getElementById(strClientID + "txtHomeEmail").style.backgroundColor = 'white';
         
       switch(intValue)
        {
        
          case 0:
               
               
                 if(primaryemail=="work")
                 {
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email","1");          
                 }
                 else
                 {
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email");          
                 }
                   if(primaryemail=="home")
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email","1");    
                  }
                  else
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email");    
                  }
                  
                  
                 break;
                 
           
            case 1:
               
                //Check for Work and Home country code for length
                 fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"std","Work Country code");
                 fnCheckInput(strClientID + "txtHomeCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"std","Home Country code");
                
                //Check for Home Email
                if(check=="std")
                {
                    
                  fnCheckInput(strClientID + "txtWorkSTDCode",document.getElementById(strClientID + "txtWorkSTDCode").value,"stdcode","Work STD code");
                  fnCheckInput(strClientID + "txtHomeSTDCode",document.getElementById(strClientID + "txtHomeSTDCode").value,"stdcode","Home STD  code");
               
                 }
                
                 fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"std","Cell Country Code");
                 fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email","1");
                 if(primaryemail=="work")
                 {
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email","1");          
                 }
                 else
                 {
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email");          
                 }
                 break;
                     
            case 2:
               //Check for Work and Home country code for length
                fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"std","Work Country code");
                fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"std","Home Country code");
       
                if(check=="std")
                {
                   fnCheckInput(strClientID + "txtWorkSTDCode",document.getElementById(strClientID + "txtWorkSTDCode").value,"stdcode","Work STD code");
                   fnCheckInput(strClientID + "txtHomeSTDCode",document.getElementById(strClientID + "txtHomeSTDCode").value,"stdcode","Home STD  code");
                }
               
                fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"std","Cell Country Code");
                if(primaryemail=="home")
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email","1");    
                  }
                  else
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email");    
                  }
                  
                  fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email","1");
                
                break;
                            
            case 3:
                fnCheckInput(strClientID + "txtCellPhone",document.getElementById(strClientID + "txtCellPhone").value,"","Cell Phone Number","1");
                if(check=="std")
                {
                    fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"stdcode","Cell Country Code","1");
                    fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"stdcode","Work Country  code");
                    fnCheckInput(strClientID + "txtHomeCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"stdcode","Home Country  code");
                    fnCheckInput(strClientID + "txtWorkSTDCode",document.getElementById(strClientID + "txtWorkSTDCode").value,"stdcode","Work STD code");
                    fnCheckInput(strClientID + "txtHomeSTDCode",document.getElementById(strClientID + "txtHomeSTDCode").value,"stdcode","Home STD  code");
                 }
                 else
                 {
                    fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"std","Cell Country Code","1");
                    fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"std","Work Country  code");
                    fnCheckInput(strClientID + "txtHomeCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"std","Home Country  code");
                 }
                 if(primaryemail=="home")
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email","1");
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email");
                  }
                   if(primaryemail=="work")
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email");
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email","1");
                  }
                break;
                
                
                
            case 4:
              
                                               
               fnCheckInput(strClientID + "txtWorkPhone",document.getElementById(strClientID + "txtWorkPhone").value,"","Work Phone Number","1");
                 
                 if(check=="std")
                {
                    fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"stdcode","Work Country Code","1");
                    fnCheckInput(strClientID + "txtHomeCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"stdcode","Home Country  code");
                    fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"stdcode","Cell Country  code");
                    fnCheckInput(strClientID + "txtWorkSTDCode",document.getElementById(strClientID + "txtWorkSTDCode").value,"stdcode","Work STD code","1");
                    fnCheckInput(strClientID + "txtHomeSTDCode",document.getElementById(strClientID + "txtHomeSTDCode").value,"stdcode","Home STD  code");
                 }
                 else
                 {
                    fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"std","Work Country Code","1");
                    fnCheckInput(strClientID + "txtHomeCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"std","Home Country  code");
                    fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"std","Cell Country  code");
                 }
                if(primaryemail=="home")
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email","1");
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email");
                  }
                if(primaryemail=="work")
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email");
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email","1");
                  }
                break;
            case 5:
                                              
                  fnCheckInput(strClientID + "txtHomePhone",document.getElementById(strClientID + "txtHomePhone").value,"","Home Phone Number","1");
                 
                 if(check=="std")
                {
                    fnCheckInput(strClientID + "txtHomeCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"stdcode","Home Country Code","1");
                    fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"stdcode","Work Country  code");
                    fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"stdcode","Cell Country  code");
                    fnCheckInput(strClientID + "txtWorkSTDCode",document.getElementById(strClientID + "txtWorkSTDCode").value,"stdcode","Work STD code");
                   fnCheckInput(strClientID + "txtHomeSTDCode",document.getElementById(strClientID + "txtHomeSTDCode").value,"stdcode","Home STD  code","1");
                   
                 }
                 else
                 {
                    fnCheckInput(strClientID + "txtHomeCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"std","Home Country Code","1");
                    fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"std","Work Country  code");
                    fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"std","Cell Country  code");
                 }
                 if(primaryemail=="home")
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email","1");
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email");
                  }
                     if(primaryemail=="work")
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email");
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email","1");
                  }
               
                
                break;
            case 6:
               if(check=="std")
                {
                    
                    fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"stdcode","Work Country  code");
                    fnCheckInput(strClientID + "txtHomeCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"stdcode","Home Country  code");
                    fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"stdcode","Cell Country Code");
                    fnCheckInput(strClientID + "txtWorkSTDCode",document.getElementById(strClientID + "txtWorkSTDCode").value,"stdcode","Work STD code");
                    fnCheckInput(strClientID + "txtHomeSTDCode",document.getElementById(strClientID + "txtHomeSTDCode").value,"stdcode","Home STD  code");
                 }
                 else
                 {
                    fnCheckInput(strClientID + "txtHomeCountryCode",document.getElementById(strClientID + "txtHomeCountryCode").value,"std","Home Country Code");
                    fnCheckInput(strClientID + "txtWorkCountryCode",document.getElementById(strClientID + "txtWorkCountryCode").value,"std","Work Country  code");
                    fnCheckInput(strClientID + "txtCellCountryCode",document.getElementById(strClientID + "txtCellCountryCode").value,"std","Cell Country  code");
                 }
                 if(primaryemail=="home")
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email","1");
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email");
                  }
                  if(primaryemail=="work")
                  {
                    fnCheckInput(strClientID + "txtHomeEmail",document.getElementById(strClientID + "txtHomeEmail").value,"email","Home Email");
                    fnCheckInput(strClientID + "txtWorkEmail",document.getElementById(strClientID + "txtWorkEmail").value,"email","Work Email","1");
                  }
                 fnCheckInput(strClientID + "txtOther",document.getElementById(strClientID + "txtOther").value,"","Other way to reach","1");
                 break;
          
        }
    }
    
    function fnCheckExpertForcePwdChange(ID,controlID)
    {
        strClientID=ID.substring(0,ID.length-controlID.length);
        strMessage=""; 
        

        fnCheckInput(strClientID +"txtNewPassword",document.getElementById(strClientID +"txtNewPassword").value,"","New Password","2");
        fnCheckInput(strClientID +"txtConfirmPassword",document.getElementById(strClientID +"txtConfirmPassword").value,"","Confirm Password","2");
        

        if(strMessage != "")
        {
            //strMessage ="Incorrect Password.Please correct and try again.";
            strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
            alert(strMessage);
            return false;
        }
         else
        {    
        
            if(CheckForHTMLTag(document.getElementById(strClientID +"txtNewPassword").value))
            {
                strMessage += '\n----New Password';
                document.getElementById(strClientID +"txtNewPassword").style.backgroundColor = "#cad7ec";
            }
            
            if(CheckForHTMLTag(document.getElementById(strClientID +"txtConfirmPassword").value))
            {
                strMessage += '\n----Confirm Password';
                document.getElementById(strClientID +"txtConfirmPassword").style.backgroundColor = "#cad7ec";
            }  
            
            if(strMessage != "")
            {
                //strMessage ="Incorrect Password.Please correct and try again.";
                strMessage ="The following is invalid:"  + strMessage +"\nPlease correct and try again.";
                alert(strMessage);
                return false;
            }
                 
            if(document.getElementById(strClientID +"txtNewPassword").value != document.getElementById(strClientID +"txtConfirmPassword").value)
            {
            
                strMessage ="New Password and Confirm password does not match.\n\tPlease try again.";
                document.getElementById(strClientID +"txtNewPassword").style.backgroundColor = "#cad7ec";
                document.getElementById(strClientID +"txtConfirmPassword").style.backgroundColor = "#cad7ec";
                alert(strMessage);
                return false;
            }
        }
        return true;
        
    }
    
    function fnCheckExpertChangePassword(ID,controlID)
    {
        try
        {
    
            strClientID=ID.substring(0,ID.length-controlID.length);
            strMessage=""; 
            
            fnCheckInput(strClientID +"txtCurrentPassword",document.getElementById(strClientID +"txtCurrentPassword").value,"","Current Password","2");
            fnCheckInput(strClientID +"txtNewPwd",document.getElementById(strClientID +"txtNewPwd").value,"","New Password","2");
            fnCheckInput(strClientID +"txtConfirmPassword",document.getElementById(strClientID +"txtConfirmPassword").value,"","Confirm Password","2");
            
            
            

            if(strMessage != "")
            {
	            //strMessage ="Incorrect Password.Please correct and try again.";
	            strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
	            alert(strMessage);
	            return false;
            }
            else
            {    
            
                // check for HTML
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtCurrentPassword").value))
                {
                    strMessage = '\n----Current Password';
                    document.getElementById(strClientID +"txtCurrentPassword").style.backgroundColor = "#cad7ec";
                }
                
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtNewPwd").value))
                {
                    strMessage += '\n----New Password';
                    document.getElementById(strClientID +"txtNewPwd").style.backgroundColor = "#cad7ec";
                }
                
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtConfirmPassword").value))
                {
                    strMessage += '\n----Confirm Password';
                    document.getElementById(strClientID +"txtConfirmPassword").style.backgroundColor = "#cad7ec";
                }  
                
                if(strMessage != "")
                {
	                //strMessage ="Incorrect Password.Please correct and try again.";
	                strMessage ="The following is invalid:"  + strMessage +"\nPlease correct and try again.";
	                alert(strMessage);
	                return false;
                }
                     
                if(document.getElementById(strClientID +"txtNewPwd").value != document.getElementById(strClientID +"txtConfirmPassword").value)
                {
                
                    strMessage ="New Password and Confirm password does not match.\n\tPlease try again.";
                    document.getElementById(strClientID +"txtNewPwd").style.backgroundColor = "#cad7ec";
                    document.getElementById(strClientID +"txtConfirmPassword").style.backgroundColor = "#cad7ec";
                    alert(strMessage);
                    return false;
                }
            }
            return true;
        }
        catch(e)
        {
            prompt('',e);
            return false;
        }
    }
    
    
    function ShowCalanderFilterClientSearch(ID,controlId,maintainstae)
    {
        strClientID = ID.substring(0,ID.length-controlId.length);
        
        var chkDateObj = document.getElementById(strClientID+'chkDateOfJoining');
        
        var divDateRangeObj = document.getElementById('divShowDateRange');        
        
        var txtDateOfJoiningState = document.getElementById(strClientID+'txtDateOfJoiningState');
        
        var bToggle = false;
        
        if(maintainstae)
        {
            if(txtDateOfJoiningState.value == "1")
            {   
                divDateRangeObj.style.display = 'inline';
                txtDateOfJoiningState.value = "1";
            }
            else
            {
                divDateRangeObj.style.display = 'none';
                txtDateOfJoiningState.value = "0";
            }
        }
        else
        {
            if(chkDateObj.checked)
            {   
                divDateRangeObj.style.display = 'inline';
                txtDateOfJoiningState.value = "1";
            }
            else
            {
                divDateRangeObj.style.display = 'none';
                txtDateOfJoiningState.value = "0";
                document.getElementById(strClientID+'txtFrom').value = '';
                document.getElementById(strClientID+'txtTo').value = '';
            }
        }
        
        fnShowSelectedCountryClientSearch(ID,controlId,true);
    }
    
    
    function fnShowSelectedCountryClientSearch(ID,controlId, bpostback)
    {
        var selItem = '';
        var bShowSel = false;
        strClientID = ID.substring(0,ID.length-controlId.length);
        var ddlCountryObj = document.getElementById(strClientID+'ddlCountry');
        for(var i = 0 ; i < ddlCountryObj.options.length;i++)
        {
            var curCtrOpt = ddlCountryObj.options[i];
            if(curCtrOpt.selected)
            {
                //ddlCountryObj.options[i].focus();
                //alert(i);
                if(selItem == '')
                    selItem = curCtrOpt.text;
                else
                    selItem += ", "+ curCtrOpt.text;
                    
                if(!bShowSel)    
                {
                    if(bpostback)
                        ddlCountryObj.options[i].selected = true;
                    bShowSel = true;
                }
                //break;
            }
        }
        
        if(bShowSel)
        {
            document.getElementById('selItems').innerHTML = "<b>Selected Countries:</b><br/>"+selItem;
            document.getElementById('selItems').style.display = 'inline';
        }
        else
        {
            document.getElementById('selItems').style.display = 'none';
        }
    }
    
    function fnValidateandSearchClientSearch(ID,ControlId)
    { 

        var bIsValid = true;
        try
        { 
          
            strClientID = ID.substring(0,ID.length - ControlId.length);
           
            //check for option selection
            var txtParamObj = document.getElementById(strClientID+'txtParameter');
            
            
            
            var chkCompanyObj = document.getElementById(strClientID+'chkCompany');
            
            var chkDateRangeObj = document.getElementById(strClientID+'chkDateOfJoining');
  
            var chkWebsiteObj = document.getElementById(strClientID+'chkWebsite');
            
            var chkCityObj = document.getElementById(strClientID+'chkCity');
            
            var strMessage="";
             
              if(CheckForHTMLTag(document.getElementById(strClientID +"txtParameter").value))
                {
                    strMessage = '\n----Search Parameter';
                    document.getElementById(strClientID +"txtParameter").style.backgroundColor = "#cad7ec";
                }
               
            
                   if(strMessage != "")
                {
	              
	               strMessage ="The following is invalid:"  + strMessage +"\nPlease enter valid search parameter.";
	          
	                alert(strMessage);
	                return false;
                }
            
            var selCountryObj = document.getElementById(strClientID+'ddlCountry');
            var bCountrySel = false;
            
            for(var i = 0 ; i < selCountryObj.options.length;i++)
            {
                var curCtrOpt = selCountryObj.options[i];
                if(curCtrOpt.selected)
                {
                    bCountrySel = true;
                    break;
                }
            }
            
           
              var strMessage="";
             
              if(CheckForHTMLTag(document.getElementById(strClientID +"txtParameter").value))
                {
                    strMessage = '\n----Search Parameter';
                    document.getElementById(strClientID +"txtParameter").style.backgroundColor = "#cad7ec";
                }
                
                   if(strMessage != "")
                {
	              
	               strMessage ="The following is invalid:"  + strMessage +"\nPlease enter valid search parameter.";
	          
	                alert(strMessage);
	                return false;
                }
           
           
            if(chkCompanyObj.checked 
                || chkDateRangeObj.checked
                || chkWebsiteObj.checked
                || chkCityObj.checked)
            {
                if(trim(txtParamObj.value) == '')
                {
                    txtParamObj.style.backgroundColor = "#cad7ec";
                    alert("Please enter search parameter.");
                    txtParamObj.focus();
                    bIsValid = false;
                    return bIsValid;
                }
            }
            
            /*
            if(!chkCompanyObj.checked 
                && !chkDateRangeObj.checked
                && !chkWebsiteObj.checked
                && !chkCityObj.checked
                && !bCountrySel)
            {
                alert("Please select at least one search option.");
                bIsValid = false;
            }*/
             
            
            
            if(bIsValid)
            {
                //validate date
                var txtdateFromObj = document.getElementById(strClientID+'txtFrom');
                var txtdateToObj = document.getElementById(strClientID+'txtTo');
                if((trim(txtdateFromObj.value) == '' 
                    || trim(txtdateToObj.value) == '')
                    && chkDateRangeObj.checked)
                {
                    txtdateFromObj.style.backgroundColor = "#cad7ec";
                    txtdateToObj.style.backgroundColor = "#cad7ec";
                    alert("Please enter valid date range.");
                    
                    if(trim(txtdateFromObj.value) == '')                        
                    {
                        txtdateFromObj.focus();
                    }
                    else if(trim(txtdateToObj.value) == '')
                    {
                        txtdateToObj.focus();
                    }  
                    bIsValid = false;
                }
                /*else
                {
                    var frmDate = fnParseDateMMddyyyy(trim(txtdateFromObj.value),'/');
                    if(frmDate != null)
                    {
                        var toDate = fnParseDateMMddyyyy(trim(txtdateToObj.value),'/');
                        if(toDate != null)
                        {
                            if(toDate < frmDate)
                            {
                                alert('To date should be greater that from date.');
                                txtdateToObj.style.backgroundColor = "#cad7ec";
                                txtdateToObj.focus();
                                bIsValid = false;
                            }
                        }
                        else
                        {
                            bIsValid = false;
                        }
                    }
                    else
                    {
                        bIsValid = false;
                    }
                }
                */
            }
            return bIsValid;
        }
        catch(e)
        {
            alert(e);
            bIsValid = false;
             
        }
        
        return bIsValid;
    }
    
    
    function fnParseDateMMddyyyy(dateText,dtSep)
    {
        /*var pos1 = dateText.indexOf(dtSep);
	    var pos2 = dateText.indexOf(dtSep,pos1+1);
	    var strMonth = dateText.substring(0,pos1);
	    var strDay = dateText.substring(pos1+1,pos2);
	    var strYear = dateText.substring(pos2+1);
	    
	    var month = parseInt(strMonth);
	    var day = parseInt(strDay);
	    var year = parseInt(strYear);
	    
	    try
	    {
	        var dateObj = new date();
	        dateObj.setFullYear(year,month - 1,day);
	        return dateObj;
	    }
	    catch(e)
	    {
	        alert(e);
	    }
	    
	    return NULL;*/
    }
    
    function ShowDNCComments(chkOnjId, oldValId, divObjid)
    {
    
        var OldVal = document.getElementById(oldValId);
        var divObj = document.getElementById(divObjid);
        var chkObj = document.getElementById(chkOnjId);
        
        var bcheckOld = true;
        if(OldVal.value == "0")
        {
            bcheckOld = false;
        }        
        if(chkObj.checked != bcheckOld)
        {
            divObj.style.display = 'inline';
            
        }
        else
        {
            divObj.style.display = 'none';
        }
    }
    
    function fnValidateConsultationFeedback(ID,ControlId)
    {
        try{       
            strClientID = ID.substring(0,ID.length - ControlId.length);
            strMessage = "";
            
            fnCheckddlvalue(strClientID + "ddlPrefix",document.getElementById(strClientID + "ddlPrefix").selectedIndex,"Prefix","1");
            
            fnCheckInput(strClientID + "txtFirstName",document.getElementById(strClientID + "txtFirstName").value,"alpha","First Name","1");
            fnCheckInput(strClientID + "txtLastName",document.getElementById(strClientID + "txtLastName").value,"alpha","Last Name","1");
            
            fnCheckInput(strClientID + "txt_EmailId",document.getElementById(strClientID + "txt_EmailId").value,"email","Client Email ID","1");
            
            //fnCheckInput(strClientID + "txtClientRecipients",document.getElementById(strClientID + "txtClientRecipients").value,"email","Client Recipients","0");
            
            //check for comma seperated Email Id
            
            if(!CheckEmailIdCommaSep(trim(document.getElementById(strClientID + "txtClientRecipients").value)))
            {
                strMessage = strMessage + "\n----Client Recipients";   
                document.getElementById(strClientID + "txtClientRecipients").style.backgroundColor = "#cad7ec";
            }
            
            
            
            fnCheckInput(strClientID + "txt_rEmailId",document.getElementById(strClientID + "txt_rEmailId").value,"email","Feedback Recipients","1");
            fnCheckInput(strClientID + "txt_rEmailId1",document.getElementById(strClientID + "txt_rEmailId1").value,"email","Feedback Recipients","0");
            fnCheckInput(strClientID + "txt_rEmailId2",document.getElementById(strClientID + "txt_rEmailId2").value,"email","Feedback Recipients","0");
            fnCheckInput(strClientID + "txt_rEmailId3",document.getElementById(strClientID + "txt_rEmailId3").value,"email","Feedback Recipients","0");
            fnCheckInput(strClientID + "txt_rEmailId4",document.getElementById(strClientID + "txt_rEmailId4").value,"email","Feedback Recipients","0");
            /**/
            if(strMessage != "")
            {
                //strMessage ="Incorrect Password.Please correct and try again.";
                strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";
                alert(strMessage);
                return false;
            }
            return true;
            
        }catch(e)
        {
            alert(e);
            return false;
        }
        
        
        
    }
    
    
    function CheckEmailIdCommaSep(emailIdsToCheck)
    {
        var emailIdsToCheckArray = emailIdsToCheck.split(',');
        
        for(var i = 0;i< emailIdsToCheckArray.length;i++)
        {
            var currEmail = trim(emailIdsToCheckArray[i]);
            if(!checkMail(currEmail))
            {
                return false;   
            }
        }
        return true;        
    }
/*
* used to show forms depending on the type of payment selected.
*/  
function ShowAccountType(ID,ControlId)
{

    strClientID = ID.substring(0,ID.length - ControlId.length);
    strMessage = "";
    
    var ddlPaymentTypeObj = document.getElementById(strClientID+'ddlPaymentType');    
    var seltype = ddlPaymentTypeObj.options[ddlPaymentTypeObj.selectedIndex].value;
    
    var divWTObj = document.getElementById('divWireTransfer'); 
    var divCHObj = document.getElementById('divCheque'); 
    var divPPObj = document.getElementById('divPaypal'); 
    var divSave = document.getElementById('divSaveAccount'); 
    
    
    var curExpertCountryId = document.getElementById(strClientID+'txtExpertCountry'); 
    var curExpertCurrencyId  = document.getElementById(strClientID+'txtExpertCurrency'); 
    
    
    
    
    
    
  
   if(seltype == 'Wire_Transfer')
    {
        divWTObj.style.display = 'inline';
        divCHObj.style.display = 'none';
        divPPObj.style.display = 'none';
        divSave.style.display = 'inline';
        
    }    
    else if(seltype == 'Cheque')
    {
        divWTObj.style.display = 'none';
        divCHObj.style.display = 'inline';
        divPPObj.style.display = 'none';
        divSave.style.display = 'inline';
        
        alert('Wire Transfer  and  PayPal are the preferred and faster mode of Payment.')       
        
    }
    else if(seltype == 'Paypal')
    {
        divWTObj.style.display = 'none';
        divCHObj.style.display = 'none';
        divPPObj.style.display = 'inline';
        divSave.style.display = 'inline';
    }    
    else
    {
        divWTObj.style.display = 'none';
        divCHObj.style.display = 'none';
        divPPObj.style.display = 'none';
        divSave.style.display = 'none';
    }
   
}


  function fnValidateandSearchRequestSearch(ID,ControlId)
    { 
   
        var bIsValid = true;
        try
        { 
          
            strClientID = ID.substring(0,ID.length - ControlId.length);
           
            //check for option selection
            var txtParamObj = document.getElementById(strClientID+'txtParameter');
            
            
            
            var chkClientNameObj = document.getElementById(strClientID+'chkClientName');
            
            var chkCaseNumberObj = document.getElementById(strClientID+'chkCaseNumber');
  
            var chkSubjectObj = document.getElementById(strClientID+'chkSubject');
          
            var strMessage="";
             
              if(CheckForHTMLTag(document.getElementById(strClientID +"txtParameter").value))
                {
                    strMessage = '\n----Search Parameter';
                    document.getElementById(strClientID +"txtParameter").style.backgroundColor = "#cad7ec";
                }
                
            
                
                
                   if(strMessage != "")
                {
	              
	               strMessage ="The following is invalid:"  + strMessage +"\nPlease enter valid search parameter.";
	          
	                alert(strMessage);
	                return false;
                }
                
                 
            if(chkClientNameObj.checked 
                || chkCaseNumberObj.checked
                || chkSubjectObj.checked
                                       )
            {
                if(trim(txtParamObj.value) == '')
                {
                    txtParamObj.style.backgroundColor = "#cad7ec";
                    alert("Please enter search parameter.");
                    txtParamObj.focus();
                    bIsValid = false;
                    return bIsValid;
                }
            }
            
            else
            {
            
                   txtParamObj.style.backgroundColor = "#cad7ec";
                    alert("Please select at least one of the search criterion.");
                    txtParamObj.focus();
                    bIsValid = false;
                    return bIsValid;
            }
    
             
            
          
            return bIsValid;
        }
        
        
        
        catch(e)
        {
            alert(e);
            bIsValid = false;
             
        }
        
        return bIsValid;
    }
    
    
    function ShowProspectiveClientPopUp()
{
//a simple: window.location.href='whatever.htm'
//instead of: window.open('whatever.htm','')

  
   
    var width = 900;
    var height = 625;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,scrollbars,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    var urlToRequest = "client/client-details.aspx";  
  //  wlookupWindow = window.open(urlToRequest, "RequestForConsultation" , windowFeatures);   
  window.location.href=urlToRequest;
   // wlookupWindow.focus();
}

function fnCheckProspectiveClientDetails(ID,controlID)
{

    strClientID=ID.substring(0,ID.length-controlID.length);
    strMessage="";   
    fnCheckInput(strClientID + "txtFirstName",document.getElementById(strClientID + "txtFirstName").value,"alpha","First name","1");
    fnCheckInput(strClientID + "txtLastName",document.getElementById(strClientID + "txtLastName").value,"alpha","Last Name","1");
    fnCheckInput(strClientID + "txtEmail",document.getElementById(strClientID + "txtEmail").value,"email","E-mail","1");
    fnCheckInput(strClientID + "txtPhone",document.getElementById(strClientID + "txtPhone").value,"","Phone","1");
    fnCheckInput(strClientID + "txtCompany",document.getElementById(strClientID + "txtCompany").value,"","Company","1");       
   
    
    if(strMessage!="")
       
    {
        strMessage ="The following is invalid or missing:"  + strMessage +"\nPlease correct and try again.";      
        alert(strMessage);
        return false;
    }
    
   
    
      else
            {
                // check for HTML
                if(CheckForHTMLTag(document.getElementById(strClientID +"txtPhone").value))
                {
                    strMessage = '\n----Phone';
                    document.getElementById(strClientID +"txtPhone").style.backgroundColor = "#cad7ec";
                }

                if(CheckForHTMLTag(document.getElementById(strClientID +"txtCompany").value))
                {
                    strMessage += '\n----Company';
                    document.getElementById(strClientID +"txtCompany").style.backgroundColor = "#cad7ec";
                }
                
                 if(CheckForHTMLTag(document.getElementById(strClientID +"txtCompanyAddress").value))
                {
                    strMessage += '\n----Company Address';
                    document.getElementById(strClientID +"txtCompanyAddress").style.backgroundColor = "#cad7ec";
                }
                
                
                
                  if(CheckForHTMLTag(document.getElementById(strClientID +"txtCompanyWebsite").value))
                {
                    strMessage += '\n----Company Website';
                    document.getElementById(strClientID +"txtCompanyWebsite").style.backgroundColor = "#cad7ec";
                }
                
                if(strMessage != "")
                {
                    //strMessage ="Incorrect Password.Please correct and try again.";
                    strMessage ="The following is invalid:"  + strMessage +"\nPlease correct and try again.";
                    alert(strMessage);
                    return false;
                }
            }
            
            return true;
    
}

function openExpertPopUp(strTarget,w, h)
{

    var LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    var TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    
    var params  = 'width='+w;
    params += ', height='+h;
    params += ', top='+TopPosition;
    params += ', left='+LeftPosition;
    //params += ', fullscreen=yes';
    params += ', status=yes';
    //params += ', toolbar=no';
    params += ', menubar=no';
    //params += ', location=no';
    params += ', resizable=yes';
    params += ', scrollbars=yes';

    var newwin = window.open(strTarget,'windowname4', params);
    if (window.focus) 
    {
        newwin.focus()
    }
    return false;
}