var EUROS_INI = "0^0^100.000^100000^200.000^200000^300.000^300000^400.000^400000^500.000^500000"
var EUROS_FIN = "100.000^100000^200.000^200000^300.000^300000^400.000^400000^500.000 +^9999999"

EUROS_INI = EUROS_INI.split("^")
EUROS_FIN = EUROS_FIN.split("^")

var LIBRAS_INI = "0^0^66.000^66000^133.000^133000^200.000^200000^266.000^266000^333.000^333000"
var LIBRAS_FIN = "66.000^66000^133.000^133000^200.000^200000^266.000^266000^333.000 +^9999999"
							
LIBRAS_INI = LIBRAS_INI.split("^")
LIBRAS_FIN = LIBRAS_FIN.split("^")


var SP_PAISES="-Please select one-^-1^Spain^SP" 
SP_PAISES = SP_PAISES.split("^")

var UK_PAISES="-Please select one-^-1^England^EN^Wales^WA^Scotland^SC" 
UK_PAISES = UK_PAISES.split("^")

var REST_PAISES="-Please select one-^-1^Australia^NONE^Bulgaria^BUL^Canada^CAN^Caribbean^NONE^Cyprus^CYP^France^FRA^Ireland^IRE^Italy^NONE^Turkey^TUR^USA^USA^South Africa^NONE^Rest of Europe^NONE"
REST_PAISES = REST_PAISES.split("^")

var SP_PROV = "-Please select one-^-1^Albacete^Albacete^Alicante^Alicante^Almeria^Almeria^Asturias^Asturias^Badajoz^Badajoz^Barcelona^Barcelona^Burgos^Burgos^Caceres^Caceres^Cadiz^Cadiz^Cantabria^Cantabria^Castellon^Castellon^"+
"Ciudad Real^Ciudad Real^Cordoba^Cordoba^Coruna^Coruna^Cuenca^Cuenca^El Hierro^El Hierro^Formentera^Formentera^Fuerteventura^Fuerteventura^Girona^Girona^Gran Canaria^Gran Canaria^Granada^Granada^"+
"Huelva^Huelva^Huesca^Huesca^Ibiza^Ibiza^Jaen^Jaen^La Gomera^La Gomera^La Palma^La Palma^Lanzarote^Lanzarote^Lleida^Lleida^Lugo^Lugo^Madrid^Madrid^Malaga^Malaga^Mallorca^Mallorca^Menorca^Menorca^"+
"Murcia^Murcia^Navarra^Navarra^Ourense^Ourense^Pontevedra^Pontevedra^Salamanca^Salamanca^Segovia^Segovia^Sevilla^Sevilla^Tarragona^Tarragona^Tenerife^Tenerife^Teruel^Teruel^Toledo^Toledo^Valencia^Valencia^Zaragoza^Zaragoza"
SP_PROV = SP_PROV.split("^")

var EN_PROV="-Please select one-^-1^Bedfordshire^Bedfordshire^Berkshire^Berkshire^Buckinghamshire^Buckinghamshire^Cambridgeshire^Cambridgeshire^Cheshire^Cheshire^Cornwall^Cornwall^Cumberland^Cumberland^Derbyshire^Derbyshire^"+
"Dorset^Dorset^Durham^Durham^Essex^Essex^Gloucestershire^Gloucestershire^Hampshire^Hampshire^Herefordshire^Herefordshire^Hertfordshire^Hertfordshire^Huntingdonshire^Huntingdonshire^Kent^Kent^"+
"Lancashire^Lancashire^Leicestershire^Leicestershire^Lincolnshire^Lincolnshire^Middlesex^Middlesex^Norfolk^Norfolk^Northamptonshire^Northamptonshire^Northumberland^Northumberland^Nottinghamshire^Nottinghamshire^Oxfordshire^Oxfordshire^"+
"Rutland^Rutland^Shropshire^Shropshire^Somerset^Somerset^Staffordshire^Staffordshire^Suffolk^Suffolk^Surrey^Surrey^Sussex^Sussex^Warwickshire^Warwickshire^Westmorland^Westmorland^Wiltshire^Wiltshire^Worcestershire^Worcestershire^Yorkshire^Yorkshire"
EN_PROV = EN_PROV.split("^")

