// .no-csstransitions included so webkit (and hopefully soon ff) handles transitions itself

$(document).ready(function(){
    $.localScroll({
        queue: true,
        duration: 1500,
        hash: true
    });
    
    //scroll on page load if hash present
    $.localScroll.hash({
        queue: true,
        duration: 1500,
        hash: true
    });
    
    $('ul#nav').lavaLamp({
        speed: 800
    });
    
    //fading of tool images on hover
    $('ul#nav li a').append('<span></span>');
    $('ul#nav li a span').css('opacity', '0'); //main nav
    $('.no-csstransitions div.trigger span').css('opacity', '0'); //thumnail images
    $('nav a:has(span)').hoverIntent(function(){
        $('span', this).stop().animate({
            opacity: 1
        }, 1200);
    }, function(){
        $('span', this).stop().animate({
            opacity: 0
        }, 500);
    });
	
	//slidein of hidden div on hover/fade of span(title)
    $('.no-csstransitions div.hidden').css({ //override css here, so still works without js 
        'left': '-620px',
        'opacity': '1'
    });
	
	jQuery.fn.thumbIn = 
	
    $('.no-csstransitions div.trigger').hoverIntent(function(){
		$('span', this).stop().animate({
            opacity: 1
        }, {
            queue: false,
            duration: 1000
        });
        $(this).find('div.hidden').stop().animate({
            left: '0'
        }, {
            queue: false,
            duration: 1000
        });
    }, function(){
		$('span', this).stop().animate({
            opacity: 0
        }, {
            queue: false,
            duration: 1000
        });
        $(this).find('div.hidden').stop().animate({
            left: '-620px'
        }, {
            queue: false,
            duration: 1000
        });
    });
	
	 $('.slideshow').cycle({
        speed: 800,
		timeout: 4000,
    });
    
}); //close docready
