jQuery(document).ready(function() {

	jQuery('#slider li:first').addClass('active');
	
	function slideSwitch() {
	
	    var $active = jQuery('#slider li.active');

	    if ( $active.length == 0 ) $active = jQuery('#slider li:last');

	    // use this to pull the images in the order they appear in the markup
	    var $next =  $active.next('li').length ? $active.next()
	        : jQuery('#slider li:first');

	    $active.addClass('last-active');

	    $next.css({opacity: 0.0})
	        .addClass('active')
	        .animate({opacity: 1.0}, 1000, function() {
	            $active.removeClass('active last-active');
	        });
	}

	setInterval( slideSwitch, 5000 );
	
	jQuery('#slider-2 li:first').addClass('active');
	
	function slideSwitchTwo() {
	
	    var $active = jQuery('#slider-2 li.active');

	    if ( $active.length == 0 ) $active = jQuery('#slider-2 li:last');

	    // use this to pull the images in the order they appear in the markup
	    var $next =  $active.next('li').length ? $active.next()
	        : jQuery('#slider-2 li:first');

	    $active.addClass('last-active');

	    $next.css({opacity: 0.0})
	        .addClass('active')
	        .animate({opacity: 1.0}, 1000, function() {
	            $active.removeClass('active last-active');
	        });
	}

	setInterval( slideSwitchTwo, 7000 );
	
	// Jquery dropdown menu
	jQuery("#dropmenu ul").css({display: "none"}); 
			jQuery("#dropmenu li ul a span").text("");
	     	jQuery("#dropmenu li ul li:has(ul) a").append("<span>&nbsp;&raquo;</span>"); 
         	jQuery("#dropmenu li ul li ul a span").text(""); 
	     	jQuery("#dropmenu li ul li ul li:has(ul) a").append("<span>&nbsp;&raquo;</span>"); 
	     	jQuery("#dropmenu li ul li ul li ul li a span").text("");  
		 	jQuery("#dropmenu li").hover(function(){
				jQuery(this).find("ul:first").fadeIn("100");
			},
			function(){
				jQuery(this).find("ul:first").fadeOut("100");
	});
	
	jQuery('#top-left a').addClass('thickbox');
	
	jQuery("param[name='wmode']").attr('value', 'opaque');
	jQuery('embed').attr('wmode', 'opaque');
	
	jQuery('.videos div:even').addClass('clear');
	
	var main = 0;
	var side = 0;
	var column = 0;
	main = jQuery('#main').height();
	side = jQuery('#sidebar').height();
	if(!main || !sidebar) {
		column = jQuery('#content').height();
	} else if(main >= side) {
		var column = main;
	} else {
		column = side + 28;
	}
	jQuery('#cap-left').css('height', column);
	jQuery('#cap-right').css('height', column);
	
	jQuery("#events input[type='image']").wrap('<div class="btn-wrap"></div>');
	
});