function calcTop(x_ele)
 {
  var x_ret=0;
  var oParent=x_ele.offsetParent;
  if(oParent==null)
   return(0)
  else
   x_ret=x_ele.offsetTop+calcTop(oParent);
  return(x_ret);
 }

function calcLeft(x_ele)
 {
  var x_ret=0;
  var oParent=x_ele.offsetParent;
  if(oParent==null)
   return(0)
  else
   x_ret=x_ele.offsetLeft+calcLeft(oParent);
  return(x_ret);
 }

function passText(selname,str,v)
 {
  var s;
  var d;
  var s2;
  var s3;
  var pos;
  var mySel;
  var i;
  var dupl;
  var isIE;
  isIE=eval('document.all')!=null;
  dupl=0;
  s3=0;
  if(parent.frames['areas'].document.forms.length==0)
   {
    parent.frames['bottom'].document.myform.ie5bugrefreshavoid1.value=selname;
    parent.frames['bottom'].document.myform.ie5bugrefreshavoid2.value=str;
    parent.frames['bottom'].document.myform.ie5bugrefreshavoid3.value=v;
    parent.frames['areas'].document.location.href=parent.frames['bottom'].document.myform.lastsearchmode.value;
    return(null);
   }

  if(eval('parent.frames["areas"].document.forms.form2')!=null)
   {
    s=eval("parent.frames['areas'].document.forms.form2."+selname+"select");
    s.value=v;
    parent.frames['areas'].document.forms.form2.submit();
    return(null);
   }

  for(i=0;i<parent.frames['areas'].document.forms.length;i++)
   if(parent.frames['areas'].document.forms[i].name=='yourform')
    s3=1;
  if(!s3)
   parent.frames['areas'].document.location.href='areas.htm';
  if(navigator.userAgent.indexOf('Opera')==-1)
   parent.frames['areas'].document.location.hash=selname+'anchor'
  else
   {
    d=parent.frames['areas'].document;
    s=d.all.tags('div');
    s2=selname+'div';
    for(i=0;i<s.length;i++)
     {
      if(s[i].id==s2)
       {
        parent.frames['areas'].scroll(calcLeft(s[i]),calcTop(s[i]));
        break;
       }
     }
   }

  mySel=eval('parent.frames["areas"].document.yourform.'+selname+'select');
  for(i=0;(i<mySel.options.length)&(dupl==0);i++)
   if(mySel.options[i].value==v)
    dupl=-1;
  if(!dupl)
   {
    for(pos=0;pos<mySel.options.length;pos++)
     mySel.options[pos].selected=false;
    if((mySel.options.length==1)&(mySel.options[0].value=='empty'))
     {
      if(isIE)
       {
        mySel.options[0].value=v;
        mySel.options[0].text=unescape(str);
       }
      else
       mySel.options[0]=new Option(unescape(str),v);
     }
    else
     {
      if(isIE)
       {
        mySel.options.length=mySel.options.length+1;
        mySel.options[mySel.options.length-1].text=unescape(str);
        mySel.options[mySel.options.length-1].value=v;
       }
      else
       mySel.options[mySel.options.length]=new Option(unescape(str),v);
     };
   };
 }

function fixie5bugrefresh()
 {
  if(parent.frames['bottom'].document.myform.invisiblesearch.value!='off')
   {
    parent.frames['bottom'].document.myform.lastsearchmode.value=parent.frames['bottom'].document.myform.searchmodebackup.value;
    parent.frames['bottom'].document.myform.invisiblesearch.value='off'
   }
  else
   parent.frames['bottom'].document.myform.lastsearchmode.value=document.location.href;
  if(parent.frames['bottom'].document.myform.ie5bugrefreshavoid1.value!='')
   {
    passText(
             parent.frames['bottom'].document.myform.ie5bugrefreshavoid1.value,
             parent.frames['bottom'].document.myform.ie5bugrefreshavoid2.value,
             parent.frames['bottom'].document.myform.ie5bugrefreshavoid3.value
            );
    parent.frames['bottom'].document.myform.ie5bugrefreshavoid1.value='';
   }
 }

function InitMute(s)
 {
  if(parent.frames.bottom.document.myform.invisiblesearch.value=='off')
   if(parent.frames.bottom.document.myform.lastsearchmode.value.indexOf('areasmute.htm')==-1)
    parent.frames.bottom.document.myform.searchmodebackup.value=parent.frames.bottom.document.myform.lastsearchmode.value;
  parent.frames.bottom.document.myform.invisiblesearch.value=s;
  parent.frames.areas.document.location.href='areasmute.htm';
 }

function GetMainUrl()
 {
  var
   p,Path;
  Path=document.location.href;
  p=Path.lastIndexOf('/');
  if(p>-1)
   {
    Path=Path.substring(0,p+1);
   };
  parent.frames['bottom'].document.forms.myform.url.value=Path;
 }

function CheckRegInFrames()
 {
  var
   s,w;
  if((eval('parent.frames["menu"]')==null)&(eval('parent.frames["areas"]')==null))
   {
    if(eval('document.layers'))
     {
      document.layers['TopLinks'].visibility='hide';
      document.layers['nnBottomButton'].visibility='hide';
     }
    else
     {
      document.getElementById('TopLinks').style.display='none';
      document.getElementById('BottomButton').style.display='none';
     };
   };
 }

function DoMuteSearch()
 {
  parent.frames.content.document.location.href=parent.frames.bottom.document.myform.invisiblesearch.value;
  fixie5bugrefresh();
 }