$(document).ready (function (){
	
	$('#fader-01').cycle({ 
	    fx:      'fade', 
    	speed:    1000, 
	    timeout:  3100 
	});
	
	$('#fader-02').cycle({ 
	    fx:      'fade', 
    	speed:    1000, 
	    timeout:  2250 
	});
	
	$('#fader-03').cycle({ 
	    fx:      'fade', 
    	speed:    1000, 
	    timeout:  4300 
	});
		
	$("#widget-weather-load").load("/assets/resources/widget-weather.php");
	$("#widget-news-load").load("/assets/resources/widget-news.php");

	 
	//store-directory details
	$("#stores-details .store-info").hide();
	$("#stores-lists a").click(function () {
		$(".store-current").hide().removeClass("store-current");
		$("#stores-map-overlay").removeClass();

		//add background image to map overlay div
		imageUrl = "/images/uploads/"+this.href.substring(this.href.indexOf("#")+1, this.href.length)+".gif"
		$("#stores-map-overlay").css('background-image', 'url(' + imageUrl + ')');

		//show store details
		$(this.href.substring(this.href.indexOf("#"), this.href.length)).addClass("store-current").fadeToggle();
		return false;
	}); 
	
	jQuery.fn.fadeToggle = function(speed, easing, callback) {
		return this.animate({opacity: 'toggle'}, speed, easing, callback);
	}; 

});