




	
alert('XML Error');

function init_searchbox(countryselectid,regionselectid,devselectid,currencyselectid,proptypeselectid) {

	if (countryselectid!=''){
countryselect=document.getElementById(countryselectid);
countryselect.length=0;

countryselect.options[0] = new Option('Any');
countryselect.options[0].value = '0';

for (i=0; i<searchbox.length;i++){

countryselect.options[i+1] = new Option(searchbox[i][0][1]);
countryselect.options[i+1].value = i.toString()+'_'+searchbox[i][0][0];
//countryselect.setAttribute('onchange', 'set_searchbox_regions("'+ countryselectid +'","'+regionselectid+'","'+ devselectid +'","'+parseInt(i)+'")');

countryselect.onchange = function() {
	set_searchbox_regions(countryselectid,regionselectid, devselectid ,parseInt(i));
}

}
	}

if (regionselectid!=''){
regionselect = document.getElementById(regionselectid);
regionselect.length=0;

regionselect.options[0] = new Option('Any');
regionselect.options[0].value = '0';
}


if (devselectid!=''){
devselect=document.getElementById(devselectid);
devselect.length=0;

devselect.options[0] = new Option('Any');
devselect.options[0].value = '0';
}


if (currencyselectid!=''){
currencyselect =document.getElementById(currencyselectid);
currencyselect.length=0;

for (i=0; i<currency.length;i++){

currencyselect.options[i] = new Option(currency[i][1]);
currencyselect.options[i].value = currency[i][0];
}
}

if (proptypeselectid!=''){
proptypeselect =document.getElementById(proptypeselectid);
proptypeselect.length=0;

proptypeselect.options[0] = new Option('Any');
proptypeselect.options[0].value = '0';

for (i=0; i<propertytypes.length;i++){

proptypeselect.options[i+1] = new Option(propertytypes[i][1]);
proptypeselect.options[i+1].value = propertytypes[i][0];
}
}







}
function set_searchbox_regions(countryselectid,regionselectid,devselectid,countryref) {
	
if (countryselectid!=''){
countryselect=document.getElementById(countryselectid);
cvalue=countryselect.options[countryselect.selectedIndex].value
_ref = cvalue.split('_');
cref =_ref[0];

if (cvalue!='0'){
if (regionselectid!=''){
	regionselect.length=1;
for (i=0; i<searchbox[cref][1].length;i++){

regionselect.options[i+1] = new Option(searchbox[cref][1][i][1]);
regionselect.options[i+1].value = i.toString()+'_'+searchbox[cref][1][i][0];
regionselect.setAttribute('onchange', 'set_searchbox_developments("'+ countryselectid +'","'+regionselectid+'","'+ devselectid +'","'+parseInt(i)+'")');
}
}
}else{
	regionselect.length=1;
}
}

}
function set_searchbox_developments(countryselectid,regionselectid, devselectid,regionref) {
	
if (countryselectid!=''){
countryselect=document.getElementById(countryselectid);
cvalue=countryselect.options[countryselect.selectedIndex].value
_ref = cvalue.split('_');
cref =_ref[0];
}

if (regionselectid!=''){
regionselect = document.getElementById(regionselectid);
rvalue= regionselect.options[regionselect.selectedIndex].value
_ref = rvalue.split('_');
rref=_ref[0];
}


if (devselectid!=''){
for (i=0; i<searchbox[cref][1][rref][2].length;i++){


devselect.options[i+1] = new Option(searchbox[cref][1][rref][2][i][1]);
devselect.options[i+1].value = searchbox[cref][1][rref][2][i][0];

}
}}function showReference() {

c_obj = document.getElementById('searchbox_country');
ctvalue=c_obj.options[c_obj .selectedIndex].value;
if (ctvalue!='0') {
x = ctvalue.split('_');
ctvalue=x[1];
}

r_obj = document.getElementById('searchbox_region');
rgvalue=r_obj.options[r_obj .selectedIndex].value;
if (rgvalue!='0') {
x = rgvalue.split('_');
rgvalue =x[1];
}

d_obj = document.getElementById('searchbox_dev');
devvalue=d_obj.options[d_obj.selectedIndex].value;

cr_obj = document.getElementById('searchbox_currency');
currvalue=cr_obj.options[cr_obj.selectedIndex].value;

pt_obj = document.getElementById('searchbox_types');
typevalue=pt_obj.options[pt_obj.selectedIndex].value;

alert('Country: ' + ctvalue +' | Region: '+ rgvalue + ' | Development: '+ devvalue + ' | Currency: ' + currvalue + '| Property Type: '+ typevalue);
}
function setSelected(obj,key){
	if (obj!=''){
	sel=document.getElementById(obj);
	for(i=0;i<sel.options.length;i++){
		if (sel.options[i].value==key){
			sel.selectedIndex=i;
		}
	}
	}
}
