///////////////Login Page////////////////////////////////////
/*function ValidateFiledsLogin()
{
	var message='Enter value for the following fields ( * )';
    var num=0;
    var status=true;
	
	if(document.form1.txtusername.value=='')
    {
    
        num=num+1;
        message=message+'\n\t'+num+') User Name';
        document.form1.txtusername.focus();
        status=false;
    }
       
	if(document.form1.txtppassword.value=='')
    {
        num=num+1;
        message=message+'\n\t'+num+') PassWord';
        status=false;
    }
	if (document.form1.ddlusertype.selectedIndex<0 )
    {
        num=num+1;
        message=message+'\n\t'+num+') Login Type';
        document.form1.ddlusertype.focus();
        status=false;
    }
	 if(status==false)
    {
        alert(message);
        return false;
    }
	 if(!echeck(document.form1.txtusername.value))
    {
       
        document.form1.txtEmail.focus();
        return false;
    }
}*/
////////////////////IDb////////
/*function IdbAddNewJobTtle()
{
	var message='';
    var num=0;
    var status=true;
	
	if(document.form1.AddNewJobTtle.value=='')
    {
    
        num=num+1;
        message=message+num+') Add New Job Title';
        document.form1.AddNewJobTtle.focus();
        status=false;
    }
	 if(status==false)
    {
        alert(message);
        return false;
    }
    }
    function IdbCity()
{
	var message='';
    var num=0;
    var status=true;
	
	if(document.form1.AddCity.value=='')
    {
    
        num=num+1;
        message=message+num+') Add City';
        document.form1.AddCity.focus();
        status=false;
    }
	 if(status==false)
    {
        alert(message);
        return false;
    }
    }
    
    
    function Search()
    {
    
	var message='';
    var num=0;
    var status=true;
	
	if(document.form1.txtSearchText.value=='')
    {
    
        num=num+1;
        message=message+num+')Search Input Required';
        document.form1.txtSearchText.focus();
        status=false;
    }
	 if(status==false)
    {
        alert(message);
        return false;
    }
    
    
    }*/
	
//////////////////////////////////////Profile ShowCase//////////////////////////////////////////////////////
function IsNumeric(sText)
{
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   }
  
  function text(sText)
{
   var ValidChars = "a-z, 0-9";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   }
  
  
  function IsNumericDot(sText)
{
   var ValidChars = "0123456789 .";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }

	
function password(sText)
{
  
   var IsNumber=true;
   

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
	  
	   if(sText.length < 6)
			IsNumber = false;
			if(sText.length > 10)
			IsNumber = false;
      Char = sText.charAt(i); 
      if (document.form1.txtPassword.value != document.form1.txtReEnterPassword.value) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
      }




function IsNumericMob(sText)
{
   var ValidChars = "0123456789 - ";
   var IsNumber=true;
   var Char;
 if(sText.length > 8 && 14 > sText.length)
 {
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }
 IsNumber = false;  
}



	
	function CTC()
	{
		if(!IsNumeric(document.form1.txtcurrctc.value))
		{
			alert("Error Current CTC");
			document.form1.txtcurrctc.value="";
			document.form1.txtcurrctc.focus();
			return false;
			
		}
		if(!IsNumeric(document.form1.txtexpectc.value))
		{
			alert("Error Expected CTC");
			document.form1.txtexpectc.value="";
			document.form1.txtexpectc.focus();
			return false;
			
		}
		
	}
	function CTC1()
	{
		if(!IsNumeric(document.form1.txtcurrentCTC.value))
		{
			alert("Error Current CTC");
			document.form1.txtcurrentCTC.value="";
			document.form1.txtcurrentCTC.focus();
			return false;
			
		}
		if(!IsNumeric(document.form1.txtExpectedCTC.value))
		{
			alert("Error Expected CTC");
			document.form1.txtExpectedCTC.value="";
			document.form1.txtExpectedCTC.focus();
			return false;
			
		}
		
	}
	
	
	


function PSEmail()
{
	 if(!echeck(document.form1.txtemailid.value))
    {
       
        document.form1.txtemailid.focus();
		document.form1.txtemailid.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtemailid.style.color = "Black";
	}
}
function PSEmailAlt()
{
	 if(!echeck(document.form1.txtaltemailid.value))
    {
       
        document.form1.txtaltemailid.focus();
		document.form1.txtaltemailid.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtaltemailid.style.color = "Black";
	}
}

function PsNotice()
{
if(!IsNumericPlain(document.form1.txtnoticeperiod.value))
		{
			alert("Notice Period\nOnly Digits Allowed");
			
			document.form1.txtnoticeperiod.focus();
			document.form1.txtnoticeperiod.style.color = "red";
			//document.form1.txtnoticeperiod.style.background  = "red";
			return false;
			
		}
		else
		{
			document.form1.txtnoticeperiod.style.color = "Black";
		}
}

