<!-- StereoViewPort version 2.0  -->
<!-- StereoViewPort is a trademark of Graphic Media Research, Cannon Falls, MN  -->
<!-- Copyright (c) 2001-2003 Monte J. Ramstad  -->
<!-- You may post this file on a web server to interact with your web pages. -->

///////Do not edit this file///////////////////////
var ie = false
var ie4 = false
var ns4 = false

var fac=1
var bordercolor=0
var width=0
var height=0
var sbor=0
var sborder=0
var srcwidth=0
var srcheight=0

var i=0
var fullw = 0
var mess = ""
var  wper=1
var  hper=1
var twid
var sw
var sh  
var tiwi
var tihe
var tzo
var sbg
var hpsL
var hpsR
var hoff
var voff

var tref1 = ""
var tref2 = ""


var psdir = ""
var tool0 = ""
var tool1 = ""
var tool2 = ""
var tool3 = ""
var tool4 = ""
var tool5 = ""

if (document.getElementById) {
  ie = true;
}
else 
if (document.layers) {
  ns4 = true;
}



function writeimages(gext) { 
  if (ie) {

    sstyle = 'position:absolute;visibility:visible;overflow:hidden;'
    tstyle='height:'+sh+';width:'+sw/2+';left:'+(hpsL+hoff)+';top:'+voff+';clip:rect(0 '+tzo*tiwi/2+' '+sh+' 0);'
    document.writeln('<div id="pair" STYLE="position:relative;left:0;top:0;width:'+twid+';height:'+sh+';background-color:'+sbg+';">')
    document.writeln('<div id="imageL" STYLE="'+sstyle+tstyle+'">')
    document.writeln(timage)
    document.writeln('</div>')
   
    tstyle = 'height:'+sh+';width:'+sw+';left:'+(hpsR+hoff-tzo*tiwi/2)+';top:'+voff+';clip:rect(0,'+tzo*tiwi+','+sh+','+tzo*tiwi/2+');'
    document.writeln('<div id="imageR" STYLE="'+sstyle+tstyle+'">')
    document.writeln(timage)
    document.writeln('</div>')
    document.writeln('</div>')
  }
  else
  if (ns4){
    document.writeln('<ilayer id="pair" left=0 top=0 width='+twid+' height='+sh+' bgColor='+sbg+' overflow=hiden; visibility=show>')

    document.writeln('<layer id="imageL" left='+(hpsL+hoff)+' top='+voff+'  width='+sw/2+' clip="0,0,'+tzo*tiwi/2+','+sh+'" visibility=show>')
    document.writeln(timage)
    document.writeln('</layer>')

    document.writeln('<layer id="imageR" left='+(hpsR+hoff-tzo*tiwi/2)+' top='+voff+' width='+sw/2+' clip="'+tzo*tiwi/2+',0,'+(tzo*tiwi)+','+sh+'" visibility=show>')
    document.writeln(timage)
    document.writeln('</layer>')
    document.writeln('</ilayer>')
  }
}
function dec(txt) {
  dataCount = 0;
  for (var c = 0; c < txt.length; c++)
    if (txt.charAt(c).indexOf("=") != -1) dataCount++;

  n0=0
  for ( it = 0; it < dataCount; it++)
  {
    txt=txt.substring(n0,txt.length);
    n1=txt.indexOf("=")
    if (n1 != -1) {
      n0=0
      for (jt=n1; jt>=0; jt--) {
        if ( txt.charAt(jt).indexOf(" ") != -1) if (n0==0) n0=jt
        if ( txt.charAt(jt).indexOf(",") != -1) if (n0==0) n0=jt
        if ( txt.charAt(jt).indexOf("<") != -1) if (n0==0) n0=jt
      } 
      itm=txt.substring(n0+1,n1)
      itm=itm.toLowerCase(0,itm.length)
      n0=n1+1
      if ( txt.charAt(n0).indexOf(" ") == -1) {
        if ( txt.charAt(n0).indexOf("\"") != -1) n0+=1
        txt=txt.substring(n0,txt.length)
        n1=0
        for (jt=0; jt<txt.length; jt++) {
          if (txt.charAt(jt).indexOf(" ") != -1) if (n1==0) n1=jt
          if (txt.charAt(jt).indexOf("\"") != -1) if (n1==0) n1=jt
          if (txt.charAt(jt).indexOf(",") != -1) if (n1==0) n1=jt
          if (txt.charAt(jt).indexOf(">") != -1) if (n1==0) n1=jt
        }
        if (n1!=0) {
	  if (txt.charAt(n1-1) == "%") {
            fac=fullw/100
            if ( itm == "height") fac*=0.75
            n1--
          }
          else 
            fac=1
          val = txt.substring(0,n1)
          if ( itm == "src") src=val
          else 
          if ( itm == "bordercolor") bordercolor=val
          else 
          if (istnum(val) ) {
            if ( itm == "width") width=fac*val
            if ( itm == "height") height=fac*val
            if ( itm == "border") sbor=fac*val
            if ( itm == "sborder") sborder=fac*val
            if ( itm == "srcwidth") srcwidth=1*val
            if ( itm == "srcheight") srcheight=1*val
          }
          n0=n1
        } 
      }
      itm=""
      if ( txt.charAt(n0).indexOf("\"") != -1) n0+=1
    }
  }
}
function istnum(inval) {
  if (inval=="") return false
  for (mt=0;mt<inval.length;mt++) {
    if (inval.charAt(mt) < "0") return false
    if (inval.charAt(mt) > "9") return false
  }
  return true
}
function sviewport(fext,jext,kext) {
  itext=fext
  if (kext) {
    ktext=kext
    tref1='<A HREF=javascript:newWindow("'+ktext+'")>'
    tref2='</A>'
  }
  else {
    ktext = ""
    tref1 = ""
    tref2 = ""
  }
  if (jext) {
    jtext=tref1+jext+tref2
  }
  else {
    jtext = ""
  }

  isgood = ( document.getElementById || document.layers )
  if (!isgood ) {
      document.write(fext)
  }
  else {
    sviewportx(fext)
  }
}
function sviewportx(fext) {
  i=i+1

  if (ie) fullw=document.body.offsetWidth-45
  else
  if (ns4) fullw=window.innerWidth-26

  if (fext.indexOf("<") != -1) 
    dec(fext.substring(fext.indexOf("<"),fext.length))

  mess=src
  wper=1
  hper=1

  if ( sborder<0) {
    if (ie) twid=document.body.offsetWidth-45
    else
    if (ns4) twid=window.innerWidth-26

    if (width > 0) sw=1*width
    else sw = 2*(0.5*screen.width-60)*wper
  }
  else {
    if (width > 0) {
      sw=1*width
      twid=sw+3*sborder
    }
    else {
      if (ie) twid=document.body.offsetWidth-45      
      else 
      if (ns4) twid=window.innerWidth-26
      sw = twid*wper-3*sborder
    }
  }

  if (height > 0) sh=1*height
  else {
    sh = (0.625*screen.width-160)*hper
  }

  if (srcwidth > 0) tiwi=srcwidth
  else tiwi=sw
  if (srcheight > 0) tihe=srcheight
  else tihe=sh

  if (tiwi>0) tzo=sw/tiwi
  if (tzo*tihe>sh) if (tihe>0) tzo=sh/tihe

    timage=tref1+
      '<img src="'+mess+'" width="'+tzo*tiwi+'" height="'+tzo*tihe+'" border="0">'+
      tref2
  //if (ktext) {
  //  timage='<A HREF=javascript:newWindow("'+ktext+'")>'+
  //  '<img src="'+mess+'" width="'+tzo*tiwi+'" height="'+tzo*tihe+'" border="0">'+
  //  '</A>'
  //}
  //else {
  //  timage='<img src="'+mess+'" width="'+tzo*tiwi+'" height="'+tzo*tihe+'" border="0">'
  //}

  sbg=document.bgColor
  if (bordercolor != -1) sbg = bordercolor
  if (document.showdata) 
    if (document.showdata.bgcolor) 
      sbg=document.showdata.bgcolor.value
 
  hpsL=(twid-sw)/3
  hpsR=2*hpsL+sw/2
  hoff=(sw-tzo*tiwi)/4
  voff=(sh-tzo*tihe)/2

  writeimages(mess)
  //document.writeln('<br>')   
  writetools(ktext)
  document.writeln('<br>') 
  document.writeln('<br>') 
}


