﻿var Status = "none";

function ChangeStatus(NewStatus) { 
 
    switch (NewStatus){
	case "down":
		Status="1";
        ScrollDown();
		break;
    case "up":
		Status="1";
        ScrollUp();
		break;
	case "right":
		Status="1";
		ScrollRight();
		break;
	case "left":
		Status="1";
		ScrollLeft();
		break;
    default:
		Status="none";
    }
}

function ScrollUp() {
    if(Status == "1")
    {
        document.getElementById("scrolling_content").scrollTop -= 10;
        setTimeout(function() { ScrollUp(); }, 50);
    }
}

function ScrollDown() {
    if(Status == "1")
    {
        document.getElementById("scrolling_content").scrollTop += 10;
        setTimeout(function() { ScrollDown(); }, 50);
    }
}
function ScrollRight() {
    if(Status == "1")
    {
        document.getElementById("scrolling_content").scrollLeft -= 10;
        setTimeout(function() { ScrollRight(); }, 50);
	}
}

function ScrollLeft() {
    if(Status == "1")
    {
        document.getElementById("scrolling_content").scrollLeft += 10;
        setTimeout(function() { ScrollLeft(); }, 50);
	}
}
