function startMenu(){
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById('nav');
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=='LI') {
				node.onmouseover=function() {
					this.className+='over';
  				}
  				node.onmouseout=function() {
  					this.className=this.className.replace('over', '');
   				}
   			}
  		}
 	}
}
var regioTS = new Array();
function show_regio(obj, mode){
	if(regioTS[obj]) clearTimeout(regioTS[obj]);
	if(document.getElementById(obj)){
		document.getElementById(obj).style.display = 'block';
		if(mode) regioTS[obj] = setTimeout("document.getElementById('"+obj+"').style.display = 'none';", 300);
	}
}

/* wins */
var oneWin = new bt_Window();

function openGalleryWindow(on_click){
	var on_click = (on_click) ? on_click : 'closeWindow();' ;
	var content = '';
	content += '<div id="x_galtitle" class="fps_galdrag"></div>';
	content += '<div id="x_galclose" onclick="'+ on_click +'" title="Close" class="fps_galclose"></div>';
	content += '<div id="loader" class="fps_galloading"></div>';
	content += '<div id="x_galcontent" class="fps_galcontent"></div>';
	
	oneWin.open({
		winclass : 'fps_gallery_window',
		drag : 'fps_galdrag',
		html : content
	});
}


function openWindow(on_click){
	var on_click = (on_click) ? on_click : 'closeWindow();' ;
	oneWin.open({
		winclass : 'fps_window',
		drag : 'fps_windrag',
		html : '<div id="x_wintitle" class="fps_windrag"></div><div id="x_winclose" onclick="'+ on_click +'" title="Close" class="fps_winclose"></div><div id="loader" class="fps_winloading"></div><div id="x_wincontent" class="fps_wincontent"></div>'
	});
}
function openWindow2(on_click){
	var on_click = (on_click) ? on_click : 'closeWindow();' ;
	oneWin.open({
		winclass : 'fps_window',
		drag : 'fps_windrag',
		html : '<div id="x_wintitle2" class="fps_windrag"></div><div id="x_winclose2" onclick="'+ on_click +'" title="Close" class="fps_winclose"></div><div id="loader2" class="fps_winloading"></div><div id="x_wincontent2" class="fps_wincontent"></div>'
	});
}
function openProgramWindow(on_click){
	var on_click = (on_click) ? on_click : 'closeWindow();' ;
	oneWin.open({
		winclass : 'fps_program_window',
		drag : 'fps_windrag',
		html : '<div id="x_pwtitle" class="fps_windrag"></div>'+
		'<div id="x_pwclose" onclick="'+ on_click +'" title="Close" class="fps_winclose"></div><div id="loader2" class="fps_winloading"></div>'+
		'<div class="fps_wincontent"><div id="x_pwcontent" class="fps_program_content"></div></div>'+
		'<div class="fps_winbottom"><!-- b --></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 += '<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="Close" class="fps_winclose"></div>'+
		'<div id="returnloader" class="fps_winloading"></div><div id="x_returncontent" class="fps_wincontent">' + content + '</div>'
	});

	if (document.getElementById('x_okbutton')) {
		document.getElementById('x_okbutton').focus();
		document.getElementById('x_okbutton').onkeydown = function(e) {
			if(window.event) { // IE
				keynum = window.event.keyCode;
			} else {
				keynum = e.keyCode;
			}
			if (keynum == 13 || keynum ==27) this.onclick();
		}
	}
}
function xWintitleSizer(){
	document.getElementById("x_wintitle").style.width = 520+'px';
}
function resizeWindow(w, h, n) {
	if (typeof n == 'undefined') n = 1;
	var bt = document.getElementById('bt_win_'+n);
	var t = bt.firstChild;
	var c = bt.lastChild;

	c.style.padding = '0px';
	bt.style.width = w+'px';
	t.style.width = (w-70)+'px';
	c.style.width = w+'px';

	bt.style.height = (h+28)+'px';
	c.style.height = h+'px';
}

function fps_alert(str, type){
	var content = '';
	var myhref;

	if(!type) type='fps_caution';

	content = "<div class=\""+type+"\">"+str+"</div><div style=\"text-align: center\"><input type=\"button\" class=\"fps_button\" value=\""+fps_confirm_ok+"\" onclick=\"oneWin.close();\" /></div>";
	oneWin.open({
		winclass : 'fps_window',
		drag : 'fps_windrag',
		html : '<div id="x_winalert" class="fps_windrag"><img src="'+fps_globalurl+'image/redcaution_small.png" />'+fps_confirm_warning+'</div><div id="x_winalertclose" onclick="closeWindow();" title="'+fps_confirm_close+'" class="fps_winclose"></div><div id="x_winconfirmcontent" class="fps_wincontent">'+content+'</div>'
	});
	return false;
}

