function changeStyle(id, property, value, literal)
{
	
    function hc(p)
    {
        pa=p.split('-');
        if(pa.length)
        {
            for(var x = 1; x<pa.length; x++)
            {
                pa[x] = pa[x][0].toUpperCase().concat(pa[x].substring(1));
            }
            pn=pa.join('');
        }
        return pn;
    }
    
    if(el=document.getElementById(id))
    {
        np = hc(property);nv = literal ? value : "'" + value + "'";eval("el.style." + np + " = " + nv);
    }
}



function displayHideDiv(divid)
{
	id="#"+divid;
	imgid="#img_"+divid;

	var prop=$(id).css("display");

	if(prop=="none"){
		$(id).show();
		$(imgid).attr("src","images/bullet_down2.GIF");

	}
	if(prop=="block"){
		$(id).hide();
		$(imgid).attr("src","images/bullet_left2.gif");

	}
   
}



$(document).ready(function (){
	$("#ArrivalDate").calendar({ dateFormat: 'MDY/',  yearRange: '2008:2030' }); 	

	$("input,select,radio").focus(function(){
	$(this).css("font-weight","bolder");
	$(this).css("background-color","#FFFFCC");
	$(this).css("border-color","");
});

$("input,select,radio").blur(function(){
	$(this).css("font-weight","");
	
	if(trim($(this).val())!='')
		$(this).css("background-color","#FFFFCC");		
	else
		$(this).css("background-color","");
	//$(this).css("background-color","");
});

$("input[@name='PropertyBuyRent']").click(function()
{
	val=$(this).attr("value");
	if(val=="rent")
	{
		$("#inbox").show();		
		$("#ArrivalDate").calendar({ dateFormat: 'MDY/',  yearRange: '2008:2030' }); 
	}
	else if(val=="buy")
	{
		$("#inbox").hide();		
	}
	
}
);

$("#Country,#State1").change(function(){
	
	var country=$("#Country").val();
	
	if(country==1)
		var state=$("#State1").val();
	else
		var state=$("#State2").val();

	var city=$("#City").val();

	$("#State").val(state);
	
	$.ajax({
			type: "get",
			url: "ajaxupdatesearchform.php",
			data: "country="+country+"&state="+state+"&city="+city,
			success: function(msg){
				$("#Resort").html(msg);
				var selObj = document.getElementById('Resort');
				selObj.selectedIndex = 0;
				}
			});
	
});

$("#State2,#City").blur(function(){
	
	var country=$("#Country").val();
	
	if(country==1)
		var state=$("#State1").val();
	else
		var state=$("#State2").val();

	var city=$("#City").val();

	$("#State").val(state);
	
	$.ajax({
			type: "get",
			url: "ajaxupdatesearchform.php",
			data: "country="+country+"&state="+state+"&city="+city,
			success: function(msg){		
				$("#Resort").html(msg);
				var selObj = document.getElementById('Resort');
				selObj.selectedIndex = 0;
				}
			});
});


}); 





function changeCountry(){
	var obj3=document.getElementById("dropDown");	
	var obj=document.getElementById("Country");		
		
	var CountryName = obj.options[obj.selectedIndex].value;

	obj=document.getElementById("textBox");

	

	if(CountryName!="1"){
				obj3.style.display="none";	
			 obj.style.display="block";	
			// obj2.options[obj2.selectedIndex]="other";
		}
		else{
			 obj.style.display="none";
			  obj3.style.display="block";	
		}
}



