// JavaScript Document
jQuery(function(){		
	jQuery("#irPage #sideArea li a").each(function(){		
		var txtH1 = jQuery("h1").text().replace(/^\s+|\s+$/g, ""); 
		var txtSideNavili = jQuery(this).text().replace(/^\s+|\s+$/g, ""); 					   
		var topicPath = '<li>' + txtH1 + '</li>'
		if( txtH1 == txtSideNavili ){
						
			var list = jQuery(this).parent();
			var liNumber = jQuery("#irPage #sideArea li a").length;
			
			for ( i = 0; i < liNumber; i = i +1 ){	

				var txt = list.parent().parent().prev("span").children('a:first').html();
				var hrefPath = list.parent().parent().prev("span").children('a:first').attr("href");
			
				if( txt != null ){
					var topicPath = '<li><a href="' + hrefPath + '">' + txt + '</a></li>' + topicPath;
					var list = list.parent().parent();
				}
			}

			jQuery("#irPage #topicpathArea li:last").after(topicPath);	
		}
	})
	
	jQuery.getScript("/js/highlightnavi.js");
});


