
// common

function WindowHeight() {
 if (window.innerHeight) return window.innerHeight;
 else if (document.body && document.body.clientHeight) return document.body.clientHeight;
 else return 500;
}

function WindowWidth() {
 if (window.innerWidth) return window.innerWidth;
 else if (document.body && document.body.clientWidth) return document.body.clientWidth;
 else return 500;
}

// Background image sizing


 function SetBgImage() {
return;

   Wscr = WindowWidth();
   Hscr = WindowHeight();

   a = imgh * Wscr / imgw;


   if (a < Hscr) {
     Annysi.style.width="";
     Annysi.style.height="100%";
   } else {
     Annysi.style.width="100%";
     Annysi.style.height="";
  }
}

function CreateBgImage(d) {
  d.write('<IMG name="Annysi" SRC="'+imgs+'" BORDER="0" STYLE=" margin: 0pt; padding: 0pt; position:absolute; z-index:-1; top:0;left:0">'); 
}  

// some color changes

  cR=15728640;
  xR=cR;
  cL=15;
  xL=cL;
  xTime=200;

 function MoveColor(c) {

   //if( !document.all ) return;

        t = document.all.tags("strong");
        n = t.length;
        if ( n == 0 ) exit;
        for (var i=1; i < n; ++i ) {
//          j = n-i-1;
          t[i-1].style.color = t[i].style.color;
//          t[j+1].style.color = t[j].style.color;
	}

     t[n-1].style.color = c.style.color;
 }

function ChangeColor() {
  xL= xL << 1;
  if ( xL >  16777215 ) xL=cL;
  xR= xR >> 4;
  if ( xR ==  0 ) xR=cR;
  //mgr = document.getElementById('mgr');
  mgr.style.color=xR + xL;
//  mgb.style.color=xR || xL;
//  ax.style.color=xR - xL;

  MoveColor(mgr);
  

  window.setTimeout("ChangeColor()",xTime);
}

// keep matching to styles

  hp =  12+4;
  hh1 = 24+4;
  hh2 = 18+4;

// services window hight (must be a value; opera doesn't understand "")

  tabh = 520;
  tabl = hh2;

function PreSetH() {
  mtab.style.pixelHeight=tabl;
}

// page functions

function DoUpdate() {
  h=WindowHeight()-(2*hp+hh1+24);
  if ( tdh.height != h ) tdh.height=h;
  PreSetH();
  SetBgImage();
}

function OnLoadAction() {
  //window.setTimeout("ChangeColor()",xTime);
  //window.mntab.style.pixelHeight=tabl;
  //DoUpdate();
  //window.onresize=DoUpdate;

}

function ShowTab(t) {
  t.style.pixelHeight=tabh;

  mtab.style.overflow='visible';

  tabh = 1400;
}



function HideTab(t) {
  
  t.style.pixelHeight=tabl;

  mtab.style.overflow='hidden';

}


