//THIS FUNCTION IS DO THE THINGS AS PER THE PAREMETER IF IT IS 'update' then update the DB else it will fetch data from DB
function emailChk() {
			//alert("s");
		  var definedFigures = {
			Email: $("Email").value
		  }
			ajaxCaller.get("ajaxEmailVal.php", definedFigures, onSelectResponse, true, null);
} 

// this function will get the data from db & put it into var text with | delim. here we split them & again put that into form element
function onSelectResponse(xml, headers, callingContext) {

	var allItems = xml.getElementsByTagName("root");
	var login_data = "";

		var itemElm = allItems[0];
		var linkElm = itemElm.getElementsByTagName("email_chk").item(0);
		var linkURL = linkElm.firstChild.nodeValue;
		if(linkURL != '0'){

			alert("This email address is already in use. Please use another email id or go to forget password to retrive old password");
			//showPopUp('dialog');
			return false;
		}
		window.document.register_mail.submit();
}
