function Trim(nStr){return nStr.replace(/(^\s*)|(\s*$)/g, "");}
function fnPaste(){event.returnValue=false;}
function isNull(obj,msg){
	if(msg!="Password")
		obj1=Trim(obj.value);
	else
		obj1=obj.value;
	if (obj1==""){
		alert("Please enter the " +msg);
		obj.focus();
		return true;
	}else
		return false;
}
function isNull_Location(obj,msg,id,divCount,divValue){
	var divName = (divValue.value).split(",")
	for(var i = 0;i < divCount.value;i++){
		newValue = "LocationAjax_"+divName[i];
		newObj = document.getElementById(newValue).value;
		if(newObj == "" || newObj == "Location"){
			//alert("Please enter the " +msg);
			$.validationEngine.buildPrompt('#'+newValue+'',''+msg+'','error');
			obj.focus();
			return true;
		}else{
			$('.formError').remove();
		}
	}
	return false;
	//return false;
}

function isMsgNull(obj,msg){
	if(msg!="Password")
		obj1=Trim(obj.value);
	else
		obj1=obj.value;
	if (obj1==""){
		alert(msg);
		obj.focus();
		return true;
	}else
		return false;
}

function isLen(obj,siz,msg){
	if(msg!="Password")
		obj1=Trim(obj.value);
	else
		obj1=obj.value;
	if(obj1!=""){
		var strLen=obj.value;
		if(strLen.length < siz){
			alert(msg+" should be atleast " + siz + " characters");
			obj.value="";
			obj.focus();
			return true;  
		} 
	}else
		return false;
}
function isSame(obj1,obj2,msg1,msg2){
	if((Trim(obj1.value))==(Trim(obj2.value))){
		alert(msg1+" is same as the "+msg2);
		obj2.focus();
		return true;
	}else
		return false;
}	
function isNotSame(obj1,obj2,msg1,msg2){
	if((Trim(obj1.value))!=(Trim(obj2.value))){
		alert(msg1+" does not match");
		obj2.value="";
		obj2.focus();
		return true;
	}else
		return false;
}	
function isCorrect(obj1,obj2,msg1,msg2){
	if((Trim(obj1.value)) >= (Trim(obj2.value))){
		alert(msg1+" should be less than "+msg2);
		obj2.focus();
		return true;
	}else
		return false;
}	
function isTxtareaNull(obj,msg){
	if(Trim(obj.innerText) == ""){
		alert("Please enter " + msg);
		obj.focus();
		return true;
	}else
		return false;
}
function isTxtareaLen(obj,msg){
	if(obj.innerHTML.length > 255){
		alert("Please enter below 256 characters in " + msg);
		obj.focus();
		return true;
	}else
		return false;
}
function notEmail(obj,msg){
	var exp=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
	if (!exp.test(obj.value)){
		alert("Please enter valid "+msg);
		obj.focus();
		return true;
	}else
		return false;
}
function notZipcode(obj,msg){
	exp = /[a-zA-Z|\d]-{1}/;
	if (!exp.test(obj.value)){
		alert("Please enter valid "+msg);
		obj.focus();
		return true;
	}else
		return false;
}
function notChecked(obj,msg){
	checked = false;
	if(obj.length){
		for(i=0;i<obj.length;i++){
			if(obj[i].checked){
				checked = true;break;
			}
		}
	}else if(obj.checked)
		checked = true;
	if(!(checked)){
		alert("Please select the "+msg);
		if(obj.length)
			obj[0].focus();
		else
			obj.focus();
		return true;
	}
}
function notChecked1(obj,msg){
	checked = false;
	if(obj.length){
		for(i=0;i<obj.length;i++){
			if(obj[i].checked){
				checked = true;break;
			}
		}
	}else if(obj.checked)
		checked = true;
	if(!(checked)){
		alert("Please select "+msg);
		/*if(obj.length)
			obj[0].focus();
		else
			obj.focus();*/
		return true;
	}
}
function notSelected(obj,msg){
	if (obj.options[obj.selectedIndex].value == ""){
		alert("Please select the "+ msg);
		obj.focus();
		return true;
	}else
		return false;
}
function notImageFile(obj,msg){
	var exp = /^.+\.(jpg|gif|jpeg|JPG|JPEG|GIF)$/;
	if (!exp.test((obj.value).toLowerCase())){
		alert("Please choose jpg or gif file for "+msg);
		//obj.focus();
		return true;
	}else
		return false;
}
function notDocFile(obj,msg){
	if(Trim(obj.value)!=""){
		var exp = /^.+\.(DOC|doc|TXT|txt)$/;
		if (!exp.test((obj.value).toLowerCase())){
			alert("Please choose doc or txt file for "+msg);
			obj.value="";
			//obj.focus();
			return true;
		}else
			return false;	
	}else
		return false;
}
function notPdfDocFile(obj,msg){
	var exp = /^.+\.(pdf|doc|PDF|DOC)$/;
	if (!exp.test((obj.value).toLowerCase())){
		alert("Please choose pdf or doc file for "+msg);
		obj.value="";
		//obj.focus();
		return true;
	}else
		return false;
}
function notPdfFile(obj,msg){
	var exp = /^.+\.(pdf|PDF)$/;
	if (!exp.test((obj.value).toLowerCase())){
		alert("Please choose pdf file for "+msg);
		obj.value="";
		//obj.focus();
		return true;
	}else
		return false;
}
function notAudioFile(obj,msg){
	var exp = /^.+\.(mp3|MP3)$/;
	if (!exp.test((obj.value).toLowerCase())){
		alert("Please choose mp3 file for "+msg);
		obj.value="";
		//obj.focus();
		return true;
	}else
		return false;
}

