//
// Neil's Status Cookie 
// Use this script if you want..  Please credit me or link to my site, or you will go to the special hell.
//

// Updated 24/06/2005    V1.01
//   Another string and %YEAR% replaced by current year in text

// Updated 30/06/2006    V1.02
//   Added 2 more strings ..

// Updated 25/09/2006    V1.03
//   Added 3 special strings
//   Added code to display special strings first, on certain dates..

// Updated 24/12/2006    V1.04
//   Added more strings

// Updated 30/03/2007    V1.05
//   Added more strings

// Updated 18/10/2007    V1.06
//   Updated for new site
//   Changed so that the Matrix line is not always first..  (It was like that by design)

var thetext = new Array
  (
    "Wake up Neo.  The Matrix has you. ",  
    "Don't forget to check out the PEiD Forum.. Link is in side menu or on links page .. ",
    "Copyright © 2004-%YEAR% - Neil the Hippie Killer / BoB - All rights reversed .. :) ",    // %year% is changed to current year..
    "If you think PEiD means feet then you're at the wrong place.. :) ",
    "Thanks to BuLLeT for hosting, and Qwerton, snaker and Jibz for PEiD .. Without whom there would be no page, no plugins.. :) ",
    "I spent too long on this lame script.. :) ",
    "This page probably looks best on my computer ... ",
    "See your name here...   ..Steal this script today! :) ",
    "You have the right to remain silent ..  Anything you say will be misquoted and then used against you .. ",
    "Stupidity is not a crime.. So you're free to go.. ",
	"The voices in my head don't like you, and wish you'd go away.. ",
	"Leave no turn un-stoned.. ;) ",
	"I know the voices in my head aren't real, but sometimes they talk sense.. ",
	"Wanted : Coding slave - Must not require food or sleep .. :) ",
	"A program without bugs has either too few users, or too few uses .. ",
	"BoBSoft - Caffine induced programming .. ",
	"How are you gentlemen? All your BoBs are belong to us! ",
	"Roses are red, Violets are blue, All of my base, Are belong to you .. ",
	"Roses are #00FF0000, Violets are #000000FF, I thought I was geeky, But then I met you .. ;) ",
	"Beauty is in the eye of the beer-holder .. ",
	"A fact is only as reliable as it's source .. ",
	"Just because you don't understand something, does not mean it is wrong .. ",
	"[ooo]  This should never be shown..  Spacer for secret texts..  [ooo]"
  )

// Birthday texts
// %NUMYEAR% is replaced with number of years since date in ReplaceNumYear function

var secrettext = new Array
  (
	"Happy Birthday to my site !!  ;)  %NUMYEAR% Years old today !!  ",
	"Happy Birthday to me !!  %NUMYEAR% Years old today !!  (Buy me Whiskey!) ;) ",
	"Happy Christmas!! (Or alternative religious/social festival)  ....  ;) "
  )

comeback=0
cometo=0
numt=0
blinker=0
delay=0
no=0
Total = 0
s = ""
i = 0
var yr;
var dy;
var mn;

Today = new Date();
yr = Today.getFullYear();
mn = Today.getMonth();
dy = Today.getDate();

mn++;  //  Zero based month ???   Freaky calendar .. !

Total = thetext.length-2;   // -2 so last item of array is not used ..

//--------------------------------------------------------------------------------
//  ReplaceYear function
//  Changes text %YEAR% to the current year ..
//

function ReplaceYear(sText) {
  	i=sText.indexOf("%YEAR%");     
	if (i > 0)  	{
    	s = sText.substring(0,i) + yr;
		i = i + 6;
		s = s + sText.substring(i,sText.length);
		return s;
  	} else {
		return sText 
	}
}


//--------------------------------------------------------------------------------
// 
//  ReplaceStr function
//

function ReplaceNumYear(DateStr, BDayStr, OrigYear, SecretNum) {
	if (DateStr == BDayStr) {
		numt = thetext.length-1;
		thetext[numt] = secrettext[SecretNum];
		i = thetext[numt].indexOf("%NUMYEAR%");
		if (i > 0) {
			s=thetext[numt].substring(0,i) + (yr - OrigYear);
			i=i+9;
			s=s+thetext[numt].substring(i,thetext[numt].length);
			thetext[numt]=s;
		}
	} else {
		// If not a birthday, set string index to random ..
       	numt=Math.round(Math.random()*(Total));
		// Change %YEAR% in text to current year, if found ..
		thetext[numt] = ReplaceYear(thetext[numt]);
	}
}

// Birthday texts ..
// Only displayed on the date specified, and only once, as first text ..

ReplaceNumYear(dy+"/"+mn,  "8/10", 2004, 0);  // Birthday of site!
ReplaceNumYear(dy+"/"+mn,  "15/8", 1974, 1);  // My Birthday!
ReplaceNumYear(dy+"/"+mn, "25/12", 2000, 2);  // Xmas 



//--------------------------------------------------------------------------------
// 
//  Main function
//

function status_scroll()
{
    if(delay==0)
    {
    	if(comeback==1)
    	{
	  		cometo--;
          	if(cometo==0)
			{
				comeback=0;
			  	no=numt;
			  	while (no==numt)
			  	{
                	no=Math.round(Math.random()*(Total));  // -2 to hide last
			  	}
			  	numt = no
				// Change %YEAR% in text to current year, if found ..
				thetext[numt] = ReplaceYear(thetext[numt]);
            }
        }
        else
        {
    	  cometo++;
		  if(cometo==thetext[numt].length)
	    	{comeback=1}
        }
    }
    else 
    {
    	delay--;
    	if (delay == 0)
        {
        	cometo--;
        }
    }

//	winY = document.body.scrollTop;
//	status = document.all("Status");
//	status.style.pixelTop = winY + (document.body.clientheight - 20px);

    if (blinker == 0)
    {
        window.status= ' ' + thetext[numt].substring(0,cometo)+" ";
//		status.title = ' ' + thetext[numt].substring(0,cometo)+" ";
        blinker=1
    }
    else
    {
        window.status= ' ' + thetext[numt].substring(0,cometo)+"_";
//		status.title = ' ' + thetext[numt].substring(0,cometo)+"_";
        blinker=0
    }

    if(cometo==thetext[numt].length)
    {
        window.setTimeout("status_scroll()",500);
        if(delay==0)
          {delay=15;}
    }
    else
    {
        window.setTimeout("status_scroll()",60);
    }

}
status_scroll()
