function setSelected(id,txt){
	document.getElementById('selectbox'+id+'_value').value = txt;
	document.getElementById('selectbox'+id+'_input_value').innerHTML = txt;
}
function dropDownSelect(id,txt){
    showSelectDropDown(id);
	document.getElementById('selectbox'+id+'_value').value = txt;
	document.getElementById('selectbox'+id+'_input_value').innerHTML = txt;
}
function showSelectDropDown(id){
	if(document.getElementById('selectbox'+id+'_dropdown').style.display == 'block') document.getElementById('selectbox'+id+'_dropdown').style.display = 'none';
	else document.getElementById('selectbox'+id+'_dropdown').style.display = 'block';
}

function changeTab(block,id,boxid){
	/* inactivate all */
	var i=1;
	while (document.getElementById(block+'page'+i)) {
		document.getElementById(block+'page'+i).style.display='none';
		document.getElementById(block+'mnu'+i).className='mnu'+i+'i';
		i++;
	}
	/* activate selected */
	document.getElementById(block+'mnu'+id).className='mnu'+id+'a';
	document.getElementById(block+'page'+id).style.display='block';
	
	document.getElementById(boxid).className='menulist menubg'+id;
}

function changeTab2(block,id){
	/* inactivate all */
	var i=1;
	while (document.getElementById(block+'page'+i)) {
		document.getElementById(block+'page'+i).style.display='none';
		document.getElementById(block+'mnuhover'+i).style.display='none';
		i++;
	}
	/* activate selected */
	document.getElementById(block+'page'+id).style.display='block';
	document.getElementById(block+'mnuhover'+id).style.display='block';
}
function changeTab3(block,id){
	/* inactivate all */
	var i=1;
	while (document.getElementById(block+'mnu'+i)) {
		document.getElementById(block+'mnu'+i).className='';
		document.getElementById(block+'page'+i).style.display='none';
		i++;
	}
	/* activate selected */
	document.getElementById(block+'mnu'+id).className='active';
	document.getElementById(block+'page'+id).style.display='block';
	document.getElementById('musorajanlomnuhover').style.marginTop=1+26*(id-1)+'px';
}

function hireknstop_row_active(rowid){
	document.getElementById('newsrowsel'+rowid).style.display='block';
	document.getElementById('newsrowimg'+rowid).className='image_active';
	document.getElementById('newsrowtitle'+rowid).className='title_active';
}
function hireknstop_row_inactive(rowid){
	document.getElementById('newsrowsel'+rowid).style.display='none';
	document.getElementById('newsrowimg'+rowid).className='image';
	document.getElementById('newsrowtitle'+rowid).className='title';
}


function getAbsoluteY(obj) {
	var parentY = 0;
	if(obj.offsetParent) parentY = getAbsoluteY(obj.offsetParent);
	return obj.offsetTop+parentY;
}

function getAbsoluteX(obj) {
	var parentX = 0;
	if(obj.offsetParent) parentX = getAbsoluteX(obj.offsetParent);
	return obj.offsetLeft+parentX;
}

function submitform (formid) {
	document.getElementById(formid).submit();
	return false;
}

function popup_window(url,w,x,y) {
    window.open(url,w,'width='+x+',height='+y+',scrollbars=1,status=0,menubar=0,location=0,resizable=1')
    return false;
}

function popup_window2(url,w,x,y) {
    window.open(url,w,'width='+x+',height='+y+',scrollbars=0,status=0,menubar=0,location=0,resizable=0')
    return false;
}

/* for altern. dropdown select */
var started = false;
var layeron = false;
var t;
function startLayerHide(dropdownid){
	if (!started ) {
		started = true
		window.status = dropdownid;
		t = window.setTimeout("showSelectDropDown("+dropdownid+");layeron=false;", 200)
		//t = window.setTimeout(function() {showSelectDropDown(dropdown_id);layeron=false;}, 200);
	}
}
function stopLayerHide(){
	if (started) {
		window.clearTimeout(t)
		started = false
	}
}
function checkedShowHide(showhide,dropdownid){ // check if dropdown layer is visible
	if (layeron) {
		if (showhide) {startLayerHide(dropdownid);}
		else {stopLayerHide();}
	}
}



WEBAUDIT=function() {
    
  this.WACID=null;
  this.WACIDName="WACID";
  
  
  this.getCookie=function(name)  {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++)
    {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1,c.length);
            if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
  }
  
  this.setCookie=function(name,value,topDomain) {
    var date = new Date(2020,12,31,23,59,59);
    var expires = "; expires="+date.toGMTString();
    document.cookie = name+"="+value+expires+"; path=/; domain=" + topDomain;  
  }
  
  this.generateID=function(splitter) {
    var sp=(splitter) ? splitter : 'A';
    var now=new Date();
    return Date.parse(now.toGMTString()) + sp + Math.floor(Math.random()*1000000000);
  }
  
  this.getTopDomain=function(fullDomain) {
    var darabok=fullDomain.split('.');
    return darabok[(darabok.length-2)] + '.' + darabok[(darabok.length-1)];
  }
  
  this.getDomain=function(url) {
    var urlDarabok=url.split('/');
    return urlDarabok[2];
  }
  
  this.WACID=this.getCookie(this.WACIDName);
}

var wa=new WEBAUDIT();
var felbontas = "";
var same =  Math.floor(Math.random()*1000000);
var wa_url = "@u=";
var wa_referrer = "@r=";

if(wa.WACID==null)
{
  wa.WACID=wa.generateID('A');
  wa.setCookie(wa.WACIDName,wa.WACID,wa.getTopDomain(wa.getDomain(document.URL)));
}

same = same + "@c=" + wa.WACID;
if(screen) felbontas='@s='+screen.width+'x'+screen.height;
if(document.referrer) wa_referrer=wa_referrer+document.referrer;
if(document.URL) wa_url=wa_url+document.URL;
same = same + felbontas + wa_url + wa_referrer;
