//FOTOALBUMHOZ
function fotoalbum(cat,foto,l)
    {
    var popupwidth = 900, popupheight = 700 ; /*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.pirat.hu/fotoalbum.php?cat="+cat+"&foto="+foto+"&lang="+l,"_blank","toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,width=900,height=700,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 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) - 120 ;
	}*/
	
	leftpos = 360 ;
	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 showelement(element)
    {
    document.getElementById(element).style.display = "block" ;
    window.focus() ;
    }
function hideelement(element)
    {
    document.getElementById(element).style.display = "none" ;
    window.focus() ;
    }

/*------------------*/
function centerbox(boxid, t){
	
	if(boxid==3){
		var box = 'resultbox';
	}else if(boxid==2){
		var box = 'timebox';
	}else if(boxid==1){
		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) - 180 ;
	}
	if(t){
		toppos = t;
	}
	
	document.getElementById(box).style.left = leftpos+'px';
	document.getElementById(box).style.top = toppos+'px';

	if(boxid!=2){
		document.onclick = function() {
			document.getElementById(box).style.display = "none" ;
			window.focus() ;
			document.onclick = empty ;
		}
	}
}

function empty()
    {
    }