function notPrice(obj,msg){
	exp = /^[\d]*[\.]{0,1}[\d]{1,2}$/;
	if (!exp.test(obj.value)){
		alert("Please enter valid "+msg);
		obj.focus();
		return true;
	}else
		return false;
}
function fnChkNum(obj,msg){
	exp = /^[\d]/;
	if (!exp.test(obj.value)){
		alert("Please enter only numeric values in "+msg);
		obj.focus();
		return true;
	}else
		return false;
}
function fnChkAlpha(obj,msg)
{
	exp = (/(^([a-z]|[A-Z]|["."]|[\s])*$)/);
	if (!exp.test(obj.value))
	{
		alert("Please enter only alphabets in "+msg);
		obj.focus();
		return true;
	}
	else
		return false;
}	

function fnChkAlphaNumeric(obj,msg){
	var alpha = /[a-zA-Z|]/;
	var Num = /[\d]/;
	if (!(Alpha.test(obj.value) && Num.test(obj.value))){
		alert("Please enter only alphanumeric in "+msg);
		obj.value="";
		obj.focus();
		return true;
	}else
		return false;
}
function fnChkFolderName(){
	if(((window.event.keyCode < 48) || (window.event.keyCode > 57)) && ((window.event.keyCode < 65) || (window.event.keyCode > 90)) && ((window.event.keyCode < 97) || (window.event.keyCode > 122)) && (window.event.keyCode != 95)){
		alert("Only Alphabets(A-Z, a-z), Numbers(0-9) and Underscore(_) are allowed");
		window.event.keyCode = 0;
		return true;
	}
}
function GetCountry(defaultValue,isNotWithSelect){
	var sCountry="Afghanistan,Albania,Algeria,American Samoa,Andorra,Angola,Anguilla,Antarctica,Antigua and Barbuda,Argentina,Armenia,Aruba,Australia,Austria,Azerbaidjan,Bahamas,Bahrain,Bangladesh,Barbados,Belarus,Belgium,Belize,Benin,Bermuda,Bolivia,Bosnia-Herzegovina,Botswana,Bouvet Island,Brazil,British Indian O. Terr.,Brunei Darussalam,Bulgaria,Burkina Faso,Burundi,Buthan,Cambodia,Cameroon,Canada,Cape Verde,Cayman Islands,Central African Rep.,Chad,Chile,China,Christmas Island,Cocos (Keeling) Isl.,Colombia,Comoros,Congo,Cook Islands,Costa Rica,Croatia,Cuba,Cyprus,Czech Republic,Czechoslovakia,Denmark,Djibouti,Dominica,Dominican Republic,East Timor,Ecuador,Egypt,El Salvador,Equatorial Guinea,Estonia,Ethiopia,Falkland Isl.(Malvinas),Faroe Islands,Fiji,Finland,France,France (European Ter.),French Southern Terr.,Gabon,Gambia,Georgia,Germany,Ghana,Gibraltar,Great Britain (UK),Greece,Greenland,Grenada,Guadeloupe (Fr.),Guam (US),Guatemala,Guinea,Guinea Bissau,Guyana,Guyana (Fr.),Haiti,Heard & McDonald Isl.,Honduras,Hong Kong,Hungary,Iceland,India,Indonesia,Iran,Iraq,Ireland,Israel,Italy,Ivory Coast,Jamaica,Japan,Jordan,Kazachstan,Kenya,Kirgistan,Kiribati,Korea (North),Korea (South),Kuwait,Laos,Latvia,Lebanon,Lesotho,Liberia,Libya,Liechtenstein,Lithuania,Luxembourg,Macau,Madagascar,Malawi,Malaysia,Maldives,Mali,Malta,Marshall Islands,Martinique (Fr.),Mauritania,Mauritius,Mexico,Micronesia,Moldavia,Monaco,Mongolia,Montserrat,Morocco,Mozambique,Myanmar,Namibia,Nauru,Nepal,Netherland Antilles,Netherlands,Neutral Zone,New Caledonia (Fr.),New Zealand,Nicaragua,Niger,Nigeria,Niue,Norfolk Island,Northern Mariana Isl.,Norway,Oman,Pakistan,Palau,Panama,Papua New,Paraguay,Peru,Philippines,Pitcairn,Poland,Polynesia (Fr.),Portugal,Puerto Rico (US),Qatar,Reunion (Fr.),Romania,Russian Federation,Rwanda,Saint Lucia,Samoa,San Marino,Saudi Arabia,Senegal,Seychelles,Sierra Leone,Singapore,Slovak Republic,Slovenia,Solomon Islands,Somalia,South Africa,Spain,Sri Lanka,St. Helena,St. Pierre & Miquelon,St. Tome and Principe,St.Kitts Nevis Anguilla,St.Vincent & Grenadines,Sudan,Suriname,Svalbard & Jan Mayen Is,Swaziland,Sweden,Switzerland,Syria,Tadjikistan,Taiwan,Tanzania,Thailand,Togo,Tokelau,Tonga,Trinidad & Tobago,Tunisia,Turkey,Turkmenistan,Turks & Caicos Islands,Tuvalu,Uganda,Ukraine,United Arab Emirates,United Kingdom,United States,Uruguay,US Minor outlying Isl.,Uzbekistan,Vanuatu,Vatican City State,Venezuela,Vietnam,Virgin Islands (British)";
	var xCountry=sCountry.split(",");
	var str="";
	if (!isNotWithSelect)str+="<option value='' selected>Select Country</option>\n";//else str+="<option value='' selected>Doesn't Matter</option>\n";
	for(i=1;i<xCountry.length; i++)
	if(i==defaultValue)str+="<option value='"+(i)+"' selected>"+xCountry[i-1]+"</option>\n";else str+="<option value='"+i+"'>"+xCountry[i-1]+"</option>\n";
	document.write(str);
}
function fnShowDate(obj,msg){
	var retdate=window.showModalDialog("includes/calender.htm","","dialogHeight: 219px; dialogWidth: 273px;  center: Yes; help: No; resizable: No; status: No;titlebar:No");
	obj.value=retdate;
}
	