function PSWkexp()
{
if(!IsNumericDot(document.form1.txtServiceTax.value))
		{
			alert("Enter The valid Service Tax");
			
			document.form1.txtServiceTax.focus();
			document.form1.txtServiceTax.style.color = "red";
			//document.form1.txtnoticeperiod.style.background  = "red";
			return false;
			
		}
		else
		{
			document.form1.txtServiceTax.style.color = "Black";
		}
}
function PSMob()
{

 if(!IsNumericMob(document.form1.txtmobilenumber.value))
    {
       alert("Invalid Mobile Number");
        document.form1.txtmobilenumber.focus();
		document.form1.txtmobilenumber.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtmobilenumber.style.color = "black";
	}
}
function PSAltMob()
{

 if(!IsNumericMob(document.form1.txtlandline.value))
    {
       alert("Invalid Landline Number");
        document.form1.txtlandline.focus();
		document.form1.txtlandline.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtlandline.style.color = "black";
	}
}
/////////////////////////Sourcing////////////////////////////////////////////////
 
 function SrcMob()
{

 if(!IsNumericMob(document.form1.txtmobileno.value))
    {
       alert("Invalid Mobile Number");
        document.form1.txtmobileno.focus();
		document.form1.txtmobileno.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtmobileno.style.color = "black";
	}
}
 
  function SrcAltMob()
{

 if(!IsNumericMob(document.form1.txtlandline.value))
    {
       alert("Invalid Mobile Number");
        document.form1.txtlandline.focus();
		document.form1.txtlandline.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtlandline.style.color = "black";
	}
}
 
 
 function SrcEmailAlt()
{
	 if(!echeck(document.form1.txtemailid.value))
    {
       
        document.form1.txtemailid.focus();
		document.form1.txtemailid.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtemailid.style.color = "Black";
	}
}

function SrcEmail()
{
	 if(!echeck(document.form1.txtalteremailid.value))
    {
       
        document.form1.txtalteremailid.focus();
		document.form1.txtalteremailid.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtalteremailid.style.color = "Black";
	}
}
 

function SrcWkexp()
{
if(!IsNumericDot(document.form1.txtworkexperience.value))
		{
			alert("Enter The valid Service Tax");
			
			document.form1.txtworkexperience.focus();
			document.form1.txtworkexperience.style.color = "red";
			//document.form1.txtnoticeperiod.style.background  = "red";
			return false;
			
		}
		else
		{
			document.form1.txtworkexperience.style.color = "Black";
		}
}


function SrcNotice()
{
if(!IsNumericPlain(document.form1.txtnoticeperiod.value))
		{
			alert("Notice Period\nOnly Digits Allowed");
			
			document.form1.txtnoticeperiod.focus();
			document.form1.txtnoticeperiod.style.color = "red";
			//document.form1.txtnoticeperiod.style.background  = "red";
			return false;
			
		}
		else
		{
			document.form1.txtnoticeperiod.style.color = "Black";
		}
}
////////////////////////////////Client And User creation///////////////////////////
   function ext(sText)
{
   var ValidChars = "0123456789/-";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
   {
	  Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
	
    }
 return IsNumber;

}
   
  
  
   function IsNumericMobCAU(sText)
{
   var ValidChars = "0123456789/-";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
   {
	    if(sText.length < 10)
			IsNumber = false;
			if(sText.length > 14)
			IsNumber = false;
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
	
    }
 return IsNumber;

}
   
   
   
   
   
function board(sText)
{
   var ValidChars = "0123456789/-";
   var IsNumber=true;
   var Char;

 if(sText.length < 7 && sText.length > 14)
 {
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
		
      }
   return IsNumber;
 }
 
 IsNumber = false;
   }   
   
   function minmaxpas()
{
if(!minmaxpass(document.form1.txtPassword.value))
		{
			alert("Password Limit Should be 6 to 10 Characters");
			
			document.form1.txtPassword.focus();
			document.form1.txtPassword.style.color = "red";
			//document.form1.txtnoticeperiod.style.background  = "red";
			return false;
			
		}
		else
		{
			document.form1.txtPassword.style.color = "Black";
		}
}

function minmaxpass(sText)
{
  
   var IsNumber=true;
   

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
	  
	   if(sText.length < 6)
			IsNumber = false;
			if(sText.length > 10)
			IsNumber = false;
      }
   return IsNumber;
      }
	
	

   
   
   function IsNumericMobCA(sText)
{
   var ValidChars = "0123456789/-";
   var IsNumber=true;
   var Char;


  		 for (i = 0; i < sText.length && IsNumber == true; i++) 
     	 { 
		 if(sText.length < 10)
			IsNumber = false;
			if(sText.length > 12)
			IsNumber = false;
     		 Char = sText.charAt(i); 
      		  if (ValidChars.indexOf(Char) == -1) 
       		  {
         			IsNumber = false;
       		  }
	 	 }

		   return IsNumber;
  	 
}
 

