// JavaScript Document
$(document).ready(function(){
	$(document).pngFix();
	$('#cover').corner('cc:#333 15px');
	$('.page, #rotator-outer').corner('15px');
	$('.header, .body, .box, .quotebox, .tab .content, a.button, table.multi td, .form .inner').corner();
	$('.menu ul').corner('bottom cc:#FFF');
	$('.announce, .announce .inner, .dl').corner('5px');
	$('.box .title').corner('right cc:#FFF 10px');
	$('.box .title').corner('left dog2 14px');
	$('.tab ul li').corner('top');
	
	$('#rotator').cycle({ 
		fx:     'fade',
		pause:  1,
		timeout: 8000,
		pager:  '#pager'
	});
	
	$('#box1').cycle({ 
		fx:     'scrollRight', 
		easing: 'backin', 
		sync:   0,
		pause:  1,
		timeout: 5000 
	});
	$('#box2').cycle({ 
		fx:     'scrollRight', 
		easing: 'backin', 
		sync:   0, 
		pause:  1,
		timeout: 4000 
	});
	$('#quotebox').cycle({ 
		fx:     'scrollVert', 
		easing: 'bounceout', 
		sync:   0, 
		pause:  1,
		timeout: 11000 
	});
	
	$('.invis').css({opacity: 0});
	$('#download').hover(function(){
		//$('#dlhover').show();
		$('#dlhover').stop().animate({opacity: 1});
		$(document).pngFix();
	},function(){
		$('#dlhover').stop().animate({opacity: 0});
	});
	
	$('.tab ul.tabs li').click(function(){
		$('.tab .content .inner').css('display', 'none');
		$('#cnt_'+ $(this).attr('id')).css({opacity: 0, display: 'block'}).animate({opacity: 1});
		//alert($(this).parent().css('backgroundColor'));
	//	var change = {backgroundColor: $('.extrabox .links ul li:not(.selected)').css('backgroundColor')};
		$('.tab .content').animate({backgroundColor: $(this).css('backgroundColor')});
	});
	
	var url = document.location.toString();
	if (url.match('#')) {
		var selectedtab = '#' + url.split('#')[1];
		$('.tab ul li a[href="' + selectedtab + '"]').click();
	}

});