function fps_confirm(obj, str, yesscript, noscript){
	var content = '';
	var myhref;
	if(obj.href) {
		myhref = obj.href;
	}
	else myhref="";

	if(!yesscript) yesscript='';
	if(!noscript) noscript='';

	content = "<div class=\"fps_caution\">"+str+"</div><div style=\"text-align: center\"><input type=\"button\" class=\"fps_button2\" value=\""+fps_confirm_yes+"\" onclick=\"oneWin.close();"+yesscript+"window.location.href='"+myhref+"';\" /> <input type=\"button\" class=\"fps_button\" value=\""+fps_confirm_no+"\" onclick=\"oneWin.close();"+noscript+"\" /></div>";
	oneWin.open({
		winclass : 'fps_window',
		drag : 'fps_windrag',
		html : '<div id="x_winconfirm" class="fps_windrag"><img src="'+fps_globalurl+'image/redcaution_small.png" />'+fps_confirm_warning+'</div><div id="x_winconfirmclose" onclick="closeWindow();'+noscript+'" title="'+fps_confirm_close+'" class="fps_winclose"></div><div id="x_winconfirmcontent" class="fps_wincontent">'+content+'</div>'
	});
	return false;
}

function fps_confirmx(obj, str, yesscript, noscript){
	var content = '';
	var myhref;
	if(obj.href) {
		myhref = obj.href;
	}
	else myhref="";

	if(!yesscript) yesscript='';
	if(!noscript) noscript='';

	content = "<div class=\"notice\">"+str+"</div><div style=\"text-align: center\"><input type=\"button\" class=\"fps_button\" value=\""+fps_confirm_yes+"\" onclick=\"oneWin.close();"+yesscript+"window.location.href='"+myhref+"';\" /> <input type=\"button\" class=\"fps_button\" value=\""+fps_confirm_no+"\" onclick=\"oneWin.close();"+noscript+"\" /></div>";
	oneWin.open({
		winclass : 'fps_window',
		drag : 'fps_windrag',
		html : '<div id="x_winconfirm" class="fps_windrag"><img src="'+fps_globalurl+'image/redcaution_small.png" />'+fps_confirm_warning+'</div><div id="x_winconfirmclose" onclick="closeWindow();'+noscript+'" title="'+fps_confirm_close+'" class="fps_winclose"></div><div id="x_winconfirmcontent" class="fps_wincontent">'+content+'</div>'
	});
	return false;
}

function fps_confirm3(obj, str, yesscript, noscript, cancelscript){
	var content = '';
	var myhref;
	if(obj.href) {
		myhref = obj.href;
	}
	else myhref="";

	if(!yesscript) yesscript='';
	if(!noscript) noscript='';
	if(!cancelscript) cancelscript='';

	content = "<div class=\"fps_caution\">"+str+"</div>"+"<div style=\"text-align: center\">"+"<input type=\"button\" class=\"fps_button2\" value=\""+fps_confirm_yes+"\" onclick=\"oneWin.close();"+yesscript+" window.location.href='"+myhref+"';\" /> <input type=\"button\" class=\"fps_button\" value=\""+fps_confirm_no+"\" onclick=\"oneWin.close();"+noscript+"\" /> <input type=\"button\" class=\"fps_button3\" value=\""+fps_confirm_cancel+"\" onclick=\"oneWin.close();"+cancelscript+"\" /></div>";
	oneWin.open({
		winclass : 'fps_window',
		drag : 'fps_windrag',
		html : '<div id="x_winconfirm3" class="fps_windrag"><img src="'+fps_globalurl+'image/redcaution_small.png" />'+fps_confirm_warning+'</div><div id="x_winconfirm3close" onclick="closeWindow();'+cancelscript+'" title="'+fps_confirm_close+'" class="fps_winclose"></div><div id="x_winconfirmcontent" class="fps_wincontent">'+content+'</div>'
	});
	return false;
}


function closeWindow(){
	oneWin.close();
}

function myO(item){
	return document.getElementById(item) != null ? document.getElementById(item) : false;
}

/* linkcloud tabmenu */
function linkcloudTab(i){
	var tab1 = myO('linkcloud_tab_1');
	var content1 = myO('linkcloud_content_1');
	var tab2 = myO('linkcloud_tab_2');
	var content2 = myO('linkcloud_content_2');
	
	if(i==1){
		tab1.className = 'active';
		content1.style.display = 'block';
		
		tab2.className = 'second';
		content2.style.display = 'none';
	}else if(i==2){
		tab2.className = 'second active';
		content2.style.display = 'block';
		
		tab1.className = '';
		content1.style.display = 'none';
	}
}

/* all tabmenu */
function allTab(i, one, two){
	var tab1 = myO(one + '_tab');
	var content1 = myO(one + '_content');
	var tab2 = myO(two + '_tab');
	var content2 = myO(two + '_content');
	
	if(i==1){
		tab1.className = 'active';
		content1.style.display = 'block';
		tab2.className = '';
		content2.style.display = 'none';
	}else{
		tab1.className = '';
		content1.style.display = 'none';
		tab2.className = 'active';
		content2.style.display = 'block';
	}
}

