
// Jquery menu
$(document).ready(function() {
	
	
	$("#topnav li.top-drop").prepend("<span></span>"); //Throws an empty span tag right before the a tag
	
	$("#topnav li.top-drop").each(function() { //For each list item...
		var linkText = $(this).find("a").html(); //Find the text inside of the a tag
		$(this).find("span").show().html(linkText); //Add the text in the span tag
	}); 
	
	$("#topnav li.top-drop").hover(function() {	//On hover...
		$(this).find("span").stop().animate({ 
			marginTop: "-40" //Find the span tag and move it up 40 pixels
		}, 250);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "0" //Move the span back to its original state (0px)
		}, 250);
	});
});







// Enroll button fade
$(document).ready(function() {
	$('.fadeThis').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(500, 1);
	  }, function () {
	    $span.stop().fadeTo(500, 0);
	  });
	});
});





<!--//--><![CDATA[//><!--

sfHover = function() {
	var sfEls = document.getElementById("topnav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
		
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//--><!]]>




/*

function slide(navigation_id, pad_out, pad_in, time, multiplier)
{

	// creates the hover-slide effect for all link elements 		
	$(link_elements).each(function(i)
	{
		$(this).hover(
		function()
		{
			$(this).animate({ paddingLeft: pad_out }, 150);
		},		
		function()
		{
			$(this).animate({ paddingLeft: pad_in }, 150);
		});
	});
}
*/



function showD(action,id)
{
	
	if (action ==1)
	{
			//we are showing a menu
			
			//first we close all main descriptions and show short ones
			
			$('.full_info').slideUp('fast');
			$('.short_info').slideDown('fast');
			//do the same with the buttons
			$('.less_but').hide();
			$('.more_but').show();
			
			
			
			
			//then we show the one we need
			$('#full_info_'+id).slideDown('fast');
			//then swap the buttons
			$('#more_but_'+id).hide();
			$('#less_but_'+id).show();
			
		
		
		
	}
	else
	{
	//hide one area
	$('#full_info_'+id).slideUp('fast');
	$('#short_info_'+id).slideUp('fast');
	//then swap the buttons
			$('#less_but_'+id).hide();
			$('#more_but_'+id).show();
		
		
		
	}
	
	
}



		function showDetail(action,id)
		{
			
					
					if (action==1)
					{
						//we show the detail
					 		$('#course_extra_'+id).slideDown(500);
							$('#plus_'+id).hide();
							$('#less_'+id).show();
					 
					 
					}
					else
					{
						
							//we show the detail
					 		$('#course_extra_'+id).slideUp(500);
							$('#plus_'+id).show();
							$('#less_'+id).hide();
						
					}
			
			
		}



