// add icon
$(function(){
  $(".hasLv3-Normal > a").addClass("arrowPlus");
  
  // for IE hacks
  if (navigator.userAgent.indexOf("MSIE") >= 0) {
    $(".hasLv3-Normal + li").css("margin-top","-3px");
    $(".hasLv3-Close + li").css("margin-top","-3px");
  };

  
});


//url

	$(function(){
	  $("#nav-category a").each(function(){
										 
			hrefSum = {};
			hrefSum.hrefCurrent = this.href.replace("index.php","");
			hrefSum.hrefLocation = document.location.href.replace("index.php","");
			hrefSum.lengthCurrent = hrefSum.hrefCurrent.length;
			hrefSum.lengthLocation = hrefSum.hrefLocation.length;
			
			var intCurrentN;
			if (hrefSum.hrefCurrent.indexOf("?", hrefSum.lengthCurrent) >= -1 ) {
				intCurrentN = hrefSum.hrefCurrent;
			} else {
				intCurrentN = hrefSum.hrefCurrent.lastIndexOf("/", hrefSum.lengthCurrent);
				hrefSum.hrefCurrent = hrefSum.hrefCurrent.substring(0,intCurrentN +1);
			};
			
			var intLocationN;
			
			if (hrefSum.hrefLocation.indexOf("?", hrefSum.lengthLocation) >= -1 ) {
				intLocationN = hrefSum.hrefLocation;
			} else {
				intLocationN = hrefSum.hrefLocation.lastIndexOf("/", hrefSum.lengthLocation);
				hrefSum.hrefLocation = hrefSum.hrefLocation.substring(0,intLocationN +1);
			};
			// add to effects for currentnavigation or menu.
			if (hrefSum.hrefLocation == hrefSum.hrefCurrent) {
				$(this).css("background-color","#F7E4BC");
				if ( $(this).parent().attr("class") == "hasLv3-Close") {
					
				} else if ( $(this).parent().parent().prev("a").parent().attr("class") == "hasLv3-Close") {
					$(this).parent().parent().prev("a").css("background-color","#F7E4BC");
					
	
				};
			};
		});
	});
