// Validating email Address
displayErrMsg=false;
displayErrMsgP2=false;

function validateEmail(Obj){
	var str=Obj.value
	var testresults=false;
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	
	if (filter.test(str))
	{
		testresults=true;
		displayErrMsg=false;
	}
	else{
		if (str!=null && str!=""){
			alert("Invalid Email Id!");
			Obj.focus();
			testresults=false;
			displayErrMsg=true;
		}
		else
			displayErrMsg=false;
	}
	return (testresults);
}

/*
function validateEmail(Obj,popupFlag){
  var email=Obj.value;
  var flag=false;
  if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))	 {
		falg = true;
	 }
	else{
		if(Obj.value=="" || Obj.value==null)
		{
	//		if(popupFlag)
	//		{
				alert("Email ID must be Empty!");
				Obj.focus();
				falg = false;
//			}
		}
		else
		{
		  alert("Invalid E-mail Address!");
		  Obj.focus();
		  falg = false;
		}
    }
   return flag;
}

*/
// Validate no of Selected leaders


// to this pass the value as 'this.name_of_the_select_box '
function CheckSelected(thisselect)
{

   var Counter = 0;
  // alert(thisselect.length);

   for (i=0; i<thisselect.length; i++)
   {

      if (document.MyForm.Months[i].selected == true)
      {
         Counter++;
      }
   }

   if (Counter == 0)
   {
      alert("You have to select atleast one name!");
      return false;
   }

}



// validate the project id

// to this pass the value as 'name_of_the_form.name_of_the_text_box '

function checkNumber(obj)
{
     num1=obj.value;
     if ((num1=="") || isNaN(num1))
      {
        alert("Enter the Valid Number!");
        obj.focus();
        return false;
      }
 }


// validate mobileNo
// to this pass the value as 'document.MyForm.name1.value'

function validateMobileNo(obj)
{
     mobileno=obj.value;
     if((mobileno=="") || (mobileno.length==10))
     {
       return(true);
     }
     else
     {
      alert("Enter the Valid Mobile No!");
      obj.focus();
      return false;
     }
}




// Validate phoneno  ( xxxx-xxxxx )
// to this pass the value as 'document.MyForm.name1.value'

function validatePhoneNo(obj)
{
     phoneno=obj.value;
     var splitvalues = phoneno.split("-");
     if((phoneno.lastIndexOf('-')!=phoneno.indexOf('-'))||phoneno.indexOf('-')==-1 || phoneno.indexOf('-')== 1 || phoneno.indexOf('-')== 2 || phoneno.indexOf('-')== 3 || phoneno.length< 9 ||(isNaN(splitvalues[0])) || (isNaN(splitvalues[1])) || (splitvalues[0].length<2 ) || (splitvalues[1].length > 9 ) )
       {
             alert("Enter the Valid Phone No \n eg. STD-PHNo!");
             obj.focus();
       }
 }




//////////////////////  updated by: vaibahv Deshpande /////////////////
function uppercase(e,obj,spechar)
{
	var str =obj.value;
	var at=str.length;
	var rFlag=true;
	var key;
	if (e.keyCode) key = e.keyCode;
	else if (e.which) key = e.which;
	var keychar = String.fromCharCode(key);

	if ((key > 0x60) && (key < 0x7B))
	{
		if(!isNetscap())
		{
			window.event.keyCode = key-0x20;
		}
	}
	else if (((key > 0x40) && (key < 0x5B)) || ((spechar.indexOf(keychar))!=-1))
	{

			if(!isNetscap()){
				window.event.keyCode = key;
			}
			else
				rFlag=true;
	}
	else
	{
		if(!isNetscap())
		{
			window.event.keyCode=null;
		}
		else
		{
			rFlag = false;
		}

		//sFlag=false;
		//sFlagCnt=0;
	}

	if(isNetscap())
		{
			if(key==0 || key==8 || key==9 || key==37 || key==39 || key==46)
			{
				rFlag=true;
			}
		}
		else
			 rFlag = true;

		return rFlag;
 }

function capitalisedAll(e,obj)
{	 
	var rFlag=true;

	if (e.keyCode) key = e.keyCode;
	else if (e.which) key = e.which;

  // key = window.event.keyCode;
	if ((key > 0x60) && (key < 0x7B))
	{
		 if(!isNetscap())
		{
			 window.event.keyCode = key-0x20;
		}
		
	}
	else if (((key > 0x40) && (key < 0x5B)) || ((key > 0x2E) && (key < 0x3B)) || (key==0x2D))
	{
		if(! isNetscap())
		{
			window.event.keyCode = key
		}
	}
	else 
	{
		if(! isNetscap())
		{
			window.event.keyCode=null;
		}
		else 
		{
			rFlag=false;
		}
	}

	if(isNetscap()){
			if(key==0 || key==8  || key==9 || key==37 || key==39 || key==46)
			{
				rFlag=true;
			}
		}
		else
			 rFlag = true;

	return rFlag;
}