function ExtraCharacters(sText)

{
	 var ValidChars = 'a-z';
  	 var Char;
	 
if(sText.length == '')
 {
   for (i = 0; i < sText.length; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         return false;
         }
      }
   return true;
 }
 
 return false;
	
}


function Extra()
{

 if(!ExtraCharacters(document.form1.txtusername.value))
    {
       alert("Enter The Value");
        document.form1.txtusername.focus();
		document.form1.txtusername.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtusername.style.color = "black";
	}
}
function Extra1()
{

 if(!ExtraCharacters(document.form1.txtAccountHoldersName.value))
    {
       alert("Enter The Value");
        document.form1.txtAccountHoldersName.focus();
		document.form1.txtAccountHoldersName.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtAccountHoldersName.style.color = "black";
	}
}
function Extra2()
{

 if(!ExtraCharacters(document.form1.txtBankName.value))
    {
       alert("Enter The Value");
        document.form1.txtBankName.focus();
		document.form1.txtBankName.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtBankName.style.color = "black";
	}
}
function Extra3()
{

 if(!ExtraCharacters(document.form1.txtBranch.value))
    {
       alert("Enter The Value");
        document.form1.txtBranch.focus();
		document.form1.txtBranch.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtBranch.style.color = "black";
	}
}
function Extra4()
{

 if(!ExtraCharacters(document.form1.txtCity.value))
    {
       alert("Enter The Value");
        document.form1.txtCity.focus();
		document.form1.txtCity.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtCity.style.color = "black";
	}
}

function Extra4()
{

 if(!ExtraCharacters(document.form1.txtChequeNumber.value))
    {
       alert("Enter The Value");
        document.form1.txtChequeNumber.focus();
		document.form1.txtChequeNumber.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtChequeNumber.style.color = "black";
	}
}

function CUCMob11()
{

 if(!IsNumericMobCAU(document.form1.txtCP2ContactNumber.value))
    {
       alert("Invalid Number");
        document.form1.txtCP2ContactNumber.focus();
		document.form1.txtCP2ContactNumber.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtCP2ContactNumber.style.color = "black";
	}
}

function CUCMob13()
{

 if(!IsNumericMobCAU(document.form1.txtCP3ContactNumber.value))
    {
       alert("Invalid Number");
        document.form1.txtCP3ContactNumber.focus();
		document.form1.txtCP3ContactNumber.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtCP3ContactNumber.style.color = "black";
	}
}



function CUCMob1()
{

 if(!IsNumericMobCAU(document.form1.txtPhoneNumberBoard.value))
    {
       alert("Invalid Number");
        document.form1.txtPhoneNumberBoard.focus();
		document.form1.txtPhoneNumberBoard.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtPhoneNumberBoard.style.color = "black";
	}
}

function CUCMob2()
{

 if(!IsNumericMobCAU(document.form1.txtFaxNumber.value))
    {
       alert("Invalid Number");
        document.form1.txtFaxNumber.focus();
		document.form1.txtFaxNumber.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtFaxNumber.style.color = "black";
	}
}
function CUCMob3()
{

 if(!IsNumericMobCAU(document.form1.txtPhoneNumberLandLine.value))
    {
       alert("Invalid Number");
        document.form1.txtPhoneNumberLandLine.focus();
		document.form1.txtPhoneNumberLandLine.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtPhoneNumberLandLine.style.color = "black";
	}
}
function CUCMob4()
{

 if(!ext(document.form1.txtPhoneNumberExten.value))
    {
       alert("Invalid Number");
        document.form1.txtPhoneNumberExten.focus();
		document.form1.txtPhoneNumberExten.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtPhoneNumberExten.style.color = "black";
	}
}
function CUCMob5()
{

 if(!IsNumericMobCA(document.form1.txtPhoneNumberMobile.value))
    {
       alert("Invalid Number");
        document.form1.txtPhoneNumberMobile.focus();
		document.form1.txtPhoneNumberMobile.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtPhoneNumberMobile.style.color = "black";
	}
}




function CUCMob51()
{

 if(!IsNumericMobCA(document.form1.txtClientphnumber.value))
    {
       alert("Invalid Number");
        document.form1.txtClientphnumber.focus();
		document.form1.txtClientphnumber.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtClientphnumber.style.color = "black";
	}
}


function CUCMob52()
{

 if(!IsNumericMobCA(document.form1.txtCP1ContactNumber.value))
    {
       alert("Invalid Number");
        document.form1.txtCP1ContactNumber.focus();
		document.form1.txtCP1ContactNumber.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtCP1ContactNumber.style.color = "black";
	}
}

function CUCMob104()
{

 if(!IsNumericMobCAU(document.form1.txtMobileNumber.value))
    {
       alert("Invalid Number");
        document.form1.txtMobileNumber.focus();
		document.form1.txtMobileNumber.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtMobileNumber.style.color = "black";
	}
}

