$(document).ready(function() {
	
	var setStyle = "org";
//	var brdCookie = $.cookie('brdstyle');
//	if ((brdCookie != null) && (brdCookie != '')) { 
//		var setStyle = brdCookie; 
//		$("#nav").addClass(setStyle);
//		}
	
	
	//split url into an array by '/'
	var path = location.pathname.split("/");
	
	//grab action from url			
	var pageId = path['1'];
	
	$("#nav ul li a").each(function () {
		var id = $(this).parent().attr("id");
		var oneHref = $(this).attr("href");
		var hrefArray = oneHref.split("/");
		var pageTitle = hrefArray['1'];
		
		if(pageId == '') { 
			var id = 'hm';
			pageId = 'Home'; 
			pageTitle = 'Home'; 
			}
			
		if(pageId == pageTitle) {
			$(this).parent().addClass("on");
			var setStyle = id + "nav";
			setNavOrg(setStyle);
//			$.cookie('brdstyle', setStyle);
			}
		});
	
	
//	$("#nav ul li a").click(function () {
//		var id = $(this).parent().attr("id");
//		var setStyle = id + "nav";
//		setNavOrg(setStyle);
//		$.cookie('brdstyle', setStyle);
//		});
	
	
	function setNavOrg(setStyle) {
		$("#nav").addClass(setStyle);
		}
	
	
	//hcc logo image behavior
//	$("img.logo").click(function () {
//		$.cookie('brdstyle', 'org');
//		});
	
});