View Single Post

  #3 (permalink)  
Old 05-29-2009, 10:47 PM
chowexfo chowexfo is offline
Junior Member
 
Join Date: Mar 2009
Posts: 12
chowexfo is on a distinguished road
code is missing in above post
PHP Code:
function extractPageName(hrefString)
{
    var 
arr hrefString.split('/');
    return  (
arr.length<2) ? hrefString arr[arr.length-2].toLowerCase() + arr[arr.length-1].toLowerCase();               
}

function 
setActiveMenu(arrcrtPage)
{
for (var 
i=0i<arr.lengthi++)
    {
        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("urbangreymenu")!=null)
        
setActiveMenu(document.getElementById("urbangreymenu").getElementsByTagName("a"), extractPageName(hrefString));

Reply With Quote