function CUCMob101()
{

 if(!IsNumericMobCAU(document.form1.txtContactNumber.value))
    {
       alert("Invalid Number");
        document.form1.txtContactNumber.focus();
		document.form1.txtContactNumber.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtContactNumber.style.color = "black";
	}
}

function CUCMob102()
{

 if(!IsNumericMobCAU(document.form1.txtFax.value))
    {
       alert("Invalid Number");
        document.form1.txtFax.focus();
		document.form1.txtFax.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtFax.style.color = "black";
	}
}
function CUCMob103()
{

 if(!IsNumericMobCAU(document.form1.txtExten.value))
    {
       alert("Invalid Number");
        document.form1.txtExten.focus();
		document.form1.txtExten.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtExten.style.color = "black";
	}
}
function CUCMob6()
{

 if(!IsNumericDot(document.form1.txtServiceTax.value))
    {
       alert("Invalid Service Tax");
        document.form1.txtServiceTax.focus();
		document.form1.txtServiceTax.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtServiceTax.style.color = "black";
	}
}


function txtUserName()
{
	 if(!echeck(document.form1.txtUserName.value))
    {
       
        document.form1.txtUserName.focus();
		document.form1.txtUserName.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtUserName.style.color = "Black";
	}
}
function CAUEmail()
{
	 if(!echeck(document.form1.txtEmailId.value))
    {
       
        document.form1.txtEmailId.focus();
		document.form1.txtEmailId.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtEmailId.style.color = "Black";
	}
}
function CAUEmail3()
{
	 if(!echeckuser(document.form1.txtUsernameEmailId.value))
    {
       
        document.form1.txtUsernameEmailId.focus();
		document.form1.txtUsernameEmailId.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtUsernameEmailId.style.color = "Black";
	}
}

function CAUEmail4()
{	if(document.form1.txtEmail.value=='')
	{
		return true;
	}
	 if(!echeck(document.form1.txtEmail.value))
    {
       
        document.form1.txtEmail.focus();
		document.form1.txtEmail.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtEmail.style.color = "Black";
	}
}
 
 function CAUEmail11()
{
	 if(!echeck(document.form1.txtCP1EmailID.value))
    {
       
        document.form1.txtCP1EmailID.focus();
		document.form1.txtCP1EmailID.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtCP1EmailID.style.color = "Black";
	}
}
 
  function CAUEmail13()
{
	 if(!echeck(document.form1.txtCP3EmailID.value))
    {
       
        document.form1.txtCP3EmailID.focus();
		document.form1.txtCP3EmailID.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtCP3EmailID.style.color = "Black";
	}
}
 
 
  function CAUEmail12()
{
	 if(!echeck(document.form1.txtCP2EmailID.value))
    {
       
        document.form1.txtCP2EmailID.focus();
		document.form1.txtCP2EmailID.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtCP2EmailID.style.color = "Black";
	}
}
 
 ///////////// shaortname////
 function charse()
{
	
	 if(!charset(document.form1.txtConsultantShortName.value))
    {
       
        document.form1.txtConsultantShortName.focus();
		document.form1.txtConsultantShortName.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtConsultantShortName.style.color = "Black";
	}
}

 function charse1()
{
	
	 if(!charset(document.form1.txtConsultantShortName.value))
    {
       
        document.form1.txtConsultantShortName.focus();
		document.form1.txtConsultantShortName.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtConsultantShortName.style.color = "Black";
	}
}


function chars()
{
	
	 if(!charset(document.form1.txtShortName.value))
    {
       
        document.form1.txtShortName.focus();
		document.form1.txtShortName.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtShortName.style.color = "Black";
	}
}
function char()
{
	
	 if(!charset(document.form1.txtJobTitleShortName.value))
    {
       
        document.form1.txtJobTitleShortName.focus();
		document.form1.txtJobTitleShortName.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtJobTitleShortName.style.color = "Black";
	}
}
 
//////////////******Internal DB================*************////

function IDBEmail()
{
	 if(!echeck(document.form1.txtEmailID.value))
    {
       
        document.form1.txtEmailID.focus();
		document.form1.txtEmailID.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtEmailID.style.color = "Black";
	}
}
function IDBEmail2()
{
	 if(!echeck(document.form1.txtAltMailID.value))
    {
       
        document.form1.txtAltMailID.focus();
		document.form1.txtAltMailID.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtAltMailID.style.color = "Black";
	}
}
function IDBEmail3()
{
	 if(!echeck(document.form1.txtsearchemailid.value))
    {
       
        document.form1.txtsearchemailid.focus();
		document.form1.txtsearchemailid.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtsearchemailid.style.color = "Black";
	}
}


function IDBMob()
{

 if(!IsNumericMobCAU(document.form1.txtMobileNumber.value))
    {
		   alert("Invalid Mobile Number");
        document.form1.txtMobileNumber.focus();
		document.form1.txtMobileNumber.style.color = "red";
        return false;
    }
	else
	{
		document.form1.txtMobileNumber.style.color = "black";
	}
}


