// this script is copyright Dorsetshire Limited 2003

var zyq = false;  // debug flag eg. for local testing
var pathToRoot = "../";  // default
var mainImg = "dorset1x.gif";  // default
var mainWidth = "100%";

function setPathToRoot(pth)
{
pathToRoot = pth;
}

function setWidth(wdth)
{
mainWidth = wdth;
}

function addHdr(nam,pic,w,h)
{
   var str=" ";
   var dotPos=0;

   str += "<table width='" + mainWidth + "' border=0 align='center'>";
   str += "<tr>";
   str += "<td width='205'><a href='" + pathToRoot + "index.html'><img src='" + pathToRoot; 
   str += "images/" + mainImg;
   str += "' width='145' height='20' align='left' border='0' alt='site home'></a></td>";
   str += "<td align=center><font color='#117711'><br><b>" + nam + "</b></font></td>";

   if ((pic != "") && (pic != 0)) {
     str += "<td width='205'><img src='" + pathToRoot + "images/icons/";
     str += pic;
     str += "' align='right'";
     if (w>0 && h>0) {
       str += " width='" + w + "' height='" + h + "'";
     }
     str += "></td>";
   } else {
     str += "<td width='205'><img src='" + pathToRoot + "images/dorset0.gif'></td>";
   }

   str += "</tr></table>";
   str += "<hr align='center' width='" + mainWidth + "'>";
   // alert(str);
   document.write(str);
}  // end addHdr



function addFtr(subject)
{
   var str=" ";
   var dotPos=0;

   str += "<hr align='center' width='" + mainWidth + "'>";
   str += "<table width='" + mainWidth + "' border='0' align='center'>";
   str += "<tr><td align='left'><a href='" + pathToRoot + "index.html'>";
   str += "<img src='" + pathToRoot + "images/homet.gif' border='0'></a></td>";
   str += "<td><center><font size='-1'>Please ";
   str += "<a href='http://www.dorsetshire.com/feedback.html";
   str += "'> send questions/comments/suggestions</A>";
   str += "</font></center></td><td align='right'>";
   str += "<font size=-2>Last Updated: ";
   str += document.lastModified;
   str += "</font></td></tr></table>";

   document.write(str);
}  // end addFtr


function openimg(imgurl,tit,w,h,wantclosebutton)
{
     var actualw = w+11;
     var actualh = h+11;
     var winid = Math.round(10000*Math.random());
     if (wantclosebutton>0) {
             actualh = actualh + 24;
     }
     winstring = "width="+actualw+",height="+actualh+",menubar=no,toolbar=no";
     newWin = window.open("",winid,winstring);
     newWin.document.open("text/html");
     with (newWin.document) {
         writeln("<head><title>",tit,"</title></head>");
         writeln("<script language='Javascript'>function closeme(){parent.close();}</script>");
         writeln("<body topmargin=1 leftmargin=1>");
         writeln("<table cellpadding='0' cellspacing='1'><tr><td>");
         writeln("<img src=\"",imgurl,"\"></td></tr>");
	if (wantclosebutton>0) {
             writeln("<tr><td><form><input type=image src='http://www.dorsetshire.com/images/close2.gif' onclick='closeme();'></form></td></tr>");
        }
         writeln("</table></body>");
         close();
     }
 return;
}


