// poptofront 0.1 - pop this window to front
// developed by Stuart Udall stu@cyberdelix.net
function poptofront() {
 window.focus();
}

// 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>");
}

// togglevisibility 0.1 - toggle the visibility state of any object
// ensure to call with the parameters populated - there's no error checking! :)
// developed by Stuart Udall stu@cyberdelix.net
function togglevisibility(elementID,state) {
 if (state) {
  document.getElementById(elementID).style.visibility = "visible";
 } else { 
  document.getElementById(elementID).style.visibility = "hidden";
 }
}

// browser detection script 2.4 --------------------------------------------
//  - the script redirects low-tech browsers to an error page - will redirect if browser is: IE 3.x or below; Opera 3; Netscape 3.x or below
// developed by Stuart Udall, stu@cyberdelix.net
function browsercheck() {

 // define vars
 var deniedurl = "lotekerr.html";
 var accessdenied = "false";
 var browsertype;

 // get browsertype
 if (navigator.userAgent.indexOf("MSIE 5") != -1) {
  browsertype = "ie5";
 } else if (navigator.userAgent.indexOf("MSIE") != -1) {
  browsertype = "ie" + navigator.appVersion.charAt(0);
  if (navigator.appVersion.charAt(0) < 4) {
   accessdenied = "true";
  }
 } else if (navigator.appName=="Opera") {
  browsertype = "opr" + navigator.appVersion.charAt(0);
  if (navigator.appVersion.charAt(0) < 4) {
   accessdenied = "true";
  }
 } else if (navigator.appName=="Netscape") {
  browsertype = "nsc" + navigator.appVersion.charAt(0);
  if (navigator.appVersion.charAt(0) < 4) {
   accessdenied = "true";
  }
 }

 // redirect if access is denied
 if (accessdenied == "true") {
  window.location.replace(deniedurl);
 }

}

// 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) {
 var defaulttitle="djeuphoria.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="master.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=pagenote><b>' + caption + '</b></div>');
 }
 imgwin.document.write('</td><td valign=top align=right class=legaltext>');
 imgwin.document.write('<a href=# onClick=window.self.close();>close</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();
}
