var dom = (document.getElementById) ? true : false;
var ns5 = (!document.all && dom || window.opera) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ie4 && !ie5 && !dom) ? true : false;

var origWidth, origHeight;

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

///////////////////////  CUSTOMIZE HERE   ////////////////////
// settings for tooltip 
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= true;	
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 160;
var offX= 12;	// how far from mouse to show tip
var offY= 12; 
var tipFontFamily= "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "8pt";
// set default text color and background color for tooltip here
// individual tooltips can have their own (set in messages arrays)
// but don't have to
var tipFontColor= "#000000";
var tipBgColor= "#FFFFFF"; 
var tipBorderColor= "#d7ec84";
var tipBorderWidth= 1;
var tipBorderStyle= "ridge";
var tipPadding= 4;

// tooltip content goes here (image, description, optional bgColor, optional textcolor)
var messages = new Array();
// multi-dimensional arrays containing: 
// image and text for tooltip
// optional: bgColor and color to be sent to tooltip
messages[0] = new Array('red_balloon.gif','Here is a red balloon on a white background',"#FFFFFF");
messages[1] = new Array('duck2.gif','Here is a duck on a light blue background.',"#DDECFF");
messages[2] = new Array('test.gif','Test description','black','white');

////////////////////  END OF CUSTOMIZATION AREA  ///////////////////

// preload images that are to appear in tooltip
// from arrays above
if (document.images) {
	var theImgs = new Array();
	for (var i=0; i<messages.length; i++) {
  	theImgs[i] = new Image();
		theImgs[i].src = messages[i][0];
  }
}

// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in doTooltip function
// startStr goes before image, midStr goes between image and text
var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var starttxtStr = '<table width="400"><tr><td valign="top" style="font-family:Verdana, arial, helvetica, sans-serif; font-size:10px;">';
var midStr = '" border="0"></td></tr><tr><td valign="top" style="font-family:Verdana, arial, helvetica, sans-serif; font-size:10px;">';
var endStr = '</td></tr></table>';