function isNullMulti(obj,msg){
	if (Trim(obj.value)==""){
		alert("Please select the " + msg);
		obj.focus();
		return true;
	}else
		return false;
}
function fnProfile(v1){
	ref=window.open("employee_profile.php?Id="+v1,"Profile","Left=180, Top=90, height=500,width=650,toolbar=no,scrollbars=yes,menubar=no,resize=false");
}

function isNullCbo(obj,msg)
{
	if (Trim(obj.value)=="")
	{
		alert("Please select the " + msg);
		obj.focus();
		return true;
	}
	else
		return false;
}

function isNullhid(obj,msg)
	{
	if (obj=="")
		{
		alert("Please enter the " +msg);
		return true;
		}
	else
		return false;
	}
function notFile(obj,msg){
	if(Trim(obj.value)!=""){
		//var exp = /^.+\.(DOC|doc|TXT|txt|JPG|jpg|JPEG|jpeg|GIF|gif|XLS|xls)$/;
		var exp = /^.+\.(XLS|xls)$/;
		if (!exp.test((obj.value).toLowerCase())){
			//alert("Please choose excel file for "+msg);
			alert("Please choose an excel file");
			obj.value="";
			//obj.focus();
			return true;
		}else
			return false;	
	}else
		return false;
}

function isEditorNull(obj,msg)
	{
	strTmp = obj.value;
	StrContent=strTmp.split("<BODY>");
	StrContent=StrContent[1];
	StrContent=StrContent.split("</BODY>");
	StrContent=StrContent[0];
	strLength=StrContent.length;
	if (strLength==0)
		{
		alert (msg);
		return true;
		}
	else
		{
		return false;
		}	
	}
