// JavaScript Document
//vrstva
var vClipH1=290;
var vLayTop1=20;
var vClipH2=78;
var vLayTop2=10;

var vPosun1=0;
var vPosun2=0;
var vScrLastTop1=0;
var vScrLastTop2=0;

function vScroll_1(dir,spd,loop) {
  sLayer=document.getElementById('content').style;
  vLayW1 = document.getElementById('content').offsetWidth;
	vLayH1 = document.getElementById('content').offsetHeight;
  if (vLayH1 < vClipH1) {
    noscroll = true;
    return;
  }
  noscroll = false;
  loop = true;
	direction = dir;
	speed = spd;
	if (loop == true)
	{
		if (direction == "dn")
		{
 			vPosun1+=speed;
 			if (vPosun1 > vLayH1-vClipH1) vPosun1 = vLayH1-vClipH1;
 			sLayer.top = vLayTop1 - vPosun1;
 			sLayer.clip = "rect(" + vPosun1 + "," + vLayW1 + "," + (vClipH1 + vPosun1) + ",0)";
		}
		else
		{
			if (direction == "up")
			{
 				vPosun1-=speed;
 				if (vPosun1 < 0) vPosun1 = 0;
 				sLayer.top = vLayTop1 - vPosun1;
 				sLayer.clip = "rect(" + vPosun1 + "," + vLayW1 + "," + (vClipH1 + vPosun1) + ",0)";
			}
			else
			{
				if (direction == "top")	sLayer.top = vLayTop;
 				vPosun1=0;
 				sLayer.clip = "rect(" + vPosun1 + "," + vLayW1 + "," + (vClipH1 + vPosun1) + ",0)";
			}
		}
		if (direction != "top")	scrolltimer1 = setTimeout("vScroll_1(direction,speed,'true')", 1);
	}
}

function vScroll_2(dir,spd,loop) {
  sLayer=document.getElementById('news-content').style;
  vLayW2 = document.getElementById('news-content').offsetWidth;
	vLayH2 = document.getElementById('news-content').offsetHeight;
  if (vLayH2 < vClipH2) {
    noscroll = true;
    return;
  }
  noscroll = false;
  loop = true;
	direction = dir;
	speed = spd;
	if (loop == true)
	{
		if (direction == "dn")
		{
 			vPosun2+=speed;
 			if (vPosun2 > vLayH2-vClipH2) vPosun2 = vLayH2-vClipH2;
 			sLayer.top = vLayTop2 - vPosun2;
 			sLayer.clip = "rect(" + vPosun2 + "," + vLayW2 + "," + (vClipH2 + vPosun2) + ",0)";
		}
		else
		{
			if (direction == "up")
			{
 				vPosun2-=speed;
 				if (vPosun2 < 0) vPosun2 = 0;
 				sLayer.top = vLayTop2 - vPosun2;
 				sLayer.clip = "rect(" + vPosun2 + "," + vLayW2 + "," + (vClipH2 + vPosun2) + ",0)";
			}
			else
			{
				if (direction == "top")	sLayer.top = vLayTop2;
 				vPosun2=0;
 				sLayer.clip = "rect(" + vPosun2 + "," + vLayW2 + "," + (vClipH2 + vPosun2) + ",0)";
			}
		}
		if (direction != "top")	scrolltimer2 = setTimeout("vScroll_2(direction,speed,'true')", 1);
	}
}

function stopScroll(no) {
if (noscroll) return;
loop = false;
if (no == 1) clearTimeout(scrolltimer1);
if (no == 2) clearTimeout(scrolltimer2);
}