/*	function capitalisedFirstLetter(obj,numbers,spechar)
	{
		var str =obj.value;
		var at=str.length;
		var key = window.event.keyCode;
		var keychar = String.fromCharCode(key);
		var flag=false;
		alert (""+at);
		if (numbers)
		{
			if (((key < 0x3A) && (key > 0x2F)) || ((spechar.indexOf(keychar))!=-1) || ((key > 0x60) && (key < 0x7B)) || ((key > 0x40) && (key < 0x5B)) || (key==0x20))
				flag=true;
		}
		else
		{
			if (spechar!="")
			{
				if ((spechar.indexOf(keychar)!=-1) || ((key > 0x60) && (key < 0x7B)) || ((key > 0x40) && (key < 0x5B)))
				flag=true;
			}
			else
				flag=true;
		}
		  if (flag)
		  	window.event.keyCode = key;
		  else
			window.event.keyCode = null;
		 
		if(at == 1)
		{
			newStr = str.replace(str.charAt(0),(str.charAt(0).toUpperCase()))
			obj.value = newStr
		}
   }
*/	
var sFlag=false;
var sFlagCnt=0;

	function capitalisedFirstLetter(e,obj,numbers,spechar)
	{
		var str =obj.value;
		var at=str.length;
		var key;
		var rFlag=true;
		var name=obj.name;
		
		if (e.keyCode) key = e.keyCode;
		else if (e.which) key = e.which;

		//var key = window.event.keyCode;
		var keychar = String.fromCharCode(key);
		var flag = false;
		//alert (""+at);
 
		if (numbers)
		{
			if (((key < 0x3A) && (key > 0x2F)) || ((spechar.indexOf(keychar))!=-1) || ((key > 0x60) && (key < 0x7B)) || ((key > 0x40) && (key < 0x5B)) || (key==0x20))
			{
				flag=true;
			}
			else
			{
				rFlag=false;
			}
		}
		else
		{
			if (spechar!="")
			{
				if ((spechar.indexOf(keychar)!=-1) || ((key > 0x60) && (key < 0x7B)) || ((key > 0x40) && (key < 0x5B)))
				{
					//alert("true");
					flag=true;
				}
				else
				{
					//alert("false");
					rFlag=false;
				}
			}
			else
				flag=true;
		}
		
		if (flag)
		{

			if(!isNetscap())
			{
				window.event.keyCode = key;
			}
			else
				rFlag=true;
		/*
			// To restrict consiqutive spaces
			if(key==0x20)
			{
				sFlagCnt++;
				if(sFlagCnt==2)
				{
					sFlag=true;
					sFlagCnt=0;
				}
			}
			else
			{

				sFlag=false;
				sFlagCnt=0;
			}

				if (sFlag)
				{
					
					if(!isNetscap())
					{
						window.event.keyCode = null;
					}
					else
						rFlag=false;

				}
				//else
				//{
				//	window.event.keyCode = key;
				//}
		*/
		}
		else
		{
	
			if(! isNetscap())
			{
				window.event.keyCode = null;
			}
			else
				rFlag=false;

		//	sFlag=false;
		//	sFlagCnt=0;

		}
		// To Capitalize first Character
		/*if((at == 1) && (name!="uname"))
		{
			newStr = str.replace(str.charAt(0),(str.charAt(0).toUpperCase()))
			obj.value = newStr
		}*/
		
		if(isNetscap())
		{
			if(key==0 || key==8 || key==9 || key==37 || key==39 || key==46)
			{
				rFlag=true;
			}
		}
		else
			 rFlag = true;

		return rFlag;

   }


	function disableValues(obj)
	{	
		var key = window.event.keyCode;
		window.event.keyCode = null;
		return false;
	}



	 function chkAllEntered(parent,child,val1,val2)
	 {
		var len1=document.forms[0].length;
		var flag=false;
		var boolRvalue=false;
		if (document.getElementById("jdescription")!=null){
			setTxtObjValue("jdescription",encodeStr(frames["iframejdescription"].document.body.innerHTML));
		}
		if (child=="Cancel" ){
			if (isAllEmpty()){
				submitMe2(parent,child,val1,val2);
			}
			else
			{
					if(confirm("Are you sure you want to Discard the Changes you made?")){
					submitMe2(parent,child,val1,val2);
				}
			}
			
		}
		else
		 {
			if (isAllValuePresent()){
				if(confirmMsgVal(child)){
					if (parent=="Edit Job"){
						var hidValCountry=document.getElementById("jcountry").value;
						submitMe2(parent,child,hidValCountry,val2);
					}
					else if(isValidKey(document.getElementById("jcode"),'pk_list')){
						submitMe2(parent,child,val1,val2);
					}
				}
			}
		 }
	 }

	function setDescObjTxt(strObjTxtValue){
		getElementById("jdescription").value=strObjTxtValue;
	 }
	 function getDescObjTxt(){
		return getElementById("jdescription").value;
	 }


	function capitalfirst(obj)
	{
		var str=obj.value;
		var charval=str.charAt(0);
		if (( charval < "A" ) || (charval > "Z"))
		{
			newStr = str.replace(str.charAt(0),(str.charAt(0).toUpperCase()))
			obj.value = newStr
		}
		removeSpace(obj);
		return true;
	}

	
	function Trim(TRIM_VALUE)
	{
		if(TRIM_VALUE.length < 1){
		return"";
		}
		TRIM_VALUE = RTrim(TRIM_VALUE);
		TRIM_VALUE = LTrim(TRIM_VALUE);
		if(TRIM_VALUE==""){
		return "";
		}
		else{
		return TRIM_VALUE;
		}
	} //End Function

	function RTrim(VALUE)
	{
		var w_space = String.fromCharCode(32);
		var v_length = VALUE.length;
		var strTemp = "";
		if(v_length < 0){
		return"";
		}
		var iTemp = v_length -1;

		while(iTemp > -1){
		if(VALUE.charAt(iTemp) == w_space){
		}
		else{
		strTemp = VALUE.substring(0,iTemp +1);
		break;
		}
		iTemp = iTemp-1;

		} //End While
		return strTemp;

	} //End Function

	function LTrim(VALUE)
	{
			var w_space = String.fromCharCode(32);
			if(v_length < 1){
			return"";
			}
			var v_length = VALUE.length;
			var strTemp = "";

			var iTemp = 0;

			while(iTemp < v_length){
			if(VALUE.charAt(iTemp) == w_space){
			}
			else{
			strTemp = VALUE.substring(iTemp,v_length);
			break;
			}
			iTemp = iTemp + 1;
			} //End While
			return strTemp;
	} //End Function

	function Sel_checkboxes(obj)
	{

		/* var len1=document.forms[0].length;
		 var status=obj.checked
		for (var i=0; i<len1;i++ )
		{
			if (document.forms[0].elements[i].type == "checkbox")
			{
				if(status)
				document.forms[0].elements[i].checked=true;
				else
				document.forms[0].elements[i].checked=false;
			}
		}*/
		var len1=document.forms[0].length;
		var objValue=obj.value;
		var status=obj.checked;
		if (objValue=="All")
			flag=true;
		else
			flag=false;
		
		if (flag)
		{
			for (var i=0; i<len1;i++ )
			{
				if (document.forms[0].elements[i].type == "checkbox")
				{
					if(status)
					document.forms[0].elements[i].checked=true;
					else
					document.forms[0].elements[i].checked=false;
				}
			}
		}
		else
		{
			for (var i=0; i<len1;i++)
			{
				if (document.forms[0].elements[i].type == "checkbox")
				{
					if(document.forms[0].elements[i].value == "All")
					{
						allstatus=document.forms[0].elements[i].checked;
						if (!status)
						{	
							if (allstatus)
							{
								document.forms[0].elements[i].checked=false;
							}
						}
					}
			
				}
			}

		}
	}

	function validatePassword(txtObj1,txtObj2,popupFlag)
	{
		if(document.getElementById(txtObj1).value=="" && document.getElementById(txtObj2).value=="")
		{
			if(popupFlag)
			{
				alert("Password can not be Empty!");
				document.getElementById(txtObj1).focus()
				return false;
			}
		}
		else if(document.getElementById(txtObj1).value != document.getElementById(txtObj2).value)
		{
			//if(!displayErrMsg)
			//{
				//alert('a');
				if(!(document.getElementById(txtObj2).value=="") && !displayErrMsgP2)
				{
					alert("Password Mismatch!");
					document.getElementById(txtObj2).value=""
					document.getElementById(txtObj2).focus()
					return false;
				}
				else if(popupFlag)
				{
					alert("Password Mismatch!");
					document.getElementById(txtObj2).value=""
					document.getElementById(txtObj2).focus()
					return false;
				}
		//	}

		}
		else
		{
			return true;
		}
	}

	function chkNumCharacters(obj1)
	{
		var flag=false;
		//alert(obj.value.length+"==="+displayErrMsg);
//		alert("DisplayMsg:  "+displayErrMsg);
		if(!displayErrMsg)
		{
//			alert("Not displayErrMsg:  "+!displayErrMsg);	
			if (obj1.value!="")
			if((obj1.value.length) < 4)
			{
				alert('Minimum 4 characters required !');
				displayErrMsgP2=true;
				flag=true;		
				obj1.focus();
			}
			else
				displayErrMsgP2=false;
			
				
		}
	//	alert("Flag:  "+flag);
	//	alert("DisplayMsg:  "+displayErrMsg);
		return flag;
	}

/*

		function validatePassword(txtObj1,txtObj2,popupFlag)
	{	
		//var chkCharFalg=true;

		if(document.getElementById(txtObj1).value=="" && document.getElementById(txtObj2).value=="")
				{
					if(popupFlag)
					{
						alert("Password can not be Empty!");
						document.getElementById(txtObj1).focus()
						return false;
					}
				}
				else if(document.getElementById(txtObj1).value != document.getElementById(txtObj2).value)
				{
					if(!(document.getElementById(txtObj2).value==""))
					{
							alert("Password Mismatch!");
							document.getElementById(txtObj2).value=""
							document.getElementById(txtObj2).focus()
							return false;
					}
					else if(popupFlag)
					{
						alert("Password Mismatch!");
						document.getElementById(txtObj2).value=""
						document.getElementById(txtObj2).focus()
							return false;
					}
										

				}
				else
				{
					return true;
				}

	}*/
	//for Same JobCode for edit user
	var currUserName="";
	function chkAllDataEntered(cmd1,cmd2,cmd3){
		 var boolFlag=false;
			if ((cmd2=="Update") || (cmd2=="Add")){
				if (isAllValuePresent())
				{
					if (isAnyDiffBetOldAndNewValues())
					{
						if(confirm("Are you sure you want to "+cmd2+" User?"))
						{
							boolFlag=true;
						}
					}
					else
						boolFlag=false;
				}
			}
			else{
				if (isAnyDiffBetOldAndNewValues())
				{
						
					if(confirm("Are you sure you want to Discard the Changes you made?"))
					{
							boolFlag=true;
					}					
				}
				else
				{
					//boolFlag=false;
	     				boolFlag=true;

				}
			}

			if (boolFlag){
				submitOfficialDome(cmd1,cmd2,cmd3);
			}
		return boolFlag;
     }