function CTCIDB()
	{
		if(!IsNumeric(document.form1.txtCurrentCTC.value))
		{
			alert("Error Current CTC");
			document.form1.txtCurrentCTC.value="";
			document.form1.txtCurrentCTC.focus();
			return false;
			
		}
		if(!IsNumeric(document.form1.txtExpectedCTC.value))
		{
			alert("Error Expected CTC");
			document.form1.txtExpectedCTC.value="";
			document.form1.txtExpectedCTC.focus();
			return false;
			
		}
		
	}
		
		function IDBNotice()
{
if(!IsNumericPlain(document.form1.txtNoticePeriod.value))
		{
			alert("Notice Period\nOnly Digits Allowed");
			
			document.form1.txtNoticePeriod.focus();
			document.form1.txtNoticePeriod.style.color = "red";
			//document.form1.txtnoticeperiod.style.background  = "red";
			return false;
			
		}
		else
		{
			document.form1.txtNoticePeriod.style.color = "Black";
		}
}

function CAUEmail31()
{
	 if(!echeckuser(document.form1.txtUserNameEmailId.value))
    {
       
        document.form1.txtUserNameEmailId.focus();
		document.form1.txtUserNameEmailId.style.color = "red";
		//document.form1.txtemailid.style..background  = "red";

        return false;
    }
	else
	{
		document.form1.txtUserNameEmailId.style.color = "Black";
	}
}

function pass()
{
if(!password(document.form1.txtReEnterPassword.value))
		{
			alert("ReEnter Correct Password");
			
			document.form1.txtReEnterPassword.focus();
			document.form1.txtReEnterPassword.style.color = "red";
			//document.form1.txtnoticeperiod.style.background  = "red";
			return false;
			
		}
		else
		{
			document.form1.txtReEnterPassword.style.color = "Black";
		}
}


function IDBWkexp()
{
if(!IsNumericDot(document.form1.txtWorkExperience.value))
		{
			alert("Enter The valid Service Tax");
			
			document.form1.txtWorkExperience.focus();
			document.form1.txtWorkExperience.style.color = "red";
			//document.form1.txtnoticeperiod.style.background  = "red";
			return false;
			
		}
		else
		{
			document.form1.txtWorkExperience.style.color = "Black";
		}
}

function Test()
{
var str=document.form1.txtkeywords.value;
	Trm=str.replace(/\s/g, "");

	Upper=Trm.toUpperCase();
	//alert(Upper);
	if((Upper.indexOf('"AND"')>-1) && (Upper.indexOf('"OR"')>-1))
	{
	alert("\nInvalid Search Query\n'AND' 'OR' Combination Not Allowed ");
	document.form1.txtkeywords.focus();
	document.form1.txtkeywords.style.color = "red";
	return false;
	}
	if(Upper.indexOf(",")>-1)
	{
	alert("\n Avoid Coma\nComa Is Not Allowed In Search Query");
	document.form1.txtkeywords.focus();
	document.form1.txtkeywords.style.color = "red";
	return false;
	}

	//if(Upper.indexOf("AND")>-1);
	//document.write(str.indexOf("OR"));
	//alert("Test");
	
	//}
	//else
	//{
	else{	//alert("FALSE");
	document.form1.txtkeywords.style.color = "Black";
	return true;
	}
	}

function Search()
{
	if(document.form1.txtcandcomany.value==''&& document.form1.txtsearchemailid.value==''&&document.form1.txtSearchDOb.value==''&&document.form1.ddljobswithclient.selectedIndex == 0 && document.form1.ddlcity.selectedIndex == 0 && document.form1.ddlfrominr.selectedIndex == 0 && document.form1.ddleXPFRM.selectedIndex == 0 &&document.form1.txtkeywords.value =='')
	{
		alert("Please Select or Enter Search Criteria");
		return false;
	}
	return true;
}

function ChkboxUN()
{
	 
	if(document.form1.R5[1].checked) 
	{
		
		document.form1.ddljobswithclient.disabled=true;		
	}
}
function ChkboxBth()
{
	 
	if(document.form1.R5[2].checked) 
	{
		
		document.form1.ddljobswithclient.disabled=true;		
	}
}
function ChkboxScr()
{
	 
	if(document.form1.R5[0].checked) 
	{
		
		document.form1.ddljobswithclient.disabled=false;		
	}
}
///////////////////////Status Update/////////////////////////////////

