	// JavaScript Document
function GetcurrentPage() { 
 if (!document.getElementsByTagName) return;  
 var anchors = document.getElementsByTagName("a"); 
 var thisPage = location.href; 

 if ( thisPage.search(/#/) != -1 ) { //remove anchor link from url
 	var thisPage_array = thisPage.split(/#/);
 	thisPage = thisPage_array[0];
 }
 
  if ( thisPage.search(/\?/) != -1 ) {//remove query string from url
 	var thisPage_array = thisPage.split(/\?/);
 	thisPage = thisPage_array[0];
 }


/*start to get subdirectory */ 

 var pathis=location.pathname;
 var path_array = pathis.split('\/');
 var subdirectory = '\/' + path_array[1]+'\/';

/*end of get subdirectory */

 for (var i=0; i<anchors.length; i++) {  
 	var Varanchor = anchors[i]; 
	 thisHREF = Varanchor.getAttribute('href'); 
	 if ( thisHREF == thisPage || location.protocol + "//" + location.hostname + subdirectory +  thisHREF == thisPage) { 
		Varanchor.id = "current"; 
		 return; 
	 }
 }
}  