<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function P7_hideDiv(evt) { //v1.3 by PVII
 var b,relT,mT=false;
 if(document.layers){b=evt.target;if(b.p7aHide){
  b.visibility="hidden";}else{routeEvent(evt);}
 }else if(document.all&&!window.opera){b=event.srcElement;
  while(b!=null){if(b.tagName=="DIV" && b.p7ahD){mT=true;break;}b=b.parentElement;}
  if(!b.contains(event.toElement)){b.style.visibility="hidden";}
 }else if(document.getElementById){b=evt.currentTarget;relT=evt.relatedTarget;
  while(relT!=null){if(b==relT){mT=true;break;}
  relT=relT.parentNode;}if(!mT){b.style.visibility="hidden";}}
}

function P7_Snap() { //v2.63 by PVII
 var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,tw,q0,xx,yy,w1,pa='px',args=P7_Snap.arguments;a=parseInt(a);
 if(document.layers||window.opera){pa='';}for(k=0;k<(args.length);k+=4){
 if((g=MM_findObj(args[k]))!=null){if((el=MM_findObj(args[k+1]))!=null){
 a=parseInt(args[k+2]);b=parseInt(args[k+3]);x=0;y=0;ox=0;oy=0;p="";tx=1;
 da="document.all['"+args[k]+"']";if(document.getElementById){
 d="document.getElementsByName('"+args[k]+"')[0]";if(!eval(d)){
 d="document.getElementById('"+args[k]+"')";if(!eval(d)){d=da;}}
 }else if(document.all){d=da;}if(document.all||document.getElementById){while(tx==1){
 p+=".offsetParent";if(eval(d+p)){x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
 }else{tx=0;}}ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);tw=x+ox+y+oy;
 if(tw==0||(navigator.appVersion.indexOf("MSIE 4")>-1&&navigator.appVersion.indexOf("Mac")>-1)){
  ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);}else{
  w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
  x=document.body.scrollLeft+event.clientX+bx;y=document.body.scrollTop+event.clientY;}}
 }else if(document.layers){x=g.x;y=g.y;q0=document.layers,dd="";for(var s=0;s<q0.length;s++){
  dd='document.'+q0[s].name;if(eval(dd+'.document.'+args[k])){x+=eval(dd+'.left');y+=eval(dd+'.top');
  break;}}}e=(document.layers)?el:el.style;xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
 if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
  xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);}
 e.left=xx+pa;e.top=yy+pa;}}}
}


function P7_autoHide() { //v1.3 by PVII
 var i,g,args=P7_autoHide.arguments;
 for(i=0;i<args.length;i++){if((g=MM_findObj(args[i]))!=null){
  g.p7aHide=true;if(document.layers){
  g.captureEvents(Event.MOUSEOUT);}g.onmouseout=P7_hideDiv;g.p7ahD=true;}}
}

function P7_autoLayers() { //v1.5 by refi
  var g,b,k,f,args=P7_autoLayers.arguments;var a = parseInt(args[0]);if(isNaN(a))a=0;if(!document.p7setc){
  p7c=new Array();document.p7setc=true;for(var u=0;u<10;u++){
  p7c[u]=new Array();}}for(k=1;k<args.length;k++){
  if((g=MM_findObj(args[k]))!=null){
  b=(document.layers)?g:g.style;b.visibility="visible";f=false;for(var j=0;j<p7c[a].length;j++){
  if(args[k]==p7c[a][j]){f=true;}}if(!f){p7c[a][p7c[a].length++]=args[k];}}}
}


function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

layernum=6;
timeoutarray=new Array(0,0,0,0,0,0);
layernames=new Array("radio88menu","musorokmenu","programmenu","interaktivmenu","linkekmenu","hirdetesmenu");

function timeoutHide()
{
 for (var i=0;i<layernum;i++)
 {
  if (timeoutarray[i]==1)
  {
   MM_showHideLayers(layernames[i],'','hide');
   timeoutarray[i]=0;
  }
 }
}

function setHide(id,time)
{
 timeoutarray[id]=1;
 trickyshot=setTimeout("timeoutHide()",time);
}

function hideAllMenu()
{
 for (var i=0;i<layernum;i++)
 {
   timeoutarray[i]=0;
   MM_showHideLayers(layernames[i],'','hide');
 }
}


function cancelHide(id)
{
 timeoutarray[id]=0;
}





function framecheck()
{
  if (parent.frames["blank"] == null)
  {
    window.location = "";
  }
}


