function goSearch()
{
	city = document.theForm.CityChoice.value.replace(/[, &\/]/g, "-").toLowerCase();
	state = document.theForm.StateChoice.value.replace(/[, &\/]/g, "-").toLowerCase();

	var URL = "/usa/" + state + "/" + city + "/";
	// top.location.href=URL;
	alert(URL);
}

function redirectPage(ListID, SourceID)
{
	window.location.href = "http://hotels.petswelcome.com/clicktrack.php?listID="+ListID+"&SourceID="+SourceID;
}

jQuery(function() {
	
	jQuery('#stateChoice').change(function() {
		
		var params = "&state=" + jQuery('#stateChoice').val();
		var pathname = window.location.protocol + "//" + window.location.host + "/get/getCitiesList.php";
		
		jQuery('.cityChoice').attr('disabled', 'disabled');
		jQuery.ajax({
			url: pathname,
			type: "POST",
			data: params,
			dataType: "html",
			complete: function(request){
			},
			success: function(html){
				var text  = '<select id="cityChoice" style="width:125;" name="CityChoice">';
				text += html;
				text += '</select>';
				jQuery('.cityChoice').html(text).attr('disabled', '');
			},
			error: function(request) {
				alert('error');
			}
		})
	});
	
	jQuery('#stateBrandChoice').change(function() {
		
		var params = "&state=" + jQuery('#stateBrandChoice').val();
		params += "&brand=" + jQuery('#brandChoice').val();
		var pathname = window.location.protocol + "//" + window.location.host + "/get/getCitiesList.php";
		
		
		jQuery.ajax({
			url: pathname,
			type: "POST",
			data: params,
			dataType: "html",
			complete: function(request){
			},
			success: function(html){
				var text  = '<select id="cityBrandChoice" style="width:125px;" name="CityChoice">';
				text += html;
				text += '</select>';
				jQuery('.cityBrandChoice').html(text);
			},
			error: function(request) {
				alert('error');
			}
		})
	});
	
	
	
});