/*
 function chkAllDataEntered(cmd1,cmd2,cmd3)
	 {
		var len1=document.forms[0].length;
		var a=new Array('User ID','Password','ReType-Password','Name','Email-ID','User Type');
		var intCnt=0;
		var flag=false;
		
		for (var i=0; i<len1;i++ )
		{
			if ((document.forms[0].elements[i].type != "hidden" ) && (document.forms[0].elements[i].type != "reset" )&&( document.forms[0].elements[i].type != "button")&&( document.forms[0].elements[i].type != "select-one"))
			{
				 if ((Trim(document.forms[0].elements[i].value)=="") && !(document.forms[0].elements[i].type=="password"))
				 {
					 alert("Please enter values in "+a[(intCnt)]);
					 flag=true;
					 document.forms[0].elements[i].focus();
					 break;
				 }
				 
				 if((document.forms[0].elements[i].name=="uname") && (currUserName != document.forms[0].elements[i].value) && !(isValidKey(document.forms[0].elements[i],'pk_list'))){
					flag=true;
					break;
				}

				 if (document.forms[0].elements[i].name=="email")
				 {
					 if(!validateEmail(document.forms[0].elements[i],true))
					 {
						 flag=true;
						 document.forms[0].elements[i].focus();
						 break;
					 }
				 }

				 if (document.forms[0].elements[i].type=="password")
				 {
					 if(document.forms[0].elements[i].name=="password1" || document.forms[0].elements[i].name=="password2")
					 {
						if(!validatePassword("password1","password2",true))
						 {
							 flag=true;
							 break;
						 }
					 }
				 }
				 var dFlag;
				 if (!(document.forms[0].elements[i].type=="password"))
				 {
					dFlag=removeSpace(document.forms[0].elements[i]);
				 }	

				if(!dFlag)
				{
					 flag=true;
					 document.forms[0].elements[i].focus();
					 break;
				}

				if (!(document.forms[0].elements[i].type=="password"))
				 {
					document.forms[0].elements[i].value = Trim(document.forms[0].elements[i].value);
				 }	

				 
				 intCnt++;
			}
			else
			{
				if ((document.forms[0].elements[i].type) == "select-one")
				{
					if ((document.forms[0].elements[i].value)=="Select")
					{
						alert ("Please Select Valid UserType");
						flag=true;
					}
				}
			}
		}

		if (!flag)
		{
			submitOfficialDome(cmd1,cmd2,cmd3);
		}

     }
*/
function restrict(e,obj,intValue)
{
	if (e.keyCode) key = e.keyCode;
		else if (e.which) key = e.which;

	if(key==0 || key==8 || key==9 || key==37 || key==39 || key==46)
	{
		return true;
	}

	if (obj.value.length>intValue)
	{
		alert("Max 255 Character's Allowed!")
		return false;		
	}
}


/*********************************************************************/
/* Author : Kishor                                                   */
/* Date : 11/08/2005                                                 */
/* Featur : Remove spaces from object value                          */
/*********************************************************************/

function removeSpace(obj)
{	
		var txtValue=obj.value;
		var rFlag=true;
		var txtTmp = txtValue.charAt(0);
		var txtLength = txtValue.length;

		for(intCnt=1;intCnt<txtValue.length;intCnt++){
			var chrFirst=txtValue.charAt(intCnt);
			if(!((chrFirst==txtTmp.charAt(txtTmp.length-1)) && (chrFirst==" "))){
				txtTmp = txtTmp + chrFirst;
			}
		}
		
		obj.value = txtTmp;
		/*
		txtValue=txtTmp.toLowerCase();
		txtTmp=txtValue.charAt(0);
		for(intCnt=1;intCnt<txtValue.length;intCnt++)
		{
			var chrFirst=txtValue.charAt(intCnt);
			var chrSecond=txtValue.charAt(intCnt+1);
			if((chrFirst==txtTmp.charAt(txtTmp.length-1)) && (chrSecond==txtTmp.charAt(txtTmp.length-1)))
			{
				//alert("Unkown words!");
				//obj.select();
				rFlag=false;
				break;
			}
			txtTmp = txtTmp + chrFirst;
		}
		*/
		return rFlag;
	}


/*********************************************************************/
/* Author : Kishor                                                   */
/* Date : 11/18/2005                                                 */
/* Featur : Return status of value                                   */
/*********************************************************************/

function checkIsPresent(strValue,lstObjectName){	
	var cnt,intListLength,Obj,boolStatus;

	Obj=document.getElementById(lstObjectName);
	intListLength=Obj.options.length;
	boolStatus=false;
	
	for(cnt=0;cnt<intListLength;cnt++){
		if (Obj.options[cnt].value==strValue){
			boolStatus=true;
			break;
		}
	}
	return boolStatus;
}

/*********************************************************************/
/* Author : Kishor                                                   */
/* Date : 11/18/2005                                                 */
/* Featur : Check if key is duplicate or not                         */
/*********************************************************************/

function isValidKey(Obj,lstObjectName){	
	var flag;
	flag=true;
//	alert("vaibhav");
	if (checkIsPresent(Obj.value,lstObjectName))
	{
		var strMsg="";
		if (Obj.name=="jcode"){
			strMsg="Job Code Already Present! Please Update New Job Code!";
		}
		else if (Obj.name=="uname"){
			strMsg="User-Id Already Present! Please Enter New User-Id!";
		}	
		
		alert(strMsg);

		flag=false;
		Obj.value="";
		Obj.focus();
	}
		return flag;
}


function isValidEid(Obj,lstObjectName,previousid){	
	if (checkIsPresent(Obj.value,lstObjectName)){	
		if (Obj.value!=previousid){
			if (Obj.name=="LoginName")
			{
				msg="Email-Id Already Present ! Please update new Email-ID !";
				displayErrMsg=true;
			}
			else
			{
				msg="User-Id Already Present ! Please update new User-ID !";
				displayErrMsg=false;
			}
			alert(msg);
			Obj.value=previousid;
			Obj.focus();
		}
	}
	
}

/*********************************************************************/
/* Author : Kishor                                                   */
/* Date : 11/18/2005                                                 */
/* Featur : Return status of value                                   */
/*********************************************************************/

function selectValue(strValue,lstObjectName){	
	var cnt,intLength,Obj,boolStatus;

	Obj=document.getElementById(lstObjectName)
	intListLength=Obj.options.length
	boolStatus=false;
	
	for(cnt=0;cnt<intListLength;cnt++){
		if (Obj.options[cnt].value==strValue){
			Obj.options[cnt].selected = true;
			boolStatus=true;
			break;
		}
	}
	return boolStatus;
}


/*********************************************************************/
/* Author : Kishor                                                   */
/* Date : 11/18/2005                                                 */
/* Featur : Generate drop down with selected or default value        */
/*********************************************************************/