//zsolesz
// az editorban a tablazat hatterkepet cserelo script
function ChangeBgImg(imgs,idd) {
bdy = document.getElementsByTagName("td");
var j =  bdy.length;
for(var i=0; i < j; i++)
{
  if (bdy[i].id == idd)
    bdy[i].style.backgroundImage = 'url('+imgs+')';
}
}



function getSelected(opt)
{
   var selected = new Array();
   var index = 0;
   for (var intLoop = 0; intLoop < opt.length; intLoop++) {
      if (opt[intLoop].selected)
      {
         index = selected.length;
         selected[index]       = new Object;
         selected[index].value = opt[intLoop].value;
         selected[index].text  = opt[intLoop].text;
         selected[index].index = intLoop;
         selected[index].ok    = false;
      }
   }
   return selected;
}


// add s2 to s1 from start position
function addToString(s1, s2, start)
{
  var t1 = s1.substr(0,start);
  var t2 = s1.substr(start);

  return t1.concat(s2).concat(t2);
}

function removeFromString(s1, start, end)
{
  var t1 = s1.substr(0,start);
  var t2 = s1.substr(end,s1.length);

  return t1.concat(t2);
}



function moveToListAdv(listFrom, listTo, add)
{
  var sel = getSelected(listFrom);
  if(add)
  {
    for (var intLoop = sel.length-1; intLoop >= 0; intLoop--)
    {
      sel[intLoop].text = sel[intLoop].text+" - korlátozva";
    }
  }
  else
  {
    for (var intLoop = sel.length-1; intLoop >= 0; intLoop--)
    {
      sel[intLoop].text = sel[intLoop].text.substr(0, sel[intLoop].text.lastIndexOf(" -"));
    }
  }
  var newElement = 0;

  for (var item in sel)
  {
    var flag = true;
    for (var intLoop = 0; intLoop < listTo.length; intLoop++)
    {
      if (sel[item].value == listTo[intLoop].value)
        flag = false;
    }

    if (flag)
    {
      newOption = new Option( "_text_" , "_value_" , false, false);
      listTo[listTo.length] = newOption;
      sel[item].ok = true;
      newElement++;
    }
  }


  var index = listTo.length-newElement-1;

  if (index >= 0)
  {
    for (intLoop = newElement-1; intLoop >= 0; intLoop--)
    {
      if( sel[intLoop].ok )
      {
        listFrom[sel[intLoop].index] = null;

        var cont = true;

        for(; cont; index--)
        {
          if (sel[intLoop].text < listTo[index].text)
          {
            listTo[index+intLoop+1].text  = listTo[index].text;
            listTo[index+intLoop+1].value = listTo[index].value;
            if (index == 0) cont = false;
          }
          else
          {
            index++
            cont = false;
          }
        }
        index++;

        listTo[index].text  = sel[intLoop].text;
        listTo[index].value = sel[intLoop].value;
      }
    }
  }
  else
  {
    for (intLoop = newElement-1;  intLoop >= 0; intLoop--)
    {
      if( sel[intLoop].ok )
      {
        listFrom[sel[intLoop].index] = null;

        listTo[intLoop].text  = sel[intLoop].text;
        listTo[intLoop].value = sel[intLoop].value;
      }
    }
  }

  for(intLoop = 0, j = 0; intLoop < listTo.length; intLoop++)
  {
    listTo[intLoop].selected = false;
    if (j >= sel.length) continue;

    if (listTo[intLoop].value == sel[j].value)
    {
      listTo[intLoop].selected = true;
      j++;
    }
  }

}

function copyToList(from, to)
{
  for(i=0; i < from.options.length; i++)
    if(from.options[i].selected)
    {
      var k = 1;
      for(j=0; j < to.options.length; j++)
        if(from.options[i].value == to.options[j].value) k = 0;

      if(k) to.options[to.length] = new Option(from.options[i].text, from.options[i].value);
    }
}

function deleteFromList(list)
{
  for(i=0; i < list.options.length; i++)
    if(list.options[i].selected)
      list.options[i--] = null;
}

function clearList(list)
{
  var length = list.length;
  for(i=0; i < length; i++)
    list.options[0] = null;
}

function selectList(list)
{
  for(i=0; i < list.length; i++)
    list.options[i].selected = true;
}

