var id=null;
var vmove= 0;
var MAX_SCROLL = 395;
function stop_up_down() {
           window.clearInterval(id);
           id = null;
}
function categories_up() {
  id = window.setInterval(move_up,20);
}

function categories_down() {

id = window.setInterval(move_down,20);
}

function move_up() {
if ((vmove <= 300-MAX_SCROLL && vmove <0) && (id != null)) {
       window.clearInterval(id);
       id = null;
} else {
 obj = document.getElementById('big_list');
 obj.style.top = vmove+"px";
 vmove -= 2;
}
}

function move_down() {
if ((vmove >= 0) && (id != null)) {
       window.clearInterval(id);
       id = null;
} else {
 obj = document.getElementById('big_list');
 obj.style.top = vmove+"px";
 vmove += 2;
}
}

var id1=null;
var vmove1= 0;
var MAX_SCROLL1 = 390;
function stop_up_down1() {
           window.clearInterval(id1);
           id1 = null;
}
function categories_up1() {
  id1 = window.setInterval(move_up1,20);
}

function categories_down1() {

id1 = window.setInterval(move_down1,20);
}

function move_up1() {
if ((vmove <= 300-MAX_SCROLL1 && vmove1 <0) && (id1 != null)) {
       window.clearInterval(id1);
       id1 = null;
} else {
 obj = document.getElementById('big_list1');
 obj.style.top = vmove1+"px";
 vmove1 -= 2;
}
}

function move_down1() {
if ((vmove1 >= 0) && (id1 != null)) {
       window.clearInterval(id1);
       id1 = null;
} else {
 obj = document.getElementById('big_list1');
 obj.style.top = vmove1+"px";
 vmove1 += 2;
}
}

function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "block";
}

function popup(mylink, windowname)
{

window.open(mylink, windowname, 'width=600,height=450,scrollbars=yes');

}
function openPopupPOptions(target, id) {
    window.open('sam_score.php?pageid='+target+'&id='+id,'POptions','width=700,height=350,toolbar=no,status=no,scrollbars=yes,resizable=no,menubar=no,location=no,direction=no');
}