function popup(url,width,height)
{
pref="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no";

pref+=",width="+width;
pref+=",height="+height;
ID=new Date();
ID=ID.getSeconds()+"_"+ID.getMinutes()+"_"+ID.getHours();
window.open(url,ID,pref);
}

function KeyPress(e, ButtonId)
{
var bt = document.getElementById(ButtonId);

  if (typeof bt == 'object')
  { 
    if(navigator.appName.indexOf("Netscape")>(-1))
    {
      if (e.keyCode == 13)
      {
      bt.click();
      return false;
      }
    }

    if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))
    {
      if (event.keyCode == 13)
      {
      bt.click();
      return false;
      }
    }
  }

}


function bold(id)
{
tr = document.selection.createRange();
selected = tr.text;

if (selected != "")
{
vs = '#$%^%$#';
tr.text = vs;
fb = id.value.split(vs);
tr.moveStart('character',-vs.length);
tr.text = selected;
before = fb[0];
after = fb[1];
}
else
{
before = id.value.substr(0, id.selectionStart);
selected = id.value.substr(id.selectionStart, (id.selectionEnd - id.selectionStart));
after = id.value.substr(id.selectionEnd, (id.value.length - id.selectionEnd));
}

id.value = before + "[RUBRIK(&king)(&" + selected + ")/]" + after;

"[RUBRIK(&king)(&" + selected + ")/]"
}

function ny_sida(url,width,height)
{
egenskaper="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no";

egenskaper+=",width="+width;
egenskaper+=",height="+height;
unik=new Date();
unik=unik.getSeconds()+"_"+unik.getMinutes()+"_"+unik.getHours();
window.open(url,unik,egenskaper);
}

function ny_noscroll(url,width,height)
{
egenskaper="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no";

egenskaper+=",width="+width;
egenskaper+=",height="+height;
unik=new Date();
unik=unik.getSeconds()+"_"+unik.getMinutes()+"_"+unik.getHours();
window.open(url,unik,egenskaper);
}

function VisaDolj(id, visibility)
{
obj = document.getElementsByTagName("font");
obj[id].style.visibility = visibility;
}
