$(function() {
	function flare(){$('#header').animate({backgroundColor:'#5cabc5'},3000).animate({backgroundColor:'#5ec783'},3000).animate({backgroundColor:'#b2c75e'},3000).animate({backgroundColor:'#c7925e'}, 3000).animate({backgroundColor:'#c75e6f'},3000).animate({backgroundColor:'#c75eb4'},3000).animate({backgroundColor:'#715ec7'},3000,flare);};
	function megaHoverOver(){$(this).find('.sub').stop().fadeTo(300,1).show();};
	function megaHoverOut(){$(this).find('.sub').stop().fadeTo(300,0,function() {$(this).hide();});};
	
	var dockOptions = {align:'middle',size:'60'};
	var slimboxOptions = {loop:true,overlayOpacity:0.92, counterText:false, closeKeys:[27,70],nextKeys:[39,83]};
	var hoverOptions = {sensitivity:2,interval:0,over:megaHoverOver,timeout:0,out:megaHoverOut};	
	var carouselOptions = {reflHeight:1, reflOpacity:0,	reflGap:0, minScale:0, xPos:313, yPos:0,xRadius:230, yRadius:-20, altBox:$('#alt-text'), titleBox:$('.iTitle'), FPS:30, autoRotate:'no', autoRotateDelay:1500, speed:0.2, mouseWheel:true};
	var scrollOptions = {circular:true};
	flare();
	$('#flare1').panoScroll({direction:'right', auto:true, scrollSpeed:50});
	$('#flare2').panoScroll({direction:'left', auto:true, scrollSpeed:50});
	$('#nav li').hoverIntent(hoverOptions);
	$('#nav > li > a').hover(function(e){$(this).css({'visibility':'visible'}).hoverFlow(e.type,{opacity:1},500);}, function(e){	$(this).hoverFlow(e.type,{opacity:0},500);});
	$('.sub a').hover(function(e){	$(this).css({backgroundColor:'#ddd'});},function(e){$(this).css({backgroundColor:'#f0f0f0'});});
	$('.sub').corner('bottom 10px');
	$('.sub li').corner('8px');
	$('#footer img').hover(function(e){$(this).hoverFlow(e.type,{opacity:0},300);},function(e){$(this).hoverFlow(e.type,{opacity:1},500);});
	$('.carousel').livequery(function(){$('.carousel').css({'height':'0'});$(this).CloudCarousel();});
	$('.dock').livequery(function(){$(this).jqDock(dockOptions);})
	$('a[rel^="lightbox"]').livequery(function(){$('a[rel^="lightbox"]').slimbox(slimboxOptions);});
	$('.quote').livequery(function(){$(this).corner('15px');});
	$('.fadeBox img, .links img').livequery(function(){$(this).fadeTo(0, 0); $(this).hover(function(e){$(this).hoverFlow(e.type,{opacity:1},300);},function(e){$(this).hoverFlow(e.type,{opacity:0},500);});});
	$('.scrollable').livequery(function(){	$(this).scrollable(scrollOptions);});
	
	$('.submit').livequery(function(){
		$(this).click(function(){
			$('.uploadStatus').show();
		});
	});
	
});