/*function ValidateFiledsStatusUpdateExport()
{
    var message=' Following fields Required';
    var num=0;
    var status=true;
    if  (document.form1.ddlExistingClients.selectedIndex == 0 )
    {
        num=num+1;
        message=message+'\n\t'+num+') Existing Clients';
        status=false;
    }
    if  (document.form1.ddlExistingJobTitles.selectedIndex == 0 )
    {
        num=num+1;
        message=message+'\n\t'+num+') Existing Job Titles';
        status=false;
    }
    if(status==false)
    {
        alert(message);
        return false;
    }
}

*/
/*function ValidateFiledsStatusUpdateAdd()
{
    var message=' Following fields Required';
    var num=0;
    var status=true;
    if  (document.form1.ddlProfilesList.selectedIndex == 0 )
    {
        num=num+1;
        message=message+'\n\t'+num+') File Name';
        status=false;
    }
    if  (document.form1.ddlClientSending.selectedIndex == 0 )
    {
        num=num+1;
        message=message+'\n\t'+num+') Action';
        status=false;
    }
    if  (document.form1.ddlAdminUpdatedStatus.selectedIndex == 0 )
    {
        num=num+1;
        message=message+'\n\t'+num+') Status';
        status=false;
    }
    if(status==false)
    {
        alert(message);
        return false;
    }
}*/
///////////////Sourcing////////////////////
/*function Sourcing()
{
    var message='Following fields Required';
    var num=0;
    var status=true;


 if(document.form1.txtcandname.value=='')
    {
        num=num+1;
        message=message+'\n\t'+num+') Candidate Name';
        status=false;
    }
    if(document.form1.txtcandfullname.value=='')
    {
        num=num+1;
        message=message+'\n\t'+num+') Candidate Full Name';
        status=false;
    }
    if(document.form1.fuprawprofile.value=='')
    {
        num=num+1;
        message=message+'\n\t'+num+') Uplaod Profile Raw';
        status=false;
    }
    
    
    
    
    
    if(status==false)
    {
        alert(message);
        return false;
    }
   

}*/

////////////////Client User Creation//////////////

/*function NewClientCreation()
{
    var message='Following fields Required';
    var num=0;
    var status=true;
    
    if(document.form1.txtClientName.value=='')
    {
        num=num+1;
        message=message+'\n\t'+num+') Client Name';
        status=false;
    }
    if(document.form1.txtPostalAdress.value=='')
    {
        num=num+1;
        message=message+'\n\t'+num+') Postal Address';
        status=false;
    }
    if(document.form1.txtClientphnumber.value=='')
    {
        num=num+1;
        message=message+'\n\t'+num+') Contact Number';
        status=false;
    }
    if(document.form1.txtJobTitle.value=='')
    {
        num=num+1;
        message=message+'\n\t'+num+') Job Title';
        status=false;
    }
     if(document.form1.txtPosition.value=='')
    {
        num=num+1;
        message=message+'\n\t'+num+') Position';
        status=false;
    }
     if(document.form1.FTBJobDescription.value=='')
    {
        num=num+1;
        message=message+'\n\t'+num+')Job Description';
        status=false;
    }
     if(document.form1.txtJobClosingDate.value=='')
    {
        num=num+1;
        message=message+'\n\t'+num+')Job Closing Date';
        status=false;
    }
     if(document.form1.txtAccountManagersName.value=='')
    {
        num=num+1;
        message=message+'\n\t'+num+')Account Manager Name';
        status=false;
    }
     if(document.form1.txtJobOpeningDate.value=='')
    {
        num=num+1;
        message=message+'\n\t'+num+')Job Opening Date';
        status=false;
        
    }
     if(status==false)
    {
        alert(message);
        return false;
    }
    if(!MobileNumber(document.form1.txtClientphnumber.value))
    {
       
        document.form1.txtClientphnumber.focus();
        return false;
    }
   
    

}

function NewTrackerCreation()
{
    var message='Following fields Required';
    var num=0;
    var status=true;
    
    if(document.form1.txtUserName.value=='')
    {
        num=num+1;
        message=message+'\n\t'+num+') User Name';
        status=false;
    }
    if(document.form1.txtUserEmailID.value=='')
    {
        num=num+1;
        message=message+'\n\t'+num+') Email ID';
        status=false;
    }
    if(document.form1.txtPassword.value=='')
    {
        num=num+1;
        message=message+'\n\t'+num+') Password';
        status=false;
    }
     if(document.form1.txtDateOfJoining.value=='')
    {
        num=num+1;
        message=message+'\n\t'+num+') Date Of Joining';
        status=false;
    }
     if(document.form1.txtDesignation.value=='')
    {
        num=num+1;
        message=message+'\n\t'+num+') Designation';
        status=false;
    }
   
     if(status==false)
    {
        alert(message);
        return false;
    }
   if(!CheckSelection('chUserRoles',"Select Atleast One from Role")==true)
    {
      return false;
    }
    if(!CheckSelection('dgjobtitle',"Select Atleast One from Job Associated with")==true)
    {
      return false;
    }
    
    
    
    
}


*/

 //////////E amil Check/////////