function generateCountry(lstObjectName,strClassName,strSelectedValue,strEvent){

	var country="";
	if (strClassName==null  && strClassName!=""){
		strClassName="";
	}
	if (strEvent!=null){
		country = country + "<SELECT NAME='"+lstObjectName+"' ID='"+lstObjectName+"' CLASS='"+strClassName+"' onFocus='setFocusForNetScap();'>";
	}
	else{
		country = country + "<SELECT NAME='"+lstObjectName+"' ID='"+lstObjectName+"' CLASS='"+strClassName+"' >";
	}
	
	if (strSelectedValue!=null && strSelectedValue!=""){
		country = country + "<OPTION VALUE='Select'>&minus;&minus; Select &minus;&minus;</OPTION>";
	}
	else{

		country = country + "<OPTION VALUE='Select' SELECTED>&minus;&minus; Select &minus;&minus;</OPTION>";
	}

	country = country + "<OPTION VALUE='AFGHANISTAN'>AFGHANISTAN</OPTION>";
	country = country + "<OPTION VALUE='ALBANIA'>ALBANIA</OPTION>";
	country = country + "<OPTION VALUE='ALGERIA'>ALGERIA</OPTION>";
	country = country + "<OPTION VALUE='AMERICAN SAMOA'>AMERICAN SAMOA</OPTION>";
	country = country + "<OPTION VALUE='ANDORRA'>ANDORRA</OPTION>";
	country = country + "<OPTION VALUE='ANGOLA'>ANGOLA</OPTION>";
	country = country + "<OPTION VALUE='ANGUILLA'>ANGUILLA</OPTION>";
	country = country + "<OPTION VALUE='ANTARCTICA'>ANTARCTICA</OPTION>";
	country = country + "<OPTION VALUE='ANTIGUA & BARBUDA'>ANTIGUA & BARBUDA</OPTION>";
	country = country + "<OPTION VALUE='ARGENTINA'>ARGENTINA</OPTION>";
	country = country + "<OPTION VALUE='ARMENIA'>ARMENIA</OPTION>";
	country = country + "<OPTION VALUE='ARUBA'>ARUBA</OPTION>";
	country = country + "<OPTION VALUE='AUSTRALIA'>AUSTRALIA</OPTION>";
	country = country + "<OPTION VALUE='AUSTRIA'>AUSTRIA</OPTION>";
	country = country + "<OPTION VALUE='AZERBAIJAN'>AZERBAIJAN</OPTION>";
	country = country + "<OPTION VALUE='BAHAMAS'>BAHAMAS</OPTION>";
	country = country + "<OPTION VALUE='BAHRAIN'>BAHRAIN</OPTION>";
	country = country + "<OPTION VALUE='BANGLADESH'>BANGLADESH</OPTION>";
	country = country + "<OPTION VALUE='BARBADOS'>BARBADOS</OPTION>";
	country = country + "<OPTION VALUE='BELARUS'>BELARUS</OPTION>";
	country = country + "<OPTION VALUE='BELGIUM'>BELGIUM</OPTION>";
	country = country + "<OPTION VALUE='BELIZE'>BELIZE</OPTION>";
	country = country + "<OPTION VALUE='BENIN'>BENIN</OPTION>";
	country = country + "<OPTION VALUE='BERMUDA'>BERMUDA</OPTION>";
	country = country + "<OPTION VALUE='BHUTAN'>BHUTAN</OPTION>";
	country = country + "<OPTION VALUE='BOLIVIA'>BOLIVIA</OPTION>";
	country = country + "<OPTION VALUE='BOSNIA & HERZEGOWINA'>BOSNIA & HERZEGOWINA</OPTION>";
	country = country + "<OPTION VALUE='BOTSWANA'>BOTSWANA</OPTION>";
	country = country + "<OPTION VALUE='BOUVET ISLAND'>BOUVET ISLAND</OPTION>";
	country = country + "<OPTION VALUE='BRAZIL'>BRAZIL</OPTION>";
	country = country + "<OPTION VALUE='BRITISH INDIAN OCEAN TERR'>BRITISH INDIAN OCEAN TERR</OPTION>";
	country = country + "<OPTION VALUE='BRUNEI DARUSSALAM'>BRUNEI DARUSSALAM</OPTION>";
	country = country + "<OPTION VALUE='BULGARIA'>BULGARIA</OPTION>";
	country = country + "<OPTION VALUE='BURKINA FASO'>BURKINA FASO</OPTION>";
	country = country + "<OPTION VALUE='BURUNDI'>BURUNDI</OPTION>";
	country = country + "<OPTION VALUE='CAMBODIA'>CAMBODIA</OPTION>";
	country = country + "<OPTION VALUE='CAMEROON'>CAMEROON</OPTION>";
	country = country + "<OPTION VALUE='CANADA'>CANADA</OPTION>";
	country = country + "<OPTION VALUE='CAPE VERDE'>CAPE VERDE</OPTION>";
	country = country + "<OPTION VALUE='CAYMAN ISLANDS'>CAYMAN ISLANDS</OPTION>";
	country = country + "<OPTION VALUE='CENTRAL AFRICAN REP'>CENTRAL AFRICAN REP</OPTION>";
	country = country + "<OPTION VALUE='CHAD'>CHAD</OPTION>";
	country = country + "<OPTION VALUE='CHILE'>CHILE</OPTION>";
	country = country + "<OPTION VALUE='CHINA'>CHINA</OPTION>";
	country = country + "<OPTION VALUE='CHRISTMAS ISLAND'>CHRISTMAS ISLAND</OPTION>";
	country = country + "<OPTION VALUE='COCOS (KEELING) ISLES'>COCOS (KEELING) ISLES</OPTION>";
	country = country + "<OPTION VALUE='COLOMBIA'>COLOMBIA</OPTION>";
	country = country + "<OPTION VALUE='COMOROS'>COMOROS</OPTION>";
	country = country + "<OPTION VALUE='CONGO'>CONGO</OPTION>";
	country = country + "<OPTION VALUE='CONGO, THE DEMOCRATIC REP'>CONGO, THE DEMOCRATIC REP</OPTION>";
	country = country + "<OPTION VALUE='COOK ISLANDS'>COOK ISLANDS</OPTION>";
	country = country + "<OPTION VALUE='COSTA RICA'>COSTA RICA</OPTION>";
	country = country + "<OPTION VALUE='COTE D'IVOIRE'>COTE D'IVOIRE</OPTION>";
	country = country + "<OPTION VALUE='CROATIA (HRVATSKA)'>CROATIA (HRVATSKA)</OPTION>";
	country = country + "<OPTION VALUE='CUBA'>CUBA</OPTION>";
	country = country + "<OPTION VALUE='CYPRUS'>CYPRUS</OPTION>";
	country = country + "<OPTION VALUE='CZECH REPUBLIC'>CZECH REPUBLIC</OPTION>";
	country = country + "<OPTION VALUE='DENMARK'>DENMARK</OPTION>";
	country = country + "<OPTION VALUE='DJIBOUTI'>DJIBOUTI</OPTION>";
	country = country + "<OPTION VALUE='DOMINICA'>DOMINICA</OPTION>";
	country = country + "<OPTION VALUE='DOMINICAN REPUBLIC'>DOMINICAN REPUBLIC</OPTION>";
	country = country + "<OPTION VALUE='EAST TIMOR'>EAST TIMOR</OPTION>";
	country = country + "<OPTION VALUE='ECUADOR'>ECUADOR</OPTION>";
	country = country + "<OPTION VALUE='EGYPT'>EGYPT</OPTION>";
	country = country + "<OPTION VALUE='EL SALVADOR'>EL SALVADOR</OPTION>";
	country = country + "<OPTION VALUE='EQUATORIAL GUINEA'>EQUATORIAL GUINEA</OPTION>";
	country = country + "<OPTION VALUE='ERITREA'>ERITREA</OPTION>";
	country = country + "<OPTION VALUE='ESTONIA'>ESTONIA</OPTION>";
	country = country + "<OPTION VALUE='ETHIOPIA'>ETHIOPIA</OPTION>";
	country = country + "<OPTION VALUE='FALKLAND ISLANDS (MALVINAS)'>FALKLAND ISLANDS (MALVINAS)</OPTION>";
	country = country + "<OPTION VALUE='FAROE ISLANDS'>FAROE ISLANDS</OPTION>";
	country = country + "<OPTION VALUE='FIJI'>FIJI</OPTION>";
	country = country + "<OPTION VALUE='FINLAND'>FINLAND</OPTION>";
	country = country + "<OPTION VALUE='FRANCE'>FRANCE</OPTION>";
	country = country + "<OPTION VALUE='FRENCH GUIANA'>FRENCH GUIANA</OPTION>";
	country = country + "<OPTION VALUE='FRENCH POLYNESIA'>FRENCH POLYNESIA</OPTION>";
	country = country + "<OPTION VALUE='FRENCH SOUTHERN TERR.'>FRENCH SOUTHERN TERR.</OPTION>";
	country = country + "<OPTION VALUE='GABON'>GABON</OPTION>";
	country = country + "<OPTION VALUE='GAMBIA'>GAMBIA</OPTION>";
	country = country + "<OPTION VALUE='GEORGIA'>GEORGIA</OPTION>";
	country = country + "<OPTION VALUE='GERMANY'>GERMANY</OPTION>";
	country = country + "<OPTION VALUE='GHANA'>GHANA</OPTION>";
	country = country + "<OPTION VALUE='GIBRALTAR'>GIBRALTAR</OPTION>";
	country = country + "<OPTION VALUE='GREECE'>GREECE</OPTION>";
	country = country + "<OPTION VALUE='GREENLAND'>GREENLAND</OPTION>";
	country = country + "<OPTION VALUE='GRENADA'>GRENADA</OPTION>";
	country = country + "<OPTION VALUE='GUADELOUPE'>GUADELOUPE</OPTION>";
	country = country + "<OPTION VALUE='GUAM'>GUAM</OPTION>";
	country = country + "<OPTION VALUE='GUATEMALA'>GUATEMALA</OPTION>";
	country = country + "<OPTION VALUE='GUINEA'>GUINEA</OPTION>";
	country = country + "<OPTION VALUE='GUINEA-BISSAU'>GUINEA-BISSAU</OPTION>";
	country = country + "<OPTION VALUE='GUYANA'>GUYANA</OPTION>";
	country = country + "<OPTION VALUE='HAITI'>HAITI</OPTION>";
	country = country + "<OPTION VALUE='HEARD AND MC DONALD ISLES'>HEARD AND MC DONALD ISLES</OPTION>";
	country = country + "<OPTION VALUE='HOLY SEE (VATICAN)'>HOLY SEE (VATICAN)</OPTION>";
	country = country + "<OPTION VALUE='HONDURAS'>HONDURAS</OPTION>";
	country = country + "<OPTION VALUE='HONG KONG'>HONG KONG</OPTION>";
	country = country + "<OPTION VALUE='HUNGARY'>HUNGARY</OPTION>";
	country = country + "<OPTION VALUE='ICELAND'>ICELAND</OPTION>";
	country = country + "<OPTION VALUE='INDIA'>INDIA</OPTION>";
	country = country + "<OPTION VALUE='INDONESIA'>INDONESIA</OPTION>";
	country = country + "<OPTION VALUE='IRAN (ISLAMIC REP)'>IRAN (ISLAMIC REP)</OPTION>";
	country = country + "<OPTION VALUE='IRAQ'>IRAQ</OPTION>";
	country = country + "<OPTION VALUE='IRELAND'>IRELAND</OPTION>";
	country = country + "<OPTION VALUE='ISRAEL'>ISRAEL</OPTION>";
	country = country + "<OPTION VALUE='ITALY'>ITALY</OPTION>";
	country = country + "<OPTION VALUE='JAMAICA'>JAMAICA</OPTION>";
	country = country + "<OPTION VALUE='JAPAN'>JAPAN</OPTION>";
	country = country + "<OPTION VALUE='JORDAN'>JORDAN</OPTION>";
	country = country + "<OPTION VALUE='KAZAKHSTAN'>KAZAKHSTAN</OPTION>";
	country = country + "<OPTION VALUE='KENYA'>KENYA</OPTION>";
	country = country + "<OPTION VALUE='KIRIBATI'>KIRIBATI</OPTION>";
	country = country + "<OPTION VALUE='KOREA, DEM PEOPLE'S REP'>KOREA, DEM PEOPLE'S REP</OPTION>";
	country = country + "<OPTION VALUE='KOREA, REPUBLIC OF'>KOREA, REPUBLIC OF</OPTION>";
	country = country + "<OPTION VALUE='KUWAIT'>KUWAIT</OPTION>";
	country = country + "<OPTION VALUE='KYRGYZSTAN'>KYRGYZSTAN</OPTION>";
	country = country + "<OPTION VALUE='LAO PEOPLE'S DEM REP'>LAO PEOPLE'S DEM REP</OPTION>";
	country = country + "<OPTION VALUE='LATVIA'>LATVIA</OPTION>";
	country = country + "<OPTION VALUE='LEBANON'>LEBANON</OPTION>";
	country = country + "<OPTION VALUE='LESOTHO'>LESOTHO</OPTION>";
	country = country + "<OPTION VALUE='LIBERIA'>LIBERIA</OPTION>";
	country = country + "<OPTION VALUE='LIBYAN ARAB JAMAHIRIYA'>LIBYAN ARAB JAMAHIRIYA</OPTION>";
	country = country + "<OPTION VALUE='LIECHTENSTEIN'>LIECHTENSTEIN</OPTION>";
	country = country + "<OPTION VALUE='LITHUANIA'>LITHUANIA</OPTION>";
	country = country + "<OPTION VALUE='LUXEMBOURG'>LUXEMBOURG</OPTION>";
	country = country + "<OPTION VALUE='MACAU'>MACAU</OPTION>";
	country = country + "<OPTION VALUE='MACEDONIA, FORMER YUGOSLAV'>MACEDONIA, FORMER YUGOSLAV</OPTION>";
	country = country + "<OPTION VALUE='MADAGASCAR'>MADAGASCAR</OPTION>";
	country = country + "<OPTION VALUE='MALAWI'>MALAWI</OPTION>";
	country = country + "<OPTION VALUE='MALAYSIA'>MALAYSIA</OPTION>";
	country = country + "<OPTION VALUE='MALDIVES'>MALDIVES</OPTION>";
	country = country + "<OPTION VALUE='MALI'>MALI</OPTION>";
	country = country + "<OPTION VALUE='MALTA'>MALTA</OPTION>";
	country = country + "<OPTION VALUE='MARSHALL ISLANDS'>MARSHALL ISLANDS</OPTION>";
	country = country + "<OPTION VALUE='MARTINIQUE'>MARTINIQUE</OPTION>";
	country = country + "<OPTION VALUE='MAURITANIA'>MAURITANIA</OPTION>";
	country = country + "<OPTION VALUE='MAURITIUS'>MAURITIUS</OPTION>";
	country = country + "<OPTION VALUE='MAYOTTE'>MAYOTTE</OPTION>";
	country = country + "<OPTION VALUE='MEXICO'>MEXICO</OPTION>";
	country = country + "<OPTION VALUE='MICRONESIA, FED STATES'>MICRONESIA, FED STATES</OPTION>";
	country = country + "<OPTION VALUE='MOLDOVA, REP'>MOLDOVA, REP</OPTION>";
	country = country + "<OPTION VALUE='MONACO'>MONACO</OPTION>";
	country = country + "<OPTION VALUE='MONGOLIA'>MONGOLIA</OPTION>";
	country = country + "<OPTION VALUE='MONTSERRAT'>MONTSERRAT</OPTION>";
	country = country + "<OPTION VALUE='MOROCCO'>MOROCCO</OPTION>";
	country = country + "<OPTION VALUE='MOZAMBIQUE'>MOZAMBIQUE</OPTION>";
	country = country + "<OPTION VALUE='MYANMAR'>MYANMAR</OPTION>";
	country = country + "<OPTION VALUE='NAMIBIA'>NAMIBIA</OPTION>";
	country = country + "<OPTION VALUE='NAURU'>NAURU</OPTION>";
	country = country + "<OPTION VALUE='NEPAL'>NEPAL</OPTION>";
	country = country + "<OPTION VALUE='NETHERLANDS'>NETHERLANDS</OPTION>";
	country = country + "<OPTION VALUE='NETHERLANDS ANTILLES'>NETHERLANDS ANTILLES</OPTION>";
	country = country + "<OPTION VALUE='NEW CALEDONIA'>NEW CALEDONIA</OPTION>";
	country = country + "<OPTION VALUE='NEW ZEALAND'>NEW ZEALAND</OPTION>";
	country = country + "<OPTION VALUE='NICARAGUA'>NICARAGUA</OPTION>";
	country = country + "<OPTION VALUE='NIGER'>NIGER</OPTION>";
	country = country + "<OPTION VALUE='NIGERIA'>NIGERIA</OPTION>";
	country = country + "<OPTION VALUE='NIUE'>NIUE</OPTION>";
	country = country + "<OPTION VALUE='NORFOLK ISLAND'>NORFOLK ISLAND</OPTION>";
	country = country + "<OPTION VALUE='NORTHERN MARIANA ISLES'>NORTHERN MARIANA ISLES</OPTION>";
	country = country + "<OPTION VALUE='NORWAY'>NORWAY</OPTION>";
	country = country + "<OPTION VALUE='OMAN'>OMAN</OPTION>";
	country = country + "<OPTION VALUE='PAKISTAN'>PAKISTAN</OPTION>";
	country = country + "<OPTION VALUE='PALAU'>PALAU</OPTION>";
	country = country + "<OPTION VALUE='PALESTINIAN TERRITORY'>PALESTINIAN TERRITORY</OPTION>";
	country = country + "<OPTION VALUE='PANAMA'>PANAMA</OPTION>";
	country = country + "<OPTION VALUE='PAPUA NEW GUINEA'>PAPUA NEW GUINEA</OPTION>";
	country = country + "<OPTION VALUE='PARAGUAY'>PARAGUAY</OPTION>";
	country = country + "<OPTION VALUE='PERU'>PERU</OPTION>";
	country = country + "<OPTION VALUE='PHILIPPINES'>PHILIPPINES</OPTION>";
	country = country + "<OPTION VALUE='PITCAIRN'>PITCAIRN</OPTION>";
	country = country + "<OPTION VALUE='POLAND'>POLAND</OPTION>";
	country = country + "<OPTION VALUE='PORTUGAL'>PORTUGAL</OPTION>";
	country = country + "<OPTION VALUE='PUERTO RICO'>PUERTO RICO</OPTION>";
	country = country + "<OPTION VALUE='QATAR'>QATAR</OPTION>";
	country = country + "<OPTION VALUE='REUNION'>REUNION</OPTION>";
	country = country + "<OPTION VALUE='ROMANIA'>ROMANIA</OPTION>";
	country = country + "<OPTION VALUE='RUSSIAN FEDERATION'>RUSSIAN FEDERATION</OPTION>";
	country = country + "<OPTION VALUE='RWANDA'>RWANDA</OPTION>";
	country = country + "<OPTION VALUE='S GEORGIA & SANDWICH ISLES'>S GEORGIA & SANDWICH ISLES</OPTION>";
	country = country + "<OPTION VALUE='SAINT KITTS & NEVIS'>SAINT KITTS & NEVIS</OPTION>";
	country = country + "<OPTION VALUE='SAINT LUCIA'>SAINT LUCIA</OPTION>";
	country = country + "<OPTION VALUE='SAINT VINCENT & GRENADINES'>SAINT VINCENT & GRENADINES</OPTION>";
	country = country + "<OPTION VALUE='SAMOA'>SAMOA</OPTION>";
	country = country + "<OPTION VALUE='SAN MARINO'>SAN MARINO</OPTION>";
	country = country + "<OPTION VALUE='SAO TOME & PRINCIPE'>SAO TOME & PRINCIPE</OPTION>";
	country = country + "<OPTION VALUE='SAUDI ARABIA'>SAUDI ARABIA</OPTION>";
	country = country + "<OPTION VALUE='SENEGAL'>SENEGAL</OPTION>";
	country = country + "<OPTION VALUE='SEYCHELLES'>SEYCHELLES</OPTION>";
	country = country + "<OPTION VALUE='SIERRA LEONA'>SIERRA LEONA</OPTION>";
	country = country + "<OPTION VALUE='SINGAPORE'>SINGAPORE</OPTION>";
	country = country + "<OPTION VALUE='SLOVAKIA (SLOVAK REP)'>SLOVAKIA (SLOVAK REP)</OPTION>";
	country = country + "<OPTION VALUE='SLOVENIA'>SLOVENIA</OPTION>";
	country = country + "<OPTION VALUE='SOLOMON ISLANDS'>SOLOMON ISLANDS</OPTION>";
	country = country + "<OPTION VALUE='SOMALIA'>SOMALIA</OPTION>";
	country = country + "<OPTION VALUE='SOUTH AFRICA'>SOUTH AFRICA</OPTION>";
	country = country + "<OPTION VALUE='SPAIN'>SPAIN</OPTION>";
	country = country + "<OPTION VALUE='SRI LANKA'>SRI LANKA</OPTION>";
	country = country + "<OPTION VALUE='ST. HELENA'>ST. HELENA</OPTION>";
	country = country + "<OPTION VALUE='ST. PIERRE & MIQUELON'>ST. PIERRE & MIQUELON</OPTION>";
	country = country + "<OPTION VALUE='SUDAN'>SUDAN</OPTION>";
	country = country + "<OPTION VALUE='SURINAME'>SURINAME</OPTION>";
	country = country + "<OPTION VALUE='SVALBARD & JAN MAYEN ISLANDS'>SVALBARD & JAN MAYEN ISLANDS</OPTION>";
	country = country + "<OPTION VALUE='SWAZILAND'>SWAZILAND</OPTION>";
	country = country + "<OPTION VALUE='SWEDEN'>SWEDEN</OPTION>";
	country = country + "<OPTION VALUE='SWITZERLAND'>SWITZERLAND</OPTION>";
	country = country + "<OPTION VALUE='SYRIAN ARAB REPUBLIC'>SYRIAN ARAB REPUBLIC</OPTION>";
	country = country + "<OPTION VALUE='TAIWAN'>TAIWAN</OPTION>";
	country = country + "<OPTION VALUE='TAJIKISTAN'>TAJIKISTAN</OPTION>";
	country = country + "<OPTION VALUE='TANZANIA, UNITED REP'>TANZANIA, UNITED REP</OPTION>";
	country = country + "<OPTION VALUE='THAILAND'>THAILAND</OPTION>";
	country = country + "<OPTION VALUE='TOGO'>TOGO</OPTION>";
	country = country + "<OPTION VALUE='TOKELAU'>TOKELAU</OPTION>";
	country = country + "<OPTION VALUE='TONGA'>TONGA</OPTION>";
	country = country + "<OPTION VALUE='TRINIDAD & TOBAGO'>TRINIDAD & TOBAGO</OPTION>";
	country = country + "<OPTION VALUE='TUNISIA'>TUNISIA</OPTION>";
	country = country + "<OPTION VALUE='TURKEY'>TURKEY</OPTION>";
	country = country + "<OPTION VALUE='TURKMENISTAN'>TURKMENISTAN</OPTION>";
	country = country + "<OPTION VALUE='TURKS & CAICOS ISLANDS'>TURKS & CAICOS ISLANDS</OPTION>";
	country = country + "<OPTION VALUE='TUVALU'>TUVALU</OPTION>";
	country = country + "<OPTION VALUE='UGANDA'>UGANDA</OPTION>";
	country = country + "<OPTION VALUE='UKRAINE'>UKRAINE</OPTION>";
	country = country + "<OPTION VALUE='UNITED ARAB EMIRATES'>UNITED ARAB EMIRATES</OPTION>";
	country = country + "<OPTION VALUE='UNITED KINGDOM'>UNITED KINGDOM</OPTION>";
	country = country + "<OPTION VALUE='UNITED STATES'>UNITED STATES</OPTION>";
	country = country + "<OPTION VALUE='URUGUAY'>URUGUAY</OPTION>";
	country = country + "<OPTION VALUE='US MINOR OUTLYING ISLES'>US MINOR OUTLYING ISLES</OPTION>";
	country = country + "<OPTION VALUE='UZBEKISTAN'>UZBEKISTAN</OPTION>";
	country = country + "<OPTION VALUE='VANUATU'>VANUATU</OPTION>";
	country = country + "<OPTION VALUE='VENEZUELA'>VENEZUELA</OPTION>";
	country = country + "<OPTION VALUE='VIET NAM'>VIET NAM</OPTION>";
	country = country + "<OPTION VALUE='VIRGIN ISLES (BRITISH)'>VIRGIN ISLES (BRITISH)</OPTION>";
	country = country + "<OPTION VALUE='VIRGIN ISLES (U.S.)'>VIRGIN ISLES (U.S.)</OPTION>";
	country = country + "<OPTION VALUE='WALLIS & FUTUNA ISLANDS'>WALLIS & FUTUNA ISLANDS</OPTION>";
	country = country + "<OPTION VALUE='WESTERN SAHARA'>WESTERN SAHARA</OPTION>";
	country = country + "<OPTION VALUE='YEMEN'>YEMEN</OPTION>";
	country = country + "<OPTION VALUE='YUGOSLAVIA'>YUGOSLAVIA</OPTION>";
	country = country + "<OPTION VALUE='ZAMBIA'>ZAMBIA</OPTION>";
	country = country + "<OPTION VALUE='ZIMBABWE'>ZIMBABWE</SELECT>";
	document.write (country);

	if (strSelectedValue!=null && strSelectedValue!=""){
		selectValue(strSelectedValue,lstObjectName);
	}
}

