// JavaScript Document

$(document).ready(function(){
	$('ul#nav').superfish({ 
		delay:       1000,
		animation:   {opacity:'show',height:'show'},
		speed:       'fast',
		autoArrows:  false,
		dropShadows: false
	});
	$(".tableimage").each(function(i){
		if ($(this).children().attr("alt")!=''){
			$(this).children('img').addClass("picturetoolimg");
			$(this).children('img').attr({'title': $(this).children().attr("alt")});
			$(this).attr({'title': $(this).children().attr("alt")});
		}
	});
	
	$(".iframe").fancybox({
		'width' : '95%',
		'height' : '95%',
		'autoScale' : false,
		'transitionIn' : 'none',
		'transitionOut' : 'none',
		'type' : 'iframe'
   	});
	
	$("a[rel=fancyimage]").fancybox({		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic'
	});
	$('ul#nav li li a').css({opacity: 0.85});
	$('ul#nav li.more').each(function(i){
		var parentWidth = $(this).width();
		var PositionLeft = (parentWidth-198)/2;
		$(this).children("ul:eq(0)").css({'left':PositionLeft+'px'});
	});
	$('#slider').nivoSlider({
        effect:'random',
        animSpeed:500,
        pauseTime: 5000,
        startSlide:0,
		directionNav:false
    });
	$(".picturetool[title]").each(function(i){
		$(this).children('img').attr({'title': $(this).attr("title")});
		$(this).children('img').addClass("picturetoolimg");
	});	
	$("img.picturetoolimg[title]").tooltip({
		offset: [0, 0],	
		effect: "slide",	
		opacity: 0.9	
	}).dynamic({ bottom: { direction: 'down', bounce: true } });
	$('.hidden').remove();
});

