function newNeighbourHome()
{
	
	if (document.getElementById('catselect').value == "-2")
	{
		if(isNaN(document.getElementById('session').value))
		{
			zip=document.getElementById('session').value.substr(0,3);
		}
		else
		{
			zip=document.getElementById('session').value;
		}		
		window.location.replace('http://www.i-'+nCookie+'s.org/'+zip);
	}
	else
	{
		window.location = "/action.php?action=switch&hood="+document.getElementById('catselect').value;
	}
}
	function ValidateEmailControl()
	{
		if (document.getElementById('login_email').value == "")
		{
			$('#no1').click(function() {
				$.unblockUI();
				document.getElementById('login_email').focus();
				return false;
			});
	
			document.getElementById("message1").innerHTML='<h2>Please enter your current email address or Username</h2>';
			$.blockUI({ message: $('#emailalert1') });
			return false;
			
		}
		else
		{
			document.forms.frmIndex.action = "/forgotpassword.php";
			document.forms.frmIndex.submit();
		}
	}
	
	function validateLoginEntries()
	{
		var sUserName, sPassword,sSearchURL;
		if (document.getElementById('login_email').value == "")
		{
		
			$('#no1').click(function() {
				$.unblockUI();
			document.getElementById('login_email').focus();
				return false;
			});
	
			document.getElementById("message1").innerHTML='<h2>Please enter valid username / email id</h2>';
			$.blockUI({ message: $('#emailalert1') });
			return false;
			
		}
		else
		{
			sUserName = document.getElementById('login_email').value;
		}
		if (document.getElementById('login_password').value == "")
		{
			$('#no1').click(function() {
				$.unblockUI();
			document.getElementById('login_password').focus();
				return false;
			});
	
			document.getElementById("message1").innerHTML='<h2>Please enter password</h2>';
			$.blockUI({ message: $('#emailalert1') });
			return false;
			
		}
		else
		{
			sPassword = document.getElementById('login_password').value;
		}
	
		if (sUserName != "" && sPassword != "")
		{
			sSearchURL = '/actionpage.php?module=login&action=check&usn=' + sUserName + '&pwd=' + sPassword;
			ajaxHeader(sSearchURL);
		}
	}
	function ValidateEmailControl()
	{
		if (document.getElementById('login_email').value == "")
		{
			$('#no1').click(function() {
				$.unblockUI();
			document.getElementById('login_email').focus();
				return false;
			});
	
			document.getElementById("message1").innerHTML='<h2>Please enter your current email address or Username</h2>';
			$.blockUI({ message: $('#emailalert1') });
			return false;
			
		}
		else
		{
			document.loginform1.action = "/forgotpassword.php";
			document.loginform1.submit();
		}
	}
	function ajaxHeader(sURL) 
	{
		var xmlhttp;
		try 
		{
			xmlhttp=new XMLHttpRequest();
		}
		catch (e) 
		{
			try 
			{
				xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e) 
			{
				try 
				{
					xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e) 
				{
					alert("Your browser does not support AJAX!");
					return false;
				}
			}
		}
		//var url='ajax.php?data='+str;
		var url = sURL;
		var sAns;
		xmlhttp.onreadystatechange=function() 
		{
			if(xmlhttp.readyState==4) 
			{
				if (xmlhttp.responseText.search('no')!=-1)
				{
					document.getElementById('error').innerHTML = 'The username or password you entered is incorrect!.';
				}
				else
				{
					 document.forms.loginform1.action ='/action.php?action=index';					
					 document.loginform1.submit();	
				}			
			}
		}
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	} 