function fnDivCheck()
	{	
	var val = tblView.offsetHeight;
	if (tblView.offsetHeight >= 320)  
		DivDisplay.style.overflow = "auto";
	else
		{
		DivDisplay.style.overflow = "hidden";
		DivDisplay.style.height = val;
		}
	}

function fnFocusIn1(txtvalfocus)
	{

	var txtval = eval("document.frmLogin."+txtvalfocus);
	if(txtval.value!="")
		txtval.value = "";
	}

function fnFocusOut1(txtvalblur)
	{
	var txtval1 = eval("document.frmLogin."+txtvalblur);
	if(txtvalblur=="txtUser" && txtval1.value=="")
		txtval1.value = "Enter your email address here..";
	}

function isPassword(obj)
{
	
	if ((obj.value.length)<5)
	{
	alert("Password should have atleast 5 characters");
	obj.value ="";
	obj.focus();
	return true;
	}
	exp=/[^\W]/;
	if(!exp.test(obj.value))
	{alert("Special characters not accepted");
	obj.value ="";
	obj.focus();
	return true;
	}
	
	else
		return false;
}
function isInValidUser(obj)
{
	exp=/[^\W]/;
	if(!exp.test(obj.value))
	{
		alert("Please enter a valid username");
		obj.value ="";
		obj.focus();
		return true;
	}
}
function notChecked(obj,msg){
	checked = false;
	if(obj.length){
		for(i=0;i<obj.length;i++){
			if(obj[i].checked){
				checked = true;break;
			}
		}
	}else if(obj.checked)
		checked = true;
	if(!(checked)){
		alert("Please select the "+msg);
		if(obj.length)
			obj[0].focus();
		else
			obj.focus();
		return true;
	}
}
function fnShowCalendar(tObj)
{
	objDateHolder = tObj;
	if(document.all)
	{
		var getIt=window.showModalDialog("includes/calender1.htm","","dialogHeight: 283px; dialogWidth: 276px;  center: Yes; help: No; resizable: No; status: No;titlebar:No; scrollbar:No");
	}
	else
	{
		var getIt=window.open("includes/calender1.htm",'','width=267,height=235,left=200,top=100,resizable=no, toolbar=no,menubar=no,location=no,scrollbar=no');	
	}
	if(document.all)
		if (getIt !='xyz')tObj.value = getIt;	
}
 function isMaxLen(obj,siz,msg)
{
	if(Trim(obj.value)!="")	
		{
		var strLen=obj.value;
		if(strLen.length >siz)
			{
			alert("Please enter the " + msg + " within " + siz + " letters")
			obj.focus();
			return true;  
			} 
		else
			{
			return false;
			}	
		}	

}

