$(document).ready(function(){
  
  // highlight tab function
  var path = window.location.toString().split("/");
  var home = "/";
  var url = "/" + path[3] + "/";
  
  $("a[href='" + [url || home] + "']").parents("li").each(function() {   
      $(this).addClass("selected");
  });
  
  $("a[href='" + [url || home] + "']").children("img").each(function() {   
      this.src = this.src.replace("_n","_h");
  });
  
  // image rollover
	$("#menu img")
	.mouseover(function(){
    this.src = this.src.replace("_n","_h");
		}
	)
	.mouseout(function(){
    // prevent rollover on selected item (HAX!)
    if( $(this).parent().parent().hasClass("selected") ) {
		} else {
    this.src = this.src.replace("_h","_n");
    }
  }
	)
  
  // call slider
  $(".btn-login").click(function() {
    $("#login-slide").slideToggle();
    }
  )
  
  $("ul.navigation a")
	.mouseover(function(){
		$(this).stop().animate({ paddingLeft: '9px'});
		}
	)
	
	.mouseout(function(){
		$(this).stop().animate({ paddingLeft: '6px' });
		}
	)
	
  $("ul.navigation a.disabled")
	.mouseover(function(){
		$(this).stop().animate({ paddingLeft: '4px'});
		}
	)
	
	.mouseout(function(){
		$(this).stop().animate({ paddingLeft: '4px' });
		}
	)
  
  
    // Link Styles for Images
    //Apply CSS class to all A links that end in .pdf
    $("a[href$='.ical']").addClass("ICAL");
    
    //Apply CSS class to all A links that end in .pdf
    $("a[href$='.pdf']").addClass("PDF");
  
});