$(function(){
	getCountries($('#continent').val(),prefs.LUXID);
});


function menuDrop(){ 
 if(navigator.appVersion.indexOf("MSIE")==-1){return;}
 var i,k,g,lg,r=/\s*hopover/,nn='',c,cs='hopover',bv='hopmenu';
 for(i=0;i<10;i++){g=document.getElementById(bv+nn);if(g){
 lg=g.getElementsByTagName("LI");if(lg){for(k=0;k<lg.length;k++){
 lg[k].onmouseover=function(){c=this.className;cl=(c)?c+' '+cs:cs;
 this.className=cl;};lg[k].onmouseout=function(){c=this.className;
 this.className=(c)?c.replace(r,''):'';};}}}nn=i+1;}
}

function check_srch_vals2(){
if(document.search.search_ID.value!=''){
var text_keyword=document.search.search_ID.value.toLowerCase();
link_keyword = (text_keyword).replace(/\s/g, "-");
 ajaxCallFunction(prefs.ajax_url+"ajax.iml?mdl=check_search_for_id.aj&DEBUG=1&searchfor="+document.search.search_ID.value+"&"+Date(),function(sc,st,rt,rxml){
	var found=getTagValue(rxml,'found');
	if(found>1){
	document.search.searchARG.value=found;
	document.search.action='/'+found;
	}
	else{
		if(prefs.arg!=''){
			if(prefs.special_arg!=''){
			document.search.searchARG.value=prefs.arg+','+prefs.special_arg+',search,keyword-'+link_keyword;
			document.search.action=prefs.arg+'/'+prefs.special_arg+'/search/keyword-'+link_keyword;
			}
			else {
			document.search.searchARG.value=prefs.arg+',search,keyword-'+link_keyword;
			document.search.action=prefs.arg+'/search/keyword-'+link_keyword;
			}
		}
		else{
		document.search.searchARG.value='search,keyword-'+link_keyword;
		document.search.action='search/keyword-'+link_keyword;
		}
	}
	document.search.submit();
	}); 
}

}
		
function check_srch_vals(){

var text_continent=document.search.continent.options[document.search.continent.selectedIndex].innerHTML.toLowerCase();
link_continent = (text_continent).replace(/\s/g, "-");


var text_country=document.search.country.options[document.search.country.selectedIndex].innerHTML.toLowerCase();
link_country = (text_country).replace(/\s/g, "-");


var text_state=document.search.state.options[document.search.state.selectedIndex].innerHTML.toLowerCase();
link_state = (text_state).replace(/\s/g, "-");

var text_city=document.search.city.value.toLowerCase();
link_city = (text_city).replace(/\s/g, "-");


if(document.search.search_ID.value!=''){
var text_keyword=document.search.search_ID.value.toLowerCase();
link_keyword = (text_keyword).replace(/\s/g, "-");
document.search.continent.value='';
document.search.country.value='';
document.search.state.value='';
document.search.city.value='';
 ajaxCallFunction(prefs.ajax_url+"ajax.iml?mdl=check_search_for_id.aj&DEBUG=1&searchfor="+document.search.search_ID.value+"&"+Date(),function(sc,st,rt,rxml){
	var found=getTagValue(rxml,'found');
	if(found>1){
	document.search.searchARG.value=found;
	document.search.action='/'+found;
	}
	else{
		if(prefs.arg!=''){
			if(prefs.special_arg!=''){
			document.search.searchARG.value=prefs.arg+','+prefs.special_arg+',search,keyword-'+link_keyword;
			document.search.action=prefs.arg+'/'+prefs.special_arg+'/search/keyword-'+link_keyword;
			}
			else {
			document.search.searchARG.value=prefs.arg+',search,keyword-'+link_keyword;
			document.search.action=prefs.arg+'/search/keyword-'+link_keyword;
			}
		}
		else{
		document.search.searchARG.value='search,keyword-'+link_keyword;
		document.search.action='search/keyword-'+link_keyword;
		}
	}
	document.search.submit();
	}); 

}
else if(link_state!='no-available-states'){
	if(prefs.arg!=''){
		if(prefs.special_arg!=''){
		document.search.searchARG.value=prefs.arg+','+prefs.special_arg+',vacation-rentals,'+link_city+'_'+link_state;
		document.search.action=prefs.arg+'/'+prefs.special_arg+'/vacation-rentals/'+link_city+'_'+link_state;
		}
		else {
		document.search.searchARG.value=prefs.arg+',vacation-rentals,'+link_city+'_'+link_state;
		document.search.action=prefs.arg+'/vacation-rentals/'+link_city+'_'+link_state;
		}
	}
	else{
	document.search.searchARG.value=prefs.arg+',vacation-rentals,'+link_city+'_'+link_state;
	document.search.action=prefs.arg+'/vacation-rentals/'+link_city+'_'+link_state;
	}

document.search.submit();
}
else if(link_country!='no-available-countries'){
	if(prefs.arg!=''){
		if(prefs.special_arg!=''){
		document.search.searchARG.value=prefs.arg+','+prefs.special_arg+',vacation-rentals,'+link_city+'_'+link_country;
		document.search.action=prefs.arg+'/'+prefs.special_arg+'/vacation-rentals/'+link_city+'_'+link_country;
		}
		else {
		document.search.searchARG.value=prefs.arg+',vacation-rentals,'+link_city+'_'+link_country;
		document.search.action=prefs.arg+'/vacation-rentals/'+link_city+'_'+link_country;
		}
	}
	else{
	document.search.searchARG.value=prefs.arg+',vacation-rentals,'+link_city+'_'+link_country;
	document.search.action=prefs.arg+'/vacation-rentals/'+link_city+'_'+link_country;
	}

document.search.submit();
}


}

function location_text(ID1, ID2){
  obj1=document.getElementById(ID1);
  obj2=document.getElementById(ID2);
  if(obj1.style.display=='none'){
    obj1.style.display=''; 
	obj2.style.display='none'; 
  }else{
     obj1.style.display='none';
	 obj2.style.display='';
  }
}

function show(ID){
  obj1=document.getElementById(ID);
  obj2=document.getElementById(ID+'_arrow');
  if(obj1.style.display=='none'){
    obj1.style.display=''; 
	obj2.src='showvacationrentals/images/arrow_down.gif';
  }else{
     obj1.style.display='none';
	 obj2.src='showvacationrentals/images/arrow_up.gif';
  }
}

    function get_price(number){
 ajaxCallFunction(prefs.ajax_url+"ajax.iml?mdl=showvacationrentals/calc_price.aj&DEBUG=1&number="+number+"&"+Date(),function(sc,st,rt,rxml){
var quantity=getTagValue(rxml,'quantity');
var setup=getTagValue(rxml,'setup');
var first_payment=getTagValue(rxml,'first_payment');
var monthly_payment=getTagValue(rxml,'monthly_payment');
el('quantity').innerHTML=quantity;
el('price_explain').innerHTML=quantity+" X $20.00 = $"+setup;
el('pay_today').innerHTML="$"+first_payment;
el('recur_pay').innerHTML="$"+monthly_payment;
}); 
  }