function fnChkTelephone(obj,msg){
	exp = (/(^[\d]|["-"]|[" "])/);
	var alpha = /[a-zA-Z|]/
	if (!exp.test(obj.value) && (alpha.test(obj.value))){
		alert("Please enter only numeric values in "+msg);
		obj.focus();
		return true;
	}else
		return false;
}

function valid_telephone(myTelNo){
	var Emsg = '';
	if(!checkUKTelephone(myTelNo)) {
		Emsg = (telNumberErrors[telNumberErrorNo]);
	}
	return Emsg;
}
function checkUKTelephone(telephoneNumber) {
	// Convert into a string and check that we were provided with something
	var telnum = telephoneNumber + " ";
	if (telnum.length == 1)  {
		telNumberErrorNo = 1;
		return false
	}
	telnum.length = telnum.length - 1;

	// Don't allow country codes to be included (assumes a leading "+")
	var exp = /^(\+)[\s]*(.*)$/;
	if (exp.test(telnum) == true) {
		telNumberErrorNo = 2;
		return false;
	}

	// Remove spaces from the telephone number to help validation
	while (telnum.indexOf(" ")!= -1)  {
		telnum = telnum.slice (0,telnum.indexOf(" ")) + telnum.slice (telnum.indexOf(" ")+1)
	}

	// Remove hyphens from the telephone number to help validation
	while (telnum.indexOf("-")!= -1)  {
		telnum = telnum.slice (0,telnum.indexOf("-")) + telnum.slice (telnum.indexOf("-")+1)
	}

	// Now check that all the characters are digits
	exp = /^[0-9]{10,11}$/;
	if (exp.test(telnum) != true) {
		telNumberErrorNo = 3;
		return false;
	}

	// Now check that the first digit is 0
	exp = /^0[0-9]{9,10}$/;
	if (exp.test(telnum) != true) {
		telNumberErrorNo = 4;
		return false;
	}

	// Disallow numbers allocated for dramas.

	// Array holds the regular expressions for the drama telephone numbers
	var tnexp = new Array ();
	tnexp.push (/^(0113|0114|0115|0116|0117|0118|0121|0131|0141|0151|0161)(4960)[0-9]{3}$/);
	tnexp.push (/^02079460[0-9]{3}$/);
	tnexp.push (/^01914980[0-9]{3}$/);
	tnexp.push (/^02890180[0-9]{3}$/);
	tnexp.push (/^02920180[0-9]{3}$/);
	tnexp.push (/^01632960[0-9]{3}$/);
	tnexp.push (/^07700900[0-9]{3}$/);
	tnexp.push (/^08081570[0-9]{3}$/);
	tnexp.push (/^09098790[0-9]{3}$/);
	tnexp.push (/^03069990[0-9]{3}$/);

	for (var i=0; i<tnexp.length; i++) {
		if ( tnexp[i].test(telnum) ) {
			telNumberErrorNo = 5;
			return false;
		}
	}

	// Finally check that the telephone number is appropriate.
	exp = (/^(01|02|03|04|05|06|070|071|072|073|074|075|07624|077|078|079|08|09)[0-9]+$/);
	if (exp.test(telnum) != true) {
		telNumberErrorNo = 5;
		return false;
	}

	// Telephone number seems to be valid - return the stripped telehone number  
	return telnum;
}

var telNumberErrorNo = 0;
var telNumberErrors = new Array ();
telNumberErrors[0] = "Valid UK telephone number";
telNumberErrors[1] = "Telephone number not provided";
telNumberErrors[2] = "UK telephone number without the country code, please";
telNumberErrors[3] = "UK telephone numbers should contain 10 or 11 digits";
telNumberErrors[4] = "The telephone number should start with a 0";
telNumberErrors[5] = "The telephone number is either invalid or inappropriate";

