$j = jQuery.noConflict();

$j(function(){

	Search.init();

});


var Search = {
	
	SiteURL: "http://" + document.domain + "/",
	AjaxURL: "http://" + document.domain + "/" + '_ajax.php',
	
	init: function(){
		Search.countryChanged();
		Search.crimboMarquee();
	},
	
	countryChanged: function(){
		$j('select#countryID').change(function(){
			countryID = $j(this).val();
			$j('select#regionID').html('<option value="na">Loading...</option>').attr('disabled', true);
			$j.getJSON(Search.AjaxURL, {
					method: 'getRegionsForCountry',
					area: 'site', 
					countryID: countryID 
				}, function(data){
					$j('select#regionID').html(data.regions).removeAttr('disabled');
				});
		});
	},
	
	crimboMarquee: function(){
		$j('div#crimboMarquee').marquee();
	}
}


