var backElem
var mainElem
var oldInitdoc
var menuTab=new Array()
var minheight=700
var minwidth=775

function startvid(uri)
  {
  document.applets[0].setParam("url", uri);
  document.applets[0].restart();
  document.applets[0].doPlay();
  }

function place()
  {
  if(mainElem.currentStyle) mainElemStyle=mainElem.currentStyle
  else mainElemStyle=window.getComputedStyle(mainElem,null)
  if(!isNaN(parseInt(mainElemStyle.height))) docHeight=parseInt(mainElemStyle.height)+
     parseInt(mainElemStyle.top)+parseInt(mainElemStyle.paddingTop)+
     parseInt(mainElemStyle.paddingBottom)+30
  else docHeight=parseInt(mainElem.offsetHeight)+parseInt(mainElemStyle.top)+30
  if(window.innerHeight) ClientHeight=window.innerHeight
  else if(document.documentElement.clientHeight)  ClientHeight=document.documentElement.clientHeight
  else if(document.body.clientHeight) ClientHeight=document.body.clientHeight
  if(docHeight<minheight && ClientHeight<minheight) backElem.style.height=minheight+"px"
  else if(docHeight>ClientHeight) backElem.style.height=docHeight+"px"
  else backElem.style.height=(ClientHeight-4)+"px"
  /*if(typeof brMSIE !=undefined) -->IE5!*/
  if(brMSIE)
    {
    if(document.documentElement.clientWidth) ClientWidth=document.documentElement.clientWidth
    else if(document.body.clientWidth) ClientWidth=document.body.clientWidth
    if(ClientWidth<minwidth) valWidth=minwidth
    else valWidth=ClientWidth
    backElem.style.width=valWidth+"px"
    }
  }

function overMenu()
  {
  for(var i in menuTab)
    {
    if(menuTab[i].childObj)
      {
      if(menuTab[i].Obj==this) menuTab[i].childObj.style.visibility="visible"
      else menuTab[i].childObj.style.visibility="hidden"
      }
    }
  }

function scanMenu()
  {
  i=1
  while(1)
    {
    strname="m"+i
    mobj=document.getElementById(strname)
    if(mobj)
      {
      smobj=document.getElementById(strname+"s")
      mobj.onmouseover=overMenu
      mobj.onfocus=overMenu
      if(smobj) smobj.style.visibility="hidden"
      //menuTab.push({Obj:mobj,childObj:smobj}) !ie5!
      menuTab[i-1]={Obj:mobj,childObj:smobj}
      i++
      }
    else break
    }
  }

function initdoc()
  {
  backElem=document.getElementById("imgback")
  mainElem=document.getElementById("main")
  backElem.style.visibility="visible"
  scanMenu()
  if(oldInitdoc) oldInitdoc()
  if(document.all)
    {
    if(document.body.onresize!=place) oldResize=document.body.onresize
    document.body.onresize=place
    }
  else
    {
    if(window.onresize!=place) oldResize=window.onresize
    window.onresize=place
    }
  place()
  }

if(window.onload) oldInitdoc=window.onload
window.onload=initdoc