function valid_mobile(myTelNo){
	var Emsg = '';
	if(!checkUKMobile(myTelNo)) {
		Emsg = (mobileNumberErrors[mobileNumberErrorNo]);
	}
	return Emsg;
}

function checkUKMobile(mobileNumber) {
	// Convert into a string and check that we were provided with something
	var telnum = mobileNumber + " ";
	if (telnum.length == 1)  {
		mobileNumberErrorNo = 1;
		return false
	}
	telnum.length = telnum.length - 1;

	// Don't allow country codes to be included (assumes a leading "+")
	var exp = /^(\+)[\s]*(.*)$/;
	if (exp.test(telnum) == true) {
		mobileNumberErrorNo = 2;
		return false;
	}

	// Remove spaces from the telephone number to help validation
	while (telnum.indexOf(" ")!= -1)  {
		telnum = telnum.slice (0,telnum.indexOf(" ")) + telnum.slice (telnum.indexOf(" ")+1)
	}

	// Remove hyphens from the telephone number to help validation
	while (telnum.indexOf("-")!= -1)  {
		telnum = telnum.slice (0,telnum.indexOf("-")) + telnum.slice (telnum.indexOf("-")+1)
	}

	// Now check that all the characters are digits
	//exp = /^[0-9]{10}$/;
	exp = /^[0-9]{10,11}$/;
	if (exp.test(telnum) != true) {
		mobileNumberErrorNo = 3;
		return false;
	}

	// Now check that the first digit is 0
	exp = /^0[0-9]{9,10}$/;
	if (exp.test(telnum) != true) {
		mobileNumberErrorNo = 4;
		return false;
	}

	// Disallow numbers allocated for dramas.

	// Array holds the regular expressions for the drama telephone numbers
	var tnexp = new Array ();
	tnexp.push (/^(0113|0114|0115|0116|0117|0118|0121|0131|0141|0151|0161)(4960)[0-9]{3}$/);
	tnexp.push (/^02079460[0-9]{3}$/);
	tnexp.push (/^01914980[0-9]{3}$/);
	tnexp.push (/^02890180[0-9]{3}$/);
	tnexp.push (/^02920180[0-9]{3}$/);
	tnexp.push (/^01632960[0-9]{3}$/);
	tnexp.push (/^07700900[0-9]{3}$/);
	tnexp.push (/^08081570[0-9]{3}$/);
	tnexp.push (/^09098790[0-9]{3}$/);
	tnexp.push (/^03069990[0-9]{3}$/);

	for (var i=0; i<tnexp.length; i++) {
		if ( tnexp[i].test(telnum) ) {
			mobileNumberErrorNo = 5;
			return false;
		}
	}

	// Finally check that the telephone number is appropriate.
	exp = (/^(01|02|03|04|05|06|070|071|072|073|074|075|07624|077|078|079|08|09)[0-9]+$/);
	if (exp.test(telnum) != true) {
		mobileNumberErrorNo = 5;
		return false;
	}

	// Telephone number seems to be valid - return the stripped telehone number  
	return telnum;
}
var mobileNumberErrorNo = 0;
var mobileNumberErrors = new Array ();
mobileNumberErrors[0] = "Valid UK mobile number";
mobileNumberErrors[1] = "Mobile number not provided";
mobileNumberErrors[2] = "UK mobile number without the country code, please";
mobileNumberErrors[3] = "UK mobile numbers should contain 10 or 11 digits";
mobileNumberErrors[4] = "The mobile number should start with a 0";
mobileNumberErrors[5] = "The mobile number is either invalid or inappropriate";



