// Slideshow (minimized)
// ---------------------

var $$=$.fn;$$.extend({SlideShowElement:null,SlideControlElements:null,SlideElements:null,SplitID:function(){return this.attr('id').split('-').pop();},Slideshow:{Defaults:function(options){if(options.slideshow){this.SlideShowElement=options.slideshow;}else{this.SlideShowElement=options;}
this.SlideControl=this.SlideShowElement.find(".Controls");this.SlideElements=this.SlideShowElement.find(".Slides .Slide");this.ControlLeft=this.SlideShowElement.find(".controlLeft");this.ControlRight=this.SlideShowElement.find(".controlRight");if(options.controls){this.SlideControl=options.controls;}
if(options.slides){this.SlideElements=options.slides;}
if(options.controlLeft){this.ControlLeft=options.controlLeft;}
if(options.controlRight){this.ControlRight=options.controlRight;}
this.SlideControlElements=this.SlideControl.children();this.TotalSlides=this.SlideElements.length-1;this.Counter=0;this.Interrupted=false;},Ready:function(options){this.Defaults(options);this.SlideControlElements.each(function(){$(this).hover(function(){$(this).addClass('SlideOn');},function(){$(this).removeClass('SlideOn');}).click(function(){$$.Slideshow.Interrupted=true;$$.Slideshow.SlideElements.hide();$$.Slideshow.SlideControlElements.removeClass('SlideActive');var id=$$.Slideshow.SlideControlElements.index($(this));$$.Slideshow.SlideElements.eq(id).show();$(this).addClass('SlideActive');})});showhide=function(id){$$.Slideshow.SlideControlElements.removeClass('SlideActive');$$.Slideshow.SlideControlElements.eq(id).addClass('SlideActive');$$.Slideshow.SlideElements.eq(id).fadeIn('slow',function(){$$.Slideshow.SlideElements.eq(id).siblings().fadeOut('fast');});};this.ControlLeft.click(function(){$$.Slideshow.Interrupted=true;$$.Slideshow.Counter--;var id=$$.Slideshow.Counter-1;if(id<0){id=$$.Slideshow.TotalSlides;$$.Slideshow.Counter=$$.Slideshow.TotalSlides+1;}
showhide(id);});this.ControlRight.click(function(){$$.Slideshow.Interrupted=true;var id=$$.Slideshow.Counter;if(id>$$.Slideshow.TotalSlides){id=0;$$.Slideshow.Counter=0;}
showhide(id);$$.Slideshow.Counter++;});this.Transition();},Transition:function(){if(this.Interrupted){return;}
this.Last=this.Counter-1;if(this.Last<0){this.Last=this.TotalSlides;}
this.SlideControlElements.eq($$.Slideshow.Counter).addClass('SlideActive');this.SlideControlElements.eq($$.Slideshow.Last).removeClass('SlideActive');this.SlideElements.eq($$.Slideshow.Counter).fadeIn('slow');if(this.SlideElements.length==1){this.Interrupted=true;return;}
this.SlideElements.eq(this.Last).fadeOut('fast',function(){$$.Slideshow.Counter++;if($$.Slideshow.Counter>$$.Slideshow.TotalSlides){$$.Slideshow.Counter=0;}
setTimeout('$$.Slideshow.Transition();',7000);});}}});$(function(){$$.Slideshow.Ready($("#Slideshow"));});



$(document).ready(function() {

    // Product Page Image Swap
    // ---------------------

    var OriginalURL = $("#ActiveImage").attr("src");

    $(".Thumb").mouseover(function() {
        var ThumbURL = $(this).attr("hoversrc");
        var BigURL = $(this).attr("bigsrc");
        $("#ActiveImage").attr("src", ThumbURL);
        $("#ActiveLink").attr("href", BigURL);       

    }, function() {
        $("#ActiveImage").attr("src", OriginalURL);
    });


});
