//initscreen
function initScreen() {
	var cim = new getObj('maintitle');
	var tabla = new getObj('mainbody');
	var szoveg = new getObj('jancsika');
	if (document.layers)
	{ 
		var screenOffset = (window.innerWidth/2) - 360;
	} 
	else if (document.all || document.getElementById)
	{
		var screenOffset = (document.body.offsetWidth/2) - 360;
	}
	
	cim.style.left = screenOffset + 200 + 'px';
	tabla.style.left = screenOffset + 'px';
	szoveg.style.left = screenOffset + 190 + 'px';
	cim.style.visibility = 'visible';
	tabla.style.visibility = 'visible';
	szoveg.style.visibility = 'visible';

}



//independent static rollover imgs for menus

var m1h = new Image();
m1h.src = "images/menu1h.gif";

var m2h = new Image();
m2h.src = "images/menu2h.gif";

var m3h = new Image();
m3h.src = "images/menu3h.gif";

var m4h = new Image();
m4h.src = "images/menu4h.gif";

var m5h = new Image();
m5h.src = "images/menu5h.gif";

var m6h = new Image();
m6h.src = "images/menu6h.gif";

var m1l = new Image();
m1l.src = "images/menu1l.gif";

var m2l = new Image();
m2l.src = "images/menu2l.gif";

var m3l = new Image();
m3l.src = "images/menu3l.gif";

var m4l = new Image();
m4l.src = "images/menu4l.gif";

var m5l = new Image();
m5l.src = "images/menu5l.gif";

var m6l = new Image();
m6l.src = "images/menu6l.gif";


function hoverUp_img(imgname)
{
	document.images[imgname].src=eval(imgname + "h.src");
}

function hoverDown_img(imgname)
{
	document.images[imgname].src=eval(imgname + "l.src");
}







//the micro api

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 = document.layers[name];
   	this.style = document.layers[name];
  }
}




//layer scrolling functions

var clipTop = 0;
var clipWidth = 460;
var clipBottom = 350;
var topper = 60;
var lyrheight = 0;
var time,amount,theTime,theHeight,DHTML;

function init()
{
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var x = new getObj('jancsika');
	if (document.layers)
	{
		lyrheight = x.style.clip.bottom;
		lyrheight += 20;
		x.style.clip.top = clipTop;
		x.style.clip.left = 0;
		x.style.clip.right = clipWidth;
		x.style.clip.bottom = clipBottom;
	}
	else if (document.getElementById || document.all)
	{
		lyrheight = x.obj.offsetHeight;
		x.style.clip = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'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 stopScroll()
{
	if (time) clearTimeout(time);
}