/*function isNull_popup(obj,msg,id){
	if(msg!="Password")	{		
		obj1=Trim(obj.value);
	}else{
		obj1=obj.value;	
	}
	if (obj1==""){		
		msg = "Please enter "+msg;
		$.validationEngine.buildPrompt('#'+id+'',''+msg+'','error');
		obj.focus();
		return true;
	}else{
		$('.formError').remove();
		return false;
	}
}*/

function isNull_popup(obj,msg,id){
	if(msg!="Password")	{	
		obj1=Trim(obj.value);
	}else{		
		obj1=obj.value;	
	}
	if (obj1==""){
		if(id=="resume_path")	{
			msg = "Please "+msg;
		}	else	{
			msg = "Please enter "+msg;
		}
		$.validationEngine.buildPrompt('#'+id+'',''+msg+'','error');
		obj.focus();
		return true;
	}else{
		$('.formError').remove();
		return false;
	}
}

function isConfirm_popup(obj,msg,id){
	if(msg!="Password")
		obj1=Trim(obj.value);
	else
		obj1=obj.value;	
	if (obj1==""){
		msg = "Please "+msg
		$.validationEngine.buildPrompt('#'+id+'',''+msg+'','error');
		obj.focus();
		return true;
	}else{
		$('.formError').remove();
		return false;
	}
}

function isNullEditor_popup(obj,msg,id){
	if(Trim(obj1)==""){
		msg = "Please enter "+msg
		$.validationEngine.buildPrompt('#'+id+'',''+msg+'','error');
		obj.focus();
		return true;
	}else{
		$('.formError').remove();
		return false;
	}
}

function isUpload_popup(obj,msg,id){
	if(msg!="Password")
		obj1=Trim(obj.value);
	else
		obj1=obj.value;	
	if (obj1==""){
		msg = "Please upload "+msg
		$.validationEngine.buildPrompt('#'+id+'',''+msg+'','error');
		obj.focus();
		return true;
	}else{
		$('.formError').remove();
		return false;
	}
}

function notEmail_popup(obj,msg,id){
	var exp=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
	if (!exp.test(obj.value)){
		msg = "Please enter a valid "+msg
		$.validationEngine.buildPrompt('#'+id+'',''+msg+'','error');
		obj.focus();
		return true;
	}else{
		$('.formError').remove();
		return false;
	}
}

function isLen_popup(obj,siz,msg,id){
	if(msg!="Password")
		obj1=Trim(obj.value);
	else
		obj1=obj.value;
	if(obj1!=""){
		var strLen=obj.value;
		if(strLen.length < siz){
			msg = msg+" should be atleast " + siz + " characters";
			$.validationEngine.buildPrompt('#'+id+'',''+msg+'','error');
			obj.value="";
			obj.focus();
			return true;  
		} 
	}else{
		$('.formError').remove();
		return false;
	}
}

function isSame_popup(obj1,obj2,msg1,msg2,id){
	if((obj1.value)==(obj2.value)){
		alert("Here")
		msg = msg1+" is same as the "+msg2;
		$.validationEngine.buildPrompt('#'+id+'',''+msg+'','error');
		obj2.focus();
		return true;
	}else{
		$('.formError').remove();
		return false;
	}
}

function isNotSame_popup(obj1,obj2,msg1,msg2,id){
	if((Trim(obj1.value))!=(Trim(obj2.value))){
		msg = msg1+" does not match "+msg2;
		$.validationEngine.buildPrompt('#'+id+'',''+msg+'','error');
		obj2.value="";
		obj2.focus();
		return true;
	}else{
		$('.formError').remove();
		return false;
	}
}	

/*function notChecked_popup(obj,msg,id){
	checked = false;
	if(obj.length){
		for(i=0;i<obj.length;i++){
			if(obj[i].checked){
				checked = true;break;
			}
		}
	}else if(obj.checked)
		checked = true;
	if(!(checked)){
		msg = "Please select the "+msg;
		$.validationEngine.buildPrompt('#'+id+'',''+msg+'','error');
		if(obj.length)
			obj[0].focus();
		else
			obj.focus();
		return true;
	}else{
		$('.formError').remove();
		return false;
	}
}*/

