// webshop_open block
var webshopOpenPagerNum = 1;
var actualWebshopOpenPagerLeft = 0;
function scrollWebshopOpen(mode, all){
	if(document.getElementById('wo_roller')){
		var oldWebshopOpenPagerLeft = actualWebshopOpenPagerLeft;

		if(webshopOpenPagerNum==all && mode==1){
			//actual = 1; // ha körbeforoghat
		}else if(webshopOpenPagerNum==1 && mode==0){
			//actual = all; // ha körbeforoghat
		}else{
			if(mode==1){
				actual = webshopOpenPagerNum + 1;
				actualWebshopOpenPagerLeft-= 560;
				var go = 1;
			}else{
				actual = webshopOpenPagerNum - 1;
				actualWebshopOpenPagerLeft+= 560;
				var go = 2;
			}
		}
		if(actual && all>1 && go){
			animatescrollWebshopOpen(oldWebshopOpenPagerLeft, actualWebshopOpenPagerLeft, go);
			webshopOpenPagerNum = actual;
		}
	}
}
scrollWebshopOpenTS = null;
function animatescrollWebshopOpen(left, actual, go){
	myObj = document.getElementById('wo_roller');
	
	if(go==1){ // csökkenteni a left
		if(left<=actual){
			clearTimeout(scrollWebshopOpenTS);
			left = actual;
			myObj.style.left = left + 'px';
		}else{
			left-= 20;
			myObj.style.left = left + 'px';
			scrollWebshopOpenTS = setTimeout("animatescrollWebshopOpen(" + left + ", " + actual + ", " + go + ")", 1);
		}
	}else if(go==2){ // növelni a left
		if(left>=actual){
			clearTimeout(scrollWebshopOpenTS);
			left = actual;
			myObj.style.left = left + 'px';
		}else{
			left+= 20;
			myObj.style.left = left + 'px';
			scrollWebshopOpenTS = setTimeout("animatescrollWebshopOpen(" + left + ", " + actual + ", " + go + ")", 1);
		}
	}
}

// picnews
var picNewsPagerNum = 1;
var actualNewsPagerLeft = 9;
function scrollPicNews(mode, all){
	if(document.getElementById('pn_roller')){
		var oldNewsPagerLeft = actualNewsPagerLeft;
		myObj = document.getElementById('pn_roller');
		navLeft = document.getElementById('pnn_1');
		navRight = document.getElementById('pnn_2');
		
		if(picNewsPagerNum==all && mode==1){
			//actual = 1; // ha körbeforoghat
		}else if(picNewsPagerNum==1 && mode==0){
			//actual = all; // ha körbeforoghat
		}else{
			if(mode==1){
				actual = picNewsPagerNum + 1;
				actualNewsPagerLeft-= 600;
				var go = 1;
			}else{
				actual = picNewsPagerNum - 1;
				actualNewsPagerLeft+= 600;
				var go = 2;
			}
		}
		if(actual && all>1 && go){
			var lastObj = document.getElementById('pns_' + picNewsPagerNum);
			var actualObj = document.getElementById('pns_' + actual);
			
			lastObj.src = 'frame/reload2009/dot_inactive.gif';
			actualObj.src = 'frame/reload2009/dot_active.gif';
			
			if(actual==1){
				navLeft.src = 'frame/reload2009/nav_left_gray.gif';
				navRight.src = 'frame/reload2009/nav_right_blue.gif';
			}else if(actual==all){
				navLeft.src = 'frame/reload2009/nav_left_blue.gif';
				navRight.src = 'frame/reload2009/nav_right_gray.gif';
			}else{
				navLeft.src = 'frame/reload2009/nav_left_blue.gif';
				navRight.src = 'frame/reload2009/nav_right_blue.gif';
			}
			
			
			
			if(oldNewsPagerLeft!=actualNewsPagerLeft) animateScrollPicNews(oldNewsPagerLeft, actualNewsPagerLeft, go);
			
			picNewsPagerNum = actual;
		}
	}
}
var ScrollPicNewsTS = null;
function animateScrollPicNews(xleft, xactual, xgo){
	myObj = document.getElementById('pn_roller');
	
	if(xgo==1){ // csökkenteni a left
		if(xleft<=xactual){
			clearTimeout(ScrollPicNewsTS);
			xleft = xactual;
			myObj.style.left = xleft + 'px';
			//alert(left);
		}else{
			xleft-= 20;
			//xleft = xactual;
			myObj.style.left = xleft + 'px';
			ScrollPicNewsTS = setTimeout("animateScrollPicNews(" + xleft + ", " + xactual + ", " + xgo + ")", 1);
		}
	}else if(xgo==2){ // növelni a left
		if(xleft>=xactual){
			clearTimeout(ScrollPicNewsTS);
			xleft = xactual;
			myObj.style.left = xleft + 'px';
			//alert(left);
		}else{
			xleft+= 20;
			//xleft = xactual;
			myObj.style.left = xleft + 'px';
			ScrollPicNewsTS = setTimeout("animateScrollPicNews(" + xleft + ", " + xactual + ", " + xgo + ")", 1);
		}
	}
}

