// JavaScript Document

var moz = (document.getElementById && !document.all) ? 1 : 0;
 NS4 = (document.layers) ? 1 : 0;
 IE4 = (document.all) ? 1 : 0;
 DOM = (document.getElementById) ? 1 : 0;
 
function go(){
  auj=new Date();
  if(auj.getMinutes()<10){plusm="0"}else plusm='';
  if(auj.getSeconds()<10){pluss="0"}else pluss='';
  heure=auj.getHours() + ':' + plusm + auj.getMinutes() + ':' + pluss + auj.getSeconds();
  document.getElementById('ora').innerHTML=heure;
  setTimeout("go()",1000)
}

function nyit(x,y) {
	mag = Number(y)*15;
	if (NS4) {
		document.layers[x].height=mag;
	} else if (IE4) {
		document.all[x].style.height=mag;
	} else if (DOM) {
		document.getElementById(x).style.height=mag;
	}
}

// Insert in Head section:
/*
<script language="JavaScript">
window.attachEvent("onload", correctPNG);
</script>
*/
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
{
	for(var i=0; i<document.images.length; i++)
	{
	  var img = document.images[i]
	  var imgName = img.src.toUpperCase()
	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
		 {
		 var imgID = (img.id) ? "id='" + img.id + "' " : ""
		 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		 var imgStyle = "display:inline-block;" + img.style.cssText 
		 if (img.align == "left") imgStyle = "float:left;" + imgStyle
		 if (img.align == "right") imgStyle = "float:right;" + imgStyle
		 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
		 var strNewHTML = "<span " + imgID + imgClass + imgTitle
		 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
		 + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
		 img.outerHTML = strNewHTML
		 i = i-1
		 }
	}
}

function pop(kep,w,h,tit) {
	var msg = window.open('ures.html','popup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+w+',height='+h+',top=100,left=100');
	msg.document.write('<head>');
	msg.document.write('<title>'+tit+'</title>');
	msg.document.write('<meta http-equiv="content-type" content="text/html; charset=iso-8859-2">');
	msg.document.write('</head>');

	msg.document.write('<body style="margin: 0px; padding: 0px;">');
	msg.document.write('<a href="javascript: window.close();">');
	msg.document.write('<img width="'+w+'" height="'+h+'" src="'+kep+'" border="0" alt="'+tit+'">');
	msg.document.write('</a></body>');
	msg.document.write('</html>');
	msg.document.close();
}

function ellenoriz(){
    if ((document.form1.nev.value == "") || (document.form1.mail.value == "")){
        if (document.form1.nev.value == ""){
                alert("Adja meg a nevét!");
        }
        else if(document.form1.mail.value == ""){
                alert("Nincs e-mail megadva!");
	}        

	return false;
    }
    else {
        return true;
    }
}

function poppage(oldal) {
	var msg = window.open(oldal+'.html','popup','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width=400,height=400,top=100,left=100');
}

function popkiem(oldal) {
	var msg = window.open(oldal,'popup','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width=440,height=400,top=100,left=100');
}
function kepcsere(x,kep)  {
	if (NS4) {
		document.layers[x].src=kep;
	} else if (IE4) {
		document.all[x].src=kep;
	} else if (DOM) {
		document.getElementById(x).src=kep;
	}
}

function check_all(group, action)
{
 for (var i=0; i<group.length; i++)
  group[i].checked = action;
}

 function show(x)  {
   if (NS4)
   {
    document.layers[x].visibility='show';
   }
   else if (IE4)
   {
    document.all[x].style.visibility='visible';
    }
   else if (DOM)
   {
    document.getElementById(x).style.visibility='visible';
   }
  }
  
 function hide(x) {
   if (NS4)
   {
    document.layers[x].visibility='hide';
   }
   else if (IE4)
   {
    document.all[x].style.visibility='hidden';
    }
   else if (DOM)
   {
    document.getElementById(x).style.visibility='hidden';
   }
 }

function beszur(szov,kep) {
	document.getElementById('latvkep').innerHTML = szov;
	document.getElementById('rightpic').value = kep;
    document.getElementById('chooser').style.visibility='hidden';
}
