/////////////////////////////////////////////////beuszo

function showPopup() {
	var winW = 1024;
	var popup_width = 401;

	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
			winW = window.innerWidth;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) {
			winW = document.body.offsetWidth;
		}
	}
	var popup = document.getElementById("popup_layer");
	popup.style.left = Math.round((winW-popup_width)/2)  + "px";
	popup.style.visibility = "visible";
}

function hidePopup() {
	var popup = document.getElementById("popup_layer");
	popup.style.visibility = "hidden";
}

function Set_Cookie(name,value,expires,path,domain,secure) {
	var cookieString = name + "=" +escape(value) +
	   ( (expires) ? ";expires=" + expires.toGMTString() : "") +
	   ( (path) ? ";path=" + path : "") +
	   ( (domain) ? ";domain=" + domain : "") +
	   ( (secure) ? ";secure" : "");
	document.cookie = cookieString;
	//document.write('kukit ad');
}


////////////////////////////////////////////////////////utilz
/*function popunder() {
	ablak=window.open("pop.php?t=<? echo $popnak_t; ?>", "kisablak", "height=530, width=460, statusbar=no, scrollbars=no, resizable=no");
		//a pop nem jöhet fel forovat oldalhoz, mert kezdetből nem jöhet get[r]
	ablak.blur();
}*/

function addToFavorite(favTitle){
	if ((navigator.appVersion.indexOf("MSIE") > 0) && (parseInt(navigator.appVersion) >= 4)) 	{
		window.external.AddFavorite(location.href, unescape(favTitle));
	}
	else { alert('Nyomd meg a CTRL+d billentyűkombinációt!');}
}

function addToFavorite2() {
	if (document.all)
		window.external.AddFavorite(document.location.href, document.title);
	else 
		if (window.sidebar)
			window.sidebar.addPanel(document.title, document.location.href, "")
}



//////kinyit becsuk modul
function switchModul(obj,obj2,obj3) {
	var el = document.getElementById(obj);
	el.style.display = ( el.style.display != "none" ) ? 'none' : '';
	var el2 = document.getElementById(obj2);
	el2.style.display = ( el2.style.display != "none" ) ? 'none' : '';
	var el3 = document.getElementById(obj3);
	el3.style.display = ( el3.style.display != "none" ) ? 'none' : '';
}



/////////////////////////////////////////////editor

function parbeszedAblak(promptcaption, defvalue)	{
  return window.prompt(promptcaption,defvalue);
}
function kodBeillesztes(code, promptcaption, defvalue, mezo_id)	{
  x = window.prompt(promptcaption,defvalue);
  if(!x) return false;
  if (x!="undefined") {
	code = reszStringCsere_msg(code,'%input%',x);
	return kodBeszuras(code,mezo_id);
  }
}
function reszStringCsere_msg(text,expression,value) {
  var exp = new RegExp(expression,'g');
  return text.replace(exp,value);
}
function kodBeszuras(code,mezo_id)	{
	if (navigator.userAgent.indexOf('Opera')!=-1)	//var isopera = (navigator.userAgent.indexOf('Opera')!=-1);
		with (document.getElementById(mezo_id)) 
			value += code;
		else
			szovegBeillesztes(document.getElementById(mezo_id),code);
	return true;
}
function szovegBeillesztes(obj, txt)	{
	if (document.all)	{	//var isie = (document.all);
		if (!obj.isTextEdit) return;
		if ( obj.caretPos )
			obj.caretPos.text = txt;
		else
			obj.value = obj.value + txt;
	} 
	else {
		otext = obj.value; ss = obj.selectionStart;
		obj.value = otext.substring(0,ss) + txt + otext.substring(ss,obj.value.length);
		obj.selectionStart = ss + txt.length;
		obj.selectionEnd = obj.selectionStart;
	}
}

function fokuszAllitas(mezo_id)	{
	document.getElementById(mezo_id).focus();
}

/*nemtom ezek kellenek-e*/
function kurzorMentes_() {
	kurzorMentes(document.getElementById("forum_mit"));
}
function kurzorMentes(obj) {
	if (!document.all) return;
	if (obj.isTextEdit) 
		obj.caretPos = document.selection.createRange();
}

obj = document.getElementById("forum_mit");
//nem kell mert ahol hivja (kodbeszuras_smile fgv) ott megadja neki, de kell az alábbi 3 sorhoz, de nemtom micsinal

/*obj.onselect = kurzorMentes_;
obj.onclick  = kurzorMentes_;
obj.onkeyup  = kurzorMentes_;*/