// box_3in1
function box3in1(num){
	for(var i=0; i<=2; i++){
		if(i==num){
			if(document.getElementById('box3in_' + i)) document.getElementById('box3in_' + i).style.display = 'block';
		}else{
			if(document.getElementById('box3in_' + i).style.display=='block'){
				if(document.getElementById('box3in_' + i)) document.getElementById('box3in_' + i).style.display = 'none';
			}
		}
	}
}



function cgr_open_gallery (url,gid,pic) {
    window.open(url+'_cgr_gallery.php?id='+gid+'&pic='+pic,'Galéria','status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,height=660,width=540');
}

function invisible_layer(mode){

	if(!document.getElementById('spg_shade')){
		invisible_Layer = document.createElement('div');
		invisible_Layer.setAttribute('id','spg_shade');
		document.body.appendChild(invisible_Layer);
	}

	invisible_Layer.style.height = document.body.scrollHeight>document.body.offsetHeight ? document.body.scrollHeight + "px" : document.body.offsetHeight + "px";
//	invisible_Layer.style.height = document.body.scrollHeight>window.innerHeight ? document.body.scrollHeight + "px" : window.innerHeight + "px";
	invisible_Layer.style.display = (mode==1) ? 'block' : 'none';
}


function open_center_layer(element,x,y){

	document.getElementById(element).style.display = "none";
	leftpos = 0 ;
    toppos = 0 ;

	/* TOP */
	if(self.pageYOffset){
		yScroll = self.pageYOffset;
	}else if(document.documentElement && document.documentElement.scrollTop){
		yScroll = document.documentElement.scrollTop;
	}else if(document.body){
		yScroll = document.body.scrollTop;
	}
	if (self.innerHeight) {
		inheight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		inheight = document.documentElement.clientHeight;
	} else if (document.body) {
		inheight = document.body.clientHeight;
	}
	toppos = (yScroll + (inheight/2)) - y;


	/* LEFT */
    if (screen){
        leftpos = (document.body.clientWidth/2) - x ;
	}

    if (leftpos<0)
        leftpos = 10 ;

	document.getElementById(element).style.left = leftpos+'px';
	document.getElementById(element).style.top = toppos+'px';
}

function open_hcenter_layer(element,x,toppos){

    document.getElementById(element).style.display = "none";
    leftpos = 0 ;

    /* LEFT */
    if (screen){
        leftpos = (document.body.clientWidth/2) - x ;
    }

    if (leftpos<0)
        leftpos = 10 ;

    document.getElementById(element).style.left = leftpos+'px';
    document.getElementById(element).style.top = toppos+'px';
}



// FLASH MEGJELENÍTÉS
function showflash(file,width,height,bgcolor) {
    document.write('<object class=\"embeddedflashmovie\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"'+width+'\" height=\"'+height+'\" wmode=\"window\">');
    document.write('<param name=\"allowScriptAccess\" value=\"always\" />');
    document.write('<param name=\"movie\" value=\"'+file+'\" />');
    document.write('<param name=\"quality\" value=\"high\" />');
    document.write('<param name=\"wmode\" value=\"opaque\" />');
    document.write('<param name=\"bgcolor\" value=\"'+bgcolor+'\" />');
    document.write('<param name=\"swliveconnect\" value=\"true\" />');
    document.write('<param name=\"menu\" value=\"false\" />');
    document.write('<embed src=\"'+file+'\" quality=\"high\" bgcolor=\"'+bgcolor+'\" width=\"'+width+'\" height=\"'+height+'\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" wmode=\"opaque\"  swliveconnect=\"true\" menu=\"false\"/>');
    document.write('</object>');
}

