$(window).bind('load', function(){
	var cache = [];
	$("img.loader").each(function(){
		var cacheImage = document.createElement('img');
		cacheImage.src = $(this).attr("src");
		cache.push(cacheImage)
	});
});
$(document).ready(function(){
	$(".opacity-60").hover(function(){
		$(this).stop().fadeTo(200,0.6);
	},function(){
		$(this).stop().fadeTo(200,1.0);
	});
	$(".opacity").hover(function(){
		$(this).stop().fadeTo(200,1.0);
	},function(){
		$(this).stop().fadeTo(200,0.5);
	});
	$("#mainnav li ul").css('opacity','0.95');
	$("#mainnav li ul").css('-moz-opacity','0.95');
	$(".hide-n-seek").fadeIn(500);
	$("#image").cycle({
		fx:           'fade',
		speed:         500,
		fastOnEvent:   300,
		next:         '#next',
		prev:         '#back',
		cleartypeNoBg: true
	});
	$("#image").hover(function(){
		$('#image').cycle('pause');
	},function(){
		$('#image').cycle('resume');
	});
	$('.description').each(function(){
		$(this).css('opacity', 0);
		$(this).children().css('opacity', 0);
		$(this).css('width', $(this).siblings('img').width()-12);
		$(this).parent().css('width', $(this).siblings('img').width());
		$(this).css('height', $(this).siblings('img').height()-12);
		$(this).parent().css('height', $(this).siblings('img').height());
		$(this).css('display', 'block');
	});
	$('.image').hover(function(){
		$(this).children('.description').stop().fadeTo(500, 0.75);
		$(this).children('.description').children('.description_content').stop().fadeTo(500, 1.0);
	},function(){
		$(this).children('.description').stop().fadeTo(500, 0);
		$(this).children('.description').children('.description_content').stop().fadeTo(500, 0);
	});
	$('.dataTable').jScrollPane({
		verticalDragMinHeight: 16,
		verticalDragMaxHeight: 16
	});
	$(".scrollableArea").preloader();
});
$(window).load(function(){
	$("div#slider").smoothDivScroll({
		autoScroll:"onstart always",
		visibleHotSpots:"always",
		autoScrollStep:1,
		autoScrollInterval:15,
		autoScrollDirection:"backandforth"
		//autoScrollDirection:"endlessloopright"
	});
});

