$(document).ready(function(){
	
	// let's insert print css
	// doing this here to avoid the need to update the massive amount of files by updating the dwt files
	// also IE doesn't recognize media types when specified via @import
	$('head').append('<link href="/css/print.css" rel="stylesheet" media="print" type="text/css" />'); 
	
	
	
	
	// side menu functions
	
	$("#left-sidebar-nav ul ul").hide();
	
	$("#left-sidebar-nav li").each(function(e) {
		if(document.location.pathname == $(this).children("a").attr("href")) {
			$(this).addClass("current");
			$(this).children("ul").show();
			$(this).parents("li").each(function() {
				$(this).addClass("current");
				$(this).children("ul").show();
			});
		}
	});
	// sort through li to see if it has children
	$("#left-sidebar-nav ul li").each(function(e) {		
	  if( $(this).children("ul").size() > 0) {
			 $(this).addClass("parent");
		  }
	});
	//wrap the contents of the li that is marked current and parent to create double border effect
	$("#left-sidebar-nav li.current.parent").wrapInner('<div class="child-wrapper" />');
	//insert dotted image inside new child-wrapper for lower double border, upper border is handled by css
	$('<div class="dotted-line-box"></div>').appendTo('div.child-wrapper');
	//insert menu arrows
	$('<div class="menu-arrow"></div>').prependTo("#left-sidebar-nav li.parent a") ;
	
	//standardize the Search button label to say Search
	//$('input[name="sa"]').attr('value','Search');

});