/*szerk segédlet fgv-ei
	function forumUjhozzaszolasFormEllenorzes()
	{
		if (document.getElementById("f_forumhozzaszolas").value == "") {
			alert('Még nem adtad meg a hozzászólását!');
			document.getElementById("f_forumhozzaszolas").focus();
			return false;
		}
		if (document.getElementById("f_forumhozzaszoloneve").value == "") {
			alert('Névtelen hozzászólóként mindig meg kell adnod a nevedet is!');
			document.getElementById("f_forumhozzaszoloneve").focus();
			return false;
		}
	}
	function reszStringCsere_msg(text,expression,value) {
	  var exp = new RegExp(expression,'g');
	  return text.replace(exp,value);
	}

	 var isie = (document.all);
	 var isopera = (navigator.userAgent.indexOf('Opera')!=-1);
	 obj = document.getElementById("f_forumhozzaszolas");
	 obj.onselect = kurzorMentes_;
	 obj.onclick  = kurzorMentes_;
	 obj.onkeyup  = kurzorMentes_;

	function keresesformchecker(){
		if (document.getElementById("keresettszoveg").value.length < 1)
		{
			alert("Kérjük, a kereséshez töltse ki a kereső mezőt!"); 
			document.getElementById("keresettszoveg").focus(); 
			return false; 
		} 
	}
*/






//az uj beuszonak a fgv-ei
/*
		var ddEnabled=false;

		if (!document.layers)
		document.write('</div>')
		isIE=document.all;
		
		isNN=!document.all&&document.getElementById;
		isN4=document.layers;
		isHot=false;
		
		function ddInit(e){
		  topDog=isIE ? "BODY" : "HTML";
		  whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer");  
		  hotDog=isIE ? event.srcElement : e.target;  
		  while (hotDog.id!="titleBar"&&hotDog.tagName!=topDog){
		    hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
		  }  
		  if (hotDog.id=="titleBar"){
		    offsetx=isIE ? event.clientX : e.clientX;
		    offsety=isIE ? event.clientY : e.clientY;
		    nowX=parseInt(whichDog.style.left);
		    nowY=parseInt(whichDog.style.top);
		    ddEnabled=true;
		    document.onmousemove=dd;
		  }
		}
		
		function dd(e){
		  if (!ddEnabled) return;
		  whichDog.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx; 
		  //whichDog.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
		  return false;  
		}
		
		function ddN4(whatDog){
		  if (!isN4) return;
		  N4=eval(whatDog);
		  N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
		  N4.onmousedown=function(e){
		    N4.captureEvents(Event.MOUSEMOVE);
		    N4x=e.x;
		    //N4y=e.y;
		  }
		  N4.onmousemove=function(e){
		    if (isHot){
		      N4.moveBy(e.x-N4x,e.y-N4y);
		      return false;
		    }
		  }
		  N4.onmouseup=function(){
		    N4.releaseEvents(Event.MOUSEMOVE);
		  }
		}
		
		function hideMe(){
		  if (isIE||isNN) whichDog.style.visibility="hidden";
		  else if (isN4) document.theLayer.visibility="hide";
		}
		
		function showMe(){
		  if (isIE||isNN) whichDog.style.visibility="visible";
		  else if (isN4) {
		  	document.theLayer.visibility="show";
		  	}
		}
		
		
		document.onmousedown=ddInit;
		document.onmouseup=Function("ddEnabled=false");	

		
	function JSFX_FloatTopDiv()
		{
			var startX = (document.body.clientWidth-400)/9;
			startY = -260;
			var ns = (navigator.appName.indexOf("Netscape") != -1);
			var d = document;
			function ml(id)
			{
			  //if (ddEnabled) return;
				var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
				if(d.layers)el.style=el;
				el.sP=function(x,y){this.style.top=y;};
				el.x = startX;
				el.y = startY;
				startY = 280;
				return el;
			}
			window.stayTopLeft=function()
			{
				//if (ddEnabled) return;
				var pY = ns ? pageYOffset : document.body.scrollTop;
				ftlObj.y += (pY + startY - ftlObj.y)/8;
				ftlObj.sP(ftlObj.x, ftlObj.y);
				setTimeout("stayTopLeft()", 10);
			}
			ftlObj = ml("theLayer");
			stayTopLeft();
	}
		window.setTimeout("JSFX_FloatTopDiv()",2500);

*/


