function LoadNewWin(theURL, theType)
  {
    if (theType==0)
      {	
	window.open(theURL, target="basefrm")
      }
    else
      if(theType==2)
        ShowPic(theURL)
      else
      { 
	if(theURL.slice(0,4)=="http")
	  WinSrc=theURL
	else
	  if(document.URL.slice(document.URL.length-1,document.URL.length)=="l")	
	    WinSrc=new String(document.URL.slice(0, document.URL.length-document.title.length-5).replace(/%20/g," ")+theURL.replace("/","\\"))
	  else
	    WinSrc=new String(document.URL.slice(0, document.URL.length-document.title.length-4).replace(/%20/g," ")+theURL.replace("/","\\"))
	if(theType==1)
	  NewWin=window.open('','', 'resizable,menubar,height='+.84*screen.height+',width='+.9*screen.width+',left='+.05*screen.width+',top='+.025*screen.height)
	else
	  NewWin=window.open('','', 'resizable,height='+.84*screen.height+',width='+.9*screen.width+',left='+.05*screen.width+',top='+.025*screen.height)

	NewWin.document.write('<iframe src="'+WinSrc+'" width="100%" height="100%"></iframe>')
	NewWin.document.title=document.title+" Viewer"
      }
  }

function ShowPic(ImageSource)
  {  
    BaseImage=new Image()
    BaseImage.src=ImageSource
    ZoomIn=new Image()
    ZoomOut=new Image()
    ZoomToFit=new Image()
    ZoomIn.src="../../../../Images/Zoom/ZoomIn.gif"
    ZoomOut.src="../../../../Images/Zoom/ZoomOut.gif"   
    ZoomToFit.src="../../../../Images/Zoom/ZoomToFit.gif"

    NewWin = window.open("", "", 'scrollbars,resizable,status,height='+.84*screen.height+',width='+.82*screen.width+',left='+.13*screen.width+',top='+.04*screen.height)   
    NewWin.document.write('<script>StatusArray=new Array("Zoom In 25%", "Zoom Out 25%")<\/script>')
    NewWin.document.write('<html><head><title>Picture Viewer</title></head>') 
    NewWin.document.write('<body><div id="div1" name="'+ImageSource+'" style="position:absolute; top: 20; left:20">')
    NewWin.document.write('<img onmouseover="self.status=StatusArray[0]; return true" onmouseout="self.status=div1.name; return true" onclick="{Image1.width *= 1.25}" src=', ZoomIn.src, ' style="margin: 5; float:left" width="30">')
    NewWin.document.write('<img onmouseover="self.status=StatusArray[1]; return true" onmouseout="self.status=div1.name; return true" onclick="{Image1.width *= .8}" src=', ZoomOut.src, ' style="margin: 5" width="30"></div>')
    NewWin.document.write('<img id="Image1" width="100%" src=', BaseImage.src, ' top="0" left="0"></body></html>')   
    NewWin.status=ImageSource

    var ScaleFactorH=NewWin.Image1.height/(.84*screen.height*.97)
    if(ScaleFactorH>1)
      {	NewWin.Image1.width/=ScaleFactorH  }   
  }
