jQuery(document).ready(function($) {
	
	$("form[name='contact-us']").submit(function() {
		
		var action = $(this).attr('action'),
			$fields = $(this).serializeArray();
		
		$.post(action, $fields, function(data, textStatus, xhr) {
			
			
			alert(data);
			
			if(data == "Thank you for contacting GDC/RE."){
			
			$.fancybox.close();
			
			}
		
		});
		
		return false;

	});
	
	$("#available-properties").tablesorter({sortList:[[1,0],[1,2,3,4,5,6]]});
	
	$("table").bind('sortEnd', function(event) {
		
		$("#available-properties").find(".odd, .even").attr('class','');
		$('#available-properties tr:odd').addClass('odd');
		
	});

	$("a.tab").click(function () {  
  
        // switch all tabs off  
        $(".active").removeClass("active");  
  
        // switch this tab on  
        $(this).addClass("active");  
  
        // slide all elements with the class 'content' up  
        $(".content").stop(true,true).slideUp();  
  
        // Now figure out what the 'title' attribute value is and find the element with that id.  Then slide that down.  
        var content_show = $(this).attr("title");  
        $("#"+content_show).stop(true,true).slideDown();  
        return false;
  
    }); 
		
});
