$(document).ready(function() {
	  $('#tabs').show();
	  $('#resError').hide();
	  $("#datepicker1").removeAttr("disabled");
	  $("#datepicker2").removeAttr("disabled");
	  $('#showTabsLink').fadeOut("slow");
	  $("#fButton").click(function(){ 
		//alert("Function Ready");
		//$('#resError').show();
		if(
         $('#datepicker1').val() && $('#datepicker2').val())
		   {$("form:first").trigger("submit");} else {
			$('#resEmpty').show();}
		   });  	       
	  
	    $(".btn-slide").click(function(){
		$("#tabSet").hide();$("#panel").show();
		update(this.id);
		$("#showTabsLink").fadeIn("slow");
		$(this).toggleClass("active"); return false;
		});
	    
		
		$("a.doSomething").live("click", function(){
			$("#tabSet").fadeIn();
			$("#panel").hide();
			$('#propPanel').hide();
			$('#showTabsLink').fadeOut("slow");
        });
		
									
        $(".adGroup").hover( adOver, adOut );	
		
		function adOver(){
			$("#tabSet").hide();
			$("#propPanel").hide();
			$("#panel").hide();
			//alert(xImage);
			$("#resortAds").html('<img src=\"img/tabContent/tab_'+this.id+'Ad.jpg\"/>').show();
		};
		
		function adOut(){
			$("#tabSet").show();
			$("#panel").hide();
			$('#resortAds').hide();
		};
		
		
		
		
				
	}); // Main function close

    $(function(){
	$("#tabs").tabs({ cache: true, spinner: '', selected:2});
	});
		
	$(function(){
	$("#datepicker1").datepicker({
			numberOfMonths: 1,
			defaultDate: +7,
			showAnim: 'fadeIn',
			altField: '#datepicker2'
			
	 });
	
	$("#datepicker2").datepicker({
			numberOfMonths: 1,
			showAnim: 'fadeIn',
			showButtonPanel: true,
			altField: '#datepicker2'
	 });
	});
	
	function update(id) {
	$.get(id, function(data) {
    $("#panel").html(data);
	//window.setTimeout(update, 10000);
	});}
	
	closePropPanel = function(){
		$('#propPanel').hide();
		$('#showTabsLink').fadeOut("slow");
	    $("#tabSet").fadeIn();
	};	
		
	