function echeck(str)
{       
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if(str=='')
		return true;
		if (str.indexOf(at)==-1){
		   alert("Invalid Email")
		   return false
		}
        
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid Email")
		   return false
		}
        
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid Email")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid Email")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid Email")
		    return false
		 }  
            
		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid Email")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid Email")
		    return false
		 }
		 
 		 return true					
	}
	/////////username/////////
	
	function echeckuser(str)
{       
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if(str=='')
		return true;
		if (str.indexOf(at)==-1){
		   alert("Invalid User Name")
		   return false
		}
        
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid User Name")
		   return false
		}
        
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid User Name")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid User Name")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid User Name")
		    return false
		 }  
            
		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid User Name")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid User Name")
		    return false
		 }
		 
 		 return true					
	}
	//////////shortname//////
	
	function charset(str)
{   

	var at=""
		var dot=""
		
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if(str=='')
		return true;
		
		 if (str.indexOf(" ")!=-1)
		 {
		    alert("Enter Valid Shortname")
		    return false
		 }
		 
 		 return true					
	}
	
	
	//////// end short name /////////
	
	
function MobileNumber(str)
 {
	 if(isNaN(str))
		  {
			  alert("Invalid Phone Number");
			  return false;
		  }
	
	  if(str.length<8 ||str.length>14)
		  {
			  alert("Invalid Phone Number");
			  return false;
		  }
		  else
		  {
			  return true;
		  }
		 
	/*if(str=='')
	return true;
	  if(str.length<10 ||str.length>15)
		  {
			  alert("Invalid Phone Number");
			  return false
		  }
		  return true*/
		  
 }

/////////////////

function CheckSelection(str,Alerttxt)
{
var checked = 0;
for(i=0;i<document.form1.elements.length;i++)
{
 if(document.form1.elements[i].name.indexOf(str)>-1)
 {
    if(document.form1.elements[i].checked == true)
    {
             var checked = 1;
    }
 }
}
if(checked == 0)
{
           alert(Alerttxt);
           return false;
}
return true;
}


function test(str)
{
 if(document.form1.chUserRoles.checked.value="4")
 {
    /*for(i=0;i<document.form1.str.length;i++)
   {
  // if(document.form1.elements[i].name.indexOf(str)>-1)
    //{
   document.form1.elements[0].checked == true
   document.form1.elements[1].checked == true
   document.form1.elements[2].checked == true
   }*/
   for(i=0;i<document.form1.elements[i].checked;i++)
   {
   document.form1.chUserRoles.
   alert("Test");
   }
 }



/*//var checked = 0;
for(i=0;i<document.form1.elements.length;i++)
{
 if(document.form1.elements[i].name.indexOf(str)>-1)
 {
    if(document.form1.elements[i].checked == true)
    {
             var checked = 1;
    }
 }
}
if(checked == 0)
{
           alert(Alerttxt);
           return false;
}
return true;*/
}




/*function CheckSelection()
{
var checked = 0;
for(i=0;i<document.form1.elements.length;i++)
{
 if(document.form1.elements[i].name.indexOf("chUserRoles")>-1)
 {
    if(document.form1.elements[document.form1.elements.length].checked == true)
    {
            for(i=0;i<document.form1.elements.length;i++)
             {
             
             document.form1.elements[i].checked=true;
             }
    }
 }
}
}

*/
function Select(Select)
{    
    /*  for (var n=0; n < document.form1.chUserRoles.length; n++) 
    
    if (document.form1.chUserRoles.elements[n].value=5)       
     document.form1.chUserRoles.elements[n].checked=Select;  
         return false;*/
         if(document.form1.getelementbyid("chUserRoles").elements[4].value=5) 
         alert("ok");   
         
  }
  
 
 
  function Showfulldata(divid,divid1,divid2,divid3)
   {
     
   	document.getElementById(divid).style.display = 'Block';
	document .getElementById(divid1).style.display = 'none';
	document .getElementById(divid2).style.display = 'Block';
	document .getElementById(divid3).style.display = 'Block';
		   
   }
    function OnlyProfile(divid,divid1,divid2,divid3)
   {
     
   	document.getElementById(divid).style.display = 'Block';
	document .getElementById(divid1).style.display = 'none';
	document .getElementById(divid2).style.display = 'Block';
	document .getElementById(divid3).style.display = 'none';
		   
   }
 
  function Excel(divid,divid1,divid2,divid3)
   {
     
   	document.getElementById(divid).style.display = 'none';
	document .getElementById(divid1).style.display = 'Block';
	document .getElementById(divid2).style.display = 'none';
	document .getElementById(divid3).style.display = 'none';
		   
   }
   
   
 function doClear(theText) 
{
     if (theText.value == theText.defaultValue)
 {
         theText.value = ""
     }
 }
 /****************************************DateMonth************************/
var dtCh= "-";
var minYear=1900;
var maxYear=2100;

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strDay=dtStr.substring(0,pos1)
	var strMonth=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : DD-MM-YYYY")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid year")
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}