/*

<!--

 * OptInOver(TM) code generated by PopUpMaster Pro from
 * http://popupmaster.com
 * Copyright (c)2003, Steve Shaw, takanomi.com

var ns_oio = document.layers||navigator.userAgent.toLowerCase().indexOf("mac")!=-1;
var ns6_oio = (!document.all && document.getElementById)?true:false;
var debug=false;
if(ns6_oio&&!debug)document.write('<div style="position:relative;z-index:1;">');

var drag_oio=false,x_oio,y_oio,a_oio,b_oio;

function move(e)
{
	if (drag_oio)
	{
		left_oio=ns6_oio?a_oio+e.clientX-x_oio:a_oio+event.clientX-x_oio;
		optinover.style.left=left_oio;
		top_oio=ns6_oio?b_oio+e.clientY-y_oio:b_oio+event.clientY-y_oio-document.body.scrollTop;
		optinover.style.top=top_oio+(ns6_oio?0:document.body.scrollTop);
		shadow.style.left=left_oio+2;
		shadow.style.top=top_oio+(ns6_oio?0:document.body.scrollTop)+2;return false;
	}
}

if(!ns_oio)document.onmouseup=new Function("drag_oio=false");


var id_oio,d_oio,optinover,shadow,height_oio,left_oio,top_oio;

function var_oio()
{
	id_oio = "optinover";
	d_oio = document;
	optinover = d_oio.getElementById?d_oio.getElementById(id_oio):d_oio.all[id_oio];
	shadow = d_oio.getElementById?d_oio.getElementById("shadow"):d_oio.all["shadow"];
	b=(typeof( window.innerWidth ) == 'number')?window.innerWidth:(document.documentElement &&document.documentElement.clientWidth?document.documentElement.clientWidth:(document.body&&document.body.clientWidth?document.body.clientWidth:800));
	left_oio=(b/2)-(400/2)-30;
	top_oio=10;
}
if(!ns_oio)
{
	var_oio();
	repos_oio();
}

function repos_oio()
{
	if(ns6_oio)
	{
		optinover.style.top = top_oio+window.pageYOffset;
		shadow.style.top = top_oio+window.pageYOffset+2;
		optinover.style.height=document.defaultView.getComputedStyle(document.getElementById("optinoverTable"), "").getPropertyValue("height");
		shadow.style.height=document.defaultView.getComputedStyle(document.getElementById("optinoverTable"), "").getPropertyValue("height");
		shadow.style.width = document.defaultView.getComputedStyle(document.getElementById("optinoverTable"), "").getPropertyValue("width");
	}else{
		optinover.style.top = top_oio+d_oio.body.scrollTop;
		shadow.style.height=optinover.offsetHeight;
		shadow.style.top = (top_oio*1+2*1)+d_oio.body.scrollTop;
		shadow.style.width = optinover.style.width;
	}
	optinover.style.left = left_oio;
	shadow.style.left = left_oio+2;
}

function hide_oio()
{
	optinover.style.visibility='hidden';
	shadow.style.visibility='hidden';
	window.scrollBy(0,1);
	//if(!ns6_oio)setTimeout('window.document.body.onscroll=null;',2000);
	optinover.style.left=0;
}


function show_ns_oio()
{
	message_oios = message_oio.split("<P><UL>");
	message_oio=message_oios[0];
	for(i=1;i<message_oios.length;i++)
	{
		message_oio+="\n"+message_oios[i];
	}
	message_oios = message_oio.split("<P>");
	message_oio=message_oios[0];
	for(i=1;i<message_oios.length;i++)
	{
		message_oio+="\n\n"+message_oios[i];
	}
	message_oios = message_oio.split("<BR>");
	message_oio=message_oios[0];
	for(i=1;i<message_oios.length;i++)
	{
		message_oio+="\n"+message_oios[i];
	}
	message_oios = message_oio.split("<LI>");
	message_oio=message_oios[0];
	for(i=1;i<message_oios.length;i++)
	{
		message_oio+="\n* "+message_oios[i];
	}
	message_oios = message_oio.split("<");
	message_oio=message_oios[0];
	for(i=1;i<message_oios.length;i++)
	{
		temp_oios = message_oios[i].split(">");
		temp_oio="";
		if(temp_oios.length>1)
		{
			temp_oio=temp_oios[1];
		}else{
			temp_oio=message_oios[i];
		}
		message_oio+=temp_oio;
	}

}
var temp_top_oio;

function show_oio()
{
	if(ns_oio)
	{
		show_ns_oio();
	}else{
		temp_top_oio = (ns6_oio?window.pageYOffset:d_oio.body.scrollTop)-(ns6_oio?document.defaultView.getComputedStyle(document.getElementById("optinoverTable"), "").getPropertyValue("height").substring(0,document.defaultView.getComputedStyle(document.getElementById("optinoverTable"), "").getPropertyValue("height").length-2):optinover.offsetHeight)-2;
		optinover.style.top=temp_top_oio;
		if(ns6_oio)
		{
			shadow.style.top=0;
		}else{
			shadow.style.top=0-optinover.offsetHeight;
		}
		optinover.style.visibility='visible';
		shadow.style.visibility='visible';
		move_oio();
		if(!ns6_oio)
		{
			//window.document.body.onscroll=repos_oio;
		}
	}
}

function move_oio()
{
	if(optinover.style.top.substring(0,optinover.style.top.length-2)<130+(ns6_oio?window.pageYOffset:d_oio.body.scrollTop))
	{
		temp_top_oio+=10;
		optinover.style.top = temp_top_oio;
		shadow.style.top = temp_top_oio+2;
		setTimeout("move_oio()",10);
	}
}


//-->


*/