// JavaScript Document

$(window).load(function() {
						   
	function s() {
		var e = ($("p.weather.active").length > 0 ? $("p.weather.active") : $("p.weather:first-child"));
		$("p.weather").hide().removeClass("active");
		var n = $(e).next("p.weather");
		if($(n).length == 0) {
			$("p.weather:first-child").fadeIn().addClass("active");	
		} else {
			$(n).fadeIn().addClass("active");	
		}
		setTimeout(s, 5000);
	}
	
	setTimeout(s, 5000);
	
	$("a.product_thumbnail").unbind().click(function() {
		var p = $(this).parent("p").parent(".listing_left");
		var id = $(this).attr("id").replace(/product_thumbnail_button_/, "");
		for(i=1; i<100; i++) { $(p).children("#product_image_"+ i).hide(); }
		$(p).children("#product_image_"+ id).show();
		return false;
	});
	
	$('#slider').nivoSlider({
        effect:'fade', 
        slices:1,
        animSpeed:1000, 
		pauseTime:5000, 
        directionNav:false, 
        controlNav:false, 
        keyboardNav:false, 
        pauseOnHover:false, 
        manualAdvance:false, 
    });
	
});

Cufon.replace('h1');
Cufon.replace('ul#navlist a');
Cufon.replace('.title-navg');
Cufon.replace('.news-title p');