function notChecked_popup(obj,msg,id){
	checked = false;
	if(obj.length){
		for(i=0;i<obj.length;i++){
			if(obj[i].checked){
				checked = true;break;
			}
		}
	}else if(obj.checked)
		checked = true;
	if(!(checked)){
		if(id=="div_confirm_reg" || id=="confirms")	{
			msg = "Please "+msg;
		}	else	{
			msg = "Please select the "+msg;
		}
		
		$.validationEngine.buildPrompt('#'+id+'',''+msg+'','error');
		if(obj.length)
			obj[0].focus();
		else
			obj.focus();
		return true;
	}else{
		$('.formError').remove();
		return false;
	}
}

function notChecked_popup_terms(obj,msg,id){
	checked = false;
	if(obj.length){
		for(i=0;i<obj.length;i++){
			if(obj[i].checked){
				checked = true;break;
			}
		}
	}else if(obj.checked)
		checked = true;
	if(!(checked)){
		msg = ""+msg;
		$.validationEngine.buildPrompt('#'+id+'',''+msg+'','error');
		if(obj.length)
			obj[0].focus();
		else
			obj.focus();
		return true;
	}else{
		$('.formError').remove();
		return false;
	}
}



function notConfirm_popup(obj,msg,id){
	checked = false;
	if(obj.length){
		for(i=0;i<obj.length;i++){
			if(obj[i].checked){
				checked = true;break;
			}
		}
	}else if(obj.checked)
		checked = true;
	if(!(checked)){
		msg = "Please confirm you accept our "+msg;
		$.validationEngine.buildPrompt('#'+id+'',''+msg+'','error');
		if(obj.length)
			obj[0].focus();
		else
			obj.focus();
		return true;
	}else{
		$('.formError').remove();
		return false;
	}
}

function notMultipleSelect_popup(obj,msg,id){
	var totalChecked = 0;
	for (i = 0; i < obj.options.length; i++) {
    	if (obj.options[i].selected) {
        	totalChecked++;
   		}
    }
    if (totalChecked < 1) {
    	msg = "Please select the "+msg;
		$.validationEngine.buildPrompt('#'+id+'',''+msg+'','error');
		obj.focus();
		return true;
    }else{
		$('.formError').remove();
		return false;
	}
}

function notSelected_popup(obj,msg,id){
	if (obj.options[obj.selectedIndex].value == ""){
		msg = "Please select the "+ msg;
		$.validationEngine.buildPrompt('#'+id+'',''+msg+'','error');
		obj.focus();
		return true;
	}else{
		$('.formError').remove();
		return false;
	}
}
function notCVFile_popup(obj,msg,id){
	if(Trim(obj.value)!=""){
		var exp = /^.+\.(DOC|doc|docx|DOCX|pdf|PDF|rtf|RTF)$/;
		if (!exp.test((obj.value).toLowerCase())){
			msg = "Please upload .doc, .docx,.pdf or .rtf file for "+msg;
			$.validationEngine.buildPrompt('#'+id+'',''+msg+'','error');
			obj.value="";
			//obj.focus();
			return true;
		}else
			return false;	
	}else{
		$('.formError').remove();
		return false;
	}
}

function fnChkNum_popup(obj,msg,id){
	exp = /^[\d]/;
	if (!exp.test(obj.value)){
		msg = "Please enter only numeric values in "+msg;
		$.validationEngine.buildPrompt('#'+id+'',''+msg+'','error');
		obj.focus();
		return true;
	}else{
		$('.formError').remove();
		return false;
	}
}

function isUpload_popup(obj,msg,id){
	if(msg!="Password")
		obj1=Trim(obj.value);
	else
		obj1=obj.value;	
	if (obj1==""){
		msg = "Please upload "+msg
		$.validationEngine.buildPrompt('#'+id+'',''+msg+'','error');
		obj.focus();
		return true;
	}else{
		$('.formError').remove();
		return false;
	}
}
