// This function would be used for removing white space charcters
			function chkEmail(vText)
				{
					if (!chkValidChars(vText)) return false
					posAt=vText.indexOf('@')
					if (posAt!=-1 && posAt>1)
						{
							posAt2=vText.indexOf('@',posAt+1)
							if (posAt2!=-1) return false
							posDot=vText.indexOf('.',posAt)
							strLen=vText.length
							if (posDot!=-1 && 2<posDot-posAt && posDot+2<strLen)
								{
									return true
								}
						}
				return false
				}


		function chkValidChars(sText)
			{
				for(i=0;i<sText.length;i++)
					{
						ch=sText.charAt(i)
						capLatters=(ch=='A' || ch=='B' ||  ch=='C' ||  ch=='D' ||  ch=='E' ||  ch=='F' ||  ch=='G' ||  ch=='H' ||  ch=='I' ||  ch=='J' ||  ch=='K' ||  ch=='L' ||  ch=='M' ||  ch=='N' ||  ch=='O' ||  ch=='P' ||  ch=='Q' ||  ch=='R' ||  ch=='S' ||  ch=='T' ||  ch=='U' ||  ch=='V' ||  ch=='W' || ch=='X' ||  ch=='Y' ||  ch=='Z')
						smallLatters=(ch=='a' || ch=='b' ||  ch=='c' ||  ch=='d' ||  ch=='e' ||  ch=='f' ||  ch=='g' ||  ch=='h' ||  ch=='i' ||  ch=='j' ||  ch=='k' ||  ch=='l' ||  ch=='m' ||  ch=='n' ||  ch=='o' ||  ch=='p' ||  ch=='q' ||  ch=='r' ||  ch=='s' ||  ch=='t' ||  ch=='u' ||  ch=='v' ||  ch=='w' ||  ch=='x' ||  ch=='y' ||  ch=='z')
						numLatters=(ch=='1' || ch=='2' ||  ch=='3' ||  ch=='4' ||  ch=='5' ||  ch=='6' ||  ch=='7' ||  ch=='8' ||  ch=='9' ||  ch=='0')
						otherLatters=(ch=='.' || ch=='_' || ch=='@' || ch=='-')
						if (!(capLatters || smallLatters || numLatters || otherLatters))
							return false;
					}
				return true
			}			
function trims(get2)
{
	get1 = new String(get2);
	for (var i = 0; get1.length; i++)
	{
		g = get1.charAt(i);
		if (g != " ")
			break;
		else
			continue;
	}
	take = get1.substring(i, get1.length);

	for (var j = take.length - 1; j > 0; j--)
	{
		z = take.charAt(j);
		if (z != " ")
			break;
		else
			continue;
	}
	make = take.substring(0, j + 1);
	return make;
}
	function isValidEntry(entry)
    {
    var chr;
    for (var i=0; i<entry.length; i++)
	    {
	    chr = entry.charAt(i);
	    if(chr=='\"' ||chr=='>' )
	    {
			return false;
	    }
	      
	    }
	    return true;
    }
    
   /* function isValidAgentName(entry)
    {
    var chr;
    for (var i=0; i<entry.length; i++)
	    {
	    chr = entry.charAt(i);
	    if(chr=='\' || chr=='>'|| chr=='"')
	    {
			return false;
	    }
	      
	    }
	    return true;
    }*/



	/****************************************************************************/
	/**
		This method validate the length of the field with custom message 
		provided by the user
		Author Riz
		Date 281102
	**/
	function validateFieldLength(textAreaObject,limit,message){
	
		//checking the length
		if(!(trims(textAreaObject.value).length <= limit) )
		{
			//displaying the message
			alert(message);
			//setting focus
			textAreaObject.focus();
			//returning false
			return false;
		}//end if
		return true ;
		
	}//end method
	
	/****************************************************************************/
	/**
		This method opens the resumepopup window  
		Author Riz
		Date 120302
	**/
	function openResumeWindow(relativePath, clientid, action)
	{
		if(eval("document.forms[0].UAction.value")!="Update")
		{ 	
			windowHandle = window.open(relativePath,"CreateResume","height=150, width=270, toolbar=false, menubar=false, noresize");
			return false ;
		}
		return true;
	}

	function resetForm() {
		for(var i=0;i<document.forms[0].elements.length;i++) {
			
			if(document.forms[0].elements[i].type=="text" || document.forms[0].elements[i].type=="textarea" ) {
				document.forms[0].elements[i].value="";
			}
			else if(document.forms[0].elements[i].type=="checkbox" && document.forms[0].elements[i].name != "showclander") {
				document.forms[0].elements[i].checked= false;
			}
			else if (document.forms[0].elements[i].type=="select-one") {
				document.forms[0].elements[i].selectedIndex = 0;
			}
		}
		return true;
	}
	
	
	////
	//		verifies that provided search value is valid or not....
	//		1) theField , field name which is to be displayed, while 	displaying 
	//		    error message
	//      2) theValue , value which is to be verified..
	//      Created On : 6-1-2003
	//		Author 	   : Yassar Mushtaq
	////
	function isValidSearchField(theField,theValue)
	{
		var inValidChars="%_";
		for(var i=0;i<theValue.length;i++)
		{
			var chr=theValue.charAt(i)
			if (inValidChars.indexOf(chr)!=-1)
			{
				alert(theField+" contains invalid character '"+chr+"'");
				return false;
			}
		}
		return true;
	}

	function closeChildWindow()
	{
		if (windowHandle != null)
		{
			if (!windowHandle.closed)
			{
				windowHandle.close();
			}
		}

	}

