
function setBookmarkSelection(a_id){
    var obj = document.getElementById("BookmarksBlock");
    var a_arr = obj.getElementsByTagName("a");
    for(var i = 0; i < a_arr.length; i++){
        a_arr[i].className ="someclass";
    }
    obj = document.getElementById(a_id).className = 'blocks2_bookmarks_active';
}

function refreshContent( args ){
    ajax_loadContent("newbles_content", "/ajax/hard/lastmaterials.aspx" + args, ajaxWaitContent);
    
}

function initSelects( hard, type){
    var obj = document.getElementById("Shard");
    if(obj != null){
        for(var i = 0; i < obj.length; i++){ 
            if(obj.options[i].value == hard){
                obj.selectedIndex = i;
                break;
            }
        }
    }
    
    var obj = document.getElementById("Stype");
    if(obj != null){
        for(var i = 0; i < obj.length; i++){ 
            if(obj.options[i].value == type){
                obj.selectedIndex = i;
                break;
            }
        }
    }

}

function applyFilter(cat){
    var hard = document.getElementById("Shard");
    var type = document.getElementById("Stype");
    if(hard.value == "" && type.value == "all/"){
        window.location.href = "/hard/"+ cat + "/";
    }else{
        window.location.href = "/hard/"+ cat + "/" + type.value + hard.value;
    }
}