
$(document).ready(function() {
	
    $("#mortgagefrm").validate();
    
	$('.blink').blink();

    $('.slideshow').cycle({
		fx: 'fade'
	});

    $('#featured').cycle({
		fx: 'fade',
   		timeout: 0,
		next:   '#next', 
		prev:   '#prev' 
	});	

	$("#estate").change(function(){
		var showCities = this.value;
		var prevCitySel = $("#hidden-city-ref").val();

		//hide the previously selected
		$("#"+prevCitySel).css("display","none");
		$("#"+prevCitySel).removeClass("required");
		$("#"+prevCitySel).removeAttr("name");
		
		//show the Newly selected
		$("#"+showCities).css("display","inline");
		$("#"+showCities).attr("name","city");
		$("#"+showCities).addClass("required");
		
		$("#hidden-city-ref").val(this.value);
		
	});
    
		$("a[rel^='prettyPhoto']").prettyPhoto({
			animationSpeed: 'fast', /* fast/slow/normal */
			padding: 40, /* padding for each side of the picture */
			opacity: 0.9, /* Value betwee 0 and 1 */
			showTitle: false, /* true/false */
			allowresize: false, /* true/false */
			counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
			theme: 'dark_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
			hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
			modal: false, /* If set to true, only the close button will close the window */
			changepicturecallback: function(){}, /* Called everytime an item is shown/changed */
			callback: function(){} /* Called when prettyPhoto is closed */
		});    
    
});

//Map Thingy..

function close_list(id){
	var prevImap = $("#prevSelImap").val();
    $("."+id).slideUp();
}

function getList(id){
	var prevImap = $("#prevSelImap").val();
    $("."+prevImap).slideUp();
    $("#prevSelImap").val(id);
    $("."+id).slideDown();
}