var oneWin = new bt_Window();
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 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 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>'
	});
}
// MENÜ KEZELÉS
startList = function() {
	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', '');
				}
			}
		}
	}
}
window.onload=startList;

function o_po(cat) {
	var popupwidth = 620, popupheight = 480 ; /*760, 540*/
	width = screen.width ;
	height = screen.height ;
	if (document.all)
		{
		width = document.body.clientWidth ;
		height = document.body.clientHeight ;
		}
	else if (document.layers)
		{
		width = window.innerWidth ;
		height = window.innerHeight ;
		}
	leftpos = (width-popupwidth)/2 ;
	toppos = (height-popupheight)/2 ;
	
	window.open("http://www.veneto.hu/popup.php","_blank","toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,width=630,height=480,scrollbars=1,top="+toppos+",left="+leftpos) ;	
	
}

function insAtCursor(myField,myValue)
	{
	// IE support
	if (document.selection)
		{
		myField.focus() ;
		sel = document.selection.createRange() ;
		sel.text = myValue ;
		}
	// MOZILLA/NETSCAPE support
	else if (myField.selectionStart || myField.selectionStart == "0")
		{
		var startPos = myField.selectionStart ;
		var endPos = myField.selectionEnd ;
		myField.value = myField.value.substring(0, startPos)
		+ myValue
		+ myField.value.substring(endPos, myField.value.length) ;
		}
	else
		{
		myField.value += myValue;
		}
	}
function open_center_layer(element,x,y,mode){
	/*
	mode : 0; absolut középre, x és y a div fele
	mode : 1; a toppos = y;
	mode : 2; a leftpos = x; toppos = y;
	*/
	document.getElementById(element).style.display = "none";
	leftpos = 0 ;
	toppos = 0 ;

	if(mode==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;
	}else{
		toppos = y;
	}

	if(mode==0){
		/* LEFT */
		if (screen){
			leftpos = (document.body.clientWidth/2) - x ;
		}

		if (leftpos<0)
			leftpos = 10 ;
	}else if(mode==2){
		leftpos = x;
	}

	document.getElementById(element).style.left = leftpos+'px';
	document.getElementById(element).style.top = toppos+'px';
}

//FOTOALBUMHOZ
function fotoalbum(cat,foto,l)
	{
	var popupwidth = 1024, popupheight = 768 ; /*760, 540*/
	width = screen.width ;
	height = screen.height ;
	if (document.all)
		{
		width = document.body.clientWidth ;
		height = document.body.clientHeight ;
		}
	else if (document.layers)
		{
		width = window.innerWidth ;
		height = window.innerHeight ;
		}
	leftpos = (width-popupwidth)/2 ;
	toppos = (height-popupheight)/2 ;
	window.open("http://www.veneto.hu/fotoalbum.php?cat="+cat+"&foto="+foto+"&lang="+l,"_blank","toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,width=1024,height=768,scrollbars=0,top="+toppos+",left="+leftpos) ;
	}


function showflash(file,width,height,bgcolor)
	{
	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=\"bgcolor\" value=\"'+bgcolor+'\" />');
	document.write('<param name=\"swliveconnect\" value=\"true\" />');
	document.write('<param name=\"menu\" value=\"false\" />');
	document.write('<param name="wmode" value="transparent">');
	document.write('<embed src=\"'+file+'\" wmode=\"transparent\" quality=\"high\" bgcolor=\"'+bgcolor+'\" width=\"'+width+'\" height=\"'+height+'\" wmode=\"transparent\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" wmode=\"transparent\"  swliveconnect=\"true\" menu=\"false\"/>');
	document.write('</object>');    
	}


// gyik megjelenítése
function showfaq(element)
	{
	document.getElementById(element).style.display = "block" ;
	document.getElementById("a"+element).href = "javascript: hidefaq('"+element+"')" ;
	window.focus() ;
	}
