﻿$ektron(document).ready(function(){

function initCats()
{
    if(!document.getElementsByTagName){return;}
    var anchors = document.getElementsByTagName("a");
    for(var i= 0; i < anchors.length; i++)
    {
        var anchor = anchors[i];
        if(anchor.getAttribute("rel") == "cat_sel")
        {
          $ektron(anchor).bind("click",function(){
            var ids = this.id.toString().split('_');
            var id = ids[ids.length -1];
            var taxes = $ektron("#hcat_" + id).val();
            window.location = "supplierdirectorycategory.aspx?cat=" + taxes + "&lev=1";
        });
        }
    }
}
    initCats();	        
});