$("document").ready(function() {

	// HOMEPAGE SLIDESHOW
	var browser=navigator.appName;
	if (browser=="Microsoft Internet Explorer")
	{
		//alert("You are currently using Internet Explorer");
		$("div.item-wrap") 
		.after('<div class="featured-nav">') 
		.cycle({ 
			fx:     'none',  
			timeout: 3000, 
			pager:  '.featured-nav',
			cleartype: true, 
			cleartypeNoBg: true
		});
	}
	else
	{
		$("div.item-wrap") 
		.after('<div class="featured-nav">') 
		.cycle({ 
			fx:     'fade',  
			timeout: 4000, 
			pager:  '.featured-nav',
			cleartype: true, 
			cleartypeNoBg: true
		});
	}
});

// Image loader
function imageLoader() {
	
    $('.loader').each(function () {
					  
        var loader = $(this);
        var pathToImage = loader.attr('title');
        var img = new Image();
	  
        $(img).css("opacity", "0.0").load(function () {
								    
            loader.append(this).removeAttr('title');
		
            $(this).css("margin", "0px").css("opacity", "0.0").animate({
											     
                opacity: 1.0
		    
            },400, function () {
			
                loader.css({ "background-image": "none", "background-color": "transparent" });
		    
            });
		
        }).attr('src', pathToImage);
	  
    });
    
}

$("document").ready(function() {
    imageLoader();
});	
