/* sendEmail - send link to selected page via email */
function sendEmail() {
    var page1;
    var page2;
    var page3;
    var page4;
    page1 = document.location.pathname;
    page2 = page1.length;
    page3 = page1.indexOf("/");
    page4 = page1.substr(page3+1,page2-page3);
    target = "emailpage.asp?page=" + page4
    location=target;
}
/* imgres - create appropriate html img tag based on screen resolution */
function imgres(mode,imgna,imgno,imgcl,imgalt,imghhgt,imghwdt,imghwin,imgmhgt,imgmwdt,imgmwin)
{ 
     var sres = "res1024"
     var pfx = "hi_"
     var imgreswn = imghwin
     var imgreswd = imghwdt
     var imgresht = imghhgt
  if ((screen.width == 640) && (screen.height == 480) || (screen.width == 800) && (screen.height == 600))  
    {
     var sres = "res800";
     var pfx = "med_";
     var imgreswn = imgmwin;
     var imgreswd = imgmwdt;
     var imgresht = imgmhgt;
    }
  if (mode == '5') 
    {
     document.writeln("<A CLASS=\"imgtbl\" HREF=\"#\" onClick=\"NewWindow(\'enlarge.asp\?pic=" + sres + '/' + pfx + 'large_' + imgna + "\&hght=" + imgresht + "\',\'BenvilleAndMarsh\',\'" + imgreswd + "\',\'" + imgreswn + "\','no')\"");
     document.writeln("onMouseOver=\"window.status=\'" + imgalt + "\'; return true\"");
     document.writeln("onMouseOut=\"window.status=\'Benville & Marsh Ltd - Electrical Contractors and Building Services Engineers\'; return true\">");
     document.writeln("<img border='0' alt='" + imgalt + "' class='" + imgcl + "' src='images/" + sres + '/' + pfx + imgna + "'></A>");
    }
  else if (mode == '4')
    {
     document.write("<img border='0' alt='" + imgalt + "' class='" + imgcl + "' src='images/" + sres + '/' + pfx + imgna + "'>");
    }
  else if (mode == '3')
    {
     document.write("<img border='0' alt='" + imgalt + "' class='" + imgcl + "' src='../images/" + sres + '/' + pfx + imgna + "'>");
    }
  else if (mode == '2')
    {
     document.write("<img alt='" + imgalt + "' class='" + imgcl + "' src='../images/" + sres + '/' + pfx + imgna + "'>");
    }
  else if (mode == '1')
    {
     document.write("<img class='" + imgcl + "' style='filter:blendTrans(duration=3)' name='slide" + imgno + "' align='center' src='images/" + sres + '/' + pfx + imgna + "'>");
    }
  else 
    { 
     document.write("<img alt='" + imgalt + "' class='" + imgcl + "' src='images/" + sres + '/' + pfx + imgna + "'>");
    }
}