var clipTop = 0;
var clipWidth = 1000;
var clipBottom = 193;
var topper = 0;
var lyrheight = 0;


var clipTop2 = 0;
var clipWidth2 = 350;
var clipBottom2 = 200;
var topper2 = 0;
var lyrheight2 = 0;

var clipTop3 = 0;
var clipWidth3 = 350;
var clipBottom3 = 200;
var topper3 = 0;
var lyrheight3 = 0;


var time,amount,theTime,theHeight,DHTML;


function init()
{	
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var x = new getObj('veatures');
	var x2 = new getObj('veatures2');
	//var x3 = new getObj('veatures3');
	if (document.layers)
	{
		lyrheight = x.style.clip.bottom;
		lyrheight += 20;
		topper = x.style.clip.top;
		x.style.clip.top = clipTop;
		x.style.clip.left = 0;
		x.style.clip.right = clipWidth;
		x.style.clip.bottom = clipBottom;

		lyrheight2 = x2.style.clip.bottom2;
		lyrheight2 += 20;
		if (parseInt(x2.style.top)<0) {
			topper2 = parseInt(x2.style.top);
			clipTop2 = -parseInt(x2.style.top);
			clipBottom2 = -parseInt(x2.style.top) + clipBottom2;
		}
		/*x2.style.clip.top = clipTop2;
		x2.style.clip.left = 0;
		x2.style.clip.right = clipWidth2;
		x2.style.clip.bottom = clipBottom2;*/
		
		/*
		lyrheight3 = x3.style.clip.bottom3;
		lyrheight3 += 20;
		x3.style.clip.top = clipTop3;
		x3.style.clip.left = 0;
		x3.style.clip.right = clipWidth3;
		x3.style.clip.bottom = clipBottom3;
		*/
	}
	else if (document.getElementById || document.all)
	{
		lyrheight = x.obj.offsetHeight;
		x.style.clip = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'px,0)';

		lyrheight2 = x2.obj.offsetHeight;
		if (parseInt(x2.style.top)<0) {
			topper2 = parseInt(x2.style.top);
			clipTop2 = -parseInt(x2.style.top);
			clipBottom2 = -parseInt(x2.style.top) + clipBottom2;
		}
		//x2.style.clip = 'rect('+clipTop2+'px,'+clipWidth2+'px,'+clipBottom2+'px,0)';
		
		//lyrheight3 = x3.obj.offsetHeight;
		//x3.style.clip = 'rect('+clipTop3+'px,'+clipWidth3+'px,'+clipBottom3+'px,0)';
	}
}

function init2()
{	
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var x3 = new getObj('veatures2');
	if (document.layers)
	{				
		
		lyrheight3 = x3.style.clip.bottom3;
		lyrheight3 += 20;
		if (parseInt(x3.style.top)<0) {
			topper3 = parseInt(x3.style.top);
			clipTop3 = -parseInt(x3.style.top);
			clipBottom3 = -parseInt(x3.style.top) + clipBottom3;
		}
		/*x3.style.clip.top = clipTop3;
		x3.style.clip.left = 0;
		x3.style.clip.right = clipWidth3;
		x3.style.clip.bottom = clipBottom3;*/
		
	}
	else if (document.getElementById || document.all)
	{
		
		lyrheight3 = x3.obj.offsetHeight;
		if (parseInt(x3.style.top)<0) {
			topper3 = parseInt(x3.style.top);
			clipTop3 = -parseInt(x3.style.top);
			clipBottom3 = -parseInt(x3.style.top) + clipBottom3;
		}
		//x3.style.clip = 'rect('+clipTop3+'px,'+clipWidth3+'px,'+clipBottom3+'px,0)';
	}
}

function scrollayer(layername,amt,tim)
{
	if (!DHTML) return;
	thelayer = new getObj(layername);
	if (!thelayer) return;
	amount = amt;
	theTime = tim;
	realscroll();
}

function realscroll()
{
	if (!DHTML) return;
	clipTop += amount;
	clipBottom += amount;
	topper -= amount;

if (clipTop < 0 || clipBottom > lyrheight)
	{
		clipTop -= amount;
		clipBottom -= amount;
		topper += amount;
		return;
	}
	if (document.getElementById || document.all)
	{
		clipstring = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'px,0)';
		thelayer.style.clip = clipstring;
		thelayer.style.top = topper + 'px';
	}
	else if (document.layers)
	{
		thelayer.style.clip.top = clipTop;
		thelayer.style.clip.bottom = clipBottom;
		thelayer.style.top = topper;
	}
	time = setTimeout('realscroll()',theTime);

}

function scrollayer2(layername,amt,tim)
{
	if (!DHTML) return;
	thelayer = new getObj(layername);
	if (!thelayer) return;
	amount = amt;
	theTime = tim;
	realscroll2();
}


function realscroll2()
{
	if (!DHTML) return;
	clipTop2 += amount;
	clipBottom2 += amount;
	topper2 -= amount;

if (clipTop2 < 0 || clipBottom2 > lyrheight2)
	{
		clipTop2 -= amount;
		clipBottom2 -= amount;
		topper2 += amount;
		return;
	}
	if (document.getElementById || document.all)
	{
		clipstring = 'rect('+clipTop2+'px,'+clipWidth2+'px,'+clipBottom2+'px,0)';
		//thelayer.style.clip = clipstring;
		thelayer.style.top = topper2 + 'px';
	}
	else if (document.layers)
	{
		thelayer.style.clip.top = clipTop2;
		//thelayer.style.clip.bottom = clipBottom2;
		thelayer.style.top = topper2;
	}
	time = setTimeout('realscroll2()',theTime);

}

function scrollayer3(layername,amt,tim)
{
	if (!DHTML) return;
	thelayer = new getObj(layername);
	if (!thelayer) return;
	amount = amt;
	theTime = tim;
	realscroll3();
}


function realscroll3()
{
	if (!DHTML) return;
	clipTop3 += amount;
	clipBottom3 += amount;
	topper3 -= amount;

if (clipTop3 < 0 || clipBottom3 > lyrheight3)
	{
		clipTop3 -= amount;
		clipBottom3 -= amount;
		topper3 += amount;
		return;
	}
	if (document.getElementById || document.all)
	{
		clipstring = 'rect('+clipTop3+'px,'+clipWidth3+'px,'+clipBottom3+'px,0)';
		//thelayer.style.clip = clipstring;
		thelayer.style.top = topper3 + 'px';
	}
	else if (document.layers)
	{
		/*thelayer.style.clip.top = clipTop3;
		thelayer.style.clip.bottom = clipBottom3;*/
		thelayer.style.top = topper3;
	}
	time = setTimeout('realscroll3()',theTime);

}

function stopScroll()
{
	if (time) clearTimeout(time);
}

function getObj(name)
{
  if (document.getElementById)
  {	
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
	this.obj = getObjNN4(document,name);
	this.style = this.obj;
  }
}

function search_input_clear()
{
	document.getElementById('i_txt').value='';
}

function search_input_write(tekst)
{
	if (document.getElementById('i_txt').value=='') document.getElementById('i_txt').value=tekst;
}
	


