2009-03-06 03:20:46 +00:00
|
|
|
function extractPageName(hrefString)
|
|
|
|
{
|
|
|
|
var arr = hrefString.split('/');
|
2010-06-24 14:41:40 +00:00
|
|
|
var result=(arr.length<3) ? hrefString : arr[3].toLowerCase();
|
|
|
|
if (result=='water') result='data';
|
2011-10-12 03:22:06 +00:00
|
|
|
if (result=='admin') result='admin/'+(arr.length<4) ? hrefString : arr[4].toLowerCase();
|
2010-06-24 14:41:40 +00:00
|
|
|
return result;
|
2009-03-06 03:20:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function setActiveMenu(arr, crtPage)
|
|
|
|
{
|
|
|
|
for (var i=0; i<arr.length; i++)
|
|
|
|
{
|
|
|
|
if(extractPageName(arr[i].href) == crtPage)
|
|
|
|
{
|
|
|
|
if (arr[i].parentNode.tagName != "DIV")
|
|
|
|
{
|
|
|
|
arr[i].className = "current";
|
|
|
|
arr[i].parentNode.className = "current";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function setPage()
|
|
|
|
{
|
|
|
|
hrefString = document.location.href ? document.location.href : document.location;
|
|
|
|
|
|
|
|
if (document.getElementById("divNavi")!=null)
|
|
|
|
setActiveMenu(document.getElementById("divNavi").getElementsByTagName("a"), extractPageName(hrefString));
|
|
|
|
}
|