function MM_swapImgRestore() { 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { 
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function OpenGallery1(SITE,NUM,TITLE) {
	imgwin = window.open('', 'GALLERY1', 'width=784,height=580,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
	imgwin.document.open('text/html');
	imgwin.document.write('<HTML><HEAD>\n<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2">\n');
	imgwin.document.write('<TITLE>'+TITLE+'</TITLE>\n<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2"><FRAMESET ROWS="502,1,40" BORDER=0 FRAMEBORDER=0><FRAME NAME="pic" SRC="'+SITE+'/'+SITE+'_'+NUM+'.html" FRAMESPACING=0 BORDER=0 FRAMEBORDER=0 SCROLLING="YES" MARGINWIDTH=4 MARGINHEIGHT=4><FRAME NAME="line" SRC="line.html" FRAMESPACING=0 BORDER=0 FRAMEBORDER=0 SCROLLING="NO" MARGINWIDTH=0 MARGINHEIGHT=0><FRAME NAME="menu" SRC="'+SITE+'/'+SITE+'_menu.html" FRAMESPACING=0 BORDER=0 FRAMEBORDER=0 SCROLLING="NO" MARGINWIDTH=10 MARGINHEIGHT=5></FRAMESET></HEAD><BODY></BODY></HTML>');
}

function OpenGallery2(SITE,NUM,TITLE) {
	imgwin = window.open('', 'GALLERY2', 'width=784,height=543,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
	imgwin.document.open('text/html');
	imgwin.document.write('<HTML><HEAD>\n<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2">\n');
	imgwin.document.write('<TITLE>'+TITLE+'</TITLE>\n<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2"><FRAMESET ROWS="502,1,40" BORDER=0 FRAMEBORDER=0><FRAME NAME="pic" SRC="'+SITE+'/'+SITE+'_'+NUM+'.html" FRAMESPACING=0 BORDER=0 FRAMEBORDER=0 SCROLLING="YES" MARGINWIDTH=4 MARGINHEIGHT=4><FRAME NAME="line" SRC="line.html" FRAMESPACING=0 BORDER=0 FRAMEBORDER=0 SCROLLING="NO" MARGINWIDTH=0 MARGINHEIGHT=0><FRAME NAME="menu" SRC="'+SITE+'/'+SITE+'_menu.html" FRAMESPACING=0 BORDER=0 FRAMEBORDER=0 SCROLLING="NO" MARGINWIDTH=10 MARGINHEIGHT=5></FRAMESET></HEAD><BODY></BODY></HTML>');
}

function OpenGallery4(SITE,NUM,TITLE) {
	imgwin = window.open('', 'GALLERY4', 'width=784,height=543,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
	imgwin.document.open('text/html');
	imgwin.document.write('<HTML><HEAD>\n<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2">\n');
	imgwin.document.write('<TITLE>'+TITLE+'</TITLE>\n<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2"><FRAMESET ROWS="502,1,40" BORDER=0 FRAMEBORDER=0><FRAME NAME="pic" SRC="'+SITE+'/'+SITE+'_'+NUM+'.html" FRAMESPACING=0 BORDER=0 FRAMEBORDER=0 SCROLLING="NO" MARGINWIDTH=4 MARGINHEIGHT=4><FRAME NAME="line" SRC="line.html" FRAMESPACING=0 BORDER=0 FRAMEBORDER=0 SCROLLING="NO" MARGINWIDTH=0 MARGINHEIGHT=0><FRAME NAME="menu" SRC="'+SITE+'/'+SITE+'_menu.html" FRAMESPACING=0 BORDER=0 FRAMEBORDER=0 SCROLLING="NO" MARGINWIDTH=10 MARGINHEIGHT=5></FRAMESET></HEAD><BODY></BODY></HTML>');
}

function OpenImage(u,t,w,h){
 scrll="no";
 if (screen.width<w) {w=screen.width-25; h+=20; scrll="yes";}
 if (screen.height<h) {h=screen.height-75; w+=20; scrll="yes";}
 wprop="toolbar=no,location=no,directories=no,status=no,scrollbars="+scrll+",resizable=no,width="+w+",height="+h;
 wdef=window.open("","_blank",wprop);
 wdef.document.write("<html>");
 wdef.document.write("<head>");
 wdef.document.write('<title>'+t+'</title>');
 wdef.document.write("</head>");
 wdef.document.write("<body bgcolor=#ffffff marginwidth=0 marginheight=0 topmargin=0 leftmargin=0>");
 wdef.document.write('<img src="img/'+u+'" border=0>');
 wdef.document.write("</body>");
 wdef.document.write("</html>");
}

function ert_ell(_val, _type, _length1, _length2) {
	switch (_type.toLowerCase()) {
		case "szam":
				x = parseInt(_val, 10);
				if (!isNaN(x)) {
					if (x == _val) return true;
				}
				return false;
			break;
		case "egyszam":
				zz = _val;
				for (x = 0;x < zz.length;x++) if (!isNaN(parseInt(zz.charAt(x)))) return true;
				return false;
			break;
		case "egybetu":
				zz = _val;
				for (x = 0;x < zz.length;x++) if (isNaN(parseInt(zz.charAt(x)))) return true;
				return false;
			break;
		case "minhossz":
				x = "_" + _val;
				if (x.length >= _length1 + 1) return true;
				return false;
			break;
		case "maxhossz":
				x = "_" + _val;
				if (x.length <= _length1 + 1) return true;
				return false;
			break;
		case 'minmax':
				x = "_" + _val;
				if ((x.length >= _length1 + 1) && (x.length <= _length2 + 1)) return true;
				return false;
			break;
		case "emailcim":
				var kukac = _val.indexOf('@');
				if (kukac < 1) return false;
				if (_val.length < kukac+3) return false;
				var vege = _val.substr(kukac+1);
				var vanbenne = false;
				if (kukac+1 == _val.length) return false;
				for (i=kukac+1;i<_val.length;i++)
					if (_val.charAt(i) == '.')
						vanbenne = i;
				if (!vanbenne) return false;
				if (_val.length-vanbenne < 3) return false;
				return true;
			break;
	}
}

function ell(miben,szoveg) {
	if (miben.value == '') {
		miben.focus();
		alert(szoveg);
		return false;
	}
	return true;
}

function ell2(bool,miben,szoveg) {
  if (bool == false) {
    miben.focus();
    alert(szoveg);
    return false;
  }
  return true;
}