////////////////////////////////////////////////////////////
//  initTip	- initialization for tooltip.
//		Global variables for tooltip. 
//		Set styles
//		Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var tooltip, tipcss;
function initTip() {
	if (nodyn) return;
	tooltip = (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
	tipcss = tooltip.style;
	if (ie4||ie5||ns5) {	// ns4 would lose all this on rewrites
		tipcss.width = tipWidth+"px";
		tipcss.fontFamily = tipFontFamily;
		tipcss.fontSize = tipFontSize;
		tipcss.color = tipFontColor;
		tipcss.backgroundColor = tipBgColor;
		tipcss.borderColor = tipBorderColor;
		tipcss.borderWidth = tipBorderWidth+"px";
		tipcss.padding = tipPadding+"px";
		tipcss.borderStyle = tipBorderStyle;
	}
	if (tooltip&&tipFollowMouse) {
		document.onmousemove = trackMouse;
	}
}

window.onload = initTip;
/////////////////////////////////////////////////
//  doTooltip function
//			Assembles content for tooltip and writes 
//			it to tipDiv
/////////////////////////////////////////////////
var t1,t2;	// for setTimeouts
var tipOn = false;	// check if over tooltip link
function doTooltip(evt,usrname,bimg) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	// set colors if included in messages array
	if (ie4||ie5||ns5) {
		var tip = startStr + bimg + midStr + "Photo of " + usrname + endStr;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}
function dotxtTooltip(evt,txtmsg) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	// set colors if included in messages array
	if (ie4||ie5||ns5) {
		var tip = starttxtStr + txtmsg + endStr;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}

var mouseX, mouseY;
function trackMouse(evt) {
	standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
	mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
	mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	if (tipOn) positionTip(evt);
}

/////////////////////////////////////////////////////////////
//  positionTip function
//		If tipFollowMouse set false, so trackMouse function
//		not being used, get position of mouseover event.
//		Calculations use mouseover event position, 
//		offset amounts and tooltip width to position
//		tooltip within window.
/////////////////////////////////////////////////////////////
function positionTip(evt) {
	if (!tipFollowMouse) {
		standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
		mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
		mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	}
	// tooltip width and height
	var tpWd = (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (ns5)? window.innerWidth-20+window.pageXOffset: standardbody.clientWidth+standardbody.scrollLeft;
	var winHt = (ns5)? window.innerHeight-20+window.pageYOffset: standardbody.clientHeight+standardbody.scrollTop;
	// check mouse position against tip and window dimensions
	// and position the tooltip 
	if ((mouseX+offX+tpWd)>winWd) 
		tipcss.left = mouseX-(tpWd+offX)+"px";
	else tipcss.left = mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = winHt-(tpHt+offY)+"px";
	else tipcss.top = mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}

document.write('<div id="tipDiv" style="position:absolute; visibility:hidden; z-index:100"></div>')
///////////////////////
function test(obj,msg){
	var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
	if (regex.test(obj.value)){
		return true;
	}else{
		alert(msg);
		obj.focus();
		return false;
	}
}
function eidtest(obj,msg){
	var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
	if(obj.value!=""){
		if (regex.test(obj.value)){
			return true;
		}else{
			alert(msg);
			obj.focus();
			return false;
		}
	}
}
function checkempty(obj,msg){
	if(obj.value==''){
		alert(msg);
		obj.focus()
		return false;
	}
	return true;
}
function confirmpass(obj,obj1,msg){
	if(obj1.value!=obj.value){
		alert(msg);
		obj1.focus()
		return false;
	}
	return true;
}
function checkdate(obj,msg){
	if(obj.value==''){
		alert(msg);
		document.all.trigger.focus();
		return false;
	}
	return true;
}
/////////////////////
var xmlHttp
function showpage(ctlName,page){
	var xmlHttp = GetXmlHttpObject();
	var url = page+"&sid="+Math.random();
	if (!xmlHttp){
		alert ("Browser does not support HTTP Request")
		return
	}
	xmlHttp.onreadystatechange=function(){
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
//			if(xmlHttp.responseText=='&nbsp;'){
				document.getElementById(ctlName).innerHTML=xmlHttp.responseText;
//			}
		}
	};
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}
function show2tf(ctlName,page){
	var xmlHttp = GetXmlHttpObject();
	var url = page+"&sid="+Math.random();
	if (!xmlHttp){
		alert ("Browser does not support HTTP Request")
		return
	}
	xmlHttp.onreadystatechange=function(){
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
				document.getElementById(ctlName).value=xmlHttp.responseText;
		}
	};
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}
function GetXmlHttpObject(){ 
var objXMLHttp=null;

     if (window.XMLHttpRequest){
          objXMLHttp=new XMLHttpRequest();
     }else if (window.ActiveXObject){
          objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
     }
     return objXMLHttp;
}
/////////////////////
function checkAll(theForm, cName, allNo_stat){
	var n=theForm.elements.length;
	for (var i=0;i<n;i++){
		if (theForm.elements[i].className.indexOf(cName) !=-1){
			if (allNo_stat.checked) {
				theForm.elements[i].checked = true;
			}else{
				theForm.elements[i].checked = false;
			}
		}
	}
}
/////////////////////
function NoSendMsgAlert() {
	NoIniChat = window.open('nosendmsgalert.php','NoSendMsg','width=372,height=281,top='+((screen.availHeight / 2) - (270 / 2))+',left='+((screen.availWidth / 2) - (410 / 2)));
	//profileWind.focus();
	return false;
}
function LaunchMsngr(){
	PhpMsngr=window.open('msgrphp/signin.php','messenger_php','width=275,height=500,status=1,resizable=0');
	PhpMsngr.focus();
}
function CloseMsngr(){
	if(PhpMsngr != null || !PhpMsngr.closed){
		PhpMsngr.close();
	}
}
/////////////////////
function chkpUpload(){
//	if(document.frmPhoto.file4.value==""){
		if(document.frmPhoto.file3.value==""){
			if(document.frmPhoto.file2.value==""){
				if(document.frmPhoto.file1.value==""){
					alert("Information: Please select Image to Upload");
					document.frmPhoto.file1.focus();
					return false;
				}
			}
		}
		return true
//	}else{
//		return true;
//	}
}
function chkpOpt(){
	if(document.frmOption.photodisplay[1].checked==true){
		if(checkempty(document.frmOption.ppass,"Information Please Enter Password")){}else{return false};
		if(checkempty(document.frmOption.pcpass,"Information Please Enter Confirm Password")){}else{return false};
		if(confirmpass(document.frmOption.ppass,document.frmOption.pcpass,"Information Password and Confirm Password must be same")){}else{return false};
	}
}
function ChkID(){
	if(checkempty(document.frmIDSearch.usrname,"Information Please Enter UserID")){return true}else{return false};
}
function ChkID1(){
	if(checkempty(document.frmIDSearch1.usrname,"Information Please Enter UserID")){return true}else{return false};
}
function ChktID(){
	if(document.frmDefID.usrname.value=='Search by ID'){
		alert("Enter Username");
		document.frmDefID.usrname.value='';
		document.frmDefID.usrname.focus();
		return false;
	}
	if(checkempty(document.frmDefID.usrname,"Information Please Enter UserID")){return true}else{return false};
}
function chkadvSrch(){
	if(checkempty(document.frmmSrch.religion,"Information Please Select Religion")){}else{return false};
	if(checkempty(document.frmmSrch.education1,"Information Please Select Education")){}else{return false}; 
	if(checkempty(document.frmmSrch.country,"Information Please Select Country")){}else{return false};
	if(checkempty(document.frmmSrch.occupation,"Information Please Select Occupation")){}else{return false};
	return true;
	
}
function validateForgotPasswordForm(){
	if(test(document.fromForgotPassword.txtEmail,"Information Please Enter Your Email ID")){}else{return false};
}
function ChkLogin(){
	if(checkempty(document.frmLogin.uname,"Information Please Enter Username")){}else{return false};
	if(checkempty(document.frmLogin.pass,"Information Please Enter Password")){}else{return false};
	return true;
}
function chkalbumpass(){
	if(checkempty(document.frmalbumlogin.pass,"Information Please Enter Password to View User's Album")){}else{return false};
	return true;
}
function chkcdpass(){
	if(checkempty(document.frmcdlogin.pass,"Information Please Enter Password to View User's Contact Details")){}else{return false};
	return true;
}
function chksstory(){
	if(checkempty(document.frmSStory.name,"Information Please Enter Your Name")){}else{return false};
	if(checkempty(document.frmSStory.partner_name,"Information Please Enter Your Partner's Name")){}else{return false};
	
	if(checkempty(document.frmSStory.profileid,"Information Please Enter Your Findrishtay.com Profile ID")){}else{return false};
	if(checkempty(document.frmSStory.partner_profileid,"Information Please Enter Your Partner's Findrishtay.com Profile ID")){}else{return false};
	
	if(checkempty(document.frmSStory.profiledob,"Information Please Select Your Date of Birth")){}else{return false};
	if(checkempty(document.frmSStory.partner_profiledob,"Information Please Select Your Partner's Date of Birth")){}else{return false};
	
	if(checkempty(document.frmSStory.marital_status,"Information Please Select Your Marital Status")){}else{return false};
	if(checkempty(document.frmSStory.partner_marital_status,"Information Please Select Your Partner's Marital Status")){}else{return false};
	
	if(checkempty(document.frmSStory.special_case,"Information Please Select Your Special Case")){}else{return false};
	if(checkempty(document.frmSStory.partner_special_case,"Information Please Select Your Partner's Special Case")){}else{return false};
	
//	if(checkempty(document.frmSStory.weddingdate,"Information Please Select Your Wedding Date")){}else{return false};
	if(checkempty(document.frmSStory.address,"Information Please Enter Your Address")){}else{return false};
	if(checkempty(document.frmSStory.message,"Information Please Tell us how you met each other on Findrishtay.com")){}else{return false};
	
	if(document.frmSStory.message.value.length < 100) {
		alert("Please write minimum 100 characters about you.")
		document.frmSStory.message.focus();
		return false;
	}
	if(document.frmSStory.message.value.length > 2000) {
		alert("You can write maximum 4000 characters in about you.")
		document.frmSStory.message.focus();
		return false;
	}	
	if(document.frmSStory.message.value.indexOf("@") != -1) {
//		alert("You can not enter email address in About You.")
//		document.frmSStory.message.focus();
//		return false;
	}
	if(document.frmSStory.message.value.indexOf("  ") != -1) {
		alert("You are not allowd to enter consecutive spaces.")
		document.frmSStory.message.focus();
		return false;
	}
	
	if(checkempty(document.frmSStory.photo1,"Information Please Select Your Wedding/Engagement Photo1")){}else{return false};
	if(checkempty(document.frmSStory.photo2,"Information Please Enter Your Wedding/Engagement Photo2")){}else{return false};
	if(checkempty(document.frmSStory.photo3,"Information Please Enter Your Wedding/Engagement Photo3")){}else{return false};
	return true;
}
function chkmAction(){
	if(confirm("Are you sure you want to delete")){
		return true;	
	}else{
		return false;
	}
}
function validateChangeProfileForm(){
	if(checkempty(document.frmPartner.txtAboutYourPartner,"Information Please Enter Some Detail About Your Partner")){}else{return false};
	return true;
}
function chkLogin2(){
	if(checkempty(document.frmlogin2.uname,"Information Please Enter Username")){}else{return false};
	if(checkempty(document.frmlogin2.pass,"Information Please Enter Password")){}else{return false};
	return true;
}
function validateLoginRegister(){
	if(checkempty(document.loginRegisterForm.Username,"Information Please Enter Username")){}else{return false};
	if(document.loginRegisterForm.unexsits.value=="Not Available"){
		alert("The username you entered is already registered, Please provide other username");
		document.loginRegisterForm.Username.focus();
		document.loginRegisterForm.Username.select();
		return false;
	}
	if(checkempty(document.loginRegisterForm.Password,"Information Please Enter Password")){}else{return false};
	if(checkempty(document.loginRegisterForm.confirmPassword,"Information Please Enter Confirm Password")){}else{return false};
	if(confirmpass(document.loginRegisterForm.Password,document.loginRegisterForm.confirmPassword,"Information Password and Confirm Password must be same")){}else{return false};
	if(test(document.loginRegisterForm.Email,"Information Please Enter Email")){}else{return false};
	if(document.loginRegisterForm.ueexsits.value=="Not Available"){
		alert("The email you entered is already registered, Please provide other email");
		document.loginRegisterForm.Email.focus();
		document.loginRegisterForm.Email.select();
		return false;
	}
	if(checkempty(document.loginRegisterForm.confirmEmail,"Information Please Enter Confirm Email")){}else{return false};
	if(test(document.loginRegisterForm.confirmEmail,"Information Please Enter Confirm Email")){}else{return false};
	if(confirmpass(document.loginRegisterForm.Email,document.loginRegisterForm.confirmEmail,"Information Email and Confirm Email must be same")){}else{return false};
	if(checkempty(document.loginRegisterForm.secertQuestion,"Information Please Select Secret Question")){}else{return false};
	if(checkempty(document.loginRegisterForm.secertAnswer,"Information Please Enter Answer to your Question")){}else{return false};
	if(!document.loginRegisterForm.chkTerms.checked) {
		alert("You must have to agree the Terms and Conditions in order to register.")
		document.loginRegisterForm.secertAnswer.focus();
		return false;
	}
	return true;
}
function validateInfoRegister(){
	if(checkempty(document.infoRegisterForm.profileBy,"Information Please Select Profile By")){}else{return false};
	if(checkempty(document.infoRegisterForm.firstName,"Information Please Enter First Name")){}else{return false};
	if(checkempty(document.infoRegisterForm.lastName,"Information Please Enter Last Name")){}else{return false};
	if(checkempty(document.infoRegisterForm.zodiacSign,"Information Please Select Star Sign")){}else{return false};
	if(checkempty(document.infoRegisterForm.maritalStatus,"Information Please Select Marital Status")){}else{return false};
	if(checkempty(document.infoRegisterForm.height,"Information Please Select Height")){}else{return false};
	if(checkempty(document.infoRegisterForm.body,"Information Please Select Body Type")){}else{return false};
	if(checkempty(document.infoRegisterForm.complexion,"Information Please Select Complexion")){}else{return false};
	if(checkempty(document.infoRegisterForm.specialCases,"Information Please Select Special Case")){}else{return false};
	if(checkempty(document.infoRegisterForm.religion,"Information Please Select Religion")){}else{return false};
	if(checkempty(document.infoRegisterForm.motherTongue,"Information Please Select Mother Tongue")){}else{return false};
	if(checkempty(document.infoRegisterForm.caste,"Information Please Enter Caste")){}else{return false};
	if(checkempty(document.infoRegisterForm.education1,"Information Please Select Education")){}else{return false};
	if(checkempty(document.infoRegisterForm.education2,"Information Please Select Education In")){}else{return false};
	if(checkempty(document.infoRegisterForm.occupation,"Information Please Select Occupation")){}else{return false};
	if(checkempty(document.infoRegisterForm.diet,"Information Please Select Diet")){}else{return false};
	if(checkempty(document.infoRegisterForm.country,"Information Please Select Country of Residence")){}else{return false};
	if(checkempty(document.infoRegisterForm.state,"Information Please Enter State")){}else{return false};
	if(checkempty(document.infoRegisterForm.city,"Information Please Enter City")){}else{return false};
	if(checkempty(document.infoRegisterForm.residenceStatus,"Information Please Select Residence Status")){}else{return false};
	return true;
}
//////////////////////////
function launchMessenger(){
	
}
function doAlert(){
	window.open('nopalert.php','messenger_php1','width=372,height=281,top='+((screen.availHeight / 2) - (270 / 2))+',left='+((screen.availWidth / 2) - (410 / 2)));
}
//////////////////////////

	function validateMessageForm() {
		if(document.frmSendMessage.txtTitle.value == "") {
			alert("Please enter a Title");
			document.frmSendMessage.txtTitle.focus();
			return false;
		}
		if(document.frmSendMessage.txtMessage.value == "") {
			alert("Please enter your Message")
			document.frmSendMessage.txtMessage.focus();
			return false;
		}
		if(document.frmSendMessage.txtMessage.value.length > 1000) {
			alert("You can send up 1000 characters in your one message Message")
			document.frmSendMessage.txtMessage.focus();
			return false;		
		}
		return true;
	}	
	function validateChangePasswordForm() {

		if(document.frmChangePassword.txtoPass.value == "") {
			alert("Please enter your Old Password.")
			document.frmChangePassword.txtoPass.focus();
			return false;
		}
		if(document.frmChangePassword.txtPassword.value == "") {
			alert("Please enter a Password.")
			document.frmChangePassword.txtPassword.focus();
			return false;
		}
		if(document.frmChangePassword.txtCPassword.value == "") {
			alert("Please enter Confirm Password.")
			document.frmChangePassword.txtCPassword.focus();
			return false;
		}	
		if(document.frmChangePassword.txtPassword.value != document.frmChangePassword.txtCPassword.value) {
			alert("Password and Confirm Password fields are not same.")
			document.frmChangePassword.txtPassword.value = "";
			document.frmChangePassword.txtCPassword.value = "";
			document.frmChangePassword.txtPassword.focus();
			return false;
		}																
		return true;
	}
