
  /* var root = 'http://localhost/_system/'; */

  document.charset='iso-8859-2';

  /* Page Reload */
/*
  var reload_target = ''; // for example: top
  var reload_page   = '';
  var reload_params = new Array(); // for example: reload_params[reload_index++]='variable=value';
  var reload_index  = 0;

  function reload() {
    var url = reload_page + '?';
    for (var i = 0; i < reload_params.length; i++) {
      if (i > 0)
        url += '&';
      url += reload_params[i];
    }
    if (reload_target != '')
      parent[reload_target].location.href = url;
    else
      document.location.href = url;
  }
*/  
  var highlight_selected;
  
  function highlight(obj, on_off, classname) {
    if (highlight_selected!=obj) {
  		if (!on_off)
  			obj.className=classname
  		else
  			obj.className=classname+'_highlight'
  	}
  } // end of the 'highlight()' function
  
  function appear(id) {
    if (get_browser() == "isDOM") {
      document.getElementById(id).style.visibility="visible";
      document.getElementById(id).style.position="static";
    } else {
      document.getElementById(id).visibility="show";
      document.getElementById(id).position="static";
    }
  }
  
  function disappear(id) {
    if (get_browser() == "isDOM") {
      document.getElementById(id).style.visibility="hidden";
      document.getElementById(id).style.position="absolute";
      document.getElementById(id).style.top=-1000;
    } else {
      document.getElementById(id).visibility="hide";
      document.getElementById(id).position="absolute";
      document.getElementById(id).top=-1000;
    }
  }
  
  var dis = new Array();
  var app = new Array();
  
  function appear_array(id) {
    var i = 0;
    while (typeof(document.all[id+'_'+i]) != 'undefined') {
      appear(id+'_'+i);
      i++;
    }
    for (i=0; i < dis.length; i++)
      if (dis[i] == id)
        dis[i] = "";
    app[app.length] = id;
  }
  
  function disappear_array(id) {
    var i = 0;
    while (typeof(document.all[id+'_'+i]) != 'undefined') {
      disappear(id+'_'+i);
      i++;
    }
    for (i=0; i < app.length; i++)
      if (app[i] == id)
        app[i] = "";
    dis[dis.length] = id;
  }
  
  function disappear_array_all() {
    var loc = new Array();
    for (i=0; i < app.length; i++)
      loc[i] = app[i];
    for (i=0; i < loc.length; i++)
      disappear_array(loc[i]);
  }
  
  function appeared(id) {
    return !disappeared(id);
  }
  
  function disappeared(id) {
    for (i=0; i < dis.length; i++)
      if (dis[i] == id)
        return true;
    return false;
  }
  
  function get_browser() {
      var isDOM      = (typeof(document.getElementsByTagName) != 'undefined'
                        && typeof(document.createElement) != 'undefined')
                     ? 1 : 0;
      var isIE       = (typeof(document.all) != 'undefined'
                        && parseInt(navigator.appVersion) >= 4
                        && !typeof(window.opera))
                     ? 1 : 0;
      var isNS       = (typeof(document.layers) != 'undefined')
                     ? 1 : 0;
      if (isDOM) return "isDOM";
      if (isIE)  return "isIE";
      if (isNS)  return "isNS";
      return 0;
  }
  
  function right_click_handler(e) {
    var message="Korona Rádió Kalocsa FM 100 Mhz";
  	if (document.all) {
  		if (event.button==2||event.button==3) {
  			alert(message);
  			return false;
  		}
  	}
  	else if (document.layers||document.getElementById) {
  		if (e.which == 3) {
  			alert(message);
  			return false;
  		}
  	}
  }
  
  function right_click() {
  	if (document.layers) {
  		document.captureEvents(Event.MOUSEDOWN);
  	}
  //	document.onmousedown=right_click_handler;
  //  document.oncontextmenu=new Function ("return false");
  }
  
  function popup_file( file, width, height, extra, title, win, winname) {
    if (!extra) extra = "";
    else extra = "?d=&" + extra + '&';
    if (!title) title = "";
    else title = "&title=" + title;
    if (!winname) winname = '_blank';
    if (!win) win = "";
  	x = (screen.width-width)/2;
  	y = (screen.height-height)/2 - 30;
  	wo = window.open(root + file + extra + title, winname,'width='+width+',height='+height+',left='+x+',top='+y+',status=no,scrollbars=yes,titlebar=no,menubar=no,toolbar=no,resizable=yes,alwaysRaised=yes,dependent=yes,'+win);
  	return wo;
  }
  
  function multimedia_popup( src, title, width, height, dir , win ) {
    if (!title) title = '';
    if (!width) width = 100;
    if (!height) height = 82;
    if (!dir) dir = "";
  	height2 = parseInt(height) + 18;
  	x = (screen.width-width)/2;
    y = (screen.height-height2)/2-20;
    if (x < 0) x = 0;
    if (y < 0) y = 0;
    window.open(system + 'multimedia_popup.php?system2root='+system2root+'&mmx_src='+src+'&width='+width+'&height='+height+'&title='+title+'&dir='+dir,'image_popup','width='+width+',height='+height2+',left='+x+',top='+y+',scrollbars=no,status=no,titlebar=yes,menubar=no,toolbar=no,resizable=yes,alwaysRaised=yes,dependent=yes,'+win);
  	return false;
  }
  
  function status_popup(id, title, width, height) {
    if (!width) width = 640;
    if (!height) height = 480;
    if (!title) title = "";
    else title = "&title=" + title;
  	x = (screen.width-width)/2;
  	y = (screen.height-height)/2 - 30;
  	wo = window.open(system + 'status.php?system2root=' + system2root + title + '&id=' + id, 'status','width='+width+',height='+height+',left='+x+',top='+y+',status=no,scrollbars=yes,titlebar=no,menubar=no,toolbar=no,resizable=yes,alwaysRaised=yes,dependent=yes');
  	return wo;
  }
  
  function window_resize(width, height){
  	//top.window.moveTo(0,0);
  	if (width <= 0 || width+30 >= screen.availWidth) width = screen.availWidth - 30;
  	if (height <= 0 || height+30 >= screen.availHeight) height = screen.availHeight - 30;
    if (document.all) {
  		top.window.resizeTo(width,height);
  	}
  	else if (document.layers||document.getElementById) {
  		if (top.window.outerHeight  < height || top.window.outerWidth < width){
  			top.window.outerHeight = height;
  			top.window.outerWidth = width;
  		}
  	}
  	x = (screen.width-width)/2;
  	y = (screen.height-height)/2;
  	if (x < 0) x = 0;
  	if (y < 0) y = 0;
  	top.window.moveTo(x,y); // center
  }
  
  var winobj;
  function wait4close(win,command) {
    winobj = win;
    if (winobj.closed) {
      eval(command.replace(/~~/gi, "'"));
    } else
      setTimeout("wait4close(winobj,'" + command + "')",1000);
  }
  
  function go(t,ms) {
    if (!ms)
      ms = 100;
    if (t!='')
      setTimeout("document.location='#" + t + "';", ms);
  }
  
  function objectToString(obj) {
    var ret = "Object " + obj.name + " is [\n";
    for (var prop in obj)
      ret += "  " + prop + " is " + obj[prop] + ";\n";
    return ret + "]";
  }
  
    function valid_email(email) {
  	  var err = true;
  	  if (email == "") {
    		err = false;
  		} else if (email.search(/(^([-a-zA-Z0-9._]+@[-a-zA-Z0-9]+(\.[-a-zA-Z0-9]+)+)*$)/i) == -1) {
    	  err = false;
  		}
  		return err;
  	}
  
  var winobj;
  function wait4close(win,command) {
    winobj = win;
    if (winobj.closed) {
      eval(command.replace(/~~/gi, "'"));
    } else
      setTimeout("wait4close(winobj,'" + command + "')",1000);
  }
  
  function go(t,ms) {
    if (!ms)
      ms = 100;
    if (t!='')
      setTimeout("document.location='#" + t + "';", ms);
  }
  
  function objectToString(obj) {
    var ret = "Object " + obj.name + " is [\n";
    for (var prop in obj)
      ret += "  " + prop + " is " + obj[prop] + ";\n";
    return ret + "]";
  }
  
  /* böngészőre figyelmeztetés */
  if (get_browser() != "isDOM" && browser_alert != 1) {
    var browser_alert = 1;
    alert('Honlapunk megtekintésére Internet Explorer használata javasolt!');
  }
  
  function go_to(t) {
    document.location = '#' + t;
  }
  
  function set_document_title(title){
    top.document.title = title;
  }


