// Akrylon Basic Functions v1.3

// --------------------------------------------------------------------------------------  Init basic data
var loaded=false;
is=new systemInfo();

// --------------------------------------------------------------------------------------  System info - browser, OS
function systemInfo()
{var b=navigator.appName; 
 if(b=="Netscape") {this.b = "ns"}
 else if(b=="Microsoft Internet Explorer") {this.b="ie"} 
 else if(b=="Opera") {this.b = "op"}
 else {this.b=b}
 this.version=navigator.appVersion;this.v=parseInt(this.version);

 if(this.b!='op')
 {var opId=navigator.userAgent.indexOf("Opera");
  if(opId!=-1) {this.b="op";this.v=parseInt(navigator.userAgent.substring(opId+6,opId+9)*10)/10;}
 }

 this.ns=(this.b=="ns"&&this.v>=4);this.ns4=(this.b=="ns"&&this.v==4);this.ns5=(this.b=="ns"&&this.v==5);this.ns6=(this.b=="ns"&&this.v==6);
 this.ie=(this.b=="ie"&&this.v>=4);this.ie4=(this.version.indexOf('MSIE 4')>0);this.ie5=(this.version.indexOf('MSIE 5')>0);this.ie55=(this.version.indexOf('MSIE 5.5')>0);this.ie6=(this.version.indexOf('MSIE 6')>0);this.ie7=(this.version.indexOf('MSIE 7')>0);
 this.op=(this.b=="op"&&this.v>=4);this.op5=(this.b=="op" && this.v==5);this.op6=(this.b=="op" && this.v==6);this.op7=(this.b=="op" && this.v==7);this.op8=(this.b=="op" && this.v==8);
 this.dom=document.getElementById?1:0;
 this.agent = navigator.userAgent.toLowerCase();
 if (this.agent.indexOf("mac")!=-1){this.os="mac"}
 else if (this.agent.indexOf("win")!=-1){this.os="win"} 	
 else this.os = "other"

 if(this.b=='ie')
 {var opId=navigator.userAgent.indexOf("MSIE");
  if(opId!=-1) {this.v=parseInt(navigator.userAgent.substring(opId+5,opId+8)*10)/10;}
 }

// alert("dom:"+this.dom+" - Ver: "+this.v+" - Nav:"+navigator.appVersion);
}

function isEmpty(obj)
{
 if (typeof obj == 'undefined' || obj === null || obj === '') return true;
 if (typeof obj == 'number' && isNaN(obj)) return true;
 if (obj instanceof Date && isNaN(Number(obj))) return true;
 return false;
}

// --------------------------------------------------------------------------------------  GetVar

varVal='';
function GetVar(varName)
{
 var argv = GetVar.arguments;
 var argc = GetVar.arguments.length;
 var subF = (argc > 1) ? 1 : 0;

 if(subF) vars=document.URL; else vars=top.document.URL;

 valFrom=-1;
 valTo=-1;
 //if(topD) vars=top.document.URL; else vars=document.URL;
 valFrom=vars.indexOf('?'+varName+'=',0);
 if(valFrom<0) valFrom=vars.indexOf('&'+varName+'=',0);
 if(valFrom<0) return false;
 valFrom=vars.indexOf('=',valFrom)+1;
 valTo=vars.indexOf('&',valFrom); 
 if(valTo<0) valTo=4096;
 varVal=vars.substring(valFrom,valTo);
 return true;
}

// --------------------------------------------------------------------------------------  Inspect
function Inspect(mes)
{if(!eL('Inspect')) document.body.innerHTML+='<div id=Inspect style="position:absolute;display:none;left:4px;top:4px;background:#FFFFFF;padding:4px;"></div>';
 eL('Inspect').innerHTML=mes;
 eL('Inspect').style.display='block';
}

// --------------------------------------------------------------------------------------  FirstTime
// Requires input tag "start", callable only once

