$(document).ready(function() {

    $('#t0').cycle('fade');         
    $('#t1').cycle('fade');         
    $('#t2').cycle('fade');         
    $('#t3').cycle('fade');         
    $('#t4').cycle('fade');         
    $('#s1').cycle('fade');         
    
    $("#nav-one li").hover(
        function(){ $("ul", this).fadeIn("fast"); }, 
        function() { } 
    );
    if (document.all) {
        $("#nav-one li").hoverClass ("sfHover");
    }
    
    $(".toggle_products").click(function () {
       $("#products_listing").slideToggle();
    });
    
          
    
$("#pageflip").hover(function() { //On hover...
    $("#pageflip img , .msg_block").stop()
        .animate({ //Animate and expand the image and the msg_block (Width + height)
            width: '307px',
            height: '319px'
        }, 500);
    } , function() {
    $("#pageflip img").stop() //On hover out, go back to original size 50x52
        .animate({
            width: '50px',
            height: '52px'
        }, 220);
    $(".msg_block").stop() //On hover out, go back to original size 50x50
        .animate({
            width: '50px',
            height: '50px'
        }, 200); //Note this one retracts a bit faster (to prevent glitching in IE)
});   


    $(".showimage").click(function () {
        $(".animage").hide();
        $('#'+$(this).attr("rel")).show();
    });
    
    $('a.lightbox').lightBox();     
    
    $('.change_page').click(function() 
    {
        rel = $(this).attr('rel');
        $('.apage:visible').fadeOut('slow',function () 
        {
            $('#'+rel).fadeIn();
        });     
    });
    

        $('#slideshow2').serialScroll(
        {
            items:'li',
            prev:'#FeatMachines a.previous',
            next:'#FeatMachines a.next',
            axis:'x',
            offset:0, //when scrolling to photo, stop 230 before reaching it (from the left)
            start:0, //as we are centering it, start at the 2nd
            duration:0,
            force:true,
            interval: 3000,
            constant: true,
            step:1,
            stop:false,  
            lock:false,
            cycle:true, //don't pull back once you reach the end                   
            jump: false //click on the images to scroll to them
        });
    
 
})



$.fn.hoverClass = function(c) {
    return this.each(function(){
        $(this).hover( 
            function() { $(this).addClass(c);  },
            function() { $(this).removeClass(c); }
        );
    });
}; ;
              
