$(function(){


	$('#logo').click(function(){
		window.open('http://www.murraystate.edu/','_self');
	});
		
	$('#directoryToggle').click(function(){
							if ($('#directoryBox').css('display')=='block') {
								$('#directoryBox').slideUp();
								$(this).removeClass('open');
								$(this).addClass('close');
							}else{
								$('#directoryBox').slideDown();
								$(this).addClass('open');
								$(this).removeClass('close');
							}
							}
						 );
	
	//$(".lh_fill").css('height',$("#interiorBody").height()-54);
	$("#studentMenu").css('height',$("#interiorBody").height()+1);
	//$("#interiorBody").css('height',$("#content").height()+1);
	//alert($("#rhblog_container").height());
	
	//tweak layout in page edit mode in Sitefinity
	if(document.location.search.indexOf('cmspagemode=edit') > - 1)
	{
	    $("#interiorBody").css('width',$("#interiorBody").width()+3);
	    $(".placement").css("zIndex","-1"); //lower this area in edit mode so the elements don't interfere with Sitefinity's edit ctls	    		
	}

	var studentMenu=$('#studentDynamicMenu');
	
	if (studentMenu){
		$(studentMenu).css('height',$("#interiorBody").height()-54);
				
		$("#studentDynamicMenu .name").click(function () {    //alert( $(this).next().css('display') );
		    if ($(this).next().css('display') == 'block')
		    {
		        $(this).next().slideUp(500);
		    }
		    else
		    {
		        $(this).next().slideDown(500);
		    }	    
                 
        }); 
    
		 $(studentMenu).find('div div').click(function(){ 
		  if ($(this).parent('div').find('ul').css('display')!='block'){
			 $(studentMenu).find('ul').slideUp(500);
			$(this).parent('div').find('ul').slideDown(500);
			  }})	 
	}
	
	$('#dropdown').hover(function(){
								  $()
								  $('#dropdown').find('ul').slideDown(1);
								  },function(){
									  $('#dropdown').find('ul').slideUp(250);
									  });
									  
	$("#msuNewsFeed").fadeIn("slow"); 
	
});

$(document).ready(function() 
{  
//homepage
if(null != $("#slides").html() )
{
    $("#slides").innerfade({
        speed: 'slow',
        timeout: 10000,
        type: 'sequence',
        containerheight: '730px'
    });  
}

//interior content page          
if(null != $("#slides_interior").html() )
{       
   $("#slides_interior").innerfade({
        speed: 'slow',
        timeout: 4000,
        type: 'sequence',
        containerheight: '228px'
    });  
}

$(".defaultclick").keypress(function(e) {
       if(e.keyCode == 13)
       {
       $("#ctl100_PeopleSearchBoxControl1_btnImgSubmit").click();
       }
});

$("body").keypress(function(e) {
       if(e.keyCode == 13)
       {
		return false;
       }
});



});


