function selectRegion(rid, label)
{
	var regionid = 'r_' + rid;
	var testVar = document.getElementById(regionid);
	if(testVar.checked === true)
	{
		testVar.checked = false;
	}
	else
	{
		testVar.checked = true;
	}
}

function changeURL(box)
{
	var url = box.options[box.selectedIndex].value;
	window.location = url;
}

function regionToolTip(name)
{
	document.getElementById("mapToolTip").innerHTML = name;
}

function showDeptBox(me, id)
{
	if(me.selectedIndex == 0)
	{
		
		document.getElementById(id).style.visibility='hidden'
		document.getElementById(id).options[0].selected=true;
		document.getElementById('dept_3').style.visibility='hidden'
		document.getElementById('dept_3').options[0].selected=true;
	}
	else
	{
		document.getElementById(id).style.visibility='visible'
	}
}

function writeText(name, desc)
{
	var thename = 'r_' + name;
	document.getElementById(thename).selected = true;
}

function createPropertyForm(id, desc)
{
		html = '<h2>Find Property in ' + desc + '</h2>\
		<form action="/search_beta/find/" method="post">\
		<table class="smallish">\
			<tr>\
				<td width="140">\
					Price\
				</td>\
				<td>\
					<select name="prr" style="width: 200px;">\
						<!--<option value="0">Any Price</option>-->\
						<option value="a">Up to &euro;100,000</option>\
						<option value="b">&euro;100,000 - &euro;150,000</option>\
						<option value="c">&euro;150,000 - &euro;200,000</option>\
						<option value="d">&euro;200,000 - &euro;250,000</option>\
						<option value="e">&euro;250,000 - &euro;300,000</option>\
						<option value="f">&euro;300,000 - &euro;350,000</option>\
						<option value="g">&euro;350,000 - &euro;400,000</option>\
						<option value="h">&euro;400,000 - &euro;500,000</option>\
						<option value="i">&euro;500,000 - &euro;750,000</option>\
						<option value="j">&euro;750,000 - &euro;1,000,000</option>\
						<option value="k">Over &euro;1,000,000</option>\
					</select>\
				</td>\
				<td>\
					&nbsp;\
				</td>\
			</tr>\
			<tr>\
				<td>\
					Keywords\
				</td>\
				<td>\
					<input type="text" name="kwd" style="width: 200px;">\
				</td>\
				<td>\
					&nbsp;\
				</td>\
			</tr>\
			<tr>\
				<td>\
					Number of Bedrooms\
				</td>\
				<td>\
					<input type="text" name="bdr" size="5" />\
				</td>\
				<td>\
					&nbsp;\
				</td>\
			</tr>\
			<tr>\
				<td>\
 				&nbsp;\
				</td>\
				<td>\
					<input type="hidden" name="regions[]" value="' + id +'">\
					<input type="submit" value="Find Property">\
				</td>\
				<td>\
 					&nbsp;\
				</td>\
			</tr>\
		</table>\
		<ul class="smallish">\
			<li><a href="/search_beta/p/nv/lcl/' + id + '/dl/1/s/da/o/a/">Latest Properties in ' + desc + '</a></li>\
			<li><a href="/search_beta/p/nv/lcl/' + id + '/at/1/">View Agency Properties Sales in ' + desc + '</a></li>\
			<li><a href="/search_beta/p/nv/lcl/' + id + '/at/2/">View Private Properties Sales in ' + desc + '</a></li>\
		</ul>\
	</form>';
	
	return html;
}