
var maxch = 10;
var currch = -1;
var htimer = null;
var imgList = new Array;

function widthclick(AImg,d)
{if (nvimgOn(AImg)==false) {return false};
 if (parent!=null && parent.frames['main']!=null && parent.frames['main'].sa!=null)
{ var tg = parent.frames['main'].sa;
 x = tg.style.width;
 y = parseInt( x.substring( 0, x.length-2 ) );
 if (d==0)
  { y=600}
  else { y += d;}
 tg.style.width = y;
 setCookie( "tabw", y );
}}

function setImgSrc(AImg, ASrc)
{ var l = AImg.src.length-ASrc.length;
 if ((nvimgOn(AImg)==true) && (ASrc.lastIndexOf('-.gif')<0)) {return false}
 else { if (l<0 || AImg.src.substr(l)!=ASrc) {AImg.src=ASrc};}
}

function updatenav()
{ var tg = parent.frames['main'];
  var imgs = ['../files/nvfirst.gif','../files/nvprev.gif','../files/nvnext.gif','../files/nvlast.gif'
  ,'../files/nvtightly.gif','../files/nvbrowser.gif','../files/nvwide.gif'];

 if (tg==null || tg.chnum==null || tg.chnum==1){imgs[0]='../files/nvfirst-.gif';imgs[1]='../files/nvprev-.gif'}
 if (tg==null || tg.chnum==null || tg.chnum==maxch){imgs[3]='../files/nvlast-.gif';imgs[2]='../files/nvnext-.gif'}

 if (tg!=null && tg.chnum!=null){currch=tg.chnum} else {currch=-1};

 if (currch<0) {imgs[4]='../files/nvtightly-.gif'; imgs[5]='../files/nvbrowser-.gif'; imgs[6]='../files/nvwide-.gif'}

 setImgSrc(nvfirst,imgs[0]);
 setImgSrc(nvprev ,imgs[1]);
 setImgSrc(nvnext ,imgs[2]);
 setImgSrc(nvlast ,imgs[3]);

 setImgSrc(nvtightly ,imgs[4]);
 setImgSrc(nvbrowser ,imgs[5]);
 setImgSrc(nvwide ,imgs[6]);
}

function nvimgOn(aimg) {if (aimg.src.lastIndexOf('-.gif')<0) {return true} else {return false}}


function gonav(dest)
{ var tg = parent.frames['main'];
  var ndest = new String('000'+dest);
  var img = event.srcElement;
  if (img.src.lastIndexOf('-.gif')<0 && tg!=null) 	{ndest=ndest.substr(ndest.length-3);tg.location.href='../part-'+ndest+'/page.htm';}
}

function doonclose()
{ if (htimer){clearInterval(htimer)}}

function nvpreloadImages(VV)
{ for (var i in VV){var img;  img=new Image; img.src='nv'+VV[i]+'.gif' } img.name=VV[i]; imgList[i]=img  }

function nvimgOver(athis) { if (nvimgOn(athis)==true) {athis.src=athis.src.replace('.gif','h.gif')}}
function nvimgOut(athis)   {if (nvimgOn(athis)==true) {athis.src=athis.src.replace('h.gif','.gif')}}