function showCityOverlay(ids){
	if(document.getElementById(ids).className=='citySubMenuHide'){
		document.getElementById(ids).className='citySubMenuShow';
		document.getElementById('dollarOverlay').className='dollarSubMenuHide';
	}
	else {
		document.getElementById(ids).className='citySubMenuHide';
	}
}
function showDollarOverlay(ids){
	if(document.getElementById(ids).className=='dollarSubMenuHide'){
		document.getElementById(ids).className='dollarSubMenuShow';
		document.getElementById('cityOverlay').className='citySubMenuHide';
	}
	else {
		document.getElementById(ids).className='dollarSubMenuHide';
	}
}
var page=new Array();
page[0]="images/Page1.gif";
page[1]="images/Page2.gif";
page[2]="images/Page3.gif";
page[3]="images/Page4.gif";
page[4]="images/Page5.gif";
page[5]="images/Page6.gif";
var pageS=new Array();
pageS[0]="images/Page1S.gif";
pageS[1]="images/Page2S.gif";
pageS[2]="images/Page3S.gif";
pageS[3]="images/Page4S.gif";
pageS[4]="images/Page5S.gif";
pageS[5]="images/Page6S.gif";
var photos=new Array();
var photoslink=new Array();
var which=0;
//define images. You can have as many as you want:
photos[0]="images/DL1.jpg";
photos[1]="images/DL2.jpg";
photos[2]="images/DL3.jpg";
photos[3]="images/DL4.jpg";
photos[4]="images/DL2.jpg";
photos[5]="images/DL5.jpg";
var linkornot=1;
//Set corresponding URLs for above images. Define ONLY if variable linkornot equals "1"
photoslink[0]="a.html";
photoslink[1]="a.html";
photoslink[2]="a.html";
photoslink[3]="a.html";
photoslink[4]="a.html";
photoslink[5]="a.html";
var preloadedimages=new Array();
for (i=0;i<photos.length;i++){
	preloadedimages[i]=new Image()
	preloadedimages[i].src=photos[i];
}

function backward(){
	if(which ==0){
		which=photos.length;
	}
	if (which>0){
		which--;
		document.images.photoslider.src=photos[which];
	}
	stopCount();
}

function forward(){
	if(which ==(photos.length-1)){
		which=photos.length-(photos.length+1);
	}
	if (which<photos.length-1){
		which++;
		document.images.photoslider.src=photos[which];
	}
	stopCount();
}

function showImg(img){
	which = img;
	document.images.photoslider.src=photos[which];
	stopCount();
}

function transport(){
	window.location=photoslink[which];
	stopCount();
}

function roll(img_name, img_src){
	document[img_name].src = img_src;
}
function selectedTab(tab){
	var par =document.getElementById('buyTabTop');
	var childs=par.getElementsByTagName('li');
	for(i=0; i<childs.length; i++)
	{
		if (childs[i].id == tab.id)
		{
			childs[i].className = "selected";
			//document.getElementById('subNavigation').className="w-1002 ls-27 ie6_lh-27 ie6_mt-5n buyTab"+childs[i].id;
		}
		else
		{
			childs[i].className = "";
		}
	}
}
function showloginLightBox(){
	alert(document.body.offsetWidth);
}
function selectedSubTab(tab){
	var par =document.getElementById('subNav');
	var childs=par.getElementsByTagName('a');
	for(i=0; i<childs.length; i++)
	{
		if (childs[i].id == tab.id)
		{
			childs[i].className = "selectedsubNavigation";
			if(tab.id=="link1"){
					document.getElementById('spR').className = "selectedsearchTab";
					document.getElementById('spC').className = "searchTab";
					document.getElementById('aopl').innerHTML ='<a href="">Re-sell</a> &nbsp; | &nbsp; <a href="">Rent</a> &nbsp; | &nbsp; <a href="">PG</a>';
			}
			if(tab.id=="link2"){
					document.getElementById('spR').className = "searchTab";
					document.getElementById('spC').className = "selectedsearchTab";
					document.getElementById('aopl').innerHTML ='<a href="">Re-sell</a> &nbsp; | &nbsp; <a href="">Lease</a>';
			}
		}
		else
		{
			childs[i].className = "unselectedsubNavigation";
		}
	}
}
function selectedTab(tab){
	var par =document.getElementById('navigation');
	var childs=par.getElementsByTagName('a');
	for(i=0; i<childs.length; i++)
	{
		if (childs[i].id == tab.id)
		{
			childs[i].className = "selectedtop";
			document.getElementById('subNav').className=tab.id;
			document.getElementById('footer').className=tab.id;
			switch(tab.id){
				case 'buy':
					document.getElementById('subNav').innerHTML="<a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link1'>Residential </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link2'>Commercial  </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link3'>Post Requirement </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link4'>Tools & Trends </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link5'>Legal Corner  </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link6'>NRI Services </a> &nbsp; | &nbsp;<input type='button' style='border:0 none; background:url(images/hotInvestment.gif); width:159px; height:23px;margin-left:20px' />";
					break;
				case 'sell':
					document.getElementById('subNav').innerHTML="<a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link1'>Residential </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link2'>Commercial  </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link3'>Post Requirement </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link4'>Tools & Trends </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link5'>Legal Corner  </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link6'>NRI Services </a> &nbsp; | &nbsp;<input type='button' style='border:0 none; background:url(images/hotInvestment.gif); width:159px; height:23px;margin-left:20px' />";
					break;
				case 'agent':
					document.getElementById('subNav').innerHTML="<a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link1'>Residential </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link2'>Commercial  </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link3'>Post Requirement </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link4'>Tools & Trends </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link5'>Legal Corner  </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link6'>NRI Services </a> &nbsp; | &nbsp;<input type='button' style='border:0 none; background:url(images/hotInvestment.gif); width:159px; height:23px;margin-left:20px' />";
					break;
				case 'event':
					document.getElementById('subNav').innerHTML="<a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link1'>Residential </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link2'>Commercial  </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link3'>Post Requirement </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link4'>Tools & Trends </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link5'>Legal Corner  </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link6'>NRI Services </a> &nbsp; | &nbsp;<input type='button' style='border:0 none; background:url(images/hotInvestment.gif); width:159px; height:23px;margin-left:20px' />";
					break;
				default :
					document.getElementById('subNav').innerHTML="<a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link1'>Residential </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link2'>Commercial  </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link3'>Post Requirement </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link4'>Tools & Trends </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link5'>Legal Corner  </a> &nbsp; | &nbsp; <a class='unselectedsubNavigation' href='javascript:void(0)' onClick='selectedSubTab(this)' id='link6'>NRI Services </a> &nbsp; | &nbsp;<input type='button' style='border:0 none; background:url(images/hotInvestment.gif); width:159px; height:23px;margin-left:20px' />";
			}
		}
		else
		{
			childs[i].className = "unSelectedtop";
		}
	}
}
function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll)
	return arrayPageScroll;
}

