// showimg.js
// copied from showimages.js (May 25/05 version) and lots removed.
// ** Sitemeter code added - could not be called.  May 20/07


var picwin = null;
// These are declared to clear up console warnings - doesn't affect results
var Tall
var Wide
var WinTall
var WinWide

function ShowPic(PicName, Wide, Tall) {
  WinTall = Tall + 150;
  WinWide = Wide + 110;

// check screen height, reduce WinTall is req'd
  if (screen.height<=WinTall) {
    WinTall =  screen.height-60;
  }

// if window doesn't exist, create it
  if (!picwin || picwin.closed)  {
picwin=window.open("","PictureWindow","menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,hotkeys=no,top=1,left=1,width="+WinWide+",height="+WinTall+"");
  }

//  resize existing window to fit wide or tall picture.
  picwin.resizeTo(WinWide,WinTall);

//output HTML to remote window
  picwin.document.open()
  picwin.document.write("<!doctype html public '-//W3C//DTD HTML 4.0 Transitional//EN'>")
  picwin.document.write("<html><head>")
  picwin.document.write("<meta http-equiv='imagetoolbar' content='no'>")
  picwin.document.write("<meta http-equiv='Pragma' content='no-cache'>")
  picwin.document.write("<meta http-equiv='expires' content='Tuesday, January 01, 2002 01:23:45 EST'>")
  picwin.document.write("<meta http-equiv='cache-control' content='no-cache'>")
  picwin.document.write("<meta http-equiv='cache-control' content='no-store'>")
  picwin.document.write("<link Rel='StyleSheet' href='style.css' type='text/css'>")
  picwin.document.write("<title>Photo ID#: "+PicName+"</title>")
  picwin.document.write("<style type='text/css'>")
  picwin.document.write("  a:link {Color : white}")
  picwin.document.write("  a:visited {Color : white}")
  picwin.document.write("  a:hover {Color: yellow}")
  picwin.document.write("  a:link img {Border-Style: none}")
  picwin.document.write("  a:visited img {Border-Style: none}")
  picwin.document.write("  a:hover img {Border-Style: none}")
  picwin.document.write("</style>")


  picwin.document.write("</Head>")

//  adding onblur='window.close()' to BODY will close window when focus changes
//  adding onkeydown='window.close()' to BODY will close window when any key is pressed
//  picwin.document.write("<Body bgcolor='black' Text='#dbdbdb' onblur='window.close()' onkeydown='window.close()' onload='window.focus()'>")
//  picwin.document.write("<Body bgcolor='black' Text='#dbdbdb'>")
//  This was an attempt at rolling up the picture window when focus was lost, 
//  nice but didn't work properly with IE6.
//  picwin.document.write("<Body bgcolor='black' Text='#dbdbdb' onkeydown='window.close()' onblur='smallsize()' onfocus='normalsize()'>")

  picwin.document.write("<Body bgcolor='black' Text='#dbdbdb' onkeydown='window.close()' onblur='window.close()'>")
  picwin.document.write("<basefont size = '3'><br>")
  picwin.document.write("<a name='top'></a>")
  picwin.document.write("<table border=5 align=center spacing=6 padding=3>")
  picwin.document.write("<tr><td>")
  // adding onmouseout='window.close()' closes window when mouse moves away
  picwin.document.write("<a href='#top' onmousedown='window.close()' onmouseover='window.focus()'>")
  picwin.document.write("<Img src='"+PicName+".jpg' width='"+Wide+"' height='"+Tall+"' Border=0 Title='Click here to close window' Alt='Click here to close window' Galleryimg='no'>")
  picwin.document.write("</a></td></tr></table>")
  picwin.document.write("<P Class='RegText' Align=Center><Strong>&copy; Bill Davis Photography</Strong><Br>");
  picwin.document.write("<P Class='RegText' Align=Center>Please keep in mind this image is reduced in quality for faster downloads.<br>");

  if (0 <= parseInt(document.cookie.indexOf('RCPCountMe=no',0))) {
    picwin.document.write("<font color='Gray'>SiteMeter disabled<\/font>");
     }
  else
    {
    picwin.document.write("<!-- sitemeter code for index.htm -->");
    picwin.document.write("<scr"+"ipt type='text/javascript' language='JavaScript'>var site='s37billdavis'</scr"+"ipt>");
    picwin.document.write("<scr"+"ipt type='text/javascript' language='JavaScript1.2' src='http://s37.sitemeter.com/js/counter.js?site=s37billdavis'>");
    picwin.document.write("</scr"+"ipt>");
    picwin.document.write("<noscr"+"ipt>");
    picwin.document.write("<a class='LtBglink' href='http://s37.sitemeter.com/stats.asp?site=s37billdavis' target='_blank'>");
    picwin.document.write("<img src='http://s37.sitemeter.com/stats.asp?site=s37billdavis' alt='Site Meter' border=0></a>");
    picwin.document.write("</noscr"+"ipt>");
    picwin.document.write("<!-- Copyright (c)2006 Site Meter -->");
    }

  picwin.document.write("</Body></Html>")
  picwin.document.close()
// make it the active window
  picwin.focus()
}


function CleanUp() {
// Microsoft Explorer was generating errors without this checking
  if (picwin > "") {
    picwin.close();
//  paypalw.close();
  }
}