var WA_PROV="-Please select one-^-1^Anglesey/Sir Fon^Anglesey/Sir Fon^Brecknockshire/Sir Frycheiniog^Brecknockshire/Sir Frycheiniog^Caernarfonshire/Sir Gaernarfon^Caernarfonshire/Sir Gaernarfon^Cardiganshire/Ceredigion^Cardiganshire/Ceredigion^Carmarthenshire/Sir Gaerfyrddin^Carmarthenshire/Sir Gaerfyrddin^"+
"Denbighshire/Sir Ddinbych^Denbighshire/Sir Ddinbych^Flintshire/Sir Fflint^Flintshire/Sir Fflint^Glamorgan/Morgannwg^Glamorgan/Morgannwg^Merioneth/Meirionnydd^Merioneth/Meirionnydd^Monmouthshire/Sir Fynwy^Monmouthshire/Sir Fynwy^Montgomeryshire/Sir Drefaldwyn^Montgomeryshire/Sir Drefaldwyn^"+
"Pembrokeshire/Sir Benfro^Pembrokeshire/Sir Benfro^Radnorshire/Sir Faesyfed^Radnorshire/Sir Faesyfed"
WA_PROV = WA_PROV.split("^")

var SC_PROV="-Please select one-^-1^Aberdeenshire^Aberdeenshire^Angus/Forfarshire^Angus/Forfarshire^Argyllshire^Argyllshire^Ayrshire^Ayrshire^Banffshire^Banffshire^Berwickshire^Berwickshire^Buteshire^Buteshire^Caithness^Caithness^Clackmannanshire^Clackmannanshire^"+
"Cromartyshire^Cromartyshire^Dumfriesshire^Dumfriesshire^Dunbartonshire/Dumbartonshire^Dunbartonshire/Dumbartonshire^East Lothian/Haddingtonshire^East Lothian/Haddingtonshire^Fife^Fife^Inverness-shire^Inverness-shire^Kincardineshire^Kincardineshire^Kinross-shire^Kinross-shire^"+
"Kirkcudbrightshire^Kirkcudbrightshire^Lanarkshire^Lanarkshire^Midlothian/Edinburghshire^Midlothian/Edinburghshire^Morayshire^Morayshire^Nairnshire^Nairnshire^Orkney^Orkney^Peeblesshire^Peeblesshire^Perthshire^Perthshire^"+
"Renfrewshire^Renfrewshire^Ross-shire^Ross-shire^Roxburghshire^Roxburghshire^Selkirkshire^Selkirkshire^Shetland^Shetland^Stirlingshire^Stirlingshire^Sutherland^Sutherland^West Lothian/Linlithgowshire^West Lothian/Linlithgowshire^Wigtownshire^Wigtownshire"
SC_PROV = SC_PROV.split("^")

var EN_SEARCH_PROV="Any^-1^Bedfordshire^Bedfordshire^Berkshire^Berkshire^Buckinghamshire^Buckinghamshire^Cambridgeshire^Cambridgeshire^Cheshire^Cheshire^Cornwall^Cornwall^Cumberland^Cumberland^Derbyshire^Derbyshire^"+
"Dorset^Dorset^Durham^Durham^Essex^Essex^Gloucestershire^Gloucestershire^Hampshire^Hampshire^Herefordshire^Herefordshire^Hertfordshire^Hertfordshire^Huntingdonshire^Huntingdonshire^Kent^Kent^"+
"Lancashire^Lancashire^Leicestershire^Leicestershire^Lincolnshire^Lincolnshire^Middlesex^Middlesex^Norfolk^Norfolk^Northamptonshire^Northamptonshire^Northumberland^Northumberland^Nottinghamshire^Nottinghamshire^Oxfordshire^Oxfordshire^"+
"Rutland^Rutland^Shropshire^Shropshire^Somerset^Somerset^Staffordshire^Staffordshire^Suffolk^Suffolk^Surrey^Surrey^Sussex^Sussex^Warwickshire^Warwickshire^Westmorland^Westmorland^Wiltshire^Wiltshire^Worcestershire^Worcestershire^Yorkshire^Yorkshire"
EN_SEARCH_PROV = EN_SEARCH_PROV.split("^")