/*********************************************************************/
/* Author : Kishor                                                   */
/* Featur : Restrict perticular characters in Object                 */
/* Inputs : Restricted String of characters and Object Name          */
/* Return : True - if key pressed is valid                           */
/*********************************************************************/
function restrictKeys(e,strRestrictChars,boolNumberAllowed,boolToLowerUper){
	//alert("vaibhav  "+strRestrictChars);
	var key,boolRtnValue=true;
	if(!isNetscap()){
		if (e.keyCode) key = e.keyCode;
		else if (e.which) key = e.which;
		
		var keyChar = String.fromCharCode(key);
		
		if (strRestrictChars == "NUM"){
			//alert(key);
			if ((key <  48) ||  (key > 57 )){
			//	alert("Only Numbers Allowed!");
				boolRtnValue=false;
				displayErrMsg=false;
			}
		}
		else{
			if(strRestrictChars.indexOf(keyChar)!=-1 ){
				//alert("Keys Not Allowed:- \"" + strRestrictChars +"'");
				boolRtnValue=false;
				displayErrMsg=false;
			}
			if (boolRtnValue && key==34 || key==39 ){
				//alert("Keys Not Allowed:- \"" + strRestrictChars +"'");
				boolRtnValue=false;
				displayErrMsg=false;
			}
			if (boolRtnValue && !boolNumberAllowed && key > 47 &&  key < 58 ){
				//alert("Numbers Not Allowed!");
				boolRtnValue=false;
				displayErrMsg=false;
			}
	     }
	  }
	  if (boolRtnValue){
		if (boolToLowerUper != null && boolToLowerUper == "UP"){
			if ((key > 0x60) && (key < 0x7B)){
				 if(!isNetscap()){
					 window.event.keyCode = key-0x20;
					 displayErrMsg=true;
				}
			}
		}
		else if (boolToLowerUper != null && boolToLowerUper == "LO"){
			if ((key > 0x40) && (key < 0x5B)){
				if(!isNetscap()){
					window.event.keyCode = key+0x20;
					 displayErrMsg=true;
				}
			}
		}
	}
	//alert(boolRtnValue);
	 return boolRtnValue;
}

