$(function() {
	$("#menu").megaMenu('hover_slide');
	
	
	//slides the element with class "menu_body" when paragraph with class "menu_head" is clicked
	$("#.menu_list p.hasChild").click(function()
	{
		$(this).css({backgroundImage:"url(down.png)"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp(300);
		$(this).siblings().css({backgroundImage:"url(left.png)"});
		return false;
	});
	$(".menu_body").hide();
	
	$.featureList(
		$("#slider #tabs li a"),
		$("#slider #output li"), {
			start_item	:	1
		}
	);

});


$(document).ready(function() {
 
	/*Add external link icon to external links
	$('a').filter(function() {
		//Compare the anchor tag's host name with location's host name
		return this.hostname && this.hostname !== location.hostname;
	}).removeClass("icon-external").addClass("icon-external");*/
   
	// Add pdf icons to pdf links
	$("#content a[href$='.pdf']").removeClass("icon-external").addClass("icon-pdf").attr('target', '_blank');
   
	// Add txt icons to document links (doc, rtf, txt)
	$("a[href$='.doc'], a[href$='.docx'], a[href$='.txt'], a[href$='.rtf']").removeClass("icon-external").addClass("icon-doc");

	// Add txt icons to powerpoint links (ppt, pptx)
	$("a[href$='.ppt'], a[href$='.pptx']").removeClass("icon-external").addClass("icon-ppt");

	// Add txt icons to excel links (xls, xlsx)
	$("a[href$='.xls'], a[href$='.xlsx']").removeClass("icon-external").addClass("icon-xls");
				   
	// Add email icons to email links
	$("a[href^='mailto:']").removeClass("icon-external").addClass("icon-email");
   
	$('.plain').removeClass("icon-pdf").removeClass("icon-txt").removeClass("icon-ppt").removeClass("icon-xls").removeClass("icon-email").removeClass("icon-external");
               
});


/* Scrolling */
$(document).ready(function(){
	$('a[href^="#"]').click(function (){
		$('html,body').animate({
			scrollTop: $(this.hash).offset().top + (-25)
		}, 800);
		return false;
	});
});

/* Tooltip */

$(document).ready(function(){	
	$("a.tooltip").easyTooltip();
});

/* Zebra Strips */
$(document).ready(function(){
	$("table.zebrastripe tr:odd").css("background-color","#cccccc");
});
