// Thumbnail Script
// (c) RJHM van den Bergh/comweb.nl, 2001
// support@comweb.nl
//
// This script opens a enlarge picture of a thumbnail.
// With the onUnload you can close the enlarged thumbnail when the user leaves the page.
//

var popupHandle;

function popup(picUrlString, windowWidth, windowHeight)
{

  // Always close the old one, so only one at a time is open
  if(popupHandle || popupHandle!=null)
  {
    if (!popupHandle.closed) popupHandle.close();
  }
  popupHandle=null;

  // create a feature string for the popup
  var x=(screen.width-windowWidth)/2
  var y=(screen.height-windowHeight)/2
  var featureString = "toolbar=no,scrollbars=no,resizable=no"
  featureString = ',left='+x + ',top='+y
  featureString += ',width='+windowWidth+',height='+windowHeight

  // html content of the popup
  var htmlString = "<html><head><title>Click to close.</title><link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\"> </head>"
  htmlString += "<body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0>"
  htmlString += "<span style=\"float: right;\" class=\"body\">"
  htmlString += "<A HREF=\"javascript:window.close();\" title=\"Close.\" >"
  htmlString += "Click here to close the window</A></span>"
  htmlString += "<div id=\"farrier\" style=\"background-color:#ffffff; padding: 15px;\">"
  htmlString += "<br><br><strong>Marty Johnson</strong><br>"
  htmlString += "Cell 512-484-2586<br>"
  htmlString += "Email: <a href=\"mailto:info@surefootedhorse.com\">info@surefootedhorse.com</a><br><br>"
  htmlString += "Services include farrier work and horse training.<br><br>"
  htmlString += "<em>Marty knows horses and isn&#8217;t intimidated by any challenge.</em>"
  htmlString += "</div>"
  htmlString += "<div id=\"feed\" style=\"background-color:#ffffff; padding: 15px;\">"
  htmlString += "<br><br><strong>Our Feed & Tack Stores</strong><br><br>"
  htmlString += "<strong>Callahan's General Store</strong><br>"
  htmlString += "501 Bastrop Hwy<br>"
  htmlString += "Austin, TX 78741<br>"
  htmlString += "512-385-3452 or 800-950-8602<br><br>"
  htmlString += "This is a true general store. It is a FUN place to browse, and the list of what they carry would be 100 pages long."
  htmlString += "<br><br><strong>Diamond Lazy S (DLS) Feed</strong><br>"
  htmlString += "13030 W Highway 290<br>"
  htmlString += "Austin, TX 78737<br>"
  htmlString += "512-288-5025<br><br>"
  htmlString += "Horse feed, tack and more, provided by very friendly people. If they don't have it, they will try to order it for you."
  htmlString += "<br><br><strong>Our Hay</strong><br><br>"
  htmlString += "<strong>8x8 Fence & Custom Baling</strong><br>"
  htmlString += "Dale, TX<br>"
  htmlString += "512-398-1979<br><br>"
  htmlString += "Horse quality hay in square and round bales, tested and barn stored. Delivery available and excellent customer service."
  htmlString += "</div>"
  htmlString += "</body></html>"

  popupHandle = window.open("" ,"popup",featureString)
  popupHandle = window.open("" ,"popup")
  popupHandle.document.clear();
  popupHandle.document.writeln(htmlString);
  popupHandle.focus();
  popupHandle.document.close(); // should trigger the picture loading.
  return popupHandle;

}
function popup2(picUrlString, windowWidth, windowHeight)
{

  // Always close the old one, so only one at a time is open
  if(popupHandle || popupHandle!=null)
  {
    if (!popupHandle.closed) popupHandle.close();
  }
  popupHandle=null;

  // create a feature string for the popup
  var x=(screen.width-windowWidth)/2
  var y=(screen.height-windowHeight)/2
  var featureString = "toolbar=no,scrollbars=no,resizable=yes"
  featureString = ',left='+x + ',top='+y
  featureString += ',width=260,height=400'

  // html content of the popup
  var htmlString = "<html><head><title>Click to close.</title><link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\"> </head>"
  htmlString += "<body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0>"
  htmlString += "<span style=\"float: right;\" class=\"body\">"
  htmlString += "<A HREF=\"javascript:window.close();\" title=\"Close.\" >"
  htmlString += "Click here to close the window</A></span>"
  htmlString += "<div id=\"feed\" style=\"background-color:#ffffff; padding: 15px;\">"
  htmlString += "<br><br><strong>Our Feed & Tack Stores</strong><br><br>"
  htmlString += "<strong>Callahan's General Store</strong><br>"
  htmlString += "501 Bastrop Hwy<br>"
  htmlString += "Austin, TX 78741<br>"
  htmlString += "512-385-3452 or 800-950-8602<br><br>"
  htmlString += "<em>This is a true general store. It is a FUN place to browse, and the list of what they carry would be 100 pages long.</em>"
  htmlString += "<br><br><strong>Diamond Lazy S (DLS) Feed</strong><br>"
  htmlString += "13030 W Highway 290<br>"
  htmlString += "Austin, TX 78737<br>"
  htmlString += "512-288-5025<br><br>"
  htmlString += "<em>Horse feed, tack and more, provided by very friendly people. If they don't have it, they will try to order it for you.</em>"
  htmlString += "<br><br><strong>Our Hay</strong><br><br>"
  htmlString += "<strong>8x8 Fence & Custom Baling</strong><br>"
  htmlString += "Dale, TX<br>"
  htmlString += "512-398-1979<br><br>"
  htmlString += "<em>Horse quality hay in square and round bales, tested and barn stored. Delivery available and excellent customer service.</em>"
  htmlString += "</div>"
  htmlString += "</body></html>"
  popupHandle = window.open("" ,"popup",featureString)
  popupHandle = window.open("" ,"popup")
  popupHandle.document.clear();
  popupHandle.document.writeln(htmlString);
  popupHandle.focus();
  popupHandle.document.close(); // should trigger the picture loading.
  return popupHandle;

}
function winclose()
{
  if (window.popupHandle!=null && !window.popupHandle.closed)
  {
    window.popupHandle.close();
  }
}

function doNothing(){} // does nothing but required by JavaScript in this case