<!--erick.js	http://www.erickinkel.com

//
// Imageswap
//

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;
}

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];}}
}

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;
}

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];}
}

//
// Window Open
//


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//
// Print Page
//

function printPage(){
   bV = parseInt(navigator.appVersion)
   if (bV >= 4) window.print()
}

//
// Random Number
//

function randnum(mult,add) {
random_num = (Math.round((Math.random()*mult)+add));
}

//
// Verify hit. Eric version to Send WoRD back to page
//

function verif(wrd) { 
var mess = "Javascript Erick Hit Verified"; 
document.write(wrd + " " + mess)
}

//
// Cookie Handling
// Mod 07Jan2009 - 17:17
//


var expDays = 1;
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*5*1000));  // Now Set to 2 hours. Chg 10(=4hrs) to 30 for 12 hours.

function check(){
var flag = 'yes';
SetCookie('check', flag, exp);
var check = GetCookie('check');
if (check == flag) {
log();
}
}
function log(){
var ref = document.referrer
var width = screen.width
var height = screen.height
document.write("<img src='cgi-bin/eric_acclog.pl?" + ref + "::" + width + "x"  + height + "' width=1 height=1 align=ABSCENTER>")
}

function wolf(){
var hyes = 'howl';
var wolf = GetCookie('wolf');
var kaka = (navigator.appName);
if (wolf == hyes) {
   if (navigator.appName == 'Microsoft Internet Explorer'){
      document.write("<iframe name='I3' src='Audio/index0.html' marginwidth='1' marginheight='1' height='36' width='38' title='IE Howl' scrolling='no' border='0' frameborder='0'>");
   }
      else{
      document.write("<iframe name='I3' src='silent.html' marginwidth='1' marginheight='1' height='36' width='38' title='IE Howl' scrolling='no' border='0' frameborder='0'>");
   }
}
else{
var filename = 'Audio/index.html';
SetCookie('wolf', hyes);
if (navigator.appName == 'Microsoft Internet Explorer')
{document.write("<iframe name='I3' src='Audio/index.html' marginwidth='1' marginheight='1' height='36' width='38' title='IE Howl' scrolling='no' border='0' frameborder='0'>");}
else
{document.write("<iframe name='I3' src='Audio/index.html' marginwidth='1' marginheight='1' height='36' width='38' title='Moz Howl' scrolling='no' border='0' frameborder='0'>");}
}
document.write("Your browser does not support inline frames or is currently configured not to display inline frames.</iframe>");
}

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" : "");
}


//
// Banner Image selector by screen size
//

function size(sm, lg){
if (width < 999) document.write("<center><img src='images/ban/"+sm+"' alt='"+jizm+"'><br><font face='Courier' color='ffffff' size='4'><b>This Site Is Best Viewed At 1024 X 768 Or Larger.</b></font>");
else document.write("<img src='images/ban/"+lg+"' alt='"+jizm+"'>");
}

//
// Quick table setter
//

function table(){
if (width < 999) document.write("<table border='1' cellspacing='5' cellpading='5' style='border-collapse: collapse' width='760' height='100%' align='center' bordercolor='#0000FF'>");
else document.write("<table border='1' cellspacing='5' cellpading='5' style='border-collapse: collapse' width='945' height='100%' align='center' bordercolor='#0000FF'>");
}

// function pixs(pno, lit, big){
// if (width < 999) document.write("<param NAME='image"+pno+"' VALUE='"+lit+"'>");
// else document.write("<param NAME='image"+pno+"' VALUE='"+big+"'>");
// }

// function anfapp(awi, ahi){
// if (width < 999) document.write("<applet ARCHIVE='AnFade.jar' CODE='AnFade.class' WIDTH='748' HEIGHT='89'>");
// else document.write("<applet ARCHIVE='AnFade.jar' CODE='AnFade.class' WIDTH='"+awi+"' HEIGHT='"+ahi+"'>");
// }

//
// Quick table setter 2
//