function writetools(ktxt) {
  z=1;
  sbg=document.bgColor
  tool0 = ""
  tool1 = ""
  tool2 = ""
  tool3 = ""
  tool4 = ""
  tool5 = ""
  jtxt = jtext
  if (!jtxt) {
    //jtxt = ""
    psdir="data/"
    tool0='<A TITLE="Zoom" HREF="javascript:mo('+z+')"><img SRC="'+psdir+'zoom3.gif" ALT="Zoom" BORDER=0 HEIGHT=19 WIDTH=19 ></A>'
    tool1='<A TITLE="Swap" HREF="javascript:wap('+z+')"><img SRC="'+psdir+'swap3.gif" ALT="Swap" BORDER=0 HEIGHT=19 WIDTH=19 ></A>'
    tool2='<A TITLE="Scroll" HREF="javascript:drk1('+z+')"><img SRC="'+psdir+'left3.gif" ALT="Left" BORDER=0 HEIGHT=19 WIDTH=19 ></A>'
    tool3='<A TITLE="Scroll" HREF="javascript:drk2('+z+')"><img SRC="'+psdir+'right3.gif" ALT="Right" BORDER=0 HEIGHT=19 WIDTH=19 ></A>'
    tool4='<A TITLE="Scroll" HREF="javascript:drk3('+z+')"><img SRC="'+psdir+'up3.gif" ALT="Up" BORDER=0 HEIGHT=19 WIDTH=19 ></A>'
    tool5='<A TITLE="Scroll" HREF="javascript:drk4('+z+')"><img SRC="'+psdir+'down3.gif" ALT="Down" BORDER=0 HEIGHT=19 WIDTH=19 ></A>'
  }
  
  if (ie) {   
  
    sps=hpsL+10
    document.writeln('<div id="tools" style="position:relative;left:0;top:0;width:'+twid+';height:30;overflow:hidden;background-color:'+sbg+';visibility:visible">')
    shps=sps+5
    document.writeln('<div id="imo0" style="position:absolute;width:19;left:'+shps+';top:2;visibility:visible;">')
    document.writeln(tool0)    
    document.writeln('</div>') 
    shps=sps+25
    document.writeln('<div id="iwap0" style="position:absolute;width:19;left:'+shps+';top:2;visibility:visible;">')
    document.writeln(tool1)
    document.writeln('</div>') 
    shps=sps+65
    document.writeln('<div id="iscrollh0" style="position:absolute;width:75;left:'+shps+';top:2;visibility:hidden;">')
    document.writeln(tool2)
    document.writeln(tool3)
    document.writeln('</div>')    
    shps=sps+50
    document.writeln('<div id="isage0" style="position:absolute;width:150;left:'+shps+';top:2;visibility:show;">')
    document.writeln('<font size=+0><b>'+jtxt+'</b></font>')
    document.writeln('</div>')   
    shps=sps+120
    document.writeln('<div id="iscrollv0" style="position:absolute;width:75;left:'+shps+';top:2;visibility:hidden;">')
    document.writeln(tool4)
    document.writeln(tool5)
    document.writeln('</div>')

    sps=hpsR+10
    shps=sps+5
    document.writeln('<div id="imo1" style="position:absolute;width:19;left:'+shps+';top:2;visibility:visible;">')
    document.writeln(tool0)
    document.writeln('</div>') 
    shps=sps+25
    document.writeln('<div id="iwap1" style="position:absolute;width:19;left:'+shps+';top:2;visibility:visible;">')
    document.writeln(tool1)
    document.writeln('</div>') 
    shps=sps+65
    document.writeln('<div id="iscrollh1" style="position:absolute;width:75;left:'+shps+';top:2;visibility:hidden;">')
    document.writeln(tool2)
    document.writeln(tool3)
    document.writeln('</div>')    
    shps=sps+50
    document.writeln('<div id="isage1" style="position:absolute;width:150;left:'+shps+';top:2;visibility:show;">')
    document.writeln('<font size=+0><b>'+jtxt+'</b></font>')
    document.writeln('</div>')  
    shps=sps+120
    document.writeln('<div id="iscrollv1" style="position:absolute;width:75;left:'+shps+';top:2;visibility:hidden;">')
    document.writeln(tool4)
    document.writeln(tool5)
    document.writeln('</div>')
    document.writeln('</div>')
  }
  else
  if (ns4){
    sps=hpsL+10
    document.writeln('<ilayer id="tools" left=0 top=0 width='+twid+' height=30 bgColor='+sbg+' overflow=hiden visibility=show>')
    
    shps=sps+5
    document.writeln('<layer id="imo0" left='+shps+' top=2 width=19 visibility=show>')
    document.writeln(tool0)
    document.writeln('</layer>') 
    shps=sps+25
    document.writeln('<layer id="iwap0" left='+shps+' top=2 width=19 visibility=show>')
    document.writeln(tool1)
    document.writeln('</layer>')
    shps=sps+65
    document.writeln('<layer id="iscrollh0" left='+shps+' top=2 width=75  visibility=hide>')
    document.writeln(tool2)
    document.writeln(tool3)
    document.writeln('</layer>')  
    shps=sps+50
    document.writeln('<layer id="isage0" left='+shps+' top=2 width=150  visibility=show>')
    document.writeln('<font size=+0><b>'+jtxt+'</b></font>')
    document.writeln('</layer>')    
    shps=sps+120
    document.writeln('<layer id="iscrollv0" left='+shps+' top=2 width=75  visibility=hide>')
    document.writeln(tool4)
    document.writeln(tool5)
    document.writeln('</layer>')    
   
    sps=hpsR+10
    shps=sps+5
    document.writeln('<layer id="imo1" left='+shps+' top=2 width=19 visibility=show>')
    document.writeln(tool0)
    document.writeln('</layer>')  
    shps=sps+25
    document.writeln('<layer id="iwap1" left='+shps+' top=2 width=19 visibility=show>')
    document.writeln(tool1)
    document.writeln('</layer>') 
    shps=sps+65
    document.writeln('<layer id="iscrollh1" left='+shps+' top=2 width=75  visibility=hide>')
    document.writeln(tool2)
    document.writeln(tool3)
    document.writeln('</layer>')   
    shps=sps+50
    document.writeln('<layer id="isage1" left='+shps+' top=2 width=150  visibility=show>')
    document.writeln('<font size=+0><b>'+jtxt+'</b></font>')
    document.writeln('</layer>')  
    
    shps=sps+120 
    document.writeln('<layer id="iscrollv1" left='+shps+' top=2 width=75  visibility=hide>')
    document.writeln(tool4)
    document.writeln(tool5)
    document.writeln('</layer>')
    document.writeln('</ilayer>')    
    
  }

}
function newWindow(viewport) {
  wid = screen.width-8
  viewWin = window.open(viewport,'Viewport','width='+wid+',height='+screen.height+',top=0,left=0' )
  viewWin.focus()
}