function FirstTime()
{
 if(parent.parent.VarF.document.forms.F.elements.start.value==0)
   {parent.parent.VarF.document.forms.F.elements.start.value=1;return 1;}
 else return 0;  
}

// --------------------------------------------------------------------------------------  Marquee
function Marquee(content,delay,step,direction)
{
 if(direction=='undefined') direction='left';
 if(is.ie) document.writeln('<marquee direction='+direction+' scrollAmount='+step+' TRUESPEED="1" scrollDelay='+delay+' valign=bottom>'+content+'</marquee><br>');
}

// --------------------------------------------------------------------------------------  Show picture in new window

function Show(pic)
{
 ukaz=window.open("","Ukazka","toolbar=no,location=0,directories=no,status=no,menubar=no,scrollbars=no,resizable=1,copyhistory=0,width=50,height=50,top=10,left=10");
 ukaz.focus();
 ukaz.document.clear();
 ukaz.document.open("text/html");
 ukaz.document.write("<body bgcolor=#FFFFFF onLoad=\"ResizeMe();\"><table width=100% height=100%><tr><td align=center valign=center><img src=\""+pic+"\"></table></body>");
 ukaz.document.write("<script>  var i=0;function ResizeMe() {if(navigator.appName==\"Netscape\") i=40;if(document.images[0]) window.resizeTo(document.images[0].width+50, document.images[0].height+70+i);self.focus();} </script>");
 if(!is.ns) ukaz.document.title="Preview";
 ukaz.document.close();
}

// --------------------------------------------------------------------------------------  Show picture in new window
function Video(vid)
{
 ukaz=window.open("","Ukazka","title=ggg,toolbar=no,location=0,directories=no,status=no,menubar=no,scrollbars=yes,resizable=1,copyhistory=0");
 ukaz.document.clear();
 ukaz.document.open("text/html");
 ukaz.document.write("<body bgcolor=#000000><table width=\"100%\" height=\"100%\"><tr><td align=center valign=center><embed src=\""+vid+"\"></td></tr></table></body>");
 if(!is.ns) ukaz.document.title="Preview";
 ukaz.document.close();
 ukaz.focus();
}

//******************************************************************************************************

// Akrylon Cookie Handle 2004 v1.1

function SetCookie(name,value)
{
 var argv = SetCookie.arguments;
 var argc = SetCookie.arguments.length;
 var expires = (argc > 2) ? argv[2] : null;
 var path = (argc > 3) ? argv[3] : null;
 var domain = (argc > 4) ? argv[4] : null;
 var secure = (argc > 5) ? argv[5] : false;
 document.cookie = name + "=" + (value) +
  ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
  ((path == null) ? "" : ("; path=" + path)) +
  ((domain == null) ? "" : ("; domain=" + domain)) +
  ((secure == true) ? "; secure" : "");
}

function GetCookie(name)
{
 var cookieFound = false;
 var start = 0;
 var end = 0;
 var cookieString = document.cookie; 

 var i = 0;
 while(i<=cookieString.length)
  {start = i;
   end = start + name.length;
   if(cookieString.substring(start,end) == name)
     {cookieFound = true;
      break;
     }
   i++;
  } 

 if(cookieFound)
   {start=end+1;
    end=document.cookie.indexOf(";",start); 
    if(end<start) end=document.cookie.length; 
    return document.cookie.substring(start,end); 
   } 
 return "";
} 

function DeleteCookie(name)
{
 var exp = new Date();
 exp.setTime (exp.getTime() - 10000);
 var cval = GetCookie (name);
 document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}


//******************************************************************************************************

// Akrylon Layers Handle 2005 v1.4

// --------------------------------------------------------------------------------------  Get Layer Object
function getLayer(name){return eL(name);}

function eL(name)
{if(is.dom) {return document.getElementById(name);}
 else if(is.ns) return eval('document.layers.'+name);
 else if(is.ie) return eval('document.all.'+name);
 else return eval('document.layers.'+name);
}

