var homag = ["január", "február", "március", "április", "május", "június", "július", "augusztus", "szeptember", "október", "november", "december"];
var napmag = ["vasárnap","hétfő", "kedd", "szerda", "csütörtök", "péntek", "szombat"];

var hoeng = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var napeng = ["Sunday","Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];

var honem = ["Jänner", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"];
var napnem = ["Sonntag","Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"];

var x=1;

function szine(text) 
{
	if (x < 3) 
	{
		if (x==1)
		{
		document.write("<td background='../sot.gif'><font class='" + text+ "'>");
		x=2;
		}
		else
		{
document.write("<td align='right' background='../sot.gif'><font class='" + text+ "'>");
		x=3;
		}
	}
	else
	{
		if (x==3)
		{
document.write("<td class='text' background='../vil.gif'><font class='" + text+ "'>");
		x=4;
		}
		else
		{
		document.write("<td class='text' align='right' background='../vil.gif'><font class='" + text+ "'>");
		x=1;
		}
	}
}

function fridatma()
{
var date = new Date();
date.setTime(Date.parse(document.lastModified));
return "Utolsó frissítés: " + date.getYear() + ". " + homag[date.getMonth()] + " " +  date.getDate() + ". " + napmag[date.getDay()] + "";
}

function fridaten()
{
var date = new Date();
date.setTime(Date.parse(document.lastModified));
return "Last Update: " + napeng[date.getDay()] + ", " +hoeng[date.getMonth()] + " " +  date.getDate() + ". " + date.getYear() + ".";
}

function fridatne()
{
var date = new Date();
date.setTime(Date.parse(document.lastModified));
return "Letzt aktualisiert am " + napnem[date.getDay()] + ", " + date.getDate() + ". " + honem[date.getMonth()] + " " + date.getYear() + ".";
}

function evho(text)
{
var date = new Date();
var ev = date.getYear();
var ho = date.getMonth()+1;
var ma=ev + "" + ho;
	if (text == ma.substring(2,ma.length)) {
		document.write("<a name='xx'><\a>");
	} else {
		document.write("<a name='text'><\a>");
	}
}

function nap(x,y,z)
{
	var date = new Date();

	date.setYear(x);
	date.setDate(z);
	date.setMonth(y-1);

	return napmag[date.getDay()] + ", " + homag[date.getMonth()] + " " +  date.getDate() + ".";
}

function napen(x,y,z)
{
	var date = new Date();

	date.setYear(x);
	date.setDate(z);
	date.setMonth(y-1);

	return napeng[date.getDay()] + ", " + hoeng[date.getMonth()] + " " +  date.getDate() + ".";
}

function napne(x,y,z)
{
	var date = new Date();

	date.setYear(x);
	date.setDate(z);
	date.setMonth(y-1);

	return napnem[date.getDay()] + ", " +  date.getDate() + ". " + honem[date.getMonth()];
}
function cim()
{
	var tit=document.title;
	return "<textarea cols='70' rows='6' name='Vélemény " + tit + " című könyvéről '>";
}

function FormCheck()
{
	if(document.F.Nev.value == "")
	{
	alert("Kérem, adja meg a nevét!");
	document.F.Nev.focus();
	return false;
	}
	if(document.F.Cim.value == "")
	{
	alert("Kérem, adja meg a címét!");
	document.F.Cim.focus();
	return false;
	}
	if(document.F.Email.value == "")
	{
	alert("Kérem, adja meg az e-mail címét!");
	document.F.Email.focus();
	return false;
	}
	if(document.F.Email.value.indexOf('@') == -1
	|| document.F.Email.value.indexOf('.') == -1)
	{
	alert("Hibás e-mail cím!");
	document.F.Email.focus();
	return false;
	}
	if(document.F.Psz_sajat.value == ""
	& document.F.Psz_ajand.value == "")
	{
	alert("Kérem, adjon meg legalább egy példányszámot!");
	document.F.Psz_sajat.focus();
	return false;
	}
	var chkZ = 1;
	for(i=0;i<document.F.Psz_sajat.value.length;++i)
	if(document.F.Psz_sajat.value.charAt(i) < "0"
	|| document.F.Psz_sajat.value.charAt(i) > "9")
		chkZ = -1;
		if(chkZ == -1)
		{
	alert("Hibás adat! Csak számot lehet megadni!");
	document.F.Psz_sajat.focus();
	return false;
	}
	if(document.F.Ajandek.selectedIndex == 0)
	{
	alert("Válasszon egy ajándékkönyvet!");
	document.F.Ajandek.focus();
	return false;
	}
	var chkZ = 1;
	for(i=0;i<document.F.Psz_ajand.value.length;++i)
{
	if(document.F.Psz_ajand.value.charAt(i) < "0"
	|| document.F.Psz_ajand.value.charAt(i) > "9")
	{
		chkZ = -1;
	}
}
		if(chkZ == -1)
		{
	alert("Hibás adat! Csak számot lehet megadni!");
	document.F.Psz_ajand.focus();
	return false;
	}
	if(document.F.Aj_Nev.value == "" & document.F.Psz_ajand.value != "")
	{
	alert("Kérem, adja meg a megajándékozott személy nevét!");
	document.F.Aj_Nev.focus();
	return false;
	}
	if(document.F.Aj_Cim.value == "" & document.F.Psz_ajand.value != "")
	{
	alert("Kérem, adja meg a megajándékozott személy címét!");
	document.F.Aj_Cim.focus();
	return false;
	}
	document.F.Nyilatkozat.value = "Előfizetem a folyóiratot ";
	if(document.F.Psz_sajat.value != "")
	{
	document.F.Nyilatkozat.value = document.F.Nyilatkozat.value + document.F.Psz_sajat.value + " példányban a magam számára";
	}
	if(document.F.Psz_ajand.value != "")
	{
	document.F.Nyilatkozat.value = document.F.Nyilatkozat.value +" " + document.F.Psz_ajand.value + " példányban ajándékként";
	}
	document.F.Nyilatkozat.value = document.F.Nyilatkozat.value + ".";
	document.F.Aj_Nev.name="Megajándékozott személy neve";
	document.F.Aj_Cim.name="Megajándékozott személy címe";
	document.F.Ajandek.name="Ajándékkönyv";
	document.F.Nev.name="Előfizető neve";
	document.F.Cim.name="Előfizető címe";
	document.F.Psz_ajand.value="";
	document.F.Psz_ajand.name="";
	document.F.Psz_sajat.value="";
	document.F.Psz_sajat.name="";
}
function checkpswd(ext) {
  if ((document.pswdform.pswd.value == null) || (document.pswdform.pswd.value == '')) {
    alert('Nem adott meg jelszót.');
  } else {
this.location.href = document.pswdform.pswd.value + ext;
}
}
function DigiFormCheck(txt)
{
	if(document.F.Nev.value == "")
	{
	alert(txt=="mag" ? "Kérem, adja meg a nevét!" : "Please give your name!");
	document.F.Nev.focus();
	return false;
	}
	if(document.F.Cim.value == "")
	{
	alert(txt=="mag" ? "Kérem, adja meg a címét!" : "Please give your mailing address!");
	document.F.Cim.focus();
	return false;
	}
	if(document.F.Email.value == "")
	{
	alert(txt=="mag" ? "Kérem, adja meg az e-mail címét!" : "Please give your e-mail address!");
	document.F.Email.focus();
	return false;
	}
	if(document.F.Email.value.indexOf('@') == -1
	|| document.F.Email.value.indexOf('.') == -1)
	{
	alert(txt=="mag" ? "Hibás e-mail cím!" : "Wrong e-mail address!");
	document.F.Email.focus();
	return false;
	}
}

//Villogáshoz
window.onerror = null;
 var bName = navigator.appName;
 var bVer = parseInt(navigator.appVersion);
 var NS4 = (bName == "Netscape" && bVer >= 4);
 var IE4 = (bName == "Microsoft Internet Explorer" 
 && bVer >= 4);
 var NS3 = (bName == "Netscape" && bVer < 4);
 var IE3 = (bName == "Microsoft Internet Explorer" 
 && bVer < 4);
 var blink_speed=300;  // villogás sebessége itt állítható
 var i=0;
 
if (NS4 || IE4) {
 if (navigator.appName == "Netscape") {
 layerStyleRef="layer.";
 layerRef="document.layers";
 styleSwitch="";
 }else{
 layerStyleRef="layer.style.";
 layerRef="document.all";
 styleSwitch=".style";
 }
}

function Blink(layerName){
 if (NS4 || IE4) { 
 if(i%2==0)
 {
 eval(layerRef+'["'+layerName+'"]'+
 styleSwitch+'.visibility="visible"');
 }
 else
 {
 eval(layerRef+'["'+layerName+'"]'+
 styleSwitch+'.visibility="hidden"');
 }
 } 
 if(i<1)
 {
 i++;
 } 
 else
 {
 i--
 }
 setTimeout("Blink('"+layerName+"')",blink_speed);
}

