/*  sIFR Related */
var sIFR_memphis = {
    src: 'flash/memphis.swf'
    ,ratios: [9, 1.16, 16, 1.09, 24, 1.06, 37, 1.04, 74, 1.02, 1.01]
  };
  
sIFR.activate(sIFR_memphis);
jQuery(function($) {
	
	sIFR.replace(sIFR_memphis, {
	    selector: 'div#top h1, body.entry-page #columnMain h1'
	    ,css: ['.sIFR-root { color: #ffaa00; }']
	    ,offsetTop: 6
	    ,wmode: 'transparent'
	}); 
	
	/*  Photo Gallery  */
    $('.gallery .thumbnails a').click(function(){
        $(this)
        	.addClass('active')
        	.siblings().removeClass('active');
        
        var img = $(this).children('img').attr('src');

        var lg_img = img.replace("/small-thumbnail/","/large/");
        var xlg_img =  this.href;
        
        // Change image src
        var img = $('.gallery .photoLarge img');
        img.hide().attr({src: lg_img}).fadeIn();
        
        // Change the anchor around the image
        $('.gallery a.enlarge, .gallery .photoLarge a').attr({href: xlg_img});
        
        return false;
    });    
    
    var galleries= $('.gallery');
    if( galleries.length > 0 ) {
	    $('.photoLarge a',galleries).lightBox();
	    $('a.enlarge:first',galleries).lightBox();
    }



	/*  Make product links open in a new window. */
	$('div#columnSub div.productLinks a').click(function(){
		window.open( this.href );
		return false;
	});
	
	$("#nav ul li").hover(
		function(){
			$(this).addClass("hover");
		}, function(){
			$(this).removeClass("hover");
		}
	)
})