function table2(bor, wid, ali, hei, boc, bgc, cep, ces){
if (width < 999) document.write("<table border='1' cellspacing='1' style='border-collapse: collapse' width='760' align='center' bordercolor='#0000FF'>");
else document.write("<table border='"+bor+"' width='"+wid+"' align='"+ali+"' height='"+hei+"' bordercolor='"+boc+"' bgcolor='"+bgc+"' cellspacing='"+cep+"' cellspacing='"+ces+"' style='border-collapse: collapse'>");
}

//
// Start: Rotator Script
// Major tweek by: Gary R. Lingner 31Jul2006 04:21 Minor Update: 14Jan2007@15:20
//

var how_many_ads = 9;  // Total number of images
var mult = 9;  // var for real random func
var add = 1;   // var for real random func
// var wide2 = screen.width;
// var ad = (Math.round((Math.random()*mult)+add)); // NOTE: Presently disabled due to confusion
var now = new Date();
var sec = now.getSeconds();
var ad = sec % how_many_ads;
ad +=1;

function adbann(){

if (width > 999) {
banpic="images/ads/HP_ADBANL";  // Set location & begining of LARGE picture name w/o # or .ext
}

if (width < 999) { 
banpic="images/ads/HP_ADBANs";  // small banner name set
}

if (ad==1) {  // Make the number show in numeric order... huh? 
url="http://www.memoryboxvideo.com/";  // link url for image
alt="For all of your video needs! Memory Box Video recorded my last concert. ";  // ALT tag for images, use them
tgt="_blank";  // If you want the click to open within the page use _self for same, or _blank for new window
banner=(banpic + ad + ".jpg");  // Location & Banner image name + LG or sm, adding Img# + .ext
banum=(alt + ad);  // Set Var "ad" to end of alt tag so we know what the Var was at banner serve
}

if (ad==2) { 
url="http://www.rahljewelers.com/history.asp"; 
alt="Click on this Banner NOW to visit Rahl Jewelers. Tell them that Eric sent you. "; 
tgt="_blank"; 
banner=(banpic + ad + ".jpg");  // ex. of old banner=("images/ads/HP_ADBANs8.jpg"); 
banum=(alt + ad);
}

if (ad==3) { 
url="http://www.erickinkel.com/Introduction.htm"; 
alt=" THE KINK IS BACK! CLICK RIGHT NOW to read his Personal Bio - Intro. THE KINK IS BACK! "; 
tgt="_self"; 
banner=(banpic + ad + ".jpg"); 
banum=(alt + ad);
}

if (ad==4) { 
url="http://www.erickinkel.com/KinkBay.htm"; 
alt="Come Sell, Buy, Trade... well Mostly Buy, from the Kinks personal Stash on KinkBay! "; 
tgt="_self"; 
banner=(banpic + ad + ".jpg"); 
banum=(alt + ad);
}

if (ad==5) { 
url="http://www.mimmassage.com/"; 
alt="Great theraputic messages by clicking NOW. He's a personal friend and fellow musician. I recomend him highly! "; 
tgt="_blank"; 
banner=(banpic + ad + ".jpg"); 
banum=(alt + ad);
}

if (ad==6) { 
url="http://www.erickinkel.com/"; 
alt="Happy New Year 2007! Here at Eric Kinkel.com. "; 
tgt="_blank"; 
banner=(banpic + ad + ".jpg"); 
banum=(alt + ad);
}

if (ad==7) { 
url="http://www.tednugent.com/"; 
alt="Hey kiddies, let's go visit Uncle Ted's house. "; 
tgt="_blank"; 
banner=(banpic + ad + ".jpg"); 
banum=(alt + ad);
}

if (ad==8) { 
url="http://www.wildfirehd.com/"; 
alt="Highly Recommended Dealer and Service of Harly Davidson Bikes. "; 
tgt="_blank"; 
banner=(banpic + ad + ".jpg"); 
banum=(alt + ad);
}

if (ad==9) { 
url="http://www.erickinkel.com/KinkBay.htm"; 
alt="Come Sell, Buy, Trade... well Mostly Buy, from the Kinks personal Stash on KinkBay! "; 
tgt="_self"; 
banner=(banpic + ad + ".jpg"); 
banum=(alt + ad);
}

document.write('<a href="'+url+'" target="'+tgt+'"><img src="'+banner+'" alt="'+banum+'" border="0"></a>');

}