function eF(name)
{if(is.dom) {return document.getElementById(name);}
 else if(is.ns) return eval('document.forms.'+name);
 else if(is.ie) return eval('document.all.'+name);
 else return eval('document.forms.'+name);
}


// --------------------------------------------------------------------------------------  Layer Visibility
var cntf=0;
function Fader(name,LN,delay,step,opacity)
              {this.Fade=Fade;this.name=name;this.LN=LN;this.delay=delay;this.step=step;this.opacity=opacity;}

function Fade()
{this.opacity+=this.step;
// eval("if(typeof("+this.name+"tHandle)!='undefined') clearTimeout("+this.name+"tHandle);")
 if(this.opacity>100) this.opacity=100;
 else if(this.opacity<=0) this.opacity=0;
 // Bad setTimeout(this.name+".Fade()",this.delay);
 else {eval(this.name+"tHandle=setTimeout(\""+this.name+".Fade()\","+this.delay+");")}
 LayOpacity(this.LN,this.opacity);
 cntf++;
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


function LayShow(L) {(is.ns4) ? L.visibility="show" : L.style.visibility="visible"}

function LayHide(L) {(is.ns4) ? L.visibility="hide" : L.style.visibility="hidden"}

function LaySetZIndex(L,z) {(is.ns) ?  L.zIndex = z : L.style.zIndex = z}

function LayOpacity(LN,opacity)
{if(opacity<0) opacity=0;else if(opacity>100) opacity=100;
 L=eL(LN);
 if(opacity==0) LayHide(L); else LayShow(L);
 if(is.ns && is.v>4) if(opacity==100 || opacity==0) L.style.MozOpacity="";else L.style.MozOpacity=""+opacity/101;
 if(is.ie) if(opacity==100 || opacity==0) L.style.filter="";else L.style.filter="alpha(opacity="+opacity+")";
}

starts=new Array();

function LayFade(LN,delay,step,start)
{if(starts[LN]==0) start=0;
 starts[LN]=start;
 if(step<0) opacity=100;else opacity=0;
 eval('isnew=(typeof('+LN+'_fader)=="undefined")?1:0');
 if(isnew) eval( LN + '_fader=new Fader("' + LN + '_fader",LN,delay,step,opacity)' );
 else{
      eval (LN+'_fader.step=step;'+LN+'_fader.delay=delay;');
     }
 eval ("if(typeof("+LN+"tHandle)!='undefined') clearTimeout("+LN+"tHandle)");
 if(start) eval (LN+'tHandle=setTimeout(LN+"_fader.Fade()",start)');
 else {eval (LN+"_fader.Fade();");starts[LN]=1;}
}

var topLayer=0,nexLayer=1;

function SlideShow(LN,slDelay,slMaxIdx)
{
 if(topLayer)
   {L=eL(LN+topLayer);LaySetZIndex(L,100);
    LayFade(LN+topLayer,10,-100,1100);
   } 
 L=eL(LN+nexLayer);LaySetZIndex(L,110);
 LayFade(LN+nexLayer,5,20,10);
 topLayer=nexLayer;nexLayer++;
 if(nexLayer>slMaxIdx) nexLayer=1;
 setTimeout('SlideShow("'+LN+'",'+slDelay+','+slMaxIdx+')',slDelay);
}


function LayMoveToMouse(LN,center)
{ var m=10;
  L=eL(LN);
  Win(LN);
  if(center){wx=mouseX-winW/2;wy=mouseY-winH/4;} else{wx=mouseX-4;wy=mouseY-4;}
  if(wx+winW>bodyW) wx=bodyW-winW-m;
  if(wy+winH>bodyH) wy=bodyH-winH-m;
  if(wx<m) wx=m;
  if(wy<m) wy=m;
  LayMove(LN,wx,wy)}

function LayMove(LN,x,y)
{ L=eL(LN);
  Win(LN);
  L.style['left']=x+'px';
  L.style['top']=y+'px';
}

function WindowSize()
{
 if(typeof(window.innerWidth)=='number')
   {this.w=window.innerWidth;
    this.h=window.innerHeight;
   } 
 else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
   {this.w=document.documentElement.clientWidth;
    this.h=document.documentElement.clientHeight;
   }
 else if(document.body && (document.body.clientWidth || document.body.clientHeight))
   {this.w=document.body.clientWidth;
    this.h=document.body.clientHeight;
   }
 if(typeof(window.pageYOffset)=='number')
  {this.yd=window.pageYOffset;
   this.xd=window.pageXOffset;
  }
 else if(document.body && (document.body.scrollLeft || document.body.scrollTop))
  {this.yd=document.body.scrollTop;
   this.xd=document.body.scrollLeft;
  }
 else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop))
  {this.yd=document.documentElement.scrollTop;
   this.xd=document.documentElement.scrollLeft;
  }
}


// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

mStat =new Array();

function MenuON(LN)
{
// if(loaded)
 do
 {if(!mStat[LN])
  {mStat[LN]=true
  L=eL(LN);
  LaySetZIndex(L,110);
  LayFade(LN,1,10,300);
  }
//  setTimeout('LayFade("'+LN+'",10,30)',200);
  LN=LN.substring(0,(LN.length)-2);
 }while(LN.charAt(LN.length-1)!='x');
}

function MenuOFF(LN,fast)
{
 // if(loaded)
 do
 {if(mStat[LN]); 
  {mStat[LN]=false;
  L=eL(LN);
  LaySetZIndex(L,100);
  if(fast) LayFade(LN,1,-200,0); else LayFade(LN,1,-100,300);
  
  }
//  setTimeout('LayFade("'+LN+'",10,-10)',200);
 LN=LN.substring(0,(LN.length)-2);
 }while(LN.charAt(LN.length-1)!='x');
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

function CursorMenuON(LN)
{
// if(loaded)
 do
 {L=eL(LN);
  LaySetZIndex(L,110);
  LayFade(LN,10,100,100);
  LayMoveToMouse(LN);
  LN=LN.substring(0,(LN.length)-2);
 }while(LN.charAt(LN.length-1)!='x');
}


function CursorMenuOFF(LN)
{
 // if(loaded)
 do
 {L=eL(LN);
  LaySetZIndex(L,100);
  LayFade(LN,1,-100,300);
  LN=LN.substring(0,(LN.length)-2);
 }while(LN.charAt(LN.length-1)!='x');
}

//-----------------------------------------------------------------------------------------------------------------------------

function ShowLayXY(LN,x,y,fast) {LayFade(LN,10,(fast?100:10),0);LayMove(LN,x,y);}
function ShowLayCenter(LN,fast) {LayFade(LN,10,(fast?100:10),0);win=new WindowSize();Win(LN);LayMove(LN,win.w/2-winW/2,win.h/2-winH/2);}
function ShowLayOnMouse(LN,fast) {LayFade(LN,10,(fast?100:10),0);LayMoveToMouse(LN);}
function ShowLayCenterOnMouse(LN,fast) {LayFade(LN,10,(fast?100:10),0);LayMoveToMouse(LN,1);}
function HideLay(LN,fast) {LayFade(LN,10,(fast?-100:-10),0);}


var clicked=false;

var dragged=false;
var drL;
var drLXd;
var drLYd;
winL='';winX=0;winY=0;winW=0;winH=0;bodyW=0;bodyH=0;

function Win(LN)
{
 winL=eL(LN);
 if(is.ns)
 {winX=winL.offsetLeft;
  winY=winL.offsetTop;
 }
 else
 {winX=winL.style.pixelLeft;
  winY=winL.style.pixelTop;
 }
 winW=winL.offsetWidth;
 winH=winL.offsetHeight;
 bodyW=document.body.offsetWidth;
 bodyH=document.body.offsetHeight;

 if(!is.ns)
  {if( document.documentElement && ( document.documentElement.scrollTop || document.documentElement.scrollLeft ) )
    {bodyW += document.documentElement.scrollLeft;
     bodyH += document.documentElement.scrollTop;
    } 
  else if( document.body && ( document.body.scrollTop || document.body.scrollLeft ) )
    {bodyW += document.body.scrollLeft;
     bodyH += document.body.scrollTop;
    }
  }


}


function Drag(LN)
{
 drL=eL(LN);
 if(is.ns)
 {drLXd=parseInt(drL.style['left'])-mouseX;
  drLYd=parseInt(drL.style['top']) -mouseY;
 }
 else
 {drLXd=drL.style.pixelLeft-mouseX;
  drLYd=drL.style.pixelTop-mouseY;
 }
 dragged=true;
}


function SetCellColor(cell, color)
{cell.style['background']=color;
}

function SetStyleClass(elem, cssClass)
{elem.className=cssClass;
}

//-----------------------------------------------------------------------------------------------------------------------------
// Akrylon Mouse Functions v 1.3
//-----------------------------------------------------------------------------------------------------------------------------

mouseHandled=1;
mPosInspected=0;
mouseX=0;
mouseY=0;
mouseB='L';
canMouseDown=0;
canMouseSel=1;
canMouseDrag=0;
insp="";

//if(mouseHandled) InitMouse();

function InitInspect() 
{
 if(mPosInspected)
   {if(!eL("LayInsp"))document.body.innerHTML+='<div id="LayInsp" style="position:absolute;z-index:10000;background:#FFFFFF;color:#000;font-weight:700;border:1px solid #000000;padding: 2px;"></div>';
    //LayOpacity("LayInsp",60);
   }
}

function InitMouse() 
{
 InitInspect();

 document.onselectstart=mouseSelect;
 document.onselect=mouseSelect;
 document.ondragstart=mouseSelect;

 document.oncontextmenu=DisableEvent;
 
 document.onmousemove = mouseMove;
 document.onmousedown = mouseDown;
 document.onmouseup   = mouseUp;
 document.onkeyup = keyUp;
 //document.onkeyup = keyPress;

 ////if(is.ns) window.captureEvents(Event.MOUSEUP | Event.MOUSEDOWN | Event.MOUSEMOVE);

}
  
function mouseMove(e) 
{
 if( e )
   {if( typeof( e.pageX ) == 'number' )
      {mouseX = e.pageX;
       mouseY = e.pageY;
      }
      else
      {mouseX = e.clientX;
       mouseY = e.clientY;
      }
   }
   else
   {e = window.event;
    mouseX = e.clientX;
    mouseY = e.clientY;
    if( document.documentElement && ( document.documentElement.scrollTop || document.documentElement.scrollLeft ) )
      {mouseX += document.documentElement.scrollLeft;
       mouseY += document.documentElement.scrollTop;
      } 
    else if( document.body && ( document.body.scrollTop || document.body.scrollLeft ) )
      {mouseX += document.body.scrollLeft;
       mouseY += document.body.scrollTop;
      }
   }

 ////if(is.ns && e.target!=document) routeEvent(e);
 //Ins();
 if(mPosInspected)
   {eL('LayInsp').style.display='block';
    if(is.ns){var evt=document.createEvent("MouseEvents");e.target.dispatchEvent(evt);var evE=e.target;}
    else var evE=event.srcElement;
    if(insp) {eval("inspected="+insp); inspected="<br>"+insp+": "+inspected;} else(inspected='');
    var nodes='';var pp=evE;
    for(var p=1;p<10;p++) {pp=pp.parentNode; if(isEmpty(pp.name) && isEmpty(pp.id) && isEmpty(pp.className)) nodes=pp.tagName+'->'+nodes;else break;}
    eL('LayInsp').innerHTML=mouseX+','+mouseY+'<br>'+pp.tagName+': '+pp.name+'<br>Id: '+pp.id+'<br>Class: '+pp.className+'<br>----------<br>'+nodes+'<br>----------<br>'+evE.tagName+': '+evE.name+'<br>Id: '+evE.id+'<br>Class: '+evE.className+inspected;
    eL('LayInsp').style['left']=mouseX+20+"px";
    eL('LayInsp').style['top']=mouseY+10+"px";
   }

 if(dragged)
   {/*if(mouseX+drLXd>0)*/ drL.style['left']=mouseX+drLXd+'px'; /*else drL.style['left']='0px';*/
    /*if(mouseY+drLYd>0)*/ drL.style['top']=mouseY+drLYd+'px'; /*else drL.style['top']='0px';*/
   }

 return true;
}


function mouseSelect()
{
 if(canMouseSel && !dragged) return true;return false;
}

function mouseDrag()
{
 if(canMouseDrag && !dragged) return true;return false;
}

dMouseX=0;dMouseY=0;uMouseX=0;uMouseY=0;

function mouseDown(e) 
{dMouseX=mouseX;dMouseY=mouseY;
 
 if(is.ns) 
   {//if(e.which>1) alert('Disabled');
    if(e.which>1)
      {return false;
       if(canMouseDown && !dragged) return true;
       else return false;
      }
    else return true;
   }
 else 
   {//if(event.button>1) alert('Disabled');
    if(event.button>1) 
      {if(canMouseDown && !dragged) 
         {event.returnValue=true;return true;}
       else {event.cancelBubble=true; event.returnValue=false;return false;}
      }
   }
}


function mouseUp(e)
{uMouseX=mouseX;uMouseY=mouseY;if(canImEd)canImEd=0;
 //CursorMenuOFF('Mx01');eL('Desktop').style['cursor']='default';
 dragId=0;dragIdP=0;mouseB='L';
 dragged=false;
 if(is.ie) if(event.button>1) {mouseB='R';event.srcElement.fireEvent("onClick");}
 if(is.ns) if(e.which>1) {mouseB='R';var evt=document.createEvent("MouseEvents");evt.initEvent("click", 1, 0);e.target.dispatchEvent(evt);}
 return true;
}


function DisableEvent()
{
 return false;
}

function keyUp(e)
{
  var key;
  if(e && e.which) key = e.which;
  else
    {if(!e && window.event) e=window.event;
     if(e && e.keyCode) key = e.keyCode;
    }
  if(key==46) {DelEdIm();}
  if(key==37) {MoveEdImByKey('back');}
  if(key==39) {MoveEdImByKey('next');}
  if(key==145) if(mPosInspected) mPosInspected=0;else {mPosInspected=1;InitInspect();}

  return true;
}

function keyPress(e) {
  var key0;
  if(e && e.which) {
    key0 = e.which;
  } else {
    if(!e && window.event) e=window.event;
    if(e && e.keyCode) {
      key0 = e.keyCode;
    }
  }
  var key = String.fromCharCode(key0);
  alert('You pressed '+key+', '+key0+', '+key.charCodeAt(0)+
    (e.keyCode?', keyCode: '+e.keyCode:'')+'!')

 return true;
}



//----------------------- AHA extension

function NavIsValid(){if(is.ie4 || (is.ie5 && !is.ie55) || is.op4 || is.op5 ||is.op6 || is.ns4) {eL('Desktop').innerHTML="<center><br><b>Váš prehliadač je príliš zastaralý na zobrazenie interaktívnej dynamickej plochy.<br>Požadovaný je IE verzie min. 5.5, Mozilla min.5.0 alebo Opera min. 7.0.<br>Stiahnite si, prosím, z internetu novšiu verziu a nainštalujte si ju.<br><br>Zatiaľ môžete AHA používať len ako vyhľadávač.<br><br>Ďakujeme za porozumenie.</b><br><br></center>";UpdateDesktopSize();loaded=1;return 0;} else return 1;}

function CountDivGo()
{
 var argv = CountDivGo.arguments;
 var argc = CountDivGo.arguments.length;
 var cntn = (argc > 0) ? argv[0] : 'Default';
 var path = (argc > 1) ? argv[1] : '';
 var uniIf= (argc > 2) ? argv[2] : 'C_Vis';
 if(uniIf) uniIf='&uniIf='+uniIf; else uniIf='';
 subReferrer='';
 Reklama='';RefId='';
 if(GetVar('Referrer')) subReferrer='SubReferrer='+escape(varVal)+'&';
 if(GetVar('RefId')) RefId='RefId='+varVal+'&';
 if(GetVar('Ad')) Reklama='Ad='+varVal+'&';
 if(GetVar('Reklama')) Reklama='Ad='+varVal+'&';
 eL('CountDiv').innerHTML='<iframe style="display:none" src="'+path+'access.php?CounterName='+cntn+uniIf+'&Redirect=no&'+Reklama+RefId+subReferrer+'Referrer='+escape(top.document.referrer)+'"></iframe>';
}

//--------------------- Catalog

function WriteToDiv(id,text) {if(eL) eL(id).innerHTML=text;}

mDef=new Array();
if(GetCookie('SessionId').match(/^O/))
{mDef['r']="";
 mDef['g']="";
} 
else
{mDef['r']="Editovať záznam::can=(1==1)|EdiRec()||Vystrihnúť záznam::can|CutRec()||Zmazať záznam::can|DelRec()";
 mDef['g']="Editovať skupinu::can=(1==1)|EdiGr()||Vystrihnúť skupinu::can|CutGr()||Vystrihnúť vnútro tejto skupiny::can|CutGrIn()||Zmazať skupinu::can|DelGr()||-||Vložiť vystrihnutý záznam sem::can|Paste()";
} 

function cMenu(m)
{
 if(mouseX!=dMouseX || mouseY!=dMouseY) return;
 var enabled;
 f="<table border=0 cellspacing=0 cellpadding=0><tr><td class=Ctl_MenuBorder><table border=0 cellspacing=0 cellpadding=0>";
 row=(mDef[m]+(m=='p' ? mDef['p'+pan[p[selIdP].typ]] : '')).split(/\|\|/g);
 for(i=0;i<row.length;i++)
    {if(row[i]=='-') f+="<tr class=Ctl_MenuRowX><td class=Ctl_MenuSeparator>.";
     else {var TitFun=row[i].split(/\|/);var TitCond=TitFun[0].split(/\:\:/);if(TitCond.length>1)eval("enabled="+TitCond[1]);else enabled=1;
           if(enabled) f+="<tr class=Ctl_MenuRowX onMouseOver=\"SetStyleClass(this, 'Ctl_MenuRowH');\" onMouseOut=\"SetStyleClass(this, 'Ctl_MenuRowX');\"><td class=Ctl_MenuCellX onMouseOver=\"SetStyleClass(this, 'Ctl_MenuCellH');\" onMouseOut=\"SetStyleClass(this, 'Ctl_MenuCellX');\" onClick=\"MenuOFF('Mx01',1);"+TitFun[1]+"\">"+TitCond[0];
           else f+="<tr class=Ctl_MenuRowDX onMouseOver=\"SetStyleClass(this, 'Ctl_MenuRowDH');\" onMouseOut=\"SetStyleClass(this, 'Ctl_MenuRowDX');\"><td class=Ctl_MenuCellX>"+TitCond[0];
          }
    }
 f+="</table></table>";
 WriteToDiv('Mx01',f);
 CursorMenuON('Mx01');
}



