var Images=(document.images)?true:false;
var Width=screen.availWidth;
var Path,BWidth,BHeight,LWidth,LHeight,CWidth,ThisDoc;

if (Width < 800) {
  Path='/src/640/';
  BHeight =  29;
  BWidth  = 120;
  CWidth  =  80;
  EWidth  =  90
  LHeight = 180;
  LWidth  = 490;
} else if (Width < 1024) {
  Path='/src/800/';
  BHeight =  36;
  BWidth  = 150;
  CWidth  = 100;
  EWidth  = 113
  LHeight = 225;
  LWidth  = 612;
} else if (Width < 1280) {
  Path='/src/1024/';
  BHeight =  46;
  BWidth  = 192;
  CWidth  = 128;
  EWidth  = 144
  LHeight = 288;
  LWidth  = 784;
} else if (Width < 1600) {
  Path='/src/1280/';
  BHeight =  58;
  BWidth  = 240;
  CWidth  = 160;
  EWidth  = 180
  LHeight = 360;
  LWidth  = 980;
} else {
  Path='/src/1600/';
  BHeight =  73;
  BWidth  = 300;
  CWidth  = 200;
  EWidth  = 225
  LHeight = 450;
  LWidth  =1225;
}

HWidth=BHeight;

if ((location.pathname == '/') || (location.pathname == '/index.html'))
  ThisDoc='home';
else {
  ThisDoc=location.pathname.substring(1,location.pathname.length-5);
  if ((ThisDoc.indexOf('/') >= 0) || (ThisDoc.indexOf('.') >= 0)) ThisDoc='an article';
}

if (Images) {
var
 Load=new Array();
 if (ThisDoc != 'home') Load['home']   = new LoadImage(Path+"home_over.gif",  Path+"home_on.gif");
 if (ThisDoc != 'adv') Load['adv']    = new LoadImage(Path+"adv_over.gif",   Path+"adv_on.gif");
 if (ThisDoc != 'list') Load['list']   = new LoadImage(Path+"list_over.gif",  Path+"list_on.gif");
 if (ThisDoc != 'links') Load['links']  = new LoadImage(Path+"links_over.gif", Path+"links_on.gif");
 if (ThisDoc != 'arc') Load['arc']    = new LoadImage(Path+"arc_over.gif",   Path+"arc_on.gif");
 if (ThisDoc != 'search') Load['search'] = new LoadImage(Path+"search_over.gif",Path+"search_on.gif");
 if (ThisDoc != 'about') Load['about']  = new LoadImage(Path+"about_over.gif", Path+"about_on.gif");
 if (ThisDoc != 'engl') Load['engl']   = new LoadImage(Path+"engl_over.gif",  Path+"engl_on.gif");
 Load['back1']  = new LoadImage(Path+"back_over.gif",  Path+"back_on.gif");
 Load['back2']  = new LoadImage(Path+"back_over.gif",  Path+"back_on.gif");
}

function LoadImage(ImgOver,ImgOff,Obj)
{
 if (Images) { 
  this.Obj=Obj;
  this.Over=new Image();
  this.Over.src=ImgOver;
  this.Off=new Image();
  this.Off.src=ImgOff; 
 }
}

function ReplaceOrig(Name)
{
 if (Images) document[Name].src=Load[Name].Over.src;
} 

function RestoreOrig(Name)
{
 if (Images) document[Name].src=Load[Name].Off.src;
}

function DrawButton(Addr,Name,Alt,Nick)
{
 if (!Nick) Nick=Name;
 if (ThisDoc != Name) document.write("<a href="+Addr+" OnMouseOver=\"ReplaceOrig('"+Nick+"')\" OnMouseOut=\"RestoreOrig('"+Nick+"')\">");
 if (ThisDoc != Name) document.write("<img name='"+Nick+"' border=0 width="+BWidth+" height="+BHeight+" src="+Path+Name+"_on.gif alt=\""+Alt+"\">");
 else document.write("<img name='"+Nick+"' border=0 width="+BWidth+" height="+BHeight+" src="+Path+Name+".gif alt=\""+Alt+"\">");
 if (ThisDoc != Name) document.write("</a>");
}