function xLinkColors() {
	var items = $('div.xnav li');
	var icons = 6	// number of graphical icon classes we've created
	for (var i=0; i < items.length; i++) {
		thisClass = "icn" + (i % icons);
		$(items[i]).addClass(thisClass);
	}
}

function searchExpansion() {
	$('div.searchForm').slideToggle();$('a.searchBtn').toggleClass('down');
}

$(document).ready(function  () {
	$('div.lnav li.l1 ul').parent().addClass('arrowed');
	
	$('div.lnav li.l1 ul').parent().click(function(e) {
			// do collision detection to make sure event's in the arrow bounds
			
			if ($(this).hasClass('down') != true) {
				
				//get dimensions
				var containerPos = $(this).offset();
				var padScratch = $(this).css('padding-left');
				var thisPad = parseInt(padScratch.substring(padScratch.indexOf('px'),0),10);
				// compute mouseX relative to li
				var x = e.pageX - containerPos.left - thisPad;

				// if mouse is to the left of child a and not to the left of the arrow, do the expandy bits
				if(x < 0 && x > (thisPad * -1)){
					$(this).toggleClass('expanded');
	            	$(this).children('ul').slideToggle();
				}
			}
			
        });

});

$(document).ready(function () {
	$('div.sitemap:eq(2)').after('<hr class="clear" />');
	$('div.sitemap:eq(5)').after('<hr class="clear" />');
});