// gyik elrejtése
function hidefaq(element)
	{
	document.getElementById(element).style.display = "none" ;
	document.getElementById("a"+element).href = "javascript: showfaq('"+element+"')" ;
	window.focus() ;
	}

function urlap_action(){
	urlap=document.getElementById('urlap2');
	urlap_select=document.getElementById('urlap2_s');
	
	urlap.action= urlap_select.value;
	urlap.submit();
}

function centermessagebox(){
	
	document.getElementById('messagebox').style.display = "none";
	leftpos = 0 ;
	toppos = 0 ;
	
	/**/
	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)) - 60;
	/**/
	
	if (screen){
		leftpos = (document.body.clientWidth/2) - 165 ;
	}
	
	document.getElementById('messagebox').style.left = leftpos+'px';
	document.getElementById('messagebox').style.top = toppos+'px';
	
	document.onclick = hidemessagebox ;
} 
function hidemessagebox()
	{
	document.getElementById("messagebox").style.display = "none" ;
	window.focus() ;
	document.onclick = empty ;
	}


function showmessagebox(mode){
	var elem = '';
	if(mode==0){
		elem = 'error_message';
	}else if(mode==1){
		elem = 'success_message';
	}else{
		elem = 'messagebox';
	}

	document.getElementById(elem).style.display = "block" ;
	window.focus() ;

	document.onclick = function(){
		document.getElementById(elem).style.display = "none" ;
		window.focus() ;
		document.onclick = empty ;
	}
}
function empty(){
}

function showelement(element)
	{
	document.getElementById(element).style.display = "block" ;
	window.focus() ;
	}
function hideelement(element)
	{
	document.getElementById(element).style.display = "none" ;
	window.focus() ;
	}

function elrejt(element){
	document.getElementById(element).style.visibility = "hidden" ;
	window.focus() ;
}
function felfed(element){
	document.getElementById(element).style.visibility = "visible" ;
	window.focus() ;
}
/*------------------*/
var xmouse;
var ymouse;
function mouseMove(e){
	if(!e) var e = window.event;

	if(e.pageX){
		xmouse = e.pageX;
		ymouse = e.pageY;
	}else if(e.clientX){
		xmouse = e.clientX;
		ymouse = e.clientY
	}else return;

}
document.onmousemove = mouseMove;

function centerbox(t){
	
	var box = 'messagebox';

	document.getElementById(box).style.display = "none";
	leftpos = 0 ;
	toppos = 0 ;
	
	/**/
	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)) - 60;
	/**/

	if (screen){
		leftpos = (document.body.clientWidth/2) - 160 ;
	}
	if(t){
		toppos = t;
	}
	
	document.getElementById(box).style.left = leftpos+'px';
	document.getElementById(box).style.top = toppos+'px';


	document.onclick = function() {
		document.getElementById(box).style.display = "none" ;
		window.focus() ;
		document.onclick = empty ;
	}

}

function empty()
	{
	}

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 fps_admin_mainMenu(){
	if(document.all && document.getElementById){
		navRoot = document.getElementById('fps_mainmenu');
		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 = '';
				}
			}
		}
	}
}

/*
	created by Sándor Vasi
	2008.07.29.
	sanyi@fps.hu
	input vars:
		uri - the uri that will contains the popup window
		popupWidth - window width 
		popupHeight - window height
*/
function createPopup(uri, popupWidth, popupHeight ) {
	width = screen.width ;
	height = screen.height ;
	if (document.all)
		{
		width = document.body.clientWidth ;
		height = document.body.clientHeight ;
		}
	else if (document.layers)
		{
		width = window.innerWidth ;
		height = window.innerHeight ;
		}
	leftpos = (width-popupWidth)/2 ;
	toppos = (height-popupHeight)/2 ;
	newWindow = window.open( uri, 'mywindow', 'width=' + popupWidth + ', height=' + popupHeight, 'scrollbars=0, location=0, menubar=0, statusbar=0,top=' + toppos + ',left='+leftpos );
	if ( window.focus ) {
		newWindow.focus();
	}
}