function ChangeType(intType) {
   if (intType == 1 ) {
      document.getElementById('period').style.visibility = 'Hidden';
	  document.getElementById('price').style.visibility = 'Visible';
	  document.getElementById('txtPlot').innerHTML = '<input  id="H7" type="checkbox" value="T_Plot">Plot';
	  document.getElementById('txtIconNew').innerHTML = '<input type="checkbox" id="I13" name="b_new" value="b_new"><img src="Images/Icons/Icon_new.gif" width="21" height="21" border="0" alt="">&nbsp;New';
	  document.getElementById('txtIconConstruction_1').innerHTML = '&nbsp;<input type="text" name="int_construction" value="" size="2" class="selectbox">&nbsp;';
	  document.getElementById('txtIconConstruction_2').innerHTML = '<img src="Images/Icons/Icon_Construction.gif" width="21" height="21" border="0" alt="">&nbsp;Minimum M<sup>2</sup> construction';
	  document.getElementById('txtIconGarden_1').innerHTML = '&nbsp;<input type="text" name="int_garden" size="2" class="selectbox">&nbsp;';
	  document.getElementById('txtIconGarden_2').innerHTML = '<img src="Images/Icons/Icon_Garden.gif" width="21" height="21" border="0" alt="">&nbsp;Minimum M<sup>2</sup> garden';
	  document.getElementById('txtIconTerrace_1').innerHTML = '&nbsp;<input type="text" name="int_terrace" value="" size="2" class="selectbox">&nbsp;';
	  document.getElementById('txtIconTerrace_2').innerHTML = '<img src="Images/Icons/Icon_Terrace.gif" width="21" height="21" border="0" alt="">&nbsp;Minimum M<sup>2</sup> terrace';
   }
   else {
      document.getElementById('period').style.visibility = 'Visible';
	  document.getElementById('price').style.visibility = 'Hidden';
	  document.getElementById('txtPlot').innerHTML = '';
	  document.getElementById('txtIconNew').innerHTML = '';
	  document.getElementById('txtIconConstruction_1').innerHTML = '';
	  document.getElementById('txtIconConstruction_2').innerHTML = '';
	  document.getElementById('txtIconGarden_1').innerHTML = '';
	  document.getElementById('txtIconGarden_2').innerHTML = '<input type="checkbox" name="b_tennis" value="b_golf"> Near tennis';
	  document.getElementById('txtIconTerrace_1').innerHTML = '';
	  document.getElementById('txtIconTerrace_2').innerHTML = '<input type="checkbox" name="b_pets" value="b_golf"> Pets allowed';
   }
}

function GetValues() {
	var strHouses;
	var strBits;
	var i;
	var strTemp='';
	
	//Reg, Prv and Loc are set via map pages
	if (checkTopValue(top.regions)) {
		strTemp = top.regions;
		document.forms.FindOnMap.RegID.value = strTemp.substr(0, (strTemp.length-1));
	}
	if (checkTopValue(top.provences)) {
		document.forms.FindOnMap.Prv.value = top.provences
	}
	if (checkTopValue(top.locations)) {
		document.forms.FindOnMap.Loc.value = top.locations
	}
	
	//Prices
	document.forms.FindOnMap['Min'].value = document.forms.Selection.MinPrice.value;
	document.forms.FindOnMap['Max'].value = document.forms.Selection.MaxPrice.value;
	
	//specs
	if (document.forms.Selection.int_bedroom.value != '') {
		document.forms.FindOnMap.Specs.value =  document.forms.Selection.int_bedroom.value + ',';
	} else {
		document.forms.FindOnMap.Specs.value =  '0,';
	}
	if (document.forms.Selection.int_bathroom.value != '') {
		document.forms.FindOnMap.Specs.value += document.forms.Selection.int_bathroom.value + ',';
	} else {
		document.forms.FindOnMap.Specs.value +=  '0,';
	}
	if (document.forms.Selection.int_toilet.value != '') {
		document.forms.FindOnMap.Specs.value += document.forms.Selection.int_toilet.value + ',';
	} else {
		document.forms.FindOnMap.Specs.value +=  '0,';
	}
	if (document.forms.Selection.int_construction.value != '') {
		document.forms.FindOnMap.Specs.value += document.forms.Selection.int_construction.value + ',';
	} else {
		document.forms.FindOnMap.Specs.value +=  '0,';
	}
	if (document.forms.Selection.int_garden.value != '') {
		document.forms.FindOnMap.Specs.value += document.forms.Selection.int_garden.value + ',';
	} else {
		document.forms.FindOnMap.Specs.value +=  '0,';
	}
	if (document.forms.Selection.int_terrace.value != '') {
		document.forms.FindOnMap.Specs.value += document.forms.Selection.int_terrace.value + ',';
	} else {
		document.forms.FindOnMap.Specs.value +=  '0,';
	}
	
	//House types
	for(i=1;i<8;i++) {
		if (document.forms.Selection['H' + i].checked == true) {
			document.forms.FindOnMap.House.value += document.forms.Selection['H' + i].value  + ',';
		}
	}
			
	//Icons
	strBits = '1';
	if (document.forms.Selection.b_pool_private.checked == true) {strBits += '1';}else{strBits += '0';}
	if (document.forms.Selection.b_pool_com.checked == true) {strBits += '1';}else{strBits += '0';}
	if (document.forms.Selection.b_airco.checked == true) {strBits += '1';}else{strBits += '0';}
	if (document.forms.Selection.b_heating.checked == true) {strBits += '1';}else{strBits += '0';}
	if (document.forms.Selection.b_garage.checked == true) {strBits += '1';}else{strBits += '0';}
	if (document.forms.Selection.b_parking.checked == true) {strBits += '1';}else{strBits += '0';}
	if (document.forms.Selection.b_sea_view.checked == true) {strBits += '1';}else{strBits += '0';}
	if (document.forms.Selection.b_mountain_view.checked == true) {strBits += '1';}else{strBits += '0';}
	if (document.forms.Selection.b_lift.checked == true) {strBits += '1';}else{strBits += '0';}
	if (document.forms.Selection.b_center.checked == true) {strBits += '1';}else{strBits += '0';}
	if (document.forms.Selection.b_urbanization.checked == true) {strBits += '1';}else{strBits += '0';}
	if (document.forms.Selection.b_neargolf.checked == true) {strBits += '1';}else{strBits += '0';}
	if (document.forms.Selection.b_nearyacht.checked == true) {strBits += '1';}else{strBits += '0';}
	if (document.forms.Selection.b_new.checked == true) {strBits += '1';}else{strBits += '0';}
	
	document.forms.FindOnMap.Bits.value = strBits;			
}

function SetProfile() {
	GetValues();
	document.forms.FindOnMap.action = 'Personal.asp';
	document.forms.FindOnMap.submit();
}

function GetResults() {
	GetValues();
	document.forms.FindOnMap.action = 'Results.asp';
	document.forms.FindOnMap.submit();
}

function ClearHouse(objChk) {
	if (objChk.value == 0) {
		for(i=1;i<8;i++) {
			document.forms.Selection['H' + i].checked = false;
		}
	}
	else {
		document.forms.Selection['H0'].checked = false;
	}
}