/*********************************************************************/
/* Author : Kishor                                                   */
/* Featur : Restrict perticular characters in Object                 */
/* Inputs : Restricted String of characters and Object Name          */
/* Return : True - if key pressed is valid                           */
/*********************************************************************/
var focusObjName="";
function restrictKeysOnBlur(e, objName,strRestrictChars,boolNumberAllowed,boolToLowerUper){
	focusObjName="";
	var intLength,boolRtnValue=true;
	var objValue=document.getElementById(objName).value;
	var strNum="0123456789"
	var strChar="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,./;!@#$%%^^&&*[]`-=\/?><:{}|+_";

	for(var intCnt=0;intCnt<objValue.length;intCnt++){
		if (strRestrictChars=="NUM"){
			if(strChar.indexOf(objValue.charAt(intCnt))!=-1) {
				alert("Only Numbers Allowed!");
				document.getElementById(objName).value=getOldValues(objName);
				document.getElementById(objName).focus();
				e.cancelBubble = true;
				boolRtnValue=false;
				displayErrMsg=false;
				focusObjName=objName;
				break;
			}
			if (ascii_value(objValue.charAt(intCnt))==34 || ascii_value(objValue.charAt(intCnt))==39 ){
				alert("Only Numbers Allowed!");
				document.getElementById(objName).value=getOldValues(objName);
				document.getElementById(objName).focus();
				e.cancelBubble = true;
				boolRtnValue=false;
				displayErrMsg=false;
				focusObjName=objName;
				break;
			}
		}
		else{
			if(strRestrictChars.indexOf(objValue.charAt(intCnt))!=-1 || strRestrictChars.indexOf("'")!=-1 ){
				alert("Keys Not Allowed:- '" + strRestrictChars +"\" ");
				document.getElementById(objName).value=getOldValues(objName);
				document.getElementById(objName).focus();
				boolRtnValue=false;
				displayErrMsg=false;
				focusObjName=objName;
				break;
			}
			if (ascii_value(objValue.charAt(intCnt))==34 || ascii_value(objValue.charAt(intCnt))==39 ){
				alert("Keys Not Allowed:- '" + strRestrictChars +"\"");
				document.getElementById(objName).value=getOldValues(objName);
				document.getElementById(objName).focus();
				e.cancelBubble = true;
				boolRtnValue=false;
				displayErrMsg=false;
				focusObjName=objName;
				break;
			}
			if(!boolNumberAllowed && strNum.indexOf(objValue.charAt(intCnt))!=-1) {
				alert("Numbers Not Allowed!");
				document.getElementById(objName).value=getOldValues(objName);
				document.getElementById(objName).focus();
				e.cancelBubble = true;
				boolRtnValue=false;
				displayErrMsg=false;
				focusObjName=objName;
				break;
			}
		}
	}
	if (boolRtnValue){
		if (boolToLowerUper != null && boolToLowerUper == "UP"){
			document.getElementById(objName).value = document.getElementById(objName).value.toUpperCase();
		}
		else if (boolToLowerUper != null &&  boolToLowerUper == "LO"){
			document.getElementById(objName).value = document.getElementById(objName).value.toLowerCase();
		}
	}
	return boolRtnValue;
}

