// FLASH Beillesztés
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=\"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>');    
	}
// 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() ;
    }
// ID Elements Elrejtések / Felfedések
function ShowInfo(ObjId)
	{
	var theObj = document.getElementById(ObjId);
	theObj.style.display = (theObj.style.display == 'none') ? 'block' : 'none';
	}
function ShowEgyeb(ObjIn, ObjOut)
	{
	var theObj = document.getElementById(ObjIn);
	var theObj2 = document.getElementById(ObjOut);

	theObj2.style.display = (theObj.value == "0") ? 'block' : 'none';
	}
function CheckRegio(id){
	Obj = document.getElementById('r_'+id);
	Obj.checked = (Obj.checked) ? false : true;
}
function CheckBudapest(){
	document.getElementById('r_1').checked = true;
}
function CheckBp(){
	if(document.getElementById('r_7').checked){
		document.getElementById('r_1').checked = true;
	}
}
function CheckRegioAll(allregio){
	for(i=1; i<=9; i++){
		Obj = document.getElementById('r_'+i);
		Obj.checked = (allregio==0) ? false : true;
	}
}
function CheckMunkaAll(allmunka){
	for(i=1; i<=26; i++){
		Obj = document.getElementById('mt_'+i);
		Obj.checked = (allmunka==0) ? false : true;
	}
}
function CheckJellegAll(alljelleg){
	for(i=1; i<=5; i++){
		Obj = document.getElementById('mj_'+i);
		Obj.checked = (alljelleg==0) ? false : true;
	}
}
function CheckNyelvAll(allnyelv){
	for(i=1; i<=38; i++){
		Obj = document.getElementById('ny_'+i);
		Obj.checked = (allnyelv==0) ? false : true;
		
		if(document.getElementById('nemkoll')){
			document.getElementById('nemkoll').checked = (allnyelv==0) ? false : true;
		}
	}
}
/*function CheckNemKell(){
	CheckNyelvAll(0);
}
function CheckIgenKell(){
	if(document.getElementById('nemkoll')){
		document.getElementById('nemkoll').checked = false;
	}
}*/

function CheckHirlevel(){
	Obj = document.getElementById('h_1');
	Obj2 = document.getElementById('show_h_1');
	
	if(Obj.checked==true){
		Obj2.style.visibility = 'visible';
	}else{
		Obj2.style.visibility = 'hidden';
	}
}
function CheckKapcsolattarto(){
	Obj = document.getElementById('k_1');
	Obj2 = document.getElementById('show_k_1');
	
	if(Obj.checked==true){
		Obj2.style.visibility = 'visible';
	}else{
		Obj2.style.visibility = 'hidden';
	}
}
function RegioBetoltes(ids){
	for(i=1; i<=9; i++){
		Obj = document.getElementById('r_'+i);
		Obj.checked = false;
	}
	
	tomb = new Array();
	tomb = ids.split(';');

	for(i=0; i<tomb.length; i++){
		Obj = document.getElementById('r_'+tomb[i]);
		Obj.checked = true;
	}
}
function TeruletBetoltes(ids){
	for(i=1; i<=26; i++){
		Obj = document.getElementById('mt_'+i);
		Obj.checked = false;
	}

	tomb = new Array();
	tomb = ids.split(';');

	for(i=0; i<tomb.length; i++){
		Obj = document.getElementById('mt_'+tomb[i]);
		Obj.checked = true;
	}
}
function JellegBetoltes(ids){
	for(i=1; i<=5; i++){
		Obj = document.getElementById('mj_'+i);
		Obj.checked = false;
	}

	tomb = new Array();
	tomb = ids.split(';');

	for(i=0; i<tomb.length; i++){
		Obj = document.getElementById('mj_'+tomb[i]);
		Obj.checked = true;
	}
}
function showelement(element)
    {
    document.getElementById(element).style.display = "block" ;
    window.focus() ;
    }
function hideelement(element)
    {
    document.getElementById(element).style.display = "none" ;
    window.focus() ;
    }

function TextCounter(ObjIn, ObjOut, maxhossz){
	Obj1 = document.getElementById(ObjIn);
	Obj2 = document.getElementById(ObjOut);
	
	s = Obj1.value;
	hossz = s.length;
	Obj2.value = maxhossz - hossz;
}
/*------------------*/
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(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 ;
	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 (screen){
        leftpos = (document.body.clientWidth/2) - 180 ;
	}
	if(t){
		//toppos = t;
		toppos = ymouse;
	}
	
	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()
    {
    }

/*------------------*/

// KÉPERNYŐ MÉRETEK LEKÉRÉSE
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else {
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) {
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}
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 "" ;
	}
