$(window).load(function() {
	$('#slider').nivoSlider({
		effect:'fade', //Specify sets like: 'sliceDown,sliceDownLeft,sliceUp,sliceUpLeft,sliceUpDown,sliceUpDownLeft,fold,fade,random'
		animSpeed:300,
		pauseTime:8000,
		captionOpacity: 1,
		controlNav: true,
		pauseOnHover:true, //Stop animation while hovering
		directionNav: false, // Next & Prev navigation
        directionNavHide: false // Only show on hover
	});	
});

jQuery(document).ready(function($){
	$('#tabs li a').click(function() {
		var selected = '#' + $(this).parent().attr('id');
		$('#tabs li').removeClass('selected');
		$(this).parent().addClass('selected');
		$('.toggle-box').hide();
		$(selected + '-box').show();
		return false;
	});
	
	$('#popularLinks #links').hide();
	$('#btn-popularLinks').click(function() {
		$('#popularLinks #links').slideToggle();
		return false;
	});
	
	$('aside.left-col article,#event-container div.event article').hover(function() {
		$(this).addClass('selected','2000','');
	}, function() {
		$(this).removeClass('selected','1000','');
	});
	 /*
	var $pageCalendar = $('fieldset.jcalendar');
	if($pageCalendar.length) {
		$pageCalendar.jcalendar();
	}
	*/
	
	//--------------------- MegaMenu dropdown fade effect ------------------------------//

	
	//--------------------- popular links fade effect ------------------------------//
	
	$('#links img').hover(function() {

		$(this).animate({
			opacity: 1
		});
	}, function() {
		$(this).animate({
			opacity: 0.5
		});
	});
	
});
	

//------------------- for clearing and replacing text in form input fields and textareas -------------------//
function clearText(thefield) {
  if (thefield.defaultValue==thefield.value) { thefield.value = "" }
} 
function replaceText(thefield) {
  if (thefield.value=="") { thefield.value = thefield.defaultValue }
}
