// JavaScript Document
	var $j = jQuery.noConflict();
	$j(function() {
		$j("#forgotPsw").dialog({
			bgiframe: true,
			height: 400,
			width:600,
			autoOpen: false,
			modal: true
		});
		
		$j('#lnkPswd').click(function() {
			$j('#forgotPsw').dialog('open');
		});	
		
		$j('#ibfSubmit').click(function() {
			var res = "";
			email = document.getElementById("txtfEmailId").value;
			if (!IsEmail(email) || email == "") res += "your email address\n";
			if (res != "") {
				alert ("Please check \n" + res);
				return;
			}
			retrievePassword();
			//$l('#sendFriend').dialog('open');
		});			
	});
	
	
	var $l = jQuery.noConflict();
	$l(function() {
		//var yemail = $l("#txstEmailId"),
			//femail = $l("#txtsFEmailId"),
			//messsage = $l("#txtsComments");//,
			//allFields = $l([]).add(yemail).add(femail).add(messsage);
		$l("#sendFriend").dialog({
			bgiframe: true,
			height: 400,
			width:600,
			autoOpen: false,
			modal: true,
			focus:true
		});
		
		$l('#lnkSendFriend').click(function() {
			$l('#sendFriend').dialog('open');
		});
		
		$l('#btnLogin').click(function() {	
			var res = "";
			email = document.getElementById("txtlEmail").value;
			pass = document.getElementById("txtlPassword").value;
			if (!IsEmail(email) || email == "") res += "- Your Email Address\n";
			if (pass == "") res += "- Password\n";
			if (res != "") {
				alert ("Please check the following \n" + res);
				return;
			}
			Login();
		});
		
		$l('#ibPopSFSubmit').click(function() {
			var res = "";
			var ye1, ye2, fe1, fe2;
			ye1 = document.getElementById("txtsEmailId");
			ye2 = document.getElementById("txstEmailId");
			fe1 = document.getElementById("txtsFEmailId");
			fe2 = document.getElementById("txtsEmailId");
			if (ye1) yemail = ye1.value;
			if (ye2) yemail = ye2.value;
			if (fe1) femail = fe1.value;
			if (fe2) femail = fe2.value;
			//yemail = document.getElementById("txstEmailId").value;
			//femail = document.getElementById("txtsEmailId").value;
			messsage = document.getElementById("txtsComments").value;
			if (!IsEmail(yemail) || yemail == "") res += "- Your Email Address\n";
			if (!IsEmail(femail) || femail == "") res += "- Your Friend's Address\n";
			if (res != "") {
				alert ("Please check the following \n" + res);
				return;
			}
			//t = document.getElementById("tPopMsg");
			//if (t) t.innerHTML = "Thank you! Your message has been sent.";
			referFriend();
		});				
	});
	
	var $k = jQuery.noConflict();
	$k(function() {
		$k("#astecoGooleMap").dialog({
			bgiframe: true,
			height: 400,
			width:600,
			autoOpen: false,
			modal: true
		});
		
		$k('#lnkGoogleMap').click(function() {
			$k('#astecoGooleMap').dialog('open');
		});				
	});
	
	var $o = jQuery.noConflict();
		$o(function() {
			$o('#ibcSubmit').click(function() {
				var res = "";
				fname = document.getElementById("txtcFirstName").value;
				lname = document.getElementById("txtcLastName").value;
				email = document.getElementById("txtcEmail").value;
				country = document.getElementById("ddlcCountry");
				phone = document.getElementById("txtcPhone").value;
				mobile = document.getElementById("txtcMobile").value;
				comments = document.getElementById("txtcComments").value;
				hf = document.getElementById("hfPropertyId");
				if (!isAlpha(fname) || fname == "") res += "- First Name\n";
				if (!isAlpha(lname) || lname == "") res += "- Last Name\n";
				if (!IsEmail(email) || email == "") res += "- Email Address\n";
				if (country.options[country.selectedIndex].value == "") res += "- Country\n";
				if (!isNum(phone) || phone == "") res += "- Telephone Number\n";
				if (!isNum(mobile) || mobile == "") res += "- Mobile Number\n";
				if (comments == "") res += "- Enquiry\n";
				if (res != "") {
					alert ("Please check the following \n" + res);
					return;
				}
				
				msg = "Information not available";
				if (hf) msg = hf.value;
				contactTeam("Property details - " + msg);
			});				
		});
