// 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 ;
	/*h = (document.body.clientHeight/4);
	if(self.pageYOffset){
		toppos = self.pageYOffset + h;
	}else if(document.documentElement && document.documentElement.scrollTop){
		toppos = document.documentElement.scrollTop + h;
	}else if(document.body){
		toppos = document.body.scrollTop + h;
	}*/

	/**/
	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 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()
    {
    }

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 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>');
}