function calcCharLen(){
		document.getElementById("noOfChar").innerHTML = document.infoRegisterForm.aboutYou.value.length
		blurTextArea();
	}
	function checkUsernameSymbol() {
		if(!((event.keyCode >= 97 && event.keyCode <= 122) || (event.keyCode >= 65 && event.keyCode <= 90) || (event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode == 46) || (event.keyCode == 95))) {
			alert("Sorry! you can enter only alphabets(A-Z,a-z), numerics(0-9), underscore (_) and dot (.) symbols.");
			event.keyCode = 0
		}
	}
	function checkTextBoxSymbol() {
		if(!((event.keyCode >= 97 && event.keyCode <= 122) || (event.keyCode >= 65 && event.keyCode <= 90) || (event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode == 32))) {
			alert("Sorry! you can enter only alphabets(A-Z,a-z), numerics(0-9) and spaces values.");
			event.keyCode = 0
		}
	}


	function checkPasswordSymbol() {
		if(!((event.keyCode >= 97 && event.keyCode <= 122) || (event.keyCode >= 65 && event.keyCode <= 90) || (event.keyCode >= 48 && event.keyCode <= 57))) {
			alert("Sorry! you can enter only alphabets(A-Z,a-z) and numerics(0-9)");
			event.keyCode = 0
		}
	}
	function blurPassword(prm) {
		txt = prm.value;
		for(i=0; i<txt.length; i++) {
			if(!(txt.charAt(i) == "A" || txt.charAt(i) == "a" || txt.charAt(i) == "B" || txt.charAt(i) == "b" || txt.charAt(i) == "C" || txt.charAt(i) == "c" || txt.charAt(i) == "D" || txt.charAt(i) == "d" || txt.charAt(i) == "E" || txt.charAt(i) == "e" || txt.charAt(i) == "F" || txt.charAt(i) == "f" || txt.charAt(i) == "G" || txt.charAt(i) == "g" || txt.charAt(i) == "H" || txt.charAt(i) == "h" || txt.charAt(i) == "I" || txt.charAt(i) == "i" || txt.charAt(i) == "J" || txt.charAt(i) == "j" || txt.charAt(i) == "K" || txt.charAt(i) == "k" || txt.charAt(i) == "L" || txt.charAt(i) == "l" || txt.charAt(i) == "M" || txt.charAt(i) == "m" || txt.charAt(i) == "N" || txt.charAt(i) == "n" || txt.charAt(i) == "O" || txt.charAt(i) == "o" || txt.charAt(i) == "P" || txt.charAt(i) == "p" || txt.charAt(i) == "Q" || txt.charAt(i) == "q" || txt.charAt(i) == "R" || txt.charAt(i) == "r" || txt.charAt(i) == "S" || txt.charAt(i) == "s" || txt.charAt(i) == "T" || txt.charAt(i) == "t" || txt.charAt(i) == "U" || txt.charAt(i) == "u" || txt.charAt(i) == "V" || txt.charAt(i) == "v" || txt.charAt(i) == "W" || txt.charAt(i) == "w" || txt.charAt(i) == "X" || txt.charAt(i) == "x" || txt.charAt(i) == "Y" || txt.charAt(i) == "y" || txt.charAt(i) == "Z" || txt.charAt(i) == "z" || txt.charAt(i) == "0" || txt.charAt(i) == "1" || txt.charAt(i) == "2" || txt.charAt(i) == "3" || txt.charAt(i) == "4" || txt.charAt(i) == "5" || txt.charAt(i) == "6" || txt.charAt(i) == "7" || txt.charAt(i) == "8" || txt.charAt(i) == "9")) {
				alert("Please enter only alphabets(A-Z,a-z) and numerics(0-9).");
				if(navigator.appName == "Microsoft Internet Explorer") {
					prm.focus();
				}
				else {
					txt.focus();
				}	
				return false;
			}
		}
	}
	
	function blurTextArea(prm) {
//		txt = prm.value;
//		for(i=0; i<txt.length; i++) {
//			if(txt.charAt(i) == "@" || txt.charAt(i) == "'" || txt.charAt(i) == '"') {
//				alert("You are not allowd to enter following special charaters ( @ , ' , '' ).");
//				if(navigator.appName == "Microsoft Internet Explorer") {
//					prm.focus();
//				}
//				else {
//					txt.focus();
//				}				
//				return false;
//			}
//			if(txt.charAt(i) == " " && txt.charAt(i-1) == " ") {
//				alert("You are not allowd to enter consecutive spaces.");
//				if(navigator.appName == "Microsoft Internet Explorer") {
//					prm.focus();
//				}
//				else {
//					txt.focus();
//				}				
//				return false;				
//			}
//		}
	}	
	
	function checkTextAreaSymbol_1() {
		if(!((event.keyCode >= 97 && event.keyCode <= 122) || (event.keyCode >= 65 && event.keyCode <= 90) || (event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode == 32) || (event.keyCode == 44))) {
			alert("Please enter only alphabets(A-Z,a-z), numerics(0-9), comman(,) and space( ).");
			event.keyCode = 0
		}
	}
	function blurTextArea_1(prm) {
		txt = prm.value;
		for(i=0; i<txt.length; i++) {
			if(!(txt.charAt(i) == "A" || txt.charAt(i) == "a" || txt.charAt(i) == "B" || txt.charAt(i) == "b" || txt.charAt(i) == "C" || txt.charAt(i) == "c" || txt.charAt(i) == "D" || txt.charAt(i) == "d" || txt.charAt(i) == "E" || txt.charAt(i) == "e" || txt.charAt(i) == "F" || txt.charAt(i) == "f" || txt.charAt(i) == "G" || txt.charAt(i) == "g" || txt.charAt(i) == "H" || txt.charAt(i) == "h" || txt.charAt(i) == "I" || txt.charAt(i) == "i" || txt.charAt(i) == "J" || txt.charAt(i) == "j" || txt.charAt(i) == "K" || txt.charAt(i) == "k" || txt.charAt(i) == "L" || txt.charAt(i) == "l" || txt.charAt(i) == "M" || txt.charAt(i) == "m" || txt.charAt(i) == "N" || txt.charAt(i) == "n" || txt.charAt(i) == "O" || txt.charAt(i) == "o" || txt.charAt(i) == "P" || txt.charAt(i) == "p" || txt.charAt(i) == "Q" || txt.charAt(i) == "q" || txt.charAt(i) == "R" || txt.charAt(i) == "r" || txt.charAt(i) == "S" || txt.charAt(i) == "s" || txt.charAt(i) == "T" || txt.charAt(i) == "t" || txt.charAt(i) == "U" || txt.charAt(i) == "u" || txt.charAt(i) == "V" || txt.charAt(i) == "v" || txt.charAt(i) == "W" || txt.charAt(i) == "w" || txt.charAt(i) == "X" || txt.charAt(i) == "x" || txt.charAt(i) == "Y" || txt.charAt(i) == "y" || txt.charAt(i) == "Z" || txt.charAt(i) == "z" || txt.charAt(i) == "0" || txt.charAt(i) == "1" || txt.charAt(i) == "2" || txt.charAt(i) == "3" || txt.charAt(i) == "4" || txt.charAt(i) == "5" || txt.charAt(i) == "6" || txt.charAt(i) == "7" || txt.charAt(i) == "8" || txt.charAt(i) == "9" || txt.charAt(i) == " " || txt.charAt(i) == ",")) {
				alert("Please enter only alphabets(A-Z,a-z), numerics(0-9), comman(,) and space( ).");
				if(navigator.appName == "Microsoft Internet Explorer") {
					prm.focus();
				}
				else {
					txt.focus();
				}				
				return false;
			}
		}
	}