function init()
{
   // initMenu();
}
function showhide(id)
{
	var c = getObj(id);
	var g = c.style.display;
	c.style.display=(g=='none')?"block":"none";
}
function leadzero(str)
{
	var ret = str;
	var h = new String(str);
	if(h.length==1)
	{
		ret='0'+h;
	}
	return ret;
}
function zopenImageWin(url,w,h)
{
	var top  = ((screen.availHeight-h)/2)-80;
	var left = ((screen.availWidth-w)/2);
	parem='status=0,menubar=0,resizable=0,copyhistory=no,directories=no,scrollbars=0,width='+w+',height='+h+',top='+top+',left='+left+'';
	var ywin = window.open(url, "zxy", parem);
	ywin.focus();
}
function openImageWin(url,w,h)
{
	var top  = ((screen.availHeight-h)/2)-80;
	var left = ((screen.availWidth-w)/2);
	var s1="toolbar=no,location=0,directories=0,status=0, menubar=0,scrollbars=no,resizable=yes,width="+w+",height="+h+",left="+left+",top="+top;
	var win = window.open("", "imgview", s1);
	win.document.open();
	var html = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n<html><head><title>ANDA</title>';
	html+='<meta http-equiv="Content-Type" content="text/html; charset=utf-8">';
	html+='<style>\nbody {margin:0;border:0;padding:0}\nimg {cursor:pointer}\n</style></head><body>';
	html+='<img onclick="self.close()" src="'+url+'" width="'+w+'" height="'+h+'" border="0" alt="" title="Bezár"></body></html>';
	win.document.write(html);
	win.document.close();
}
function openWin(the_url,the_x,the_y,scrollbars)
{
    the_x -= 0;
    the_y -= 0;
    var how_wide = screen.availWidth;
    var how_high = screen.availHeight;
    var the_toolbar = "no";
    var the_addressbar = "no";
    var the_directories = "no";
    var the_statusbar = "no";
    var the_menubar = "no";
	if(scrollbars) {
		var the_scrollbars = "yes";
	} else {
		var the_scrollbars = "no";
	}
    var the_do_resize = "yes";
    var the_copy_history = "no";
    top_pos = (how_high / 2) - (the_y / 2);
    left_pos = (how_wide / 2) - (the_x / 2);
    if (window.outerWidth) {
        var option = "toolbar=" + the_toolbar + ",location=" + the_addressbar + ",directories=" + the_directories + ",status=" + the_statusbar + ",menubar=" + the_menubar + ",scrollbars=" + the_scrollbars + ",resizable=" + the_do_resize + ",outerWidth=" + the_x + ",outerHeight=" + the_y + ",copyhistory=" + the_copy_history + ",left=" + left_pos + ",top=" + top_pos;
        site = open(the_url, "DisplayWindow", option);
        var Opera = (navigator.userAgent.indexOf('Opera') !=  - 1);
        if (Opera) {
            site.resizeTo(the_x, the_y);
            site.moveTo(0, 0);
        }
    }
    else {
        var option = "toolbar=" + the_toolbar + ",location=" + the_addressbar + ",directories=" + the_directories + ",status=" + the_statusbar + ",menubar=" + the_menubar + ",scrollbars=" + the_scrollbars + ",resizable=" + the_do_resize + ",Width=" + the_x + ",Height=" + the_y + ",copyhistory=" + the_copy_history + ",left=" + left_pos + ",top=" + top_pos;
        site = open('', "DisplayWindow", option);
        site.location = the_url;
        if (site.open) {
            site.focus();
            return false;
        }
        site.resizeTo(the_x, the_y);
    }
}
function xopenWin(url,w,h)
{
	var top  = ((screen.availHeight-h)/2)-80;
	var left = ((screen.availWidth-w)/2);
	parem='status=0,menubar=0,resizable=0,copyhistory=no,directories=no,scrollbars=yes,width='+w+',height='+h+',top='+top+',left='+left+'';
	var ywin = window.open(url, "c556zxy", parem);
	ywin.focus();
}

function getObj(name)
{
	if (document.getElementById) {
		return document.getElementById(name);
	} else if (document.all) {
		return document.all[name];
	} else if (document.layers) {
		return document.layers[name];
	}
	else return false;
}

function printpage()
{
	var input = getObj("right").innerHTML;
	if (typeof(input.replace) != 'undefined') {
	    input = input.replace(/<a([^<]+)>/gi, "");
	    input = input.replace(/<\/a>/gi, "");
	}
	var windowTitle='ANDA';
	var html='<html><head><title>'+windowTitle+'</title>'+
	'<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">'+
	'<link rel="stylesheet" href="anda.css" type="text/css">'+
	'<style type="text/css">td {font-family:Arial,Helvetica,sans serif;font-size:12px}</style></head>'+
	'<body style="background-color:white"><div style="padding:10px">'+input+'<br clear="all"><hr noshade size=1><i>URL: '+document.location.href + '</i><br></div></body></html>';

	var resize = 1; var scroll = 1; var toolbar = 1; var width  = 600; var height = 450;
	var s1="toolbar="+toolbar+",location=0,directories=0,status=1, menubar=1,scrollbars="+scroll+",resizable="+resize+",width="+width+",height="+height + ",left=20, top=20";
	var win = window.open("", "printable", s1);
	win.document.open();
	win.document.write(html);
	win.document.close();
}

function send()
{
	openWin("send.php?u="+document.location.href,500,500);
}
function holmi()
{
	openWin("holmi.php",500,440);
}

function AddToBookmarks()
{
	if(document.all) {
		var url=self.location.href;
		var title="ANDA";
		window.external.AddFavorite(url,title);
	} else {
		alert("Ez a művelet csak Internet Explorer-ben működik.")
	}
}
function externalLinks()
{
	if(document.getElementById) {
		var anchors = document.getElementById(DIV).getElementsByTagName("a");
		for (var i=0; i<anchors.length; i++) {
			var anchor = anchors[i];
			if(anchor.getAttribute("href")!="javascript:void(0)")
			{
				anchor.target = "_blank";
			}
		}
	}
}
function Random(N) {
    return Math.floor(N * (Math.random() % 1));
}
function Shuffle(Q) {
    var R, T, J;
    for (J = Q.length - 1; J > 0; J--) {
        R = Random(J + 1);
        T = Q[J];
        Q[J] = Q[R];
        Q[R] = T;
    }
    return Q;
}

function randomPic() {
   var Q = [];
   for(var i=1;i<=26;i++) Q.push(i);
   Shuffle(Q);
   for(var i=1;i<=4;i++) {
   	document.write('<img src="images/rotal/rot-'+Q[i]+'.jpg" style="width:148px;height:115px;border:0" alt="" title="">');
   }
}

