// ToolTip gombokhoz

var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0

if(ns){doc = "document."; sty = ""}
if(ie){doc = "document.all."; sty = ".style"}


var initialize = 0;
var Ex, Ey, topColor, subColor, ContentInfo;

topColor = "#999900"; subColor = "#FFFFCC";

if(ie){ Ex = "event.x"; Ey = "event.y"; }
if(ns){Ex = "e.pageX"; Ey = "e.pageY";
window.captureEvents(Event.MOUSEMOVE); window.onmousemove=overhere;}

function MoveToolTip(layerName, FromTop, FromLeft, e){
if(ie){eval(doc + layerName + sty + ".top = "  + (eval(FromTop) + document.body.scrollTop))}
if(ns){eval(doc + layerName + sty + ".top = "  +  eval(FromTop))} eval(doc + layerName + sty + ".left = " + (eval(FromLeft) + 15))
}

function ReplaceContent(layerName){
	if(ie) {
		document.all[layerName].innerHTML = ContentInfo;
	}
	if(ns) {
		with(document.layers[layerName].document) {
			open();
			write(ContentInfo);
			close();
		}
	}
}

function Activate(){
	initialize=1;
}
function deActivate(){
	initialize=0;
}

function overhere(e){
if(initialize){ MoveToolTip("ToolTip", Ey, Ex, e)
eval(doc + "ToolTip" + sty + ".visibility = 'visible'")}
else{ MoveToolTip("ToolTip", 0, 0)
eval(doc + "ToolTip" + sty + ".visibility = 'hidden'") }
}

function EnterContent(layerName, TTitle, TContent){
	ContentInfo = '<table border="0" width="150" cellspacing="0" cellpadding="0"><tr><td width="100%" bgcolor="#000000">'+
	'<table border="0" width="100%" cellspacing="1" cellpadding="0"><tr><td width="100%" bgcolor='+topColor+'>';
	if (TTitle.length!=0) {
		ContentInfo = ContentInfo + '<table border="0" width="90%" cellspacing="0" cellpadding="0" align="center">'+
		'<tr><td width="100%"><font class="tooltiptitle">&nbsp;'+TTitle+'</font></td></tr></table>';
	}
	ContentInfo = ContentInfo + '</td></tr><tr><td width="100%" bgcolor='+subColor+'>'+
	'<table border="0" width="90%" cellpadding="0" cellspacing="1" align="center">'+
	'<tr><td width="100%"><font class="tooltipcontent">'+TContent+'</font>'+
	'</td></tr></table>'+'</td></tr></table>'+'</td></tr></table>';
	ReplaceContent(layerName);
}

// gombcsere
function csere(kepneve, ujkep){ // cserélés  
   if (document.images) document.images[kepneve].src=eval(ujkep).src;  
   }

// ablaknyitas
function ablaknyitas(nyitofile,x,y,s)
{ open(nyitofile,"","width="+x+",height="+y+",status=no,toolbar=no,menubar=no,resizable=yes,scrollbars="+s); }

function ujablak(nyitofile) { 
	open(nyitofile,"","width=795,height=570,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=yes");
}

// A blokkok eltuntetese es elohozasa ---------------------------------------------------
function blokkallapot(adat)
{
	var ablakallapotstr="";
	if (document.getElementById(adat).style.display == "")
	{
		document.getElementById(adat).style.display = "none";
	}
	else
	{
		document.getElementById(adat).style.display = "";
	}
}

/*function blokkallapot(adat)
{
	var ablakallapotstr="";
	if (document.all[adat].style.display == "")
	{
		document.all[adat].style.display = "none";
	}
	else
	{
		document.all[adat].style.display = "";
	}
}*/


var str = "left=0,screenX=0,top=0,screenY=0,fullscreen";
function launchFull(url, name) {
  window.open(url, name, str);
}

// enter esemény
function keypressed(e)
{
	var code;

	if (!e)
	{
		e = window.event;
	}
	if (e.keyCode)
	{
		code = e.keyCode;
	}
	else
	{
		if (e.which)
		{
			code = e.which;
		}
	}
	if (code==13)
	{
		document.kereso.submit();
	}
}