var WA_SEARCH_PROV="Any^-1^Anglesey/Sir Fon^Anglesey/Sir Fon^Brecknockshire/Sir Frycheiniog^Brecknockshire/Sir Frycheiniog^Caernarfonshire/Sir Gaernarfon^Caernarfonshire/Sir Gaernarfon^Cardiganshire/Ceredigion^Cardiganshire/Ceredigion^Carmarthenshire/Sir Gaerfyrddin^Carmarthenshire/Sir Gaerfyrddin^"+
"Denbighshire/Sir Ddinbych^Denbighshire/Sir Ddinbych^Flintshire/Sir Fflint^Flintshire/Sir Fflint^Glamorgan/Morgannwg^Glamorgan/Morgannwg^Merioneth/Meirionnydd^Merioneth/Meirionnydd^Monmouthshire/Sir Fynwy^Monmouthshire/Sir Fynwy^Montgomeryshire/Sir Drefaldwyn^Montgomeryshire/Sir Drefaldwyn^"+
"Pembrokeshire/Sir Benfro^Pembrokeshire/Sir Benfro^Radnorshire/Sir Faesyfed^Radnorshire/Sir Faesyfed"
WA_SEARCH_PROV = WA_SEARCH_PROV.split("^")

var SC_SEARCH_PROV="Any^-1^Aberdeenshire^Aberdeenshire^Angus/Forfarshire^Angus/Forfarshire^Argyllshire^Argyllshire^Ayrshire^Ayrshire^Banffshire^Banffshire^Berwickshire^Berwickshire^Buteshire^Buteshire^Caithness^Caithness^Clackmannanshire^Clackmannanshire^"+
"Cromartyshire^Cromartyshire^Dumfriesshire^Dumfriesshire^Dunbartonshire/Dumbartonshire^Dunbartonshire/Dumbartonshire^East Lothian/Haddingtonshire^East Lothian/Haddingtonshire^Fife^Fife^Inverness-shire^Inverness-shire^Kincardineshire^Kincardineshire^Kinross-shire^Kinross-shire^"+
"Kirkcudbrightshire^Kirkcudbrightshire^Lanarkshire^Lanarkshire^Midlothian/Edinburghshire^Midlothian/Edinburghshire^Morayshire^Morayshire^Nairnshire^Nairnshire^Orkney^Orkney^Peeblesshire^Peeblesshire^Perthshire^Perthshire^"+
"Renfrewshire^Renfrewshire^Ross-shire^Ross-shire^Roxburghshire^Roxburghshire^Selkirkshire^Selkirkshire^Shetland^Shetland^Stirlingshire^Stirlingshire^Sutherland^Sutherland^West Lothian/Linlithgowshire^West Lothian/Linlithgowshire^Wigtownshire^Wigtownshire"
SC_SEARCH_PROV = SC_SEARCH_PROV.split("^")

var NONE_SEARCH_PROV="Any^-1"
NONE_SEARCH_PROV = NONE_SEARCH_PROV.split("^")

var NONE_PROV="-Please select one-^-1^N/A^0"
NONE_PROV = NONE_PROV.split("^")

var SP_AREA="-Please select one-^-1^Costa Calida^1^Costa Brava^2^Costa Dorada^3^Costa Almeria^4^Costa de la Luz^5^Costa del Sol^6^Costa Blanca^7^Inland^8^Costa Del Azahar^9^Cities^10^Costa Tropical^11^Canaries^13^Balaerics^14^Asturias^315^Aragon^316^Cantabria^317^Castilla y Leon^318^Castilla La Mancha^319^Extramadura^320^Galicia^321^Pais Vasco^322"
SP_AREA = SP_AREA.split("^")

var EN_AREA="-Please select one-^-1^N/A^0"
EN_AREA = EN_AREA.split("^")

var WA_AREA="-Please select one-^-1^N/A^0"
WA_AREA = WA_AREA.split("^")

var SC_AREA="-Please select one-^-1^N/A^0"
SC_AREA = SC_AREA.split("^")

var NONE_AREA="-Please select one-^-1^N/A^0"
NONE_AREA = NONE_AREA.split("^")