function fillListFromStr(list, str, sel)
{
  var a,i;
  a = new Array();
  a = str.split('#');

  clearList(list);

  for(i=0; i < a.length/2; i++)
  {
    var text     = a[2*i+1];
    var value    = a[2*i];
    var selected = false;

    if(text == sel) selected = true;

    list.options[list.length] = new Option(text, value, false, selected);
  }
}

function buildStrFromList(list)
{
  var s = "";

  for(var i=0; i < list.length; i++)
  {
    if(i == 0) s += list.options[i].value;
    else       s += '#' + list.options[i].value;
  }

  return s;
}

function moveToList(listFrom, listTo)
{
  var sel = getSelected(listFrom);
  var newElement = 0;

  for (var item in sel)
  {
    var flag = true;
    for (var intLoop = 0; intLoop < listTo.length; intLoop++)
    {
      if (sel[item].value == listTo[intLoop].value)
        flag = false;
    }

    if (flag)
    {
      newOption = new Option( "_text_" , "_value_" , false, false);
      listTo[listTo.length] = newOption;
      sel[item].ok = true;
      newElement++;
    }
  }


  var index = listTo.length-newElement-1;

  if (index >= 0)
  {
    for (intLoop = newElement-1; intLoop >= 0; intLoop--)
    {
      if( sel[intLoop].ok )
      {
        listFrom[sel[intLoop].index] = null;

        var cont = true;

        for(; cont; index--)
        {
          if (sel[intLoop].text < listTo[index].text)
          {
            listTo[index+intLoop+1].text  = listTo[index].text;
            listTo[index+intLoop+1].value = listTo[index].value;
            if (index == 0) cont = false;
          }
          else
          {
            index++
            cont = false;
          }
        }
        index++;

        listTo[index].text  = sel[intLoop].text;
        listTo[index].value = sel[intLoop].value;
      }
    }
  }
  else
  {
    for (intLoop = newElement-1;  intLoop >= 0; intLoop--)
    {
      if( sel[intLoop].ok )
      {
        listFrom[sel[intLoop].index] = null;

        listTo[intLoop].text  = sel[intLoop].text;
        listTo[intLoop].value = sel[intLoop].value;
      }
    }
  }


  for(intLoop = 0, j = 0; intLoop < listTo.length; intLoop++)
  {
    listTo[intLoop].selected = false;
    if (j >= sel.length) continue;

    if (listTo[intLoop].value == sel[j].value)
    {
      listTo[intLoop].selected = true;
      j++;
    }
  }

}





function outputList(list,result) {
   var strSel = "";
   for (var i = 0; i < list.length; i++)
   {
       strSel += list[i].value + ";";
	 }
   result.value = strSel;
}


function outputList2(list,result) {
  var strSel = "";
  for (var i = 0; i < list.length; i++)
	{
    if( list[i].text.substr(list[i].text.lastIndexOf("-"), list[i].text.length ) == "- korlátozva" )
    {
      strSel += "2;";
    }
    else
    {
      strSel += "1;";
    }
	}
  result.value = strSel;
}

function changePerm(list,type)
{
  var s = "";
  if(type == "limited") s = " korlátozva";
  else                  s = " korlátlan";

  for (var i = 0; i < list.length; i++)
	{
    if( list[i].selected )
    {
      list[i].text = list[i].text.substr(0, list[i].text.lastIndexOf("-")+1)+s;
    }
	}
}



//timer functions
function setTimeText(value)
{

  x = MM_findObj('timelayer');
  var t = value;

  var t_s = t%60;
  var t_m = ((t-t_s)%3600)/60;
  var t_h = ((t-t_s-t_m*60)%86400)/3600;
  var t_d = (t-t_s-t_m*60-t_h*60*60)/86400;

  t_h = t_h+1;

  x.innerHTML = '<b>'+t_d+'</b> <font color="#5378A6">nap</font> <b>'+t_h+'</b> <font color="#5378A6">óra</font> <b>'+t_m+'</b> <font color="#5378A6">perc</font>';
}

function updateS()
{
  document.exf1.sec.value = (parseInt(document.exf1.sec.value)-1);
  var s = document.exf1.sec.value;
  if(s%60 == 1)
  {
    setTimeText(s);
  }
}

function startTimer(sec)
{
  clearInterval(_myTimer_s);
  document.exf1.sec.value=sec;

  setTimeText(sec);

  var _myTimer_s  = setInterval("updateS()",1000);
}

function ifEnter(field,event,actionstring) {
  var theCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
  if (theCode == 13){
    eval(actionstring);
    return false;
  }
  else
    return true;
}

