function doRS() {
    var v = document.getElementById("rs").value
    if(v != "") window.location.href =  "/resources/calories/search/?s=" + v 
}
function dss(id) {
     var v = document.getElementById(id).value
     if(v == "") return false;
}

var vm_min = 10;
var vm_max = null;
var vm_cur = 0;
function viewmore(m) {
    if(vm_max != null) {
   
        if(m == true) {
            if(vm_cur < vm_max) {
                for(i=(vm_cur+1);i<(vm_cur+11);i++) {
                    if(i<=vm_max){
                        try{document.getElementById("tb_" + i).className = "tb_vis";}catch(e){}
                    }
                }
                vm_cur += 10
            }
        }else{
            if(vm_min < vm_cur) {
                for(i=vm_cur;i>(vm_cur-11);i--) {
                    if(i>vm_min){
                        try{document.getElementById("tb_" + i).className = "tb_nv";}catch(e){}
                    }
                }
                vm_cur -= 10
            }
        }
        
        var s = "<div style=\"padding:5px;height:15px;\">"
        
        if(vm_cur < vm_max) {
            s += "<div class=\"plus\" onclick=\"viewmore(true);\"><!-- --></div>"
        }
        if(vm_min < vm_cur) {
            s += "<div class=\"minus\" onclick=\"viewmore(false);\"><!-- --></div>"
        }

        s += "</div>"
        
        try{document.getElementById("dm").innerHTML = s;}catch(e){}
    }
}