function extractPageName(hrefString) { var arr = hrefString.split('/'); var result=(arr.length<3) ? hrefString : arr[3].toLowerCase(); if (result=='water') result='data'; if (result=='heihe') result='data'; if (result=='admin' && arr.length>=4) result+="/"+arr[4]; return result; } function setActiveMenu(arr, crtPage) { for (var i=0; i