function ValidateForm(str){
	var dt=str;
	if(dt.value=='')
	return true;
	
	if (isDate(dt.value)==false){
		str.style.color = "red";
		dt.focus()
		return false
	}
	str.style.color = "Black";
    return true
	
 }
/*****************************Manage Announcement*****************************************/




/*var flag=0;
var chkList1= document.getElementById ("ChbxExecutiveList");
var arrayOfCheckBoxes= chkList1.getElementsByTagName("input");
for(counter = 0; counter<arrayOfCheckBoxes.length; counter++)
{
if (arrayOfCheckBoxes[counter].checked)
{
flag=1;
}
else
{
alert("not checked");
return false;
}
}
if(flag==1)
{
alert('checked');
return true;
}
}
*/



function spadaddedit()
{
	if(document.form1.ddlCity.selectedIndex == 0 || document.form1.ddlCity.selectedIndex == 1 || document.form1.ddlCity.selectedIndex == 14 || document.form1.ddlCity.selectedIndex == 29 || document.form1.ddlCity.selectedIndex == 32 || document.form1.ddlCity.selectedIndex == 36 || document.form1.ddlCity.selectedIndex == 40 || document.form1.ddlCity.selectedIndex == 44 || document.form1.ddlCity.selectedIndex == 48 || document.form1.ddlCity.selectedIndex == 65 || document.form1.ddlCity.selectedIndex == 76 || document.form1.ddlCity.selectedIndex == 82 || document.form1.ddlCity.selectedIndex == 86 || document.form1.ddlCity.selectedIndex == 92 || document.form1.ddlCity.selectedIndex == 104 || document.form1.ddlCity.selectedIndex == 117 || document.form1.ddlCity.selectedIndex == 124 || document.form1.ddlCity.selectedIndex == 136 || document.form1.ddlCity.selectedIndex == 139 || document.form1.ddlCity.selectedIndex == 142 ||document.form1.ddlCity.selectedIndex == 144 || document.form1.ddlCity.selectedIndex == 147 || document.form1.ddlCity.selectedIndex == 154 || document.form1.ddlCity.selectedIndex == 164 || document.form1.ddlCity.selectedIndex == 172 || document.form1.ddlCity.selectedIndex == 175 || document.form1.ddlCity.selectedIndex == 191 || document.form1.ddlCity.selectedIndex == 194 || document.form1.ddlCity.selectedIndex == 201 || document.form1.ddlCity.selectedIndex == 217 || document.form1.ddlCity.selectedIndex == 221 || document.form1.ddlCity.selectedIndex == 229 )
	{
		alert("Select Correct City");
				
			document.form1.ddlCity.focus();
			document.form1.ddlCity.style.color = "Black";
			//document.form1.txtnoticeperiod.style.background  = "red";
			return false;
		
	}
	else
		{	
			return true;
			document.form1.ddlCity.style.color = "Black";
		}
}






function topic()
{
	if(document.form1.txtTopic.value=='')
	{
		alert("Please Enter The Topic *");
	document.form1.txtTopic.focus();
	return false;

	}
	if(document.form1.txtSenderName.value=='')
	{
		alert(" Please Enter Sender Name *");
	document.form1.txtSenderName.focus();
	return false;

	}
	/*var chkList1= document.getElementById ("ChbxExecutiveList");
	var arrayOfCheckBoxes= chkList1.getElementsByTagName("input");
	for(var i=0;i<arrayOfCheckBoxes.length;i++)
	{
	if(arrayOfCheckBoxes[i].checked)
	{
	return false;
	}
	else
	{
	alert("Atleast Select one From Annoncement To");
	return false;
	}
	}

	return false;*/
}




/*function CheckSelection()
        {
          var tblObj=document.getElementById("ChbxExecutiveList");
          var chkObjlst= document.getElementById('ChbxExecutiveList').getElementsByTagName("INPUT");
          var selectedCount;
          selectedCount=0;
        
             for(var i=0;i<chkObjlst.length;i++)
             {
               if(chkObjlst[i].type=="checkbox")
               {
                  if(chkObjlst[i].checked)   
                     selectedCount++;
               }
             }
             
           if( !(selectedCount>0))
           {
             alert('Atleast Select A Person To Send Mail');
			
             return false;
           }
          if(document.form1.txtTopic.value=='')
			{
			alert("Please Enter The Topic *");
			document.form1.txtTopic.focus();
			return false;

			}
			if(document.form1.txtSenderName.value=='')
			{
			alert(" Please Enter Sender Name *");
			document.form1.txtSenderName.focus();
			return false;

			}
          else
		  {
			  alert("Message Send Successfully");
			  return true;
		  }
        }
*/




/////////////////////////////////****************UPDATE PASSWORD**************************///////////////////////////////
function updatepass(str)
{
	if (str.value=='')
	{
		alert("Please Enter the Password");
		return false;
	}
	else
	
	return true;
	
}








