var $old=null;

//MAIN MENU
$(document).ready(function(){
	
	//Banners - LOOP
	$('.banners').cycle({
			fx: 'fade',
			pause: 1,
			speed:    1000, 
			timeout:  7000,
			random:  1
		});
	
	//News - LOOP
	$('#news').cycle({
		fx: 'fade',
		pause: 1,
		speed:    500, 
		timeout:  5000,
		random:  1
	});
	
	//Banners - SHOW HIDE TEXT
	var showText='More Information';
	var hideText='Hide';
	
	var is_visible = false;
	$('.toggle').prev().append(' (<a href="#" class="toggleLink">'+showText+'</a>)');
	$('.toggle').hide();
	
	$('a.toggleLink').click(function() {
		is_visible = !is_visible;
		$(this).html( (!is_visible) ? showText : hideText);
		$(this).parent().next('.toggle').toggle('slow');
		return false;
	});
	
	//Delete News
	$('.delnews').hide();
	
	$("tr.data td.delshow").click(function(){
		$(this).parent().next("tr").toggle();
	});	
	
	//Delete Download
	$('.deldownload').hide();

	$("tr.data td.downshow").click(function(){
		$(this).parent().next("tr").toggle();
	});
	
	//Delete Download
	// $('.updownload').hide();
	// 
	// $("tr.data td.upshow").click(function(){
	// 	$(this).parent().next("tr").toggle();
	// });
	
	//MAIN MENU	
	function addMega(){
		$(this).addClass("hovering");
	}

	function removeMega(){
		$(this).removeClass("hovering");
	}

	var megaConfig = {
		interval: 50,
		sensitivity: 400,
		over: addMega,
		timeout: 100,
		out: removeMega
	};
	
	$("li.show_sub, #menuOver").hoverIntent(megaConfig)	
});

//news ticker
$(function() {
	$(".newsticker").jCarouselLite({
		vertical: true,
		hoverPause:true,
		visible: 1,
		auto:5000,
		speed:3000
	});
});