function showflash_e(file,width,height,bgcolor) {
	document.write('<object height=\"'+height+'\" width=\"'+width+'\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\">');
	document.write('<param value=\"'+file+'\" name=\"movie\">');
	document.write('<param value=\"high\" name=\"quality\">');
	document.write('<param name=\"wmode\" value=\"opaque\" />');
	document.write('<param name=\"bgcolor\" value=\"'+bgcolor+'\" />');
    document.write('<param name=\"swliveconnect\" value=\"true\" />');
    document.write('<param name=\"menu\" value=\"false\" />');
	document.write('<embed height=\"'+height+'\" width=\"'+width+'\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" quality=\"high\" src=\"'+file+'\">');
	document.write('</object>');
}

// RADIO BUTTONOK MEGJELÖLT ÉRTÉKÉNEK VISSZAADÁSA
function getradiovalue(radioObj)
	{
	if (!radioObj)
		return "" ;
	var radioLength = radioObj.length ;
	if (radioLength == undefined)
		if (radioObj.checked)
			return radioObj.value ;
		else
			return "" ;
	for (var i = 0; i < radioLength; i++)
        	{
		if (radioObj[i].checked)
			{
			return radioObj[i].value ;
			}
		}
	return "" ;
	}

function showelement(element)
    {
    document.getElementById(element).style.display = "block" ;
    window.focus() ;
    }

function hideelement(element)
    {
    document.getElementById(element).style.display = "none" ;
    window.focus() ;
    }
function hideall(elements){
    var element = elements.split(',');
	for(i=0; i<element.length; i++)	{
		e = element[i];
		if(document.getElementById(e)){
			document.getElementById(e).style.display = "none" ;
		}
	}
    window.focus() ;
}
function visible_element(element)
    {
    document.getElementById(element).style.visibility = "visible" ;
    window.focus() ;
    }

function invisible_element(element)
    {
    document.getElementById(element).style.visibility = "hidden" ;
    window.focus() ;
    }
function showhideelement(element)
    {
    if (document.getElementById(element).style.display=='none')
	showelement(element) ;
    else
	hideelement(element) ;
    window.focus() ;
    }

// POPUP ABLAK NYITÁS

function openForumHszWin(url, winname)
    {
	window.open(url, winname, 'width=648, height=624,scrollbars=yes, resizable=yes') ;
    }

// HOTLEAD MENÜ MŰKÖDÉS

function hotlead_menuvalaszt(id){
	Obj_friss_menu = document.getElementById('friss_hotlead');
	Obj_olvasott_menu = document.getElementById('olvasott_hotlead');
	Obj_frissebb = document.getElementById('frissebb_hotlead');
	Obj_olvasottabb = document.getElementById('olvasottabb_hotlead');

	if(id==1){
		Obj_olvasottabb.style.display = 'none';
		Obj_frissebb.style.display = 'block';
		Obj_friss_menu.className = 'aktiv';
		Obj_olvasott_menu.className = '';
	}else{
		Obj_frissebb.style.display = 'none';
		Obj_olvasottabb.style.display = 'block';
		Obj_olvasott_menu.className = 'aktiv';
		Obj_friss_menu.className = '';
	}
}

// QUIZ TAB

function quiz_tab(item, tabs){
	for(i = 0; i < tabs.length; ++i) {
		tab = 'quiz_tab_'+tabs[i];
		document.getElementById(tab).className = '';
	}
	tab = 'quiz_tab_'+item;
	document.getElementById(tab).className = 'aktiv';
}

// DONTMISS TAB

function dontmiss_tab(base, i) {
    var length = 3;

    if (base == 'hot_classad_') { length = 4; }	// pecijalis eset, amikor az apro doboz van

    for (p = 1; p <= length; p++) {	// most 3 tab van fixen
	tab = base+p;
	document.getElementById(tab).className = 'dontmiss_tab';
    }
    tab = base+i;
    document.getElementById(tab).className = 'dontmiss_tab_aktiv';
    document.getElementById(tab).blur();
}

function general_tab(base, i) {
    var length = 3;

    if (base == 'sporttv_tab_') { length = 2; }

    for (p = 1; p <= length; p++) {
	tab = base+p;
	document.getElementById(tab).className = base;
    }
    tab = base+i;
    document.getElementById(tab).className = base+'aktiv';
    document.getElementById(tab).blur();
}