var BUL_PROV="-Please select one-^-1^N/A^0"
BUL_PROV = BUL_PROV.split("^")

var BUL_AREA="-Please select one-^-1^Blagoevgrad^21^Burgas^22^Shumen^23^Dobrich^24^Gabrovo^25^Haskovo^26^Kardzhali^27^Kyustendil^28^Lovech^29^Montana^30^"+
"Pazardzhik^31^Pernik^32^Pleven^33^Plovdiv^34^Razgrad^35^Ruse^36^Silistra^37^Sliven^38^Smolyan^39^Sofia (city)^40^Sofia (province)^41^"+
"Stara Zagora^42^Targovishte^43^Varna^44^Veliko Tarnovo^45^Vidin^46^Vratsa^47^Yambol^48"
BUL_AREA = BUL_AREA.split("^")

var TUR_PROV="-Please select one-^-1^N/A^0"
TUR_PROV = TUR_PROV.split("^")

var TUR_AREA="-Please select one-^-1^Aegean Region (Ege Bölgesi)^61^Black Sea Region (Karadeniz Bölgesi)^62^Central Anatolia Region (Iç Anadolu Bölgesi)^63^"+
"Eastern Anatolia Region (Dogu Anadolu Bölgesi)^64^Marmara Region (Marmara Bölgesi)^65"
TUR_AREA = TUR_AREA.split("^")

var FRA_PROV="-Please select one-^-1^N/A^0"
FRA_PROV = FRA_PROV.split("^")

var FRA_AREA="-Please select one-^-1^Alsace^81^Aquitaine^82^Auvergne^83^Basse-Normandie^84^Bourgogne^85^Bretagne^86^Centre^87^Champagne-Ardenne^88^"+
"Corse^89^Franche-Comté^90^Guadeloupe^91^Guyane^92^Haute-Normandie^93^Île-de-France^94^Languedoc-Roussillon^95^Limousin^96^Lorraine^97^"+
"Martinique^98^Midi-Pyrénées^99^Nord-Pas de Calais^100^Pays de la Loire^101^Provence-Alpes-Côte d'Azur^102^Rhône-Alpes^103^Picardie^104^"+
"Poitou-Charentes^105^Réunion^106"
FRA_AREA = FRA_AREA.split("^")

var IRE_PROV="-Please select one-^-1^N/A^0"
IRE_PROV = IRE_PROV.split("^")

var IRE_AREA="-Please select one-^-1^Cork^120^Galway^121^Mayo^122^Donegal^123^Kerry^124^Tipperary^125^Tyrone^126^Clare^127^Antrim^128^"+
"Limerick^129^Roscommon^130^Down^131^Wexford^132^Meath^133^Derry^134^Kilkenny^135^Wicklow^136^Offaly^137^Cavan^138^Westmeath^139^"+
"Waterford^140^Sligo^141^Laois^142^Kildare^143^Fermanagh^144^Leitrim^145^Monaghan^146^Armagh^147^Longford^148^Dublin^149^Carlow^150^Louth^151"
IRE_AREA = IRE_AREA.split("^")

var CYP_PROV="-Please select one-^-1^N/A^0"
CYP_PROV = CYP_PROV.split("^")

var CYP_AREA="-Please select one-^-1^Ammochostos Region^160^Larnaka^161^Limassol^162^Nicosia^163^Pafos^164^Troodos^165"
CYP_AREA = CYP_AREA.split("^")

var USA_PROV="-Please select one-^-1^N/A^0"
USA_PROV = USA_PROV.split("^")

var USA_AREA="-Please select one-^-1^Alabama^181^Alaska^182^Arizona^183^Arkansas^184^California^185^Colorado^186^Connecticut^187^Delaware^188^"+
"Florida^189^Georgia^190^Hawaii^191^Illinois^192^Indiana^193^Idaho^194^Iowa^195^Kansas^196^Kentucky^197^Louisiana^198^Maine^199^Maryland^200^"+
"Massachusetts^201^Michigan^202^Minnesota^203^Mississippi^204^Missouri^205^Montana^206^Nebraska^207^Nevada^208^New Hampshire^209^New Jersey^210^"+
"New Mexico^211^New York^212^North Carolina^213^North Dakota^214^Ohio^215^Oklahoma^216^Oregon^217^Pennsylvania^218^Rhode Island^219^South Carolina^220^"+
"South Dakota^221^Tennessee^222^Texas^223^Utah^224^Vermont^225^Virginia^226^Washington^227^West Virginia^228^Wisconsin^229^Wyoming^230"
USA_AREA = USA_AREA.split("^")

var CAN_PROV="-Please select one-^-1^N/A^0"
CAN_PROV = CAN_PROV.split("^")

var CAN_AREA="-Please select one-^-1^Alberta^251^British Columbia^252^Manitoba^253^New Brunswick^254^Newfoundland and Labrador^255^Northwest Territories^256^"+
"Nova Scotia^257^Nunavut^258^Ontario^259^Prince Edward Island^260^Quebec^261^Saskatchewan^262^Yukon^263"
CAN_AREA = CAN_AREA.split("^")

function swapOptionsMoneda(array_name)
{

if(array_name != 'separador'){
	var modifArrayIni = eval(array_name+'_INI');
	setOptionText(document.Search.PrecioIni,  modifArrayIni);
	var modifArrayFin = eval(array_name+'_FIN');
	setOptionText(document.Search.PrecioFin,  modifArrayFin);
}
}

function getPaises(array_name)
{
if(array_name != '-1'){
	document.frmProperty.Country.disabled=true;	
	var modifArray = eval(array_name);
	setOptionText(document.frmProperty.Country,  modifArray);
	if (document.frmProperty.Country.options.length==2)
	{
			document.frmProperty.Country.selectedIndex=1;
			getProvincias(document.frmProperty.Country.options[1].value);
	}	
	else
	{
		document.frmProperty.Area.selectedIndex=0;
		document.frmProperty.Area.disabled=true;
		document.frmProperty.Province.selectedIndex=0;
		document.frmProperty.Province.disabled=true;
	}
}
else {
	document.frmProperty.Area.selectedIndex=0;
	document.frmProperty.Area.disabled=true;
	document.frmProperty.Province.selectedIndex=0;
	document.frmProperty.Province.disabled=true;
	document.frmProperty.Country.selectedIndex=0;
	document.frmProperty.Country.disabled=true;
	}
}

function getCountiesSearch(array_name)
{
	if(array_name != '-1'){
	document.Search.Province.disabled=true;	
	var modifArray = eval(array_name+'_PROV');
	setOptionText(document.Search.Province,  modifArray);
}
else {
	document.Search.Province.selectedIndex=0;
	document.Search.Province.disabled=true;
	}
}


function getProvincias(array_name)
{
if(array_name != '-1'){
	document.frmProperty.Province.disabled=true;	
	var modifArray = eval(array_name+'_PROV');
	setOptionText(document.frmProperty.Province,  modifArray);
	if (document.frmProperty.Province.options.length==2)
	{
			document.frmProperty.Province.selectedIndex=1;
	}		
	var modifArray = eval(array_name+'_AREA');
	setOptionText(document.frmProperty.Area,  modifArray);
	if (document.frmProperty.Area.options.length==2)
	{
			document.frmProperty.Area.selectedIndex=1;			
	}		
	
}
else {
	document.frmProperty.Area.selectedIndex=0;
	document.frmProperty.Area.disabled=true;
	document.frmProperty.Province.selectedIndex=0;
	document.frmProperty.Province.disabled=true;
	}
}

function setOptionText(modifSel, modifArray)
{
var aux2 = modifSel.options.length;
var total=100;
var i=0;
var option = new Array();
while (aux2 && ++i<=total) modifSel.options[0] = null;
i=0;
for (loop=0; loop < modifArray.length; loop=loop+2)
{
	var option = new Option(loop, loop);
	eval("modifSel.options[i]=option")
	i++;
}
modifSel.options[0].selected=true;
i=0;
for (loop=0; loop < modifSel.options.length; loop++)
{
	modifSel.options[loop].text = modifArray[i];
	modifSel.options[loop].value = modifArray[i+1];
	i=i+2;
}
if (modifArray.length > 0)
{
	modifSel.disabled=false;
}
}


