// bloodnok.js
// contains all sorts of nasties...

// added this smeg apr2k9
if (top !== self) top.location.replace(self.location.href);

// rewrote this smeg 20apr2k5
// is this prat is running a micro$lop browser?
if (/msie/i.test(navigator.userAgent)) alert("SECURITY ALERT! YOUR BROWSER IS NON-COMPLIANT!");
// that got rid of them!
// no it didn't - they still get the alert, though...

// end of redirect and auntieclick trap...

// disabled the second stylesheet 20apr2k5
// load css that the branedead-ie can't render ...
//else if(document.images && document.addEventListener)
//document.write("<link rel='stylesheet' href='bloodnok2.css' type='text/css'>");

// is it an iphone (or similar)? 13oct2k10 ...
if (/mobile.*safari/i.test(navigator.userAgent)) {
document.write("<meta name='viewport' content='width=device-width; initial-scale=0.95; maximum-scale=2.5;' />");
//document.write("<style type='text/css'>");
//document.write("html,body,p,div,h1 { -webkit-text-size-adjust: none; }");
//document.write("body { min-width: 320px; }");
//document.write(".mobile { display: inherit; }");
//document.write(".notmobile { display: none; }");
//document.write("div#mooseOver { display: none; }");
//document.write("</style>");
//} else {
//document.write("<style type='text/css'>");
//document.write(".tip { border: 1px #666 solid; background-color: #333; color:#9F9; width: 450px; padding: 3px 3px; position: absolute; z-index: 100; visibility: hidden; top: 10px; left: 90px; font-size: x-small; text-align: left; }");
//document.write("</style>");
}

// have a fake date, a copyleft, an email address, and a cookie!
var m = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
var d = new Date();

// cookie
var directCookie = "bloodnokPestulence=" + escape("@+" + d.getDate() + m[d.getMonth()] + d.getFullYear() + "!crun,bannister,&crun") + ";expires=Wed, 01 Jan 2020 00:15:35 GMT";
document.cookie = directCookie;

// email...
var a = new Array('t','loodn','blood','b','nok','ok.ne');
var at = "@";
var subj = "naughty dennis at blodgenog.nutt";
var maile = "<a href=\"mailto:"+ a[2] + a[4] + at + a[3] + a[1] + a[5] + a[0] + "?subject=" + subj + "\" class=\"sit\">bloodnok</a>";

// paypal's url makes the w3.org validator puke & with cause, too...
// paypal sucks, too, but that's just my opinion!
// added (local) paypal gif 17dec2k3
var paypal = "<a href=\"https://www.paypal.com/xclick/business=bloodnok%40yahoo.com&item_name=dennis+bloodnok+memorial+legal+fund+and+girls+school&item_number=n2+4db&no_note=1&currency_code=USD\" class=\"buy\"><img src=\"image/paypal.gif\" type=\"image/gif\" /><br> help yourself! </a>";

// pinched this from somewhere/other and added 18apr2k5...
// opera doesn't render this correctly (and i should pay them for their incompetence?)
var ns = (navigator.appName.toLowerCase().indexOf("netscape") != -1);
var op = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);
var p = document;
var px = document.layers ? "" : "px";
function floatdiv(id, sx, sy) {
if(op) return;
var el = p.getElementById ? p.getElementById(id) : p.all ? p.all[id] : p.layers[id];
window[id + "_obj"] = el;
if(p.layers)el.style=el;
el.cx = el.sx = sx;el.cy = el.sy = sy;
el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};
el.flt=function() {
var pX, pY;
pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
document.documentElement && document.documentElement.clientWidth ? 
document.documentElement.clientWidth : document.body.clientWidth;
pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
document.documentElement.scrollTop : document.body.scrollTop;
if(this.sy<0) 
pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
document.documentElement.clientHeight : document.body.clientHeight;
this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
this.sP(this.cx, this.cy);
setTimeout(this.id + "_obj.flt()", 40);
}
return el;
}

// Extended Tooltip Javascript
// copyright 9th August 2002, by Stephen Chapman, Felgall Pty Ltd
var DH = 0;
var an = 0;
var al = 0;
var ai = 0;

if (document.getElementById) {
ai = 1; 
DH = 1;
} else {
if (document.all) {
al = 1; 
DH = 1;
} else { 
browserVersion = parseInt(navigator.appVersion); 
if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {
an = 1; 
DH = 1;
}
}
} 

function fd(oi,ws) {
if (ws == 1) {
if (ai) {
return (document.getElementById(oi).style);
} else {
if (al) {
return (document.all[oi].style);
} else {
if (an) {
return (document.layers[oi]);
}
};
}
} else {
if (ai) {
return (document.getElementById(oi));
} else {
if (al) {
return (document.all[oi]);
} else {
if (an) {
return (document.layers[oi]);
}
};
}
}
} 

function pw() {
if (window.innerWidth != null) 
return window.innerWidth; 
if (document.body.clientWidth != null)
return document.body.clientWidth; 
return (null);
} 

function popUp(evt,oi) {
// no popup on mobile safari ...
if (/mobile.*safari/i.test(navigator.userAgent))
return (null);
// original code ...
if (DH) {
var wp = pw(); 
ds = fd(oi,1); 
dm = fd(oi,0); 
st = ds.visibility; 
if (dm.offsetWidth) 
ew = dm.offsetWidth; 
else if (dm.clip.width) 
ew = dm.clip.width; 
if (st == "visible" || st == "show") { 
ds.visibility = "hidden"; 
} else  { 
if (evt.y || evt.pageY) {
if (evt.pageY) {
tv = evt.pageY + 20;
lv = evt.pageX - (ew/4);
} else {
tv = evt.y + 20 + document.body.scrollTop; 
lv = evt.x  - (ew/4) + document.body.scrollLeft;
} 
if (lv < 2) 
lv = 2; 
else if (lv + ew > wp) 
lv -= ew/2;
if (!an) {
lv += 'px';
tv += 'px'
};
ds.left = lv; 
ds.top = tv;
} 
ds.visibility = "visible";
}
}
}

