/********************************************************************
 WN Archive JavaScript Functions - V 1.3a
 Author: The e.Lib, Inc. Team
 Site URL: http://www.rsarchive.org/include/js/
*********************************************************************/
var gotlayers = 0;
var ns4=(document.layers) ? true:false;
var ns6=(document.getElementById) ? true:false;
var ie4=(document.all) ? true:false;
var ie5=false;
if(ie4){
 if((navigator.userAgent.indexOf('MSIE 5')> 0) ||
    (navigator.userAgent.indexOf('MSIE 6')> 0)) {
  ie5=true;
 }
 if(ns6){
  ns6=false;
 }
}
ver4 = (ns4 || ie4 || ie5 || ns6) ? 1 : 0;

function openWindow(theURL,winName,features) {
  features="resizable=yes,"+features;
  window.open(theURL,winName,features);
}
function launchzoom() {
  w=screen.width*0.7
  h=screen.height*0.7
  w=780
  h=580
  open('http://www.rsarchive.org/Maps/zoommap/index.php?MAP=%2FMaps%2Fimages%2Feurope06a.png&SMALLMAP=%2FMaps%2Fimages%2Feurope06as.png&MAPNAME=Map+of+Europe+after+World+War+I&INFO=Map+of+Europe%0D%0ANational+borders+after+the+First+World+War&TTF_SIZE=25&TITLECOLOR=F0F0F0&INFOCOLOR=010101','zoommap','width='+w+',height='+h+',scrollbars=no,resizable=yes,toolbar=no,status=0,menubar=false')
}

function popUp(menuName,on) { }
function moveLayers() { }
function mouse_over(imageNum) {
  var name;
  name = "status"+imageNum;
  window.status = eval(name);
  return true;
}
function mouse_out(imageNum) {
  var name;
  window.status = " ";
  return true;
}

function showMenu() {
 self.name="sitemain"; // names current window as "main"
 var windowprops="toolbar=0,location=0,directories=0,status=0, " +
     "menubar=0,scrollbars=1,resizable=1,left=40,top=40,width=180,height=450";
 OpenWindow=window.open("http://www.rsarchive.org/menu.php","menu",windowprops);
}
function setVariables(){
 if(navigator.appName == "Netscape") {
  v=".top=";h=".left=";dS="document.";sD="";
  y="window.pageYOffset";x="window.pageXOffset";
  iW="window.innerWidth";iH="window.innerHeight"
 }else{
  h=".pixelLeft=";v=".pixelTop=";dS="";sD=".style";
  y="document.body.scrollTop";x="document.body.scrollLeft";
  iW="document.body.clientWidth";iH="document.body.clientHeight"
 }
 object="logo";
 checkLocationA()
}
movex=0,movey=0,xdiff=0,ydiff=0,ystart=0,xstart=0
function checkLocation(){
 //innerX=eval(iW)-185 // place to the right
 innerX=40 // controls the horizontal from the left side of the page
 //innerY=eval(iH)-25 // place at the bottom
 innerY=150 // controls the verticle from the top of the page
 if(document.layers){innerY-=10;innerX-=10}
 yy=eval(y);
 xx=eval(x);
 ydiff=ystart-yy;
 xdiff=xstart-xx;
 if((ydiff<(-1))||(ydiff>(1))) movey=Math.round(ydiff/10),ystart-=movey
 if((xdiff<(-1))||(xdiff>(1))) movex=Math.round(xdiff/10),xstart-=movex

 N=(document.layers)?1:0
 V=(N) ? 4:5
 if(V==4){
  eval(dS+object+sD+v+(ystart+innerY));
  eval(dS+object+sD+h+(xstart+innerX));
  //eval(dS + objectX + sD + v + y);
 }else{
  object=document.getElementById('logo')
  object.style.top=ystart+innerY-30
  object.style.left=xstart+innerX-30
 }
 setTimeout("checkLocation()",10)
}
function checkLocationA(){ystart=eval(y);xstart=eval(x);}
var statusCheck=null;
function open_rspwin(url) {
 if(statusCheck==null) {
 } else {
  mywin.close();
 }
 mywin = open(url,"rspress",'toolbar=1,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=626,height=414,top=20,left=20,screeny=20,screenx=20');
 statusCheck = 1;
}
var statusBDA=null;
function open_bdawin(url) {
 if(statusBDA==null) {
 } else {
  mywin.close();
 }
 mywin = open(url,"bda",'toolbar=1,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=760,height=560,top=20,left=20,screeny=20,screenx=20');
 statusBDA = 1;
}

//Specify affected tags. Add or remove from list:
var tgs=new Array('div','td','tr','p');
//Specify spectrum of different font sizes:
var szs=new Array('xx-small','x-small','small','medium','large','x-large','xx-large');
var startSz=2;
function ts(trgt,inc) {
 if(!document.getElementById) return
 var d=document,cEl=null,sz=startSz,i,j,cTags;
 sz+=inc;
 if(sz<0) sz=0;
 if(sz>6) sz=6;
 startSz=sz;
 if(!(cEl=d.getElementById(trgt))) cEl=d.getElementsByTagName(trgt)[0];
 cEl.style.fontSize=szs[sz];
 for(i=0; i<tgs.length; i++) {
  cTags=cEl.getElementsByTagName(tgs[i]);
  for(j=0; j<cTags.length; j++) cTags[j].style.fontSize=szs[sz];
 }
}
window.focus();