// PORTHU OPENWINDOW

function porthu_openwindow (args) {
    window.open('/_porthu_popup.php?'+args, 'x', 'status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,height=680,width=800');
}

function porthu_openwindow2 (args) {
    window.open('/_porthu_popup.php?v=1&'+args, 'x', 'status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,height=400,width=500');
}

function print_open (block,args) {
    window.open('/_print.php?&block='+block+'&'+args, 'Nyomtatas', 'status=0,toolbar=0,location=0,menubar=1,resizable=1,scrollbars=1,directories=0,height=600,width=680');
}

function gallery_open (gid,kid) {
    if(!kid){ kid = 0; }
    if(gid){
    	var gal = window.open('/_kepgaleria.php?gid='+gid+'&kid='+kid, 'Képgaléria', 'statusbar=no,locationbar=no,status=0,toolbar=0,location=0,menubar=0,resizable=0,scrollbars=0,directories=0,height=698,width=978');
	}
}
function postcard_open (kid) {
    if(kid){
    	var klp = window.open('/_kepeslap.php?kid='+kid, 'Képeslap', 'status=0,toolbar=0,location=0,menubar=0,resizable=0,scrollbars=1,directories=0,height=700,width=920');
	}
}

// HEADER MENU
var szunet_id;
function header_menu(id,tomb){

	var Obj_menu = document.getElementById('hm_'+id);
	var Obj_layer = document.getElementById('hmlayer_'+id);

	Obj_menu.className = 'aktiv';
	Obj_layer.style.display = 'block';

	if(szunet_id == null){
		szunet_id = setTimeout('header_menu_clear('+id+');','5000');
	}else{
		clearTimeout(szunet_id);
		szunet_id = setTimeout('header_menu_clear('+id+');','5000');
	}

	Obj_layer.onmouseover = function(){
		clearTimeout(szunet_id);

		this.onmouseout = function(){
			szunet_id = setTimeout('header_menu_clear('+id+');','5000');
		}
	}

	for(i = 0; i < tomb.length; ++i){
		if(id!=tomb[i]){
			document.getElementById('hm_'+tomb[i]).className = '';
			document.getElementById('hmlayer_'+tomb[i]).style.display = 'none';
		}
	}

}
function header_menu_clear(id){
	Obj_menu = document.getElementById('hm_'+id);
	Obj_layer = document.getElementById('hmlayer_'+id);

	Obj_menu.className = '';
	Obj_layer.style.display = 'none';
}

  /*------------------*/
 /* KÉSŐBB ELOLVASOM */
/*------------------*/
function createCookie(name,value,days){
	if (days){
		var date = new Date();
		date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
		var expires = "; expires=" + date.toGMTString();
	} else {
		var expires = "";
	}
	document.cookie = name + "=" + value + expires + "; path=/";
}

function readCookie(name){
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name){
	createCookie(name,"",-1);
}

function parseCookie(cookievalues){
	var cookieValuesArray = new Array();
	var CookiesArray = cookievalues.split("&");
	for (var i = 0; i < CookiesArray.length; i++){
		var v = CookiesArray[i].split(":");
		cookieValuesArray[i] = v[1];
	}
	return cookieValuesArray;
}

var cookieValues;
var cv = readCookie("kedvencek");
if (cv){
	cookieValues = parseCookie(cv);
} else {
	createCookie("kedvencek","columnMode:3&fontSize:9px&kedvencek:",7);
	cv = readCookie("kedvencek");
	cookieValues = parseCookie(cv);
}

function displaykedvencek(){
	var kedvencekarea = document.getElementById("kedvencekarea");
	var volte=0;
	var cv1 = readCookie("kedvencek");
	cookieValues = parseCookie(cv1);
	var kedvencek = cookieValues[2].split("~");

	var html = "<div class=\"kedvenc_cont\">";
	for (var i = 0; i < (kedvencek.length - 1); i++){
		var kedvencekVals = kedvencek[i].split("^");
		kedvencekVals[0] = kedvencekVals[0].replace(/###/g, "&");
		kedvencekVals[0] = kedvencekVals[0].replace(/@@@/g, ":");
		html += '<a style="width: 22px;" href="javascript:delEgykedvenc(' + "'" + kedvencekVals[2] + "'" + ');"><img src=frame/trash.gif alt="Ezt töröljük"></a>';
		html += '<a style="width: 208px;" onclick=\"javascript:Olvassel(' + "'" + kedvencekVals[2] + "'" + ');\" href=\"' + kedvencekVals[0] + '\">' + unescape(kedvencekVals[1]) + '</a><br />';
		html += '<div class="clear"></div>';
		try {
			document.getElementById(kedvencekVals[2]).style.display = "none";
		} catch(e) {}
		volte = 1;
	}
	html += '</div>';
	if (volte) {
	    document.getElementById("hmlayer_2_szoveg").style.display = 'none';
	    kedvencekarea.innerHTML = html;
	    volte=0;
	} else {
	    document.getElementById("hmlayer_2_szoveg").style.display = 'block';
	    kedvencekarea.innerHTML = '';
	}
	header_menu(2,new Array(1,2));
}

/* cikk hozzáadáas a kedvencekhez */
function addkedvencek(url,headline,obj) {
	if (headline.indexOf("|039|") != -1) {
		headline = headline.replace(/\|039\|/g, "&#039;");
	}
	// globális replace, hogy az összes előfordulást escape-elje
	url = url.replace(/&/g, "###");
	url = url.replace(/:/g, "@@@");

	var cv1 = readCookie("kedvencek");
	cookieValues = parseCookie(cv1);
	var newkedvencektring = cookieValues[2];
	var kedvencek = cookieValues[2].split("~");
	for (var i = 0; i < (kedvencek.length - 1); i++){
		var kedvencekVals = kedvencek[i].split("^");
		if (kedvencekVals[0] == url){
			return;
		}
	}
	var newclipping = url + "^" + escape(headline) + "^" + obj.id + "^" + "0~";
	newkedvencektring = newkedvencektring + newclipping;

	var cv = "columnMode:" + cookieValues[0] + "&fontSize:" + cookieValues[1] + "&kedvencek:" + newkedvencektring;
	createCookie("kedvencek",cv,7);
	obj.style.display = "none";
	displaykedvencek();
}

/*összes törlése*/
function removeAllkedvencek(){
	var cv1 = readCookie("kedvencek");
	cookieValues = parseCookie(cv1);
	var kedvencek = cookieValues[2].split("~");
	for (var i = 0; i < (kedvencek.length - 1); i++){
		var kedvencekVals = kedvencek[i].split("^");
		try {
			kedvencekVals[0] = kedvencekVals[0].replace(/###/g, "&");
			kedvencekVals[0] = kedvencekVals[0].replace(/@@@/g, ":");
			document.getElementById(kedvencekVals[2]).style.display = "inline";
		} catch(e) {}
	}
	var cv = "columnMode:" + cookieValues[0] + "&fontSize:" + cookieValues[1] + "&kedvencek:";
	createCookie("kedvencek",cv,7);
	displaykedvencek();
}

function Olvassel(id){
    var newclippingstring = "";
    var cv1 = readCookie("kedvencek");

    cookieValues = parseCookie(cv1);
    var clippings = cookieValues[2].split("~");
	for (var i = 0; i < (clippings.length - 1); i++){
	var clippingsVals = clippings[i].split("^");
	var newclipping = "";
	    if (id == clippingsVals[2] || clippingsVals[3]=="1"){
		newclipping = clippingsVals[0] + "^" + clippingsVals[1] + "^" + clippingsVals[2] + "^" + "1~";
	    } else {
		newclipping = clippingsVals[0] + "^" + clippingsVals[1] + "^" + clippingsVals[2] + "^" + "0~";
	    }
	newclippingstring = newclippingstring + newclipping;
	}
    var cv = "columnMode:" + cookieValues[0] + "&fontSize:" + cookieValues[1] + "&kedvencek:" + newclippingstring;
    createCookie("kedvencek",cv,7);
}

/*olvasottak törlése*/
function delOlv(){
    var newclippingstring = "";
    var cv1 = readCookie("kedvencek");
    cookieValues = parseCookie(cv1);
    var clippings = cookieValues[2].split("~");
	for (var i = 0; i < (clippings.length - 1); i++){
	var clippingsVals = clippings[i].split("^");
	var newclipping = "";
	    if (clippingsVals[3] == 0){
			newclipping = clippingsVals[0] + "^" + clippingsVals[1] + "^" + clippingsVals[2] + "^" + "0~";
	    } else {
			try {
				document.getElementById(clippingsVals[2]).style.display = "inline";
			} catch(e) {}
	    }
	    newclippingstring = newclippingstring + newclipping;
	    }
    var cv = "columnMode:" + cookieValues[0] + "&fontSize:" + cookieValues[1] + "&kedvencek:" + newclippingstring;
    createCookie("kedvencek",cv,7);
    displaykedvencek();
}

/* egy kedvenc törlése a listából */
function delEgykedvenc(id){
	try {
		document.getElementById(id).style.display = "inline";
	} catch(e) {}

	var cv1 = readCookie("kedvencek");
	cookieValues = parseCookie(cv1);
	var newnewkedvencek = "columnMode:" + cookieValues[0] + "&fontSize:" + cookieValues[1] + "&kedvencek:";
	var newkedvencektring = cookieValues[2];
	var kedvencek = cookieValues[2].split("~");
	for (var i = 0; i < (kedvencek.length - 1); i++) {
		var kedvencekVals = kedvencek[i].split("^");
		if (kedvencekVals[2] != id){
			newnewkedvencek = newnewkedvencek + kedvencekVals[0] + "^" + kedvencekVals[1] + "^" + kedvencekVals[2] + "^" + "0~";
		}
	}
	createCookie("kedvencek",newnewkedvencek,7);
	displaykedvencek();
}

/* a kedvencek ikon eltüntetése az oldalról */
function hideKedvencekIkon(){

	var cv1 = readCookie("kedvencek");
	cookieValues = parseCookie(cv1);
	var kedvencek = cookieValues[2].split("~");

	for (var i = 0; i < (kedvencek.length - 1); i++){
		var kedvencekVals = kedvencek[i].split("^");

		if(document.getElementById(kedvencekVals[2])){
			document.getElementById(kedvencekVals[2]).style.display = "none";
		}
	}
}

/* BETŰMÉRET NÖVELÉSE */

var font_size = 16;
var font_orig = 16;

function text_size(size) {

	if (size < 2) {
		if (size==1 && font_size < font_orig + 2){
			font_size += 1;
		}else if (size==0 && font_size > font_orig - 3){
			font_size -= 1;
		}
	} else {
		size = parseInt(size);
		if (size <= font_orig + 2 && size >= font_orig - 3)	font_size = size;
	}

	// lead szövege
	if(document.getElementById('article_lead'))
	document.getElementById('article_lead').style.fontSize = (font_size) + "px";
	// text szövege
	if(document.getElementById('article_text'))
	document.getElementById('article_text').style.fontSize = (font_size) + "px";

	createCookie('article_fontsize', font_size, 365);
}

/* FLASH arg átírás */
function flashfix() {
	var embedArray = document.getElementsByTagName('embed');
	for (i=0;i<embedArray.length;i++) {
		if (embedArray[i].setAttribute) {
            embedArray[i].setAttribute('wmode','opaque');
		}
	}

	var objectArray = document.getElementsByTagName('object');

	for (i=0;i<objectArray.length;i++) {
		if (objectArray[i].setAttribute) {
			objectArray[i].setAttribute('wmode','opaque');
		}

		if (objectArray[i].outerHTML && objectArray[i].className!='embeddedflashmovie') {
            objectArray[i].outerHTML= objectArray[i].outerHTML;
		}
	}
}
function addLoadEvent(func){
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}else{
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

/* BT WINDOW - 2008 Csete Roland, Copyright (C) csete[at]fps[dot]hu */
var bt_Widget = 0;
function bt_Window(){
	var Setting;
	var Coords = {mouse:null, mouseOffset:null};
	var dragableObject = null;

	this.open = function(set){
		Setting = set;
		o = this;
		bt_Widget++;

		Number.prototype.NaN0 = function(){ return isNaN(this) ? 0 : this; }
		var objBody = document.getElementsByTagName("body").item(0);
		var zIndex = (bt_Widget) ? bt_Widget * 1000 : 1000;
		var pageSize = o.getPageSize();
		var objOverlay = document.createElement("div");

		objOverlay.setAttribute('id','bt_layer_' + bt_Widget );
		objOverlay.style.display = 'none';
		objOverlay.style.position = 'absolute';
		objOverlay.style.top = '0';
		objOverlay.style.left = '0';
		objOverlay.style.zIndex = zIndex;
		objOverlay.style.width = (pageSize.pw + 'px');
		objOverlay.style.minWidth = '100%';
		objOverlay.style.height = (pageSize.ph + 'px');
		objOverlay.style.minHeight = '100%';
		if(Setting.background)
			objOverlay.style.backgroundColor = Setting.background;
		else
			objOverlay.style.backgroundColor = '#000000';
		if(Setting.transparent){
			objOverlay.style.filter = 'alpha(opacity=' + Setting.transparent + ')';
			objOverlay.style.opacity = ( Setting.transparent / 100 );
		}else{
			objOverlay.style.filter = 'alpha(opacity=50)';
			objOverlay.style.opacity = 0.50;
		}
		objBody.appendChild(objOverlay);

		var objContent = document.createElement("div");
		objContent.setAttribute('id','bt_content_' + bt_Widget );
		objContent.style.visibility	= 'hidden';
		objContent.style.position = 'absolute';
		objContent.style.top = '0';
		objContent.style.left = '0';
		objContent.style.zIndex = zIndex + 1;
		objBody.appendChild(objContent);

		Setting.winid = 'bt_win_' + bt_Widget;
		var objBox = document.createElement("div");
		objBox.setAttribute('id', Setting.winid);
		if(Setting.winclass) objBox.className = Setting.winclass;
		objContent.appendChild(objBox);
		if(Setting.html) objBox.innerHTML = Setting.html;

		if(!Setting.width) Setting.width = objBox.offsetWidth;
		if(!Setting.height) Setting.height = objBox.offsetHeight;

		var scroll = o.getPageScroll(0);
		if(Setting.fixtop)
			toppos   = scroll.y + Setting.fixtop;
		else
			toppos   = scroll.y + (pageSize.wh - Setting.height) / 2;
		leftpos	= scroll.x + (pageSize.pw - Setting.width) / 2;

		objBox.style.top  = (toppos < 0) ? '0px' : toppos + 'px';
		objBox.style.left = (leftpos < 0) ? '0px' : leftpos + 'px';

		objOverlay.style.display = '';
		objContent.style.visibility	= '';

		if(Setting.drag){
			var root = document.getElementById(Setting.winid);
			for(var i=0; i<root.childNodes.length; i++){
				var handle = root.childNodes[i];
				if(handle.className == Setting.drag){
					handle.onmousedown = function(e){
						o.mouseDown(this.parentNode, e);
					}
				}
			} // end for
		}
	};

	this.reposition = function(){
		var target = document.getElementById('bt_win_' + bt_Widget);
		var pageSize = o.getPageSize();
		var scroll = o.getPageScroll(0);

		toppos   = scroll.y + (pageSize.wh - target.offsetHeight) / 2;
		leftpos	= scroll.x + (pageSize.pw - target.offsetWidth) / 2;
		target.style.top  = (toppos < 0) ? '0px' : toppos + 'px';
		target.style.left = (leftpos < 0) ? '0px' : leftpos + 'px';
	};

	this.mouseDown = function(root, e){
		e = event(e);
		Coords.mouse = getMouseCoords(e);
		Coords.mouseOffset = getMouseOffset(root,e);
		dragableObject = root;

		document.onmousemove = o.mouseMove;
		document.onmouseup = o.mouseUp;

		return false;
	};

	this.mouseUp = function(){
		dragableObject = null;
	};

	this.mouseMove = function(e){
		e = event(e);
		Coords.mouse = getMouseCoords(e);

		if(dragableObject){
			dragableObject.style.top  = Coords.mouse.y - Coords.mouseOffset.y + 'px';
			dragableObject.style.left = Coords.mouse.x - Coords.mouseOffset.x + 'px';
		}
		return false;
	};

	this.close = function(){

		var activeWidget = bt_Widget;

		layerID = 'bt_content_' + activeWidget;
		objElement = document.getElementById(layerID);
		if (objElement && objElement.parentNode && objElement.parentNode.removeChild){
			objElement.parentNode.removeChild(objElement);
		}

		layerID = 'bt_layer_' + activeWidget;
		objElement = document.getElementById(layerID);
		if (objElement && objElement.parentNode && objElement.parentNode.removeChild){
			objElement.parentNode.removeChild(objElement);
			bt_Widget--;
		}
	};

	this.getPageSize = function(){
		var scroll = o.getPageScroll(1);

		var windowWidth, windowHeight;
		if(self.innerHeight) {	// all except
			windowWidth = self.innerWidth; windowHeight = self.innerHeight;
		}else if(document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict
			windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight;
		}else if(document.body) { // other
			windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight;
		}

		pageHeight = (scroll.y < windowHeight) ? windowHeight : scroll.y ;
		pageWidth = (scroll.x < windowWidth) ? windowWidth : scroll.x ;

		return {pw:pageWidth, ph:pageHeight, ww:windowWidth, wh:windowHeight};
	};

	this.getPageScroll = function(mode){
		var xScroll, yScroll;
		if(mode==1){
			if(window.innerHeight && window.scrollMaxY) {
				xScroll = document.body.scrollWidth; yScroll = window.innerHeight + window.scrollMaxY;
			}else if(document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
				xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight;
			}else{ // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
				xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight;
			}
		}else{
			if(self.pageYOffset){
				xScroll = self.pageXOffset; yScroll = self.pageYOffset;
			}else if(document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict
				xScroll = document.documentElement.scrollLeft; yScroll = document.documentElement.scrollTop;
			}else if(document.body){ // other
				xScroll = document.body.scrollLeft; yScroll = document.body.scrollTop;
			}
		}
		return {x:xScroll,y:yScroll};
	};

	function getMouseOffset(target, e){
		e = event(e);
		var targPos =  getPosition(target);
		var mousePos = getMouseCoords(e);
		return {x:mousePos.x - targPos.x, y:mousePos.y - targPos.y};
	};

	function getMouseCoords(e){
		e = event(e);

		var sL = (document.body.scrollLeft) ? document.body.scrollLeft : 0 ;
		var sT = (document.body.scrollTop) ? document.body.scrollTop : 0 ;
		var cL = (document.body.clientLeft) ? document.body.clientLeft : 0 ;
		var cT = (document.body.clientTop) ? document.body.clientTop : 0 ;

		var mouseX = e.clientX + sL - cL;
		var mouseY = e.clientY + sT - cT;
		return {x:mouseX, y:mouseY};
	};

	function getPosition(target){
		var left = 0;
		var top  = 0;
		do{
			left += target.offsetLeft + (target.currentStyle ? (parseInt(target.currentStyle.borderLeftWidth)).NaN0() : 0);
			top += target.offsetTop + (target.currentStyle ? (parseInt(target.currentStyle.borderTopWidth)).NaN0() : 0);
		}while(target = target.offsetParent);
		return {x:left, y:top};
	};

	function event(e){
		if (typeof e == 'undefined') e = window.event;
		return e;
	};
}

/* wins */
var oneWin = new bt_Window();
function openWindow(){
	oneWin.open({
		winclass : 'fps_window',
		drag : 'fps_windrag',
		html : '<div id="x_wintitle" class="fps_windrag"></div><div id="x_winclose" onclick="closeWindow();" title="Close" class="fps_winclose"></div><div id="loader" class="fps_winloading"></div><div id="x_wincontent" class="fps_wincontent"></div>'
	});
}
function openWindow2(){
	oneWin.open({
		winclass : 'fps_window',
		drag : 'fps_windrag',
		html : '<div id="x_wintitle2" class="fps_windrag"></div><div id="x_winclose2" onclick="closeWindow();" title="Close" class="fps_winclose"></div><div id="loader2" class="fps_winloading"></div><div id="x_wincontent2" class="fps_wincontent"></div>'
	});
}
function returnWindow(title, str, type, on_click){
	var on_click = (on_click) ? on_click : 'closeWindow();' ;
	var content = '';
	if(type==0){
		content += '<div class="error">';
	}else if(type==1){
		content += '<div class="success">';
	}else{
		content += '<div class="notice">';
	}
	content += str + '</div>';
	content += '<br /><div style="text-align:center;"><input id="x_okbutton" onclick="'+ on_click +'" class="button" type="button" value="OK" /></div></div>';

	oneWin.open({
		winclass : 'fps_window',
		drag : 'fps_windrag',
		html : '<div id="x_returntitle" class="fps_windrag">' + title + '</div><div id="x_returnclose" onclick="'+ on_click +'" title="Bezár" class="fps_winclose"></div>'+
		'<div id="returnloader" class="fps_winloading"></div><div id="x_returncontent" class="fps_wincontent">' + content + '</div>'
	});
}
function closeWindow(){
	oneWin.close();
}