// poptofront 0.1 - pop this window to front
// developed by Stuart Udall stu@cyberdelix.net
function poptofront() {
 window.focus();
}

// showplaceholder 0.1 - display placeholder message
// developed by Stuart Udall stu@cyberdelix.net
function showplaceholder() {
 document.write('<font color=white>[placeholder for ' + document.location + ']</font>');
}

// safemailto 0.3 - generate email address - antispam measure
// developed by Stuart Udall stu@cyberdelix.net (based on source from authors unknown)
function safemailto(email1, email2, linktext) {
 if (linktext) { // do nothing
  } else {
  linktext = email1 + '@' + email2;
 }
 document.write("<a h" + "ref=" + "mail" + "to:" + email1 + "@" + email2 + ">" + linktext + "</a>");
}

// safeformto 0.1 - generate recipient line for formmail - antispam measure
// developed by Stuart Udall stu@cyberdelix.net (based on source from authors unknown)
function safeformto(email1, email2) {
 document.write("<INPUT type=hidden NAME=recipient VALUE=" + email1 + "@" + email2 + ">");
}

// writeimgdata 0.2 - open popup and write image data directly into it
// ensure to call with the parameters populated - there's no error checking! :)
// developed by Stuart Udall stu@cyberdelix.net
function writeimgdata(contentURL, width, height, title, caption, status) {
 var defaulttitle="shelleyrichmond.com";
 var imgwin = window.open('about:blank','','width=' + width + ',height=' + height);
 // set the title to appear if none is supplied
 if (!title) {
  title=defaulttitle;
 }
 imgwin.document.open('text/html');
 imgwin.document.write('<HTML><HEAD><TITLE>' + title + '<\/TITLE><link rel="stylesheet" href="../global.css" type="text/css"><\/HEAD>');
 imgwin.document.write('<body bgcolor=black text=white vlink=black link=black alink=black leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0 marginwidth=0 marginheight=0>');
 imgwin.document.write('<table border=0 cellpadding=0 cellspacing=0 width=100%>');
 imgwin.document.write('<tr><td height=20 width=20>&nbsp;</td><td>&nbsp;</td><td height=20 width=20>&nbsp;</td>');
 imgwin.document.write('<tr><td>&nbsp;</td><td valign=top align=center>');
 imgwin.document.write('<a href=# onClick=window.self.close(); onFocus="if(this.blur)this.blur()"><img src=' + contentURL + ' class=popuppicborder alt=" click to close " border=0 hspace=0 vspace=0></a>');
 imgwin.document.write('</td><td>&nbsp;</td></tr>');
 imgwin.document.write('<tr><td>&nbsp;</td><td><!-- start of text area --><br>');
 imgwin.document.write('<table border=0 cellpadding=2 cellspacing=0 width=100%>');
 imgwin.document.write('<tr><td valign=top align=left>');
 if (caption) {
  imgwin.document.write('<div class=imgholdtextbig><b>' + caption + '</b></div>');
 }
 imgwin.document.write('</td><td valign=top align=right class=pagenote>');
 imgwin.document.write('<a href=# onClick=window.self.close(); onFocus="if(this.blur)this.blur()"><img src=images/b_close.jpg alt=" click to close " border=0 hspace=0 vspace=0></a>');

// insert status
 imgwin.document.write('<tr><td valign=top align=left>');
 if (status) {
  imgwin.document.write('<div class=imgholdtext>' + status + '</div>');
 }

// insert buynow button
 imgwin.document.write('</td><td valign=top align=right class=imgholdtext><p>');
 if (status) {
  if (status.indexOf('for sale') == 0) {
   // status string must start with "for sale" (with no quotes) to trigger the shop button
   imgwin.document.write('<a href=# onclick="window.opener.location.replace(\'shop.php\');window.self.close();"><img src=images/b_shop.jpg alt=" click to visit the shop " border=0 hspace=0 vspace=0></a>');
  }
 }

 imgwin.document.write('</td></tr></table><!-- end of text area -->');
 imgwin.document.write('</td><td>&nbsp;</td></tr></table>');
 imgwin.document.write('</BODY></HTML>');
 imgwin.document.close();
}

// writeimgdata 0.1 - write imagehold data into formfields (for use by imghold)
// ensure to call with the parameters populated - there's no error checking! :)
// developed by Stuart Udall stu@cyberdelix.net
function oldwriteimgdata(contentURL, width, height, title, caption, status) {
 document.imghold.contentURL.value=contentURL;
 document.imghold.title.value=title;
 document.imghold.caption.value=caption;
 document.imghold.status.value=status;
 window.open('imghold.htm','','width=' + width + ',height=' + height);
}

// rollover support script
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

// rollover support script
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

// rollover support script
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

// rollover support script
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