//
// QueryString Handling
//

function QueryString(key)
{
	var value = null;
	for (var i=0;i<QueryString.keys.length;i++)
	{
		if (QueryString.keys[i]==key)
		{
			value = QueryString.values[i];
			break;
		}
	}
	return value;
}

QueryString.keys = new Array();
QueryString.values = new Array();

function QueryString_Parse()
{
	var query = window.location.search.substring(1);
	var pairs = query.split("::");
	
	for (var i=0;i<pairs.length;i++)
	{
		var pos = pairs[i].indexOf('=');
		if (pos >= 0)
		{
			var argname = pairs[i].substring(0,pos);
			var value = pairs[i].substring(pos+1);
			QueryString.keys[QueryString.keys.length] = argname;
			QueryString.values[QueryString.values.length] = value;
		}
	}

}

QueryString_Parse();

// 
// Snow Script
//

function snowing(flakes, melt)
{
  // Configure below to change URL path to the snow image
  var snowsrc="http://www.erickinkel.com/snow.gif";
  // Configure below to change number of snow to render
  var no = flakes;
  // Configure whether snow should disappear after x seconds (0=never):
  var hidesnowtime = melt;
  // Configure how much snow should drop down before fading ("windowheight" or "pageheight")
  var snowdistance = "pageheight";

///////////Stop Config//////////////////////////////////

  var ie4up = (document.all) ? 1 : 0;
  var ns6up = (document.getElementById&&!document.all) ? 1 : 0;

	function iecompattest(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	}

  var dx, xp, yp;    // coordinate and position variables
  var am, stx, sty;  // amplitude and step variables
  var i, doc_width = 800, doc_height = 600; 
  
  if (ns6up) {
    doc_width = self.innerWidth;
    doc_height = self.innerHeight;
  } else if (ie4up) {
    doc_width = iecompattest().clientWidth;
    doc_height = iecompattest().clientHeight;
  }

  dx = new Array();
  xp = new Array();
  yp = new Array();
  am = new Array();
  stx = new Array();
  sty = new Array();
  snowsrc=(snowsrc.indexOf("dynamicdrive.com")!=-1)? "snow.gif" : snowsrc
  for (i = 0; i < no; ++ i) {  
    dx[i] = 0;                        // set coordinate variables
    xp[i] = Math.random()*(doc_width-50);  // set position variables
    yp[i] = Math.random()*doc_height;
    am[i] = Math.random()*20;         // set amplitude variables
    stx[i] = 0.02 + Math.random()/10; // set step variables
    sty[i] = 0.7 + Math.random();     // set step variables
		if (ie4up||ns6up) {
      if (i == 0) {
        document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http://dynamicdrive.com\"><img src='"+snowsrc+"' border=\"0\"><\/a><\/div>");
      } else {
        document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"><\/div>");
      }
    }
  }

  function snowIE_NS6() {  // IE and NS6 main animation function
    doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;
		doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")?  iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight;
    for (i = 0; i < no; ++ i) {  // iterate for every dot
      yp[i] += sty[i];
      if (yp[i] > doc_height-50) {
        xp[i] = Math.random()*(doc_width-am[i]-30);
        yp[i] = 0;
        stx[i] = 0.02 + Math.random()/10;
        sty[i] = 0.7 + Math.random();
      }
      dx[i] += stx[i];
      document.getElementById("dot"+i).style.top=yp[i]+"px";
      document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px";  
    }
    snowtimer=setTimeout("snowIE_NS6()", 10);
  }

	function hidesnow(){
		if (window.snowtimer) clearTimeout(snowtimer)
		for (i=0; i<no; i++) document.getElementById("dot"+i).style.visibility="hidden"
	}
		

if (ie4up||ns6up){
    snowIE_NS6();
		if (hidesnowtime>0)
		setTimeout("hidesnow()", hidesnowtime*1000)
		}
}

//-->
