    function popup(mit) {
      var w = window.open(mit,'','width=700,height=600,toolbar=no,status=no,resizable=no,scrollbars=yes');
      var xc =(screen.width - 700) / 2;
      var yc =(screen.height - 600) / 2;
      w.moveTo(xc, yc);
    }

    function popup2(mit) {
      var w = window.open(mit,'','width=600,height=220,toolbar=no,status=no,resizable=no,scrollbars=no');
      var xc =(screen.width - 600) / 2;
      var yc =(screen.height - 220) / 2-60; //aranymetszes :)
      w.moveTo(xc, yc);
    }

    // getElementById egyszerűsítve
    function $div(id) { return document.getElementById(id); }

    // láthatóvá tesz egy divet
    function showDiv(_id) {
      $div(_id).style.display = 'block';
    }

    // elrejt egy divet
    function hideDiv(_id) {
      $div(_id).style.display = 'none';
    }

    if (navigator.appName.indexOf("Internet Explorer") > -1) { isIE = true; } else { isIE = false; }

  
    function linkclick(linkid) {
        new ajax ('ajax.php', {
            postBody: 'action=linkClick&id='+linkid
        });
        return true;
    }

	function getScreenWidth() {
		if (self.innerWidth)
		{
			return self.innerWidth;
		}
		if (document.documentElement && document.documentElement.clientWidth)
		{
			return document.documentElement.clientWidth;
		}
		if (document.body)
		{
			return document.body.clientWidth;
		}
	}
	

	function getObject( obj ) {
  		if ( document.getElementById ) {
   	 		obj = document.getElementById( obj );
  		} else if ( document.all ) {
    		obj = document.all.item( obj );
  		} else { 
    		obj = null;
  		}
  		return obj;
  	}

	function getPosition(e) {
    	e = e || window.event;
	    var cursor = {x:0, y:0};
	    if (e.pageX || e.pageY) {
    	    cursor.x = e.pageX;
        	cursor.y = e.pageY;
	    } 
    	else {
        	var de = document.documentElement;
	        var b = document.body;
    	    cursor.x = e.clientX + 
        	    (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
	        cursor.y = e.clientY + 
    	        (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
	    }
    	return cursor;
	}
		
	function showbubi(obj, e ) {
  		var tempX = 0;
  		var tempY = 0;
  		var offset = 0;
  		var objHolder = obj;

  		curr_title = $(obj + '_title' ).innerHTML;
  		curr_lead  = $(obj + '_lead' ).innerHTML;
	    $('bubi_title').innerHTML = curr_title;
	    $('bubi_lead').innerHTML = curr_lead;
		
		cursorpos = getPosition(e);
  		$('hirbubi').style.top  = (cursorpos.y - 20 + offset) + 'px';
//  		$('hirbubi').style.left = (cursorpos.x - Math.round((getScreenWidth()-700)/2) + offset) + 'px';
  		$('hirbubi').style.left = (cursorpos.x + 3) + 'px';
	    $('hirbubi').style.display = 'block';
  	}
	
	function hidebubi(obj) {
	    $('hirbubi').style.display = 'none';
	}
		
	function PermQuery() {
		setTimeout("doPermQuery()", 1000);  
	}

	function doPermQuery() {
          var myWidth = 0, myHeight = 0, top = 0;
          myWidth = document.body.scrollWidth;
          myHeight = document.body.scrollHeight;
          top = document.body.scrollTop + 185;

          $("overlay").style.width = myWidth + 'px';
          $("overlay").style.height = myHeight + 'px';
          $("overlay").style.display = 'block';
		  
		  $("permquery").style.top = top+'px';
		  $("permquery").style.left = Math.round((myWidth-390)/2) + 'px';
          $("permquery").style.display = 'block';
	}
	
		
	function createCookie(name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	}
	
	function allowRead() {
	      var date = new Date();
	      createCookie("perm", "1", (365*5));
          $("overlay").style.display = 'none';
          $("permquery").style.display = 'none';
	}

	

  