/* layer menu */
var layerMenuTS = 0;
function layerMenu(active, inactive, out){
	if(myO(active) && myO(inactive)){
		activeO = myO(active);
		inactiveO = myO(inactive);
		
		if(inactiveO.style.display == 'block') inactiveO.style.display = 'none';
		if(activeO.style.display == 'none') activeO.style.display = 'block';
		if(layerMenuTS) clearTimeout(layerMenuTS);
		if(out) layerMenuTS = setTimeout("document.getElementById('" + active +"').style.display = 'none';", 4000);
	}
}

/* datasheet offer pager */
var datasheet_offer_pager_num = 1;
function datasheet_offer_pager(all, actual, mode){
	if(!actual){
		if(datasheet_offer_pager_num==all && mode=='next'){
			actual = 1;
		}else if(datasheet_offer_pager_num==1 && mode=='prev'){
			actual = all;
		}else{
			actual = (mode=='next') ? datasheet_offer_pager_num + 1 : datasheet_offer_pager_num - 1 ;	
		}
	}
	
	if(actual){
		var lastObj = myO('datasheet_offer_pager_' + datasheet_offer_pager_num);
		var actualObj = myO('datasheet_offer_pager_' + actual);
		var lastDataObj = myO('datasheet_offer_data_' + datasheet_offer_pager_num);
		var actualDataObj = myO('datasheet_offer_data_' + actual);
		
		lastObj.className = 'page';
		actualObj.className = 'page active';
		lastDataObj.style.display = 'none';
		actualDataObj.style.display = 'block';
		
		datasheet_offer_pager_num = actual;
	}
}

var datasheet_offer_pager_TS = null;
var datasheet_offer_SS = 1;
var datasheet_offer_ALL = 0;
function datasheet_offer_autopager(all){
	if(all) datasheet_offer_ALL = all;
	if(datasheet_offer_SS){
		if(datasheet_offer_pager_TS) datasheet_offer_pager(datasheet_offer_ALL, 0, 'next');
		datasheet_offer_pager_TS = setTimeout("datasheet_offer_autopager(0);", 8000);
	}else{
		if(datasheet_offer_pager_TS){
			clearTimeout(datasheet_offer_pager_TS);
			datasheet_offer_pager_TS = null;
		}
	}
}
function datasheetOfferMove(e){
	if(!e) var e = window.event;
	
	if(e.pageX){
		x = e.pageX; y = e.pageY;
	}else if(e.clientX){
		x = e.clientX; y = e.clientY
	}else return;
	
	var objData = myO('datasheet_offer');
	if (typeof e == 'undefined') e = window.event;
	Number.prototype.NaN0 = function(){ return isNaN(this) ? 0 : this; }
	
	var Positions = get_Position(objData);
	min_x = Positions.x;
	min_y = Positions.y;
	max_x = min_x + objData.offsetWidth;
	max_y = min_y + objData.offsetHeight;

	if(x>min_x && x<max_x && y>min_y && y<max_y){
		datasheet_offer_SS = 0;
		datasheet_offer_autopager(0);
	}else{
		tmp = datasheet_offer_SS;
		datasheet_offer_SS = 1;
		if(tmp == 0) datasheet_offer_autopager(0);
	}
}

function get_Position(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 getMouse_Offset(target, ev){
	if (typeof ev== 'undefined') ev = window.event;
	
	var targPos =  get_Position(target);
	var mousePos = getMouse_Coords(ev);
	return {x:mousePos.x - targPos.x, y:mousePos.y - targPos.y};
}
function getMouse_Coords(ev){
	if (typeof ev== 'undefined') ev = window.event;

	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 = ev.clientX + sL - cL;
	var mouseY = ev.clientY + sT - cT;
	return {x:mouseX, y:mouseY};
}*/

/* BETŰMÉRET NÖVELÉSE */
var font_size = 14;
var font_orig = 14;
function textSize(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;
	}

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

	createCookie('article_fontsize', font_size, 365);
}
function print_open(url,block,pid) {
	window.open(url + '?block='+block+'&pid='+pid, 'Nyomtatas', 'status=0,toolbar=0,location=0,menubar=1,resizable=1,scrollbars=1,directories=0,height=600,width=700');
}
function view_open(url,block,param) {
	window.open(url + '?block='+block+( param ? '&param='+param : '' ), 'Block', 'status=0,toolbar=0,location=0,menubar=1,resizable=1,scrollbars=1,directories=0,height=600,width=700');
}

function search_tabber(num){
	for(var i=1; i<=5; i++){
		if(document.getElementById('stab_' + i)){
			document.getElementById('stab_' + i).className = (i==num) ? 'active' : '' ;
		}
	}
}

// flash megjeleítés
function showflash(file,width,height,bgcolor,wmode) {
	if (wmode)
		wmode = 'transparent' ;
	else
		wmode = 'opaque' ;
	document.write('<object 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+'\">');
	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=\"'+wmode+'\" />');
	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=\"'+wmode+'\"  swliveconnect=\"true\" menu=\"false\"/>');
	document.write('</object>');
}