//<!--
var IW= 0;
var IH= 0;
var PX= 0;
var PY= 0;
var ZIN= 0;
var us= null;
var IMGW= 49;
var IMGH= 61;
var LSAFETY= 20;
var TSAFETY= 15;
var deadMikeInserted = false;
var waitSome=false;

function logoOnTop () {

	if (!deadMikeInserted) {
		if (IE_browser && document.readyState == "complete") {
			str = '<div id="deadMikeLogo" style="position:absolute; left:-50; top:-50; z-index:0; width:'+IMGW+'; height='+IMGH+'">'
			+ '<center><a href="http://www.deadmike.com/" onclick="return goDeadMikeHome();"><img src="http://www.deadmike.com/pix/deadMikeLogo.gif" border=0 width='+IMGW+' height='+IMGH+' alt="Dead Mike Home"><br>'
			+ '<font size="1">&copy 2001 Dead Mike Productions</font></a></center>'
			+ '</div>';
			document.body.insertAdjacentHTML("BeforeEnd", str);
			TSAFETY -= 5;
			LSAFETY -= 10;
			deadMikeInserted = true;
		} else if (NS_browser && window.document) {
		// bug in NS won't allow <center> around anchor, doesn't show up at all...
		str = '<layer id="deadMikeLogo" style="text-align:center; position:absolute; left:150; top:150; z-index:0; width:'+IMGW+'; height='+IMGH+'">'
		+ '<a href="http://www.deadmike.com/" onclick="return goDeadMikeHome();"><img src="http://www.deadmike.com/pix/deadMikeLogo.gif" border=0 width='+IMGW+' height='+IMGH+' alt="Dead Mike Home"><br><font size="1">&copy 2001<br>Dead Mike<br>Productions</font></a>'
		+ '</layer>';
			deadMikeInserted = true;
			document.write(str);
		}

	}

	if (IE_browser && document.readyState =="complete" && deadMikeInserted) {
      us = document.all.deadMikeLogo;
      alldivs = document.all.tags("DIV");

//        us.style.display= "none";
        IH= document.body.clientHeight;
        IW= document.body.clientWidth;
        PX= document.body.scrollLeft;
        PY= document.body.scrollTop;
        us.style.top= (IH+PY-(IMGH+TSAFETY));
        us.style.left=(IW+PX-(IMGW+LSAFETY));
        for (i=0; i<alldivs.length; i++){
          templay= alldivs(i);
          if (templay.style.zIndex > ZIN)
            us.style.zindex= (templay.style.zIndex + 1);
        }
        us.onmouseover= neat_mouseover;
        us.onmouseout= neat_mouseout; 
//        us.style.display= "";
	} else if (NS_browser && deadMikeInserted) {
		us = document.layers["deadMikeLogo"];

        IH= window.innerHeight;
        IW= window.innerWidth;
        PX= window.pageXOffset;
        PY= window.pageYOffset;
        (IH > IMGH) ? us.top= (IH+PY-(IMGH+TSAFETY)) : us.top= 0;
        (IW > IMGW) ? us.left= (IW+PX-(IMGW+LSAFETY)) : us.left= 0;

        for (i=0; i<document.layers.length; i++)
          {
          templay= document.layers[i];
          if (templay.zIndex > ZIN)
            ZIN= (templay.zIndex + 1);
          }
        us.document.links[0].onmouseover= neat_mouseover;
        us.document.links[0].onmouseout= neat_mouseout;
        us.zIndex= ZIN;
	}
	setTimeout("logoOnTop()",100);
}

function neat_mouseover(){
  if(us != null){
    window.status="Dead Mike Home";
    return true;
  }
}

function neat_mouseout(){
  if(us != null){
    window.status="";
    return true;
  }
}

function setOpenerHref(myHref) {
	if (opener) {
		opener.location.href=myHref;
	} else {
		parent.location.href=myHref;
	}
	return false;
}

NS_browser = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 ));
IE_browser = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ));

// following code courtesy www.insidedhtml.com

function doError(a1,a2,a3) {
  str = ""
  str += "<TITLE>An error has occurred</TITLE>"
  str += "<FONT FACE='geneva, arial, sans-serif'><FONT COLOR=darkred SIZE=+1>"
  str += "<B>Uh Oh...</B></FONT>"
  str += "<FONT SIZE=-1><BR>Something went wrong while processing this page."
  str += "<P>To help Dead Mike identify the problem, "
  str += "please provide a brief explanation of what you were doing on the page at the time of this error, " 
  str += "and press the SEND button below.  This will help me identify and fix the error."
  str += "<FORM METHOD='POST' ACTION='mailto:bug@deadmike.com?SUBJECT=Bug Report'>"
  str += "Error Description:<BR><TEXTAREA NAME=desc ROWS=5 COLS=30>"
  str += "error " + a1 + "\n"
  str += "file " + a2 + "\n"
  str += "line " + a3 + "\n"
  str += "browser " + navigator.appName + "\n"
  str += "version " + navigator.appVersion + "\n"
  str += "YOUR MESSAGE BELOW\n\n</TEXTAREA>"
  str += "<BR>Your email (optional)<BR><INPUT NAME=email SIZE=30>"
  str += "<P><INPUT TYPE=SUBMIT VALUE=\"SEND\">&nbsp;&nbsp;<INPUT onclick='window.close();return true;' TYPE=BUTTON VALUE=\"CLOSE\">"
  str += "</FORM></FONT></FONT>"
  var w = window.open("","","width=600,height=400")
  var d = w.document
  d.open() 
  d.write(str)
  d.close()
  return true
}

window.onerror = doError

///////////// cookie functions

function getCookieVal(offset) {
	var endstr = document.cookie.indexOf (";", offset);

	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {  
	var arg = name + "=";  
	var alen = arg.length;  
	var clen = document.cookie.length;  
	var i = 0;
	while (i < clen) {    
		var j = i + alen;    
		if (document.cookie.substring(i, j) == arg)
			return getCookieVal (j);    
		i = document.cookie.indexOf(" ", i) + 1;    
		if (i == 0) break;   
	}  
	return null;
}

function SetCookie (name, value) {  
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;  

	document.cookie = name + "=" + escape (value) + 
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
	((path == null) ? "" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain)) +    
	((secure == true) ? "; secure" : "");
}

function DeleteCookie (name) {  
	var exp = new Date();  
	exp.setTime (exp.getTime() - 1);  
	// This cookie is history  
	var cval = GetCookie (name);  
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

var expDays = 180;
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

function goDeadMikeHome() {
	var myHref = GetCookie("DeadMikeHome");
	if (myHref != null)
		return setOpenerHref(myHref);
	else
		return setOpenerHref("/");
}

if ( parseInt(navigator.appVersion) > 3)
	logoOnTop();

//!-->