jQuery.noConflict();

jQuery(document).ready(function($){
      
	  $('ul.menuleft-mainmenu li a').click(function(e){
		if($(this).parent().children('ul#submenuleft:hidden').length > 0){
			e.preventDefault();
			$('ul.menuleft-mainmenu li a').parent().children('ul#submenuleft').slideUp('fast');
			$('ul.menuleft-mainmenu li a').removeClass('bHover');
			$(this).parent().children('ul#submenuleft').slideDown('fast');
			$(this).addClass('bHover');
		}
		else
		{
			if($(this).parent().children('ul#submenuleft:visible').length > 0){
				e.preventDefault();
				$(this).parent().children('ul#submenuleft').slideUp('fast');
				$(this).removeClass('bHover');
			}
		}
	});
	  
	$('li.noactive').each( function(i,e){
		if ($(this).parent().attr("id")=="submenuleft")
				$(this).parent().slideDown('fast');
	});
	
	$('li.noactive').each( function(i,e){
		if ($(this).parent().attr("id")=="submenuleft")
				$(this).parent().parent().children('a').addClass('bHover');
	});
	
	$('.select-me').click(function(){
		var id = $(this).attr('rel'),
		status = $(id).attr('checked'),
		srcimg = $(this).children('img').attr('src');
		if(status) { 
			$(id).removeAttr('checked');
			srcimg = srcimg.replace('-on.gif', '.gif');
			$(this).children('img').attr('src', srcimg);
		} else { 
			$(id).attr('checked', 'checked');
			srcimg = srcimg.replace('.gif', '-on.gif');
			$(this).children('img').attr('src', srcimg);
		} 
		return false;});
	
	
	var speed = 150;

	/* Action Plan */
	
	$('.hp-month').click(function () {
		if ($(this).is('.hp-close')) {
			/*$(this)
				.removeClass('hp-close')
				.addClass('hp-open');
			$(this)
				.children('.hp-events')
				.slideUp(speed);*/
		} else {
			$('.hp-events').slideUp(speed);
			$('.hp-month')
				.not(this)
				.removeClass('hp-close')
				.addClass('hp-open');
			$(this)
				.removeClass('hp-open')
				.addClass('hp-close');
			$(this)
				.children('.hp-events')
				.slideDown(speed);
		}
	});
	if($(".advisory_board").length > 0)
	{	
		$(".advisory_board").tooltip({ effect: 'slide',relative:true});
	}
	$("a[rel*='fancyvideo']").fancybox({
         overlayShow: true,
         frameWidth:640,
         frameHeight:360
    });
	
});
