
jQuery(function($){


	$("#nav>li.menu-item").each(function(){

		   if($(this).has('ul.sub-menu').length > 0){
				$(this).addClass('parent');
	   }

      });
	$('#nav li.menu-item').hover(
	function(){
	
		$(this).children('ul.sub-menu').slideDown(200);
		//$("ul.sub-menu").slideDown(200);
	},
	function(){
		$(this).children('ul.sub-menu').slideUp(200);
	}
	);

}); 

/*Begin: jQuery function with a code to toggle child drop down*/

function returnNull()
{
	return false;
}
jQuery(function($){
	
	
	$("ul.sideNav > li > ul.subNav > li.page_item").each(function(){
		
		if($(this).has("ul.children").length > 0) {

		$(this).children("a").attr("href","javascript: void(0)"); // sinppet to make fparent link of the list as static
	
		
						$(this).addClass("parent"); // snippet adds a parent class to list items of the page list, if it has sub menu included in it's list

					//	$(this).children("ul.children").css("cursor","s-resize"); // code to hide child lists initially
//page_item page-item-46 current_page_ancestor current_page_parent parent
					if(($(this).hasClass("current_page_item") == true) || ($(this).hasClass("current_page_ancestor") == true)){
							 $(this).children("ul.children").css("display","block"); // code to hide child lists initially
						} else{
								 $(this).children("ul.children").css("display","none"); // code to hide child lists initially
						}
		}

	});

$('ul.sideNav > li > ul.subNav > li.page_item').click(function(){

	$(this).toggleClass('current_page_item');

	$(this).children("ul.children").slideToggle("slow"); // snippet to toggle child list items on click of it's parent list item	 

});



});

/*End: jQuery function with a code to toggle child drop down*/

/*Begin: jQuery function with a code to toggle login drop down*/
jQuery(function($){

	$("a#login_link").click(function(){
		$("div#login_container").slideToggle(200);
	});

});

/*End: jQuery function with a code to toggle login drop down*/

jQuery(function($){
            $('.slideshow').cycle({
                //fx: 'fade'
                fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
				timeout: 0,
                pager: '#slideshowNav'
				
            });
			$('.thumbNailDiv').each(function(index) {
				$(this).click(function() {
					$('.slideshow').cycle(index);
				})
			});
        });
/*Begin: Home page thumbnail carousel section*/

jQuery(function($){

	$('#thumnail_scroller').jcarousel({
        vertical: true,
        scroll: 1,
		buttonNextEvent:'click',
		buttonPrevEvent: 'click'
    });

});

/*End: Home page thumbnail carousel section*/
/*Begin: tabs section*/
jQuery(function($){
	//$( "#tabs" ).tabs();
});
/*End: tabs section*/
jQuery(function($){
$(".listPPL .hoverBox").fancybox({
				'titlePosition'		: 'inside',
				'transitionIn'		: 'none',
				'transitionOut'		: 'none'
			});
});

/*For staff page*/
jQuery(function($){
	$(".listPPL .hoverBox").fancybox({
	'titlePosition' : 'inside',
	'transitionIn' : 'none',
	'transitionOut' : 'none'
	});
});
/*For staff page ends*/

/*For resources page*/
jQuery(function($){
	$(".listResources li a").fancybox({
	'titlePosition' : 'inside',
	'transitionIn' : 'none',
	'transitionOut' : 'none'
	});
});
/*For resources page ends*/


jQuery(function($){
	//Default Action
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs li").click(function() {

		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		
		$(this).addClass("active"); //Add "active" class to selected tab
			
		$(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
});

/*Begin: Functionality to hide show more info contents of Staff Entries page*/

jQuery(function($){
		$("ul.staff_entries > li > div.entry_post").hide();

		$("ul.staff_entries > li").each(function(){
	
			$(this).has('a.more_info').click(function(){
					$(this).find('a').toggleClass("active_tab");
					$(this).children("div.entry_post").toggle();																	
			}); 
		});
});

/*End: Functionality to hide show more info contents of Staff Entries page*/