function getPageSize(){

	var xScroll, yScroll;

	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
	return arrayPageSize;
}
function showLightbox(){
	var lightboxWidth='500';
	var objOverlay = document.getElementById('shadowoverlay');
	var objLightbox = document.getElementById('lightbox');
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();
	objOverlay.style.height = (arrayPageSize[1] + 'px');
	objOverlay.style.display = 'block';
	objOverlay.style.zIndex = '90';
	objLightbox.style.display = 'block';
	var lightboxHeight = objLightbox.offsetHeight;
	var lightboxTop = arrayPageScroll[1] + ((arrayPageSize[3] - 35 - lightboxHeight) / 2);
	var lightboxLeft = ((arrayPageSize[0] - 20 - lightboxWidth) / 2);
	objLightbox.style.top = (lightboxTop < 0) ? "0px" : lightboxTop + "px";
	objLightbox.style.left = (lightboxLeft < 0) ? "0px" : lightboxLeft + "px";
	objLightbox.style.zIndex = '100';
	arrayPageSize = getPageSize();
	objOverlay.style.height = (arrayPageSize[1] + 'px');
}
function hideLightbox(){
	objOverlay = document.getElementById('shadowoverlay');
	objLightbox = document.getElementById('lightbox');
	objOverlay.style.display = 'none';
	objLightbox.style.display = 'none';
}

function findPosition(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function closefeaturedcaption(){
	document.getElementById('galleryDiv').style.display = 'none';
}

function showGalleryImage(imageObj)
{
	var imgXY = findPosition(imageObj);
	document.getElementById('galleryDiv').style.display = 'block';
	var divX = imgXY[0] - 50;
	var divY = imgXY[1] - 48;
	document.getElementById('galleryDiv').style.left = divX +'px';
	document.getElementById('galleryDiv').style.top = divY +'px';
}
function hideGalleryImage(galleryObj) {
		document.getElementById('galleryDiv').style.display = 'none';
}
function isEmail(str)
{
    var regex = /^[-_.a-z0-9]+@(([-_a-z0-9]+\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i;
    return regex.test(str);
}
//Verify Login
function VerifyAdminLogin(path,email,password)
{
    var xmlhttp = false;
    if(window.XMLHttpRequest)
    {
        xmlhttp = new XMLHttpRequest();
    }
    else if(window.ActiveXObject)
    {

        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    var url = path+'index.php/dashboard/go_loginAdmin?email='+email+'&password='+password;
    xmlhttp.open('GET', url, true);

    xmlhttp.onreadystatechange = function()
    {
        if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
        {
            var CtrlResponce = xmlhttp.responseText;
                CtrlResponce=trim(CtrlResponce, '');
                if(CtrlResponce == "found")
            {
                //window.location.href="http://development.at1place.com/index.php/dashboard/statistics";
            }
        }
    }
    xmlhttp.send(null);
}
function VerifyLogin(path,email,password,url_string)
{
    var redirStringArr=url_string.split('uri_string/')
	var redirString=redirStringArr[1];
	var redirContr=redirString.split('/');
	var xmlhttp = false;
    var Image_Url = document.getElementById('loading_image_url').value;
	if(window.XMLHttpRequest)
	{
		xmlhttp = new XMLHttpRequest();
	} else if(window.ActiveXObject) {

		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
		var url = path+'index.php/login/go?email='+email+'&password='+password;
        xmlhttp.open('GET', url, true);
        xmlhttp.onreadystatechange = function() {
			if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
			{	var CtrlResponce = xmlhttp.responseText;
					CtrlResponce=trim(CtrlResponce, '');
				if(CtrlResponce == "found")
				{
					if(redirString=='home' || redirString=='')
					{
				 		window.location.href=path+"index.php/dashboard/statistics";
					}else
					{
				 		if(redirContr[0]=="project" || redirContr[0]=="developer" || redirContr[0]=="property" || redirContr[0]=="agent")
						{
							window.location.href=path+""+redirString+"/";
						}
                        else if(redirContr[0]=="search")
                        {
                            window.location.href=path+"index.php/"+redirString+"/";
                        }
						else
						{
							//window.location.href=path+"index.php/"+redirString;
                            window.location.href=path+"index.php/dashboard/statistics";
						}
					}
				}else if(xmlhttp.responseText == "inactive")
				{
					document.getElementById('error_div').style.display='block' ;
					document.getElementById('error_div').innerHTML="Your account is inactive!.<br>To activate your account please click on the link sent on your email!" ;
				}else if(xmlhttp.responseText == "deleted")
				{
					document.getElementById('error_div').style.display='block' ;
					document.getElementById('error_div').innerHTML="Your account has been deleted!" ;
				}
				else
				{
					document.getElementById('error_div').style.display='block' ;
					document.getElementById('error_div').innerHTML="Username or Password doesn't match" ;
					document.getElementById('txtemail').focus();
					return false;
				}
			} else {
				document.getElementById('error_div').innerHTML = "<img src="+Image_Url+"images/ajaxloading.gif'>"
			}
		};
		xmlhttp.send(null);

}


function LoginValidation(host_path)
{
	var path=host_path;
	if(document.getElementById('chkremme').checked == true)
	{
		var RememberMe = document.getElementById('chkremme').value;
		var UserNameCookie = document.getElementById('txtemail').value;
		var PasswordCookie = document.getElementById('txtpassword').value;

		// Set cookie for username
		var UserName = getCookie('aop_username');
		if(UserName == UserNameCookie && UserName!=null && UserName!="")
		{
			del_cookie('aop_username');
		}
		if(UserNameCookie!=null && UserNameCookie!="")
		{
			setCookie('aop_username', UserNameCookie, 1);
		}

		// Set cookie for password
		var Password = getCookie('aop_password');
		if(Password == PasswordCookie && Password!=null && Password!="")
		{
			del_cookie('aop_password');
		}
		if(PasswordCookie!=null && PasswordCookie!="")
		{
			setCookie('aop_password', PasswordCookie, 1);
		}
	}

	if(!document.getElementById('txtemail').value)
	{
		document.getElementById('error_div').style.display='inline' ;
		document.getElementById('error_div').innerHTML='Email should not blank' ;
		document.getElementById('txtemail').focus();
		return false ;
	}
	else if(document.getElementById('txtemail').value!="" && !isEmail(document.getElementById('txtemail').value))
	{
		document.getElementById('error_div').style.display='inline' ;
		document.getElementById('error_div').innerHTML='Invalid Email Id' ;
		document.getElementById('txtemail').focus();
		return false;
	}
	else if(!document.getElementById('txtpassword').value)
	{
		document.getElementById('error_div').style.display='inline' ;
		document.getElementById('error_div').innerHTML='Password should not blank' ;
		document.getElementById('txtpassword').focus();
		return false;
	}
	else
	{
		var email = document.getElementById('txtemail').value;
		var password = document.getElementById('txtpassword').value;
		var uri_string = document.getElementById('uri_string').value;
		VerifyLogin(path,email,password,uri_string);
		return true ;
	}
}


function get_post_req_city_state(path)
{
    if(document.getElementById('selstate').value == '')
	{
		return false;
	}
	var state_id = document.getElementById('selstate').value;
	var randomnumber=Math.floor(Math.random()*110);
	var url = path+"index.php/login/getpostreqcity?state_id="+state_id+"&randno="+randomnumber;
    xmlHttp=GetXmlHttpObject(handleresponsepostcity);
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
    return true;
}

function handleresponsepostcity()
{

    var Image_Url = document.getElementById('loading_image_url').value;
    if(xmlHttp.readyState == 4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("cityajax").innerHTML =xmlHttp.responseText;
	}
	else
	{
		document.getElementById("cityajax").innerHTML= "<img src="+Image_Url+"images/ajaxloading.gif'>";
	}

}

function get_post_req_city_state_other(path)
{
    if(document.getElementById('selstaterequired').value == '')
	{
		return false;
	}
	var state_id = document.getElementById('selstaterequired').value;
	var randomnumber=Math.floor(Math.random()*110);
	var url = path+"index.php/login/getpostreqothercity?state_id="+state_id+"&randno="+randomnumber;
	xmlHttp=GetXmlHttpObject(handleresponsepostothercity);
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
    return true;
}

function handleresponsepostothercity()
{

    var Image_Url = document.getElementById('loading_image_url').value;
    if(xmlHttp.readyState == 4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("cityajaxrequired").innerHTML =xmlHttp.responseText;
	}
	else
	{
		document.getElementById("cityajaxrequired").innerHTML= "<img src="+Image_Url+"images/ajaxloading.gif'>";
	}

}

function postEnquiry(path,id,type)
{
	var All_phonechars = "1234567890\.-/() ";
	if(document.getElementById('enquiry_email').value == 0)
	{
		document.getElementById('div_email').style.display = "block";
		document.getElementById('div_email').innerHTML = "Please enter email";
		document.getElementById('enquiry_email').focus();
		return false;
	}
	else
	{
		document.getElementById('div_email').style.display = "none";
	}

	if(document.getElementById('enquiry_email').value!="")
	{
		if(!isEmail(document.getElementById('enquiry_email').value))
		{
			document.getElementById('div_email').style.display = "block";
			document.getElementById('div_email').innerHTML = "Please enter email properly";
			document.getElementById('enquiry_email').select();
			return false;
		}
		else
		{
			document.getElementById('div_email').style.display = "none";
		}
	}

	if(document.getElementById('enquiry_name').value == 0)
	{
		document.getElementById('div_name').style.display = "block";
		document.getElementById('div_name').innerHTML = "Please enter name";
		document.getElementById('enquiry_name').focus();
		return false;
	}
	else
	{
		document.getElementById('div_name').style.display = "none";
	}
	if(!isNaN(document.getElementById('enquiry_name').value))
	{
		document.getElementById('div_name').style.display = "block";
		document.getElementById('div_name').innerHTML = "Please enter name properly";
		document.getElementById('enquiry_name').focus();
		return false;
	}
	else
	{
		document.getElementById('div_name').style.display = "none";
	}
	if(document.getElementById('enquiry_phone').value != "")
	{
		/*if(isNaN(document.getElementById('enquiry_phone').value))
		{
			document.getElementById('div_phone').style.display = "block";
			document.getElementById('div_phone').innerHTML = "Invalid phone number";
			document.getElementById('enquiry_phone').focus();
			return false;
		}*/
		var s=document.getElementById('enquiry_phone').value;
		var i;
		for(i=0;i < s.length;i++)
		{
			var currchar = s.charAt(i);
			//window.alert(All_phonechars.indexOf(currchar));
			if(All_phonechars.indexOf(currchar) == -1)
			{
				document.getElementById('div_phone').style.display = "block";
				document.getElementById('div_phone').innerHTML = "Invalid phone number";
				document.getElementById('enquiry_phone').focus();
				return false;
			}
			else
			{
				document.getElementById('div_phone').style.display = "none";
			}
		}

	}
	if(document.getElementById('enquiry').value == 0)
	{
		document.getElementById('div_enquiry_text').style.display = "block";
		document.getElementById('div_enquiry_text').innerHTML = "Please enter enquiry";
		document.getElementById('enquiry').focus();
		return false;
	}
	else
	{
		document.getElementById('div_enquiry_text').style.display = "none";
	}

	var email = document.getElementById('enquiry_email').value;
	var name = document.getElementById('enquiry_name').value;
	var min_budget = document.getElementById('budget_from').value;
	var max_budget = document.getElementById('budget_to').value;
	var phone = document.getElementById('enquiry_phone').value;
	var country = document.getElementById('enquiry_country').value;
	var enquiry = document.getElementById('enquiry').value;
	var enquiry_loan = document.getElementById('enquiry_loan').checked;
	var enquiry_sitevisit = document.getElementById('enquiry_sitevisit').checked;

	var randomnumber=Math.floor(Math.random()*110);
	var url = path+"index.php/project_microsite/sendEnquiry?enquiry_email="+email+"&enquiry_name="+name+"&min_budget="+min_budget+"&max_budget="+max_budget+"&enquiry_phone="+phone+"&enquiry_country="+country+"&enquiry="+enquiry+"&enquiry_loan="+enquiry_loan+"&enquiry_sitevisit="+enquiry_sitevisit+"&owner_id="+id+"&owner_type="+type+"&randno="+randomnumber;

	xmlHttp=GetXmlHttpObject(handleresponsepostenquiry)
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
    return true;
}

function handleresponsepostenquiry()
{
    var Image_Url = document.getElementById('loading_image_url').value;
    //document.getElementById('pagefrm').style.display = "none";
	if(xmlHttp.readyState == 4 || xmlHttp.readyState=="complete")
	{
        document.getElementById("div_enquiry").innerHTML =xmlHttp.responseText;
        document.getElementById('enquiry_email').value="";
        document.getElementById('enquiry_name').value="";
        document.getElementById('budget_from').value="";
        document.getElementById('budget_to').value="";
        document.getElementById('enquiry_phone').value="";
        document.getElementById('enquiry_country').value=""
        document.getElementById('enquiry').value="";
        document.getElementById('enquiry_loan').checked=false;
        document.getElementById('enquiry_sitevisit').checked=false;
	}
	else
	{
		document.getElementById("div_enquiry").innerHTML= "<img src="+Image_Url+"images/ajaxloading.gif'>";
	}

}

function maxBudgetVal(val)
{
	if(val=="<1000000" || val==">200000000" || val=="<5000" || val==">1000000")
	{
		document.getElementById('maxbudget').innerHTML="<select name='budget_to' id='budget_to' style='width:80px;'><option value='Max Price'>Max Price</option></select>";
	}
	else if(val=="40 Lacs")
	{
		document.getElementById("maxbudget").innerHTML="<select name='budget_to' id='budget_to' style='width:80px;'><option value='5000000'>50 Lacs</option><option value='6000000'>60 Lacs</option><option value='7500000'>75 Lacs</option><option value='10000000'>1 Crore</option><option value='15000000'>1.5 Crore</option><option value='20000000'>2 Crore</option><option value='30000000'>3 Crore</option><option value='50000000'>5 Crore</option><option value='100000000'>10 Crore</option><option value='200000000'>20 Crore</option></select>";
	}
	else if(val=="50 Lacs")
	{
		document.getElementById("maxbudget").innerHTML="<select name='budget_to' id='budget_to' style='width:80px;'><option value='6000000'>60 Lacs</option><option value='7500000'>75 Lacs</option><option value='10000000'>1 Crore</option><option value='15000000'>1.5 Crore</option><option value='20000000'>2 Crore</option><option value='30000000'>3 Crore</option><option value='50000000'>5 Crore</option><option value='100000000'>10 Crore</option><option value='200000000'>20 Crore</option></select>";
	}
	else if(val=="60 Lacs")
	{
		document.getElementById("maxbudget").innerHTML="<select name='budget_to' id='budget_to' style='width:80px;'><option value='7500000'>75 Lacs</option><option value='10000000'>1 Crore</option><option value='15000000'>1.5 Crore</option><option value='20000000'>2 Crore</option><option value='30000000'>3 Crore</option><option value='50000000'>5 Crore</option><option value='100000000'>10 Crore</option><option value='200000000'>20 Crore</option></select>";
	}
	else if(val=="75 Lacs")
	{
		document.getElementById("maxbudget").innerHTML="<select name='budget_to' id='budget_to' style='width:80px;'><option value='10000000'>1 Crore</option><option value='15000000'>1.5 Crore</option><option value='20000000'>2 Crore</option><option value='30000000'>3 Crore</option><option value='50000000'>5 Crore</option><option value='100000000'>10 Crore</option><option value='200000000'>20 Crore</option></select>";
	}
	else if(val=="1 Crore")
	{
		document.getElementById("maxbudget").innerHTML="<select name='budget_to' id='budget_to' style='width:80px;'><option value='15000000'>1.5 Crore</option><option value='20000000'>2 Crore</option><option value='30000000'>3 Crore</option><option value='50000000'>5 Crore</option><option value='100000000'>10 Crore</option><option value='200000000'>20 Crore</option></select>";
	}
	else if(val=="1.5 Crore")
	{
		document.getElementById("maxbudget").innerHTML="<select name='budget_to' id='budget_to' style='width:80px;'><option value='20000000'>2 Crore</option><option value='30000000'>3 Crore</option><option value='50000000'>5 Crore</option><option value='100000000'>10 Crore</option><option value='200000000'>20 Crore</option></select>";
	}
	else if(val=="2 Crore")
	{
		document.getElementById("maxbudget").innerHTML="<select name='budget_to' id='budget_to' style='width:80px;'><option value='30000000'>3 Crore</option><option value='50000000'>5 Crore</option><option value='100000000'>10 Crore</option><option value='200000000'>20 Crore</option></select>";
	}
	else if(val=="3 Crore")
	{
		document.getElementById("maxbudget").innerHTML="<select name='budget_to' id='budget_to' style='width:80px;'><option value='50000000'>5 Crore</option><option value='100000000'>10 Crore</option><option value='200000000'>20 Crore</option></select>";
	}
	else if(val=="5 Crore")
	{
		document.getElementById("maxbudget").innerHTML="<select name='budget_to' id='budget_to' style='width:80px;'><option value='100000000'>10 Crore</option><option value='200000000'>20 Crore</option></select>";
	}
	else if(val=="10 Crore")
	{
		document.getElementById("maxbudget").innerHTML="<select name='budget_to' id='budget_to' style='width:80px;'><option value='200000000'>20 Crore</option></select>";
	}
	else
	{
		document.getElementById("maxbudget").innerHTML="<select name='budget_to' id='budget_to' style='width:80px;'><option value='4000000'>40 Lacs</option><option value='5000000'>50 Lacs</option><option value='6000000'>60 Lacs</option><option value='7500000'>75 Lacs</option><option value='10000000'>1 Crore</option><option value='15000000'>1.5 Crore</option><option value='20000000'>2 Crore</option><option value='30000000'>3 Crore</option><option value='50000000'>5 Crore</option><option value='100000000'>10 Crore</option><option value='200000000'>20 Crore</option></select>";
	}
}

function emailEnquiry()
{
	if(document.getElementById('enquiry_email').value == 0 || document.getElementById('enquiry_email').value == '')
	{
		document.getElementById('div_email').style.display = "block";
		document.getElementById('div_email').innerHTML = "Please enter email";
		//document.getElementById('enquiry_email').focus();
		return false;
	}
	else
	{
		document.getElementById('div_email').style.display = "none";
	}
	if(document.getElementById('enquiry_email').value!="")
	{
		if(!isEmail(document.getElementById('enquiry_email').value))
		{
			document.getElementById('div_email').style.display = "block";
			document.getElementById('div_email').innerHTML = "Please enter valid email";
			//document.getElementById('enquiry_email').select();
			return false;
		}
		else
		{
			document.getElementById('div_email').style.display = "none";
		}
	}
}

function nameEnquiry()
{
	if(document.getElementById('enquiry_name').value == 0)
	{
		document.getElementById('div_name').style.display = "block";
		document.getElementById('div_name').innerHTML = "Please enter name";
		//document.getElementById('enquiry_name').focus();
		return false;
	}
	else
	{
		document.getElementById('div_name').style.display = "none";
	}
	if(!isNaN(document.getElementById('enquiry_name').value))
	{
		document.getElementById('div_name').style.display = "block";
		document.getElementById('div_name').innerHTML = "Please enter name properly";
		document.getElementById('enquiry_name').focus();
		return false;
	}
	else
	{
		document.getElementById('div_name').style.display = "none";
	}
}

function phoneEnquiry()
{
	var All_phonechars = "1234567890\.-/() ";
	if(document.getElementById('enquiry_phone').value != "")
	{
		var s=document.getElementById('enquiry_phone').value;
		var i;
		for(i=0;i < s.length;i++)
		{
			var currchar = s.charAt(i);
			//window.alert(All_phonechars.indexOf(currchar));
			if(All_phonechars.indexOf(currchar) == -1)
			{
				document.getElementById('div_phone').style.display = "block";
				document.getElementById('div_phone').innerHTML = "Invalid phone number";
				//document.getElementById('enquiry_phone').focus();
				return false;
			}
			else
			{
				document.getElementById('div_phone').style.display = "none";
			}
		}
	}
}

function textEnquiry()
{
	if(document.getElementById('enquiry').value == 0 || document.getElementById('enquiry').value == '')
	{
		document.getElementById('div_enquiry_text').style.display = "block";
		document.getElementById('div_enquiry_text').innerHTML = "Please enter enquiry";
		//document.getElementById('enquiry').focus();
		return false;
	}
	else
	{
		document.getElementById('div_enquiry_text').style.display = "none";
	}
}

function showProjectGallery(imageObj,galleryID) {

	var imgXY = findPosition(imageObj);
	document.getElementById(galleryID).style.display = 'block';
	var divX = imgXY[0] - 2;
	var divY = imgXY[1] + 2;
	document.getElementById(galleryID).style.left = divX +'px';
	document.getElementById(galleryID).style.top = divY +'px';

	//Hide previous before showing this one
	previousGalleryID = document.getElementById('current_gallery').value;
	if(previousGalleryID != "") {
		hideProjectGallery(previousGalleryID);
	}

	document.getElementById('current_gallery').value = galleryID;
}

function hideProjectGallery(galleryID) {
		document.getElementById('current_gallery').value = "";
		document.getElementById(galleryID).style.display = 'none';
}

function get_post_req_state(path)
{
	//alert(path);
    //document.getElementById('cityajax').style.display = 'none';
	var county_id= document.getElementById('selcountryrequired').value;
	var randomnumber=Math.floor(Math.random()*110);
	var url = path+"index.php/login/getpostreqstate?country_id="+county_id+"&randno="+randomnumber;
	xmlHttp=GetXmlHttpObject(handleresponserequiredcountry)
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	return true;
}
function handleresponserequiredcountry()
{
	var Image_Url = document.getElementById('loading_image_url').value;
    if(xmlHttp.readyState == 4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("loginstateajax").innerHTML = xmlHttp.responseText;
	}
	else
	{
		document.getElementById("loginstateajax").innerHTML= "<img src="+Image_Url+"images/ajaxloading.gif'>";
	}
}

// Post requirement page function start here.
function changeBudget(transaction_type)
{
	if(transaction_type=='BUY')
	{
		document.getElementById("minbudget").innerHTML="<select name='budget_from' id='budget_from' class='property_req_middle_div_list_menu1'  style='width:90px;' onchange='maxBudgetVal(this.value);'><option value='<10000000'><10 Lacs</option><option value='10 Lacs'>10 Lacs</option><option value='1500000'>15 Lacs</option><option value='2000000'>20 Lacs</option><option value='3000000' selected='selected'>30 Lacs</option><option value='4000000'>40 Lacs</option><option value='5000000'>50 Lacs</option><option value='6000000'>60 Lacs</option><option value='7500000'>75 Lacs</option><option value='10000000'>1 Crore</option><option value='15000000'>1.5 Crore</option><option value='20000000'>2 Crore</option><option value='30000000'>3 Crore</option><option value='50000000'>5 Crore</option><option value='100000000'>10 Crore</option><option value='>20 Crore'>>200000000</option></select>";
		document.getElementById("maxbudget").innerHTML="<select name='budget_to' id='budget_to' class='property_req_middle_div_list_menu1' style='width:90px;'><option value='4000000' selected='selected'>40 Lacs</option><option value='5000000'>50 Lacs</option><option value='6000000'>60 Lacs</option><option value='7500000'>75 Lacs</option><option value='10000000'>1 Crore</option><option value='15000000'>1.5 Crore</option><option value='20000000'>2 Crore</option><option value='30000000'>3 Crore</option><option value='50000000'>5 Crore</option><option value='100000000'>10 Crore</option><option value='200000000'>20 Crore</option></select>";
	} else
	{
		document.getElementById("minbudget").innerHTML="<select name='budget_from' id='budget_from' class='property_req_middle_div_list_menu1'  style='width:90px;' onchange='maxVal(this.value);'><option value='<5000'><5000</option><option value='5000'>5000</option><option value='10000'>10000</option><option value='15000' selected='selected'>15000</option><option value='20000'>20000</option><option value='25000'>25000</option><option value='40000'>40000</option><option value='70000'>70000</option><option value='100000'>1 Lac</option><option value='1500000'>1.5 Lacs</option><option value='200000'>2 Lacs</option><option value='500000'>5 Lacs</option><option value='>1000000'>>10 Lacs</option></select>";
		document.getElementById("maxbudget").innerHTML="<select name='budget_to' id='budget_to' class='property_req_middle_div_list_menu1' style='width:90px;'><option value='20000'>20000</option><option value='25000'>25000</option><option value='40000'>40000</option><option value='70000'>70000</option><option value='100000'>1 Lac</option><option value='150000'>1.5 Lacs</option><option value='200000'>2 Lacs</option><option value='500000'>5 Lacs</option><option value='1000000'>10 Lacs</option></select>";
	}
}

function maxVal(val)
{
	if(val=="<1000000" || val==">200000000" || val=="<5000" || val==">1000000")
	{
		document.getElementById('maxbudget').innerHTML="<select name='budget_to' id='budget_to' class='property_req_middle_div_list_menu1' style='width:90px;'><option value='Max Price'>Max Price</option></select>";
	}
	else
	{
		if(document.post_requirement.transaction_type[0].checked==true)
		{
			document.getElementById("maxbudget").innerHTML="<select name='budget_to' id='budget_to' class='property_req_middle_div_list_menu1' style='width:90px;'><option value='4000000' selected='selected'>40 Lacs</option><option value='5000000'>50 Lacs</option><option value='6000000'>60 Lacs</option><option value='7500000'>75 Lacs</option><option value='10000000'>1 Crore</option><option value='15000000'>1.5 Crore</option><option value='20000000'>2 Crore</option><option value='30000000'>3 Crore</option><option value='50000000'>5 Crore</option><option value='100000000'>10 Crore</option><option value='200000000'>20 Crore</option></select>";
		}
		else
		{
			document.getElementById("maxbudget").innerHTML="<select name='budget_to' id='budget_to' class='property_req_middle_div_list_menu1' style='width:90px;'><option value='20000'>20000</option><option value='25000'>25000</option><option value='40000'>40000</option><option value='70000'>70000</option><option value='100000'>1 Lac</option><option value='150000'>1.5 Lacs</option><option value='200000'>2 Lacs</option><option value='500000'>5 Lacs</option><option value='1000000'>10 Lacs</option></select>";
		}
	}
}

function Validate_contactinfo()
{
	var All_phonechars = "1234567890\.-/() ";
	if(document.post_requirement.firstname.value==0)
	{
		alert("Please enter first name !!!");
		document.post_requirement.firstname.focus();
		return false;
	}
	if(document.post_requirement.lastname.value==0)
	{
		alert("Please enter last name !!!");
		document.post_requirement.lastname.focus();
		return false;
	}
	if(document.post_requirement.email.value==0)
	{
		alert("Please enter email !!!");
		document.post_requirement.email.focus();
		return false;
	}
	if(document.post_requirement.email.value!="")
	{
		reg=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
		if(!reg.test(document.post_requirement.email.value))
		{
			alert('Please enter e-mail properly !!!');
			document.post_requirement.email.select();
			return false;
		}
	}
	if(document.post_requirement.phone.value==0 || document.post_requirement.phone.value=="")
	{
		alert("Please enter either telephone number or mobile number !!!");
		document.post_requirement.phone.focus();
		return false;
	}
	if(document.post_requirement.phone.value!="")
	{
		var s=document.post_requirement.phone.value;
		var i;

        if(s.length < 5){
            alert("Invalid phone number !!!");
            document.post_requirement.phone.value = '';
            document.post_requirement.phone.select();
                return false;
        }
		for(i=0;i < s.length;i++)
		{
			var currchar = s.charAt(i);
			//window.alert(All_phonechars.indexOf(currchar));
			if(All_phonechars.indexOf(currchar) == -1)
			{
				alert("Invalid phone number !!!");
                document.post_requirement.phone.value = '';
				document.post_requirement.phone.select();
				return false;
			}
		}
		/*if(isNaN(document.post_requirement.phone.value))
		{
			alert('Invalid phone number !!!');
			document.post_requirement.phone.focus();
			return false;
		}*/
	}
	/*if(document.post_requirement.mobile.value!="")
	{
		var s=document.post_requirement.mobile.value;
		var i;
		for(i=0;i < s.length;i++)
		{
			var currchar = s.charAt(i);
			//window.alert(All_phonechars.indexOf(currchar));
			if(All_phonechars.indexOf(currchar) == -1)
			{
				alert("Invalid mobile number !!!");
				document.post_requirement.mobile.select();
				return false;
			}
		}
		/*if(isNaN(document.post_requirement.mobile.value))
		{
			alert('Invalid mobile number !!!');
			document.post_requirement.mobile.focus();
			return false;
		}
	}*/
    //alert(document.post_requirement.txt_security_code.value);
	if(document.post_requirement.txt_security_code.value==0 || document.post_requirement.txt_security_code.value=='')
	{
		alert("Please enter security code !!!");
		document.post_requirement.txt_security_code.focus();
		return false;
	}
	if(document.post_requirement.txt_security_code.value!=document.post_requirement.sess_sec_code.value)
	{
		alert("Security code doesn't match with image code !!!");
		document.post_requirement.txt_security_code.focus();
		return false;
	}
	if(document.post_requirement.chk_policy.checked == false)
	{
		alert("Please accept the terms and conditions !!!");
		document.post_requirement.chk_policy.focus();
		return false;
	}
	return true;
}

function disableTextBox()
{
	document.post_requirement.moveon_month.value="";
	document.post_requirement.moveon_month.disabled=true;
}
function enableTextBox()
{
	document.post_requirement.moveon_month.disabled=false;
}
function div_minbed(id)
{
	if(id==1 || id==4 || id==6 || id==8 || id==9 || id==10 || id==11|| id==12|| id==13|| id==14|| id==19|| id==23|| id==24 || id==25)
	{
		document.getElementById('minbed').style.display="none";
	} else
	{
		document.getElementById('minbed').style.display="block";
	}
}
function contactInfo()
{
	if(document.post_requirement.property_type.value=="")
	{
		alert("Please select property type !!!");
		document.post_requirement.property_type.focus();
		return false;
	}
	if(document.post_requirement.selstate.value=="")
	{
		alert("Please select state !!!");
		document.post_requirement.selstate.focus();
		return false;
	}
	if(document.post_requirement.selcity.value=="")
	{
		alert("Please select city !!!");
		document.post_requirement.selcity.focus();
		return false;
	}
	/*if(document.post_requirement.select_locality.value=="")
	{
		alert("Please select locality !!!");
		document.post_requirement.select_locality.focus();
		return false;
	}*/
	if(document.post_requirement.area.value==0)
	{
		alert("Please enter area !!!");
		document.post_requirement.area.focus();
		return false;
	}
	if(isNaN(document.post_requirement.area.value))
	{
		alert('Area should be numeric !!!');
		document.post_requirement.area.focus();
		return false;
	}
	if(document.getElementById('moveon_after').checked == true && document.post_requirement.moveon_month.value == "")
	{
		alert("Please enter required time to move !!!");
		document.post_requirement.moveon_month.focus();
		return false;
	}
	if(isNaN(document.post_requirement.moveon_month.value))
	{
		alert('Invalid required time !!!');
		document.post_requirement.moveon_month.focus();
		return false;
	}
	if(document.post_requirement.estimated_time_to_purchase.value == "")
	{
		alert("Please select how soon you wish to close !!!");
		document.post_requirement.estimated_time_to_purchase.focus();
		return false;
	}
	/*if(document.post_requirement.chk_policy.checked == false)
	{
		alert("Please accept the terms and conditions !!!");
		document.post_requirement.chk_policy.focus();
		return false;
	}*/
	document.getElementById('propertyinfo').style.display="none";
	document.getElementById('contactinfo').style.display="block";

	document.getElementById('lookingfor').style.display="none";
	document.getElementById('contactfor').style.display="block";
	return true;
}
function storePrevArea()
{
	document.getElementById('prvarea').value = document.getElementById('area').value;
}

function validateFeedback()
		{
			if(document.getElementById("name").value==0)
			{
				alert("Please enter your name!!!");
				document.getElementById("name").focus();
				return false;
			}
			else if(document.getElementById("email").value==0)
			{
				alert("Please enter your email address!!!");
				document.getElementById("email").focus();
				return false;
			}
			else if(!isEmail(document.getElementById("email").value))
			{
				alert("Please enter valid email address!!!");
				document.getElementById("email").value="";
				document.getElementById("email").focus();
				return false;
			}
			else if(document.getElementById("comments").value==0)
			{
				alert("Please enter your feedback!!!");
				document.getElementById("comments").focus();
				return false;
			}
		}

function emailer_subscription_validation(){
		var checked = 0;
		for (var i = 0; i < document.emailer.emailer.length; i++){
			if(document.emailer.emailer[i].checked){
				checked = 1;
			}
		}
		if(!checked){
			alert("PLease select a emailer type");
			return false;
		}else if(document.emailer.emailid.value == 0){
			alert("PLease enter your email id!!");
			return false;
		}
		else if(!isEmail(document.getElementById('emailid').value)){
			alert("PLease enter a valid email id!!");
			return false;
		}
}//end of function

function emailer_subscription_validation(){
		var checked = 0;
		for (var i = 0; i < document.emailer.emailer.length; i++){
			if(document.emailer.emailer[i].checked){
				checked = 1;
			}
		}
		if(!checked){
			alert("PLease select a emailer type");
			return false;
		}else if(document.emailer.emailid.value == 0){
			alert("PLease enter your email id!!");
			return false;
		}
		else if(!isEmail(document.getElementById('emailid').value)){
			alert("PLease enter a valid email id!!");
			return false;
		}
	}//end of function


function convertArea(val)
{
	if(document.getElementById('area').value==0)
	{
			alert("Please enter area !!!");
			document.getElementById('area').focus();
			return false;
	}
	else
	{
		if(isNaN(document.getElementById('area').value))
		{
			alert('Area should be numeric !!!');
			document.getElementById('area').focus();
			return false;
		}
		else
		{
			if(document.getElementById('unitconverter').value=="Sq Feet")
			{
				var new_area_round = document.getElementById('prvarea').value;
			}
			else
			{
				var area = document.getElementById('prvarea').value;
				var to_unit = document.getElementById('unitconverter').value;
				var split_to_unit = to_unit.split("-");
				var new_area = area*split_to_unit[1];
				var new_area_round = new_area.toFixed(2);
			}
			document.getElementById('area').value = new_area_round;
		}
	}
}
// Post requirement page function end here.

function gotoParent()
{
	window.location.href=window.opener.location.href;
	//window.close();
}

function frmtoSubmit_member(path,frmName)
{
	if(frmName=='agentsearch')
	{
		city = document.agentsearch.agent_location.value;
		document.agentsearch.action=path+"index.php/search/agentsearch/cityname/"+city;
		document.agentsearch.method="post";
		document.agentsearch.submit();
	}
	else
	{
		city = document.developersearch.developer_location.value;
		document.developersearch.action=path+"index.php/search/developersearch/cityname/"+city;
        document.developersearch.method="post";
		document.developersearch.submit();
	}
}