// JavaScript Document

function changedcurrency(str)
{
	lan_id = document.frm.select2.value;
	document.frm.action = 'property-details.php?id='+str+'&lan='+lan_id;
	document.frm.submit();
}
function sendform()

{

	if(document.getElementById('search').value != 'Please select:')
	{
      document.rent_let.submit();
	}
	else
	{
		//alert('Please select any search type');
		document.rent_let.submit();
	}
}

function sendformp()
{
	
	if(document.rent_let.postcode.value != '')
	{
      document.rent_let.submit();
	}
	else
	{
		alert('Please Enter Postcode');
	}
}

function sendformt()
{
	if(document.rent_let.postcode.value != '')
	{
		document.rent_let.submit();
	}
	else
	{
        alert('Please Enter Town Name');
	}
}
function sendforms()
{
	if(document.rent_let.postcode.value != '')
	{
		document.rent_let.submit();
	}
	else
	{
        alert('Please Enter Street Name');
	}
}
function sendform2()
{
	if(document.getElementById('search').value == 'defaultsearchform.php')
	{

      alert('Please Select any Location');
	}
	else if(document.rent_let.postcode.value == '')
	{
		alert('Can not left blank Text field.');
		
        document.rent_let.postcode.focus();
	}
	else
	{
		if(document.rent_let.searchby.options[document.rent_let.searchby.selectedIndex].value == 'postcodesearchform.php')
		{
			val = 'postcodesearchpage.php';
		}
		if(document.rent_let.searchby.options[document.rent_let.searchby.selectedIndex].value == 'townsearchform.php')
		{
			val = 'townsearchpage.php';
		}

        if(document.rent_let.searchby.options[document.rent_let.searchby.selectedIndex].value == 'streetsearchform.php')
		{
			val = 'streetsearchpage.php';
		}
        if(val != '')
		{
			document.rent_let.action= val;
		}

        document.rent_let.submit();
	}
}
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=400,height=400,scrollbars=yes');
return false;
}
/* FUNCTIO FOR GOOGLER MAP */
function popupmap(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=800,height=600,scrollbars=yes');
return false;
}


/* FUNCTION END FOR GOOGLE MAP */
function Back() {
        window.history.back();
    }
/* function for postcode in index page */

function checkpostcode()
{
//alert("jfjkghfdkjgkfdl");
	with(document.rent_let)
	{
		if(postcode.value=="")
		{
			alert("Enter Postcode or  name of a place ");
			postcode.focus();
			return false;
		}
		
	}
}
/*    popup for vtour */
/* FUNCTIO FOR GOOGLER MAP */
function popupvtour(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=600,height=600,scrollbars=yes');
return false;
}


function display(obj,id1,id2,id3) {
txt = obj.options[obj.selectedIndex].value;
document.getElementById(id1).style.display = 'none';
document.getElementById(id2).style.display = 'none';
document.getElementById(id3).style.display = 'none';
if ( txt.match(id1) ) {
document.getElementById(id1).style.display = 'block';
}
if ( txt.match(id2) ) {
document.getElementById(id2).style.display = 'block';
}
if ( txt.match(id3) ) {
document.getElementById(id3).style.display = 'block';
}
}