/*********************************************************************/
/* Author : Kishor                                                   */
/* Featur : Setting Focus for NetScap                                */
/* Inputs : None                                                     */
/* Return : Set Focus to pertVariable                                */
/*********************************************************************/
function setFocusForNetScap(){
	if(isNetscap()){
	var cnt,intLength,boolStatus;
	intListLength=document.forms[0].length;
	boolStatus=false;
	
	for (var i=0; i<document.forms[0].length;i++ ){
		if ((document.forms[0].elements[i].type != "hidden" ) && (document.forms[0].elements[i].type != "submit" ) && (document.forms[0].elements[i].type != "reset" )&&( document.forms[0].elements[i].type != "button")){
			if((document.forms[0].elements[i].name == focusObjName )){
				boolStatus=true;
				break;
			}
		}
	}

	if(focusObjName!="" && boolStatus ){
			document.getElementById(focusObjName).focus();
			if (document.getElementById(focusObjName).type != "select-one"){
				document.getElementById(focusObjName).options[0].selected= true;
			}
		}
	}
}


/*********************************************************************/
/* Author : Kishor                                                   */
/* Featur : Finding diffrence between initial value and New Value    */
/*          Same or Not                                              */
/* Inputs : None                                                     */
/* Return : Status                                                   */
/*********************************************************************/
var arrSize = 10;
var txtObjName = new Array(arrSize);
var txtObjOldValue = new Array(arrSize);

function isAnyDiffBetOldAndNewValues(){
	var intLength,boolStatus;
	intListLength=document.forms[0].length;
	boolStatus=true;
	
	outer:
	for (var i=0; i<intListLength;i++ ){
		if ((document.forms[0].elements[i].name == "CD_ResumePath" ) || (document.forms[0].elements[i].name == "CD_CoveringLetter" ) || (document.forms[0].elements[i].type != "hidden" ) && (document.forms[0].elements[i].type != "submit" ) && (document.forms[0].elements[i].type != "reset" )&&( document.forms[0].elements[i].type != "button")){
			for(var objCnt = 0;objCnt < txtObjName.length;objCnt++){
				if((document.forms[0].elements[i].name == txtObjName[objCnt])){
					if(document.forms[0].elements[i].value != txtObjOldValue[objCnt]){
						boolStatus = false;
						i = intListLength;
						break outer;
					}
				}
			}
		}
	}
	return !boolStatus;
}

/*********************************************************************/
/* Author : Kishor                                                   */
/* Featur : getting Old Value                                        */
/* Inputs : string name of txt object                                */
/* Return : old values                                               */
/*********************************************************************/
function getOldValues(txtObjNameStr){
	var intLength,strOldValue;
	intListLength = document.forms[0].length;
	strOldValue = "";
	
	outer:
	for (var i=0; i<intListLength;i++ ){
		if ((document.forms[0].elements[i].type != "hidden" ) && (document.forms[0].elements[i].type != "submit" ) && (document.forms[0].elements[i].type != "reset" )&&( document.forms[0].elements[i].type != "button") && ( document.forms[0].elements[i].type != "select-one")){
			for(var objCnt = 0;objCnt < txtObjName.length;objCnt++){
				if((document.forms[0].elements[i].name == txtObjName[objCnt]) && (txtObjNameStr == txtObjName[objCnt]) ){
					strOldValue= txtObjOldValue[objCnt] ;
					i=intListLength;
					break outer;
					}
				}
			}
		}
	return strOldValue;
}

/*********************************************************************/
/* Author : Kishor                                                   */
/* Featur : Getting Diffrence between old and new value              */
/* Inputs : string name of txt object                                */
/* Return : True - false                                             */
/*********************************************************************/
function isEqualBoth(txtObjNameStr){
	var intLength,strOldValue,bolStatus;
	intListLength = document.forms[0].length;
	strOldValue = "";
	bolStatus=true;
	
	outer:
	for (var i=0; i<intListLength;i++ ){
		if ((document.forms[0].elements[i].type != "hidden" ) && (document.forms[0].elements[i].type != "submit" ) && (document.forms[0].elements[i].type != "reset" )&&( document.forms[0].elements[i].type != "button") && ( document.forms[0].elements[i].type != "select-one")){
			for(var objCnt = 0;objCnt < txtObjName.length;objCnt++){
				if((document.forms[0].elements[i].name == txtObjName[objCnt]) && (txtObjNameStr == txtObjName[objCnt]) ){
					strOldValue= txtObjOldValue[objCnt] ;
					i=intListLength;
					break outer;
					}
				}
			}
		}
	if(strOldValue!=document.getElementById(txtObjNameStr).value){
		bolStatus=false
	}
	return bolStatus;
}
/*********************************************************************/
/* Author : vaibhav                                                  */
/* Date : 11/29/2005                                                 */
/* Featur : Generate drop down with selected or default value        */
/*********************************************************************/

function generateExperience(lstObjectName,strClassName,strSelectedValue){

	var Exp="";
	if (strClassName==null){
		strClassName="";
	}
	Exp = Exp + "<SELECT NAME='"+lstObjectName+"' ID='"+lstObjectName+"' CLASS='"+strClassName+"'>";
	
	if (strSelectedValue!=null && strSelectedValue!=""){
		Exp = Exp + "<OPTION VALUE='Select'>&minus;&minus; Select &minus;&minus;</OPTION>";
	}
	else{
		Exp = Exp + "<OPTION VALUE='Select' SELECTED>&minus;&minus; Select &minus;&minus;</OPTION>";
	}
	Exp = Exp + "<OPTION VALUE='0'>0 year</OPTION>";
//	Exp = Exp + "<OPTION VALUE='less'>< 1 year</OPTION>";
	Exp = Exp + "<OPTION VALUE='0-1'>0-1 year</OPTION>";
	Exp = Exp + "<OPTION VALUE='1-2'>1-2 years</OPTION>";
	Exp = Exp + "<OPTION VALUE='2-3'>2-3 years</OPTION>";
	Exp = Exp + "<OPTION VALUE='3-4'>3-4 years</OPTION>";
	Exp = Exp + "<OPTION VALUE='4-5'>4-5 years</OPTION>";
	Exp = Exp + "<OPTION VALUE='5-6'>5-6 years</OPTION>";
	Exp = Exp + "<OPTION VALUE='6-7'>6-7 years</OPTION>";
	Exp = Exp + "<OPTION VALUE='7-8'>7-8 years</OPTION>";
	Exp = Exp + "<OPTION VALUE='8-9'>8-9 years</OPTION>";
	Exp = Exp + "<OPTION VALUE='9-10'>9-10 years</OPTION>";
	Exp = Exp + "<OPTION VALUE='10-11'>10-11 years</OPTION>";
	Exp = Exp + "<OPTION VALUE='11-12'>11-12 years</OPTION>";
	Exp = Exp + "<OPTION VALUE='12-13'>12-13 years</OPTION>";
	Exp = Exp + "<OPTION VALUE='13-14'>13-14 years</OPTION>";
	Exp = Exp + "<OPTION VALUE='14-15'>14-15 years</OPTION>";
	Exp = Exp + "</SELECT>";
	document.write (Exp);

	if (strSelectedValue!=null && strSelectedValue!=""){
		selectValue(strSelectedValue,lstObjectName);
	}
}

/******************************************************************************/
/* Author : vaibhav                                                           */
/* Featur : Checks whether al least one radio button is selected or not       */
/******************************************************************************/
function chkIfRadioSelected()
{	
	var intListLength;
	var flag;
	var radioChkVal;
	flag=false
	radioChkVal=document.getElementById("Radiochk").value.toLowerCase();
	
	//alert("-->>"+radioChkVal);
	
	if (radioChkVal=="true")
	{
		if (confirm("Are you sure you want to Update?"))
		{
			flag=true;
		}
		
	}
	else
		alert("Please select a Candidate Status to be Updated!");
	//alert(flag);
	return flag;
}

function chkRadioSelected()
{	
	document.getElementById("Radiochk").value="true";
}

/******************************************************************************/
/* Author : vaibhav                                                           */
/* Featur : Confirm dialog box selected gets return value                     */
/******************************************************************************/
function confirmMsgVal(type)
{
	var flag;
	if (confirm("Are you sure you want to "+ type +"?"))
		flag=true;
	else
		flag=false;
	return flag;
}


function ifAnyChkBoxSelected()
{
	var length1=document.forms[0].length;
	var chkFlag=false;
	outer:
	for(var i=0;i<length1;i++)
	{
		if (document.forms[0].elements[i].type=="checkbox")
		{
			if (document.forms[0].elements[i].checked)
			{
				chkFlag=true;
				i=length1;
				break outer;
			}

		}
	}
		return chkFlag;
}