// Default page scripts

$(document).ready(function(){
		
		// Clear input boxs on click
		if ($('#what').val() == "") {
                                $('#what').autofill({
                                                value: 'e.g. Builders'
                                });
                }
                if ($('#where').val() == "") {
		   $('#where').autofill({
			value: 'e.g. Bath, BA1 or 01225'
                                });
                }
		
		// Clear input boxs on click	
		//$("#set_location_btn").click(function() { alert("DONE"); });
		$("#set_location_btn").click(function() { 			 
			if($("input#location").val()=="")
			{
				alert("Please enter your location");
				return false;
		 	}	 
		 });
		
		$("#set_exact_location").click(function() { 			 
			if($("select#multiple").val()=="")
			{
				alert("Please select your exact location");
				return false;
		 	}	 
		 });
		 
	
		
		//$("#hMain").load("set_location.php");
		
		$('#localNews').hide();
		$('.lnews').append('<div id="load">&nbsp;</div>');
		$('#load').fadeIn('fast'); 
		$('.lnews').oneTime(100, function() { 											 
		$('#load').fadeOut('fast').hide(); 		
		$('#localNews').fadeIn();
		//$('#localNews').fadeIn(function() { this.style.removeAttribute("filter"); } );
		} );
		
		$('#weatherforecast').hide();
		$('.weather').append('<div id="load1">&nbsp;</div>');
		$('#load1').fadeIn('fast'); 
		$('.weather').oneTime(1500, function() { 											 
		$('#load1').fadeOut('fast').hide(); 		
		$('#weatherforecast').fadeIn();
		} );
		
		$('#nationNews').hide();
		$('.news').append('<div id="load2">&nbsp;</div>');
		$('#load2').fadeIn('fast');
		$('.news').oneTime(2000, function() { 											 
		$('#load2').fadeOut('fast').hide(); 		
		$('#nationNews').fadeIn();
		} );
		
	

		


});