// This script will no longer overwrite your current onmouseover and
// onmouseout attributes - it will instead skip those links. If you would
// still like to fade them, add findLink(this.id) to your onmouseover
// and clearFade() to your onmouseout, like so -
// <a href="#" onmouseover="findLink(this.id); yourFunction()"
// onmouseout="clearFade(); yourSecondFunction()">
// Make sure to put it BEFORE any "return" statements otherwise
// the fade will not execute.

var fadeTo = "000000";

// Fade in colour increment/decrement by
var fiBy = 6;

// Fade out colour increment/decrement by
var foBy = 6;

// Speed - milliseconds between each colour change in the fade
// Less than 10ms doesn't really make all that much difference, so
// 10 is the minimum effective value.
var speed = 20;

// Class name of links to NOT fade (i.e. ignore)
// var ignoreClass = "somebogusvalue" if you don't want to
// use this feature. Alternatively, add onmouseover="clearFade()"
// to the link you do not wish to fade.
var ignoreClass = "ignore";

// No more changes required (unless you know what you are doing)
// Enjoy... and email me and let me know what site(s) you are using it on :)
var opera, ie, dom, x = 0, oc, fader, ocs = new Array();

if (navigator.userAgent.indexOf("Opera") != -1) opera = true
else if (document.all && !opera) ie = true
else if (!document.all && document.getElementById) dom = true;

function convertRGB(z)
	{
		var newfcS = "", splitter = "";
		splitter = z.split(",");
		splitter[0] = parseInt(splitter[0].substring(4, splitter[0].length));
		splitter[1] = parseInt(splitter[1]);
		splitter[2] = parseInt(splitter[2].substring(0, splitter[2].length-1));
		for (var q = 0; q < 3; q++)
			{
				splitter[q] = splitter[q].toString(16);
				if (splitter[q].length == 1) splitter[q] = "0" + splitter[q];
				newfcS += splitter[q];
			}
		return newfcS;
	}

function currentColour(index)
	{
		var temp, cc;
		if (opera) cc = document.links[index].style.color
		else if (ie) cc = document.links[index].currentStyle.color
		else if (dom) cc = document.defaultView.getComputedStyle(document.links[index], '').getPropertyValue("color");
		if (cc.length == 4 && cc.substring(0, 1) == "#")
			{
				temp = "";
				for (var a = 0; a < 3; a++)
					temp += cc.substring(a+1, a+2) + cc.substring(a+1, a+2);
				cc = temp;
			}
		else if (cc.indexOf("rgb") != -1) cc = convertRGB(cc)
		else if (cc.length == 7) cc = cc.substring(1, 7)
		else cc = fadeTo;
		return cc;
	}


function convert2Dec(hex)
	{	
		var rgb = new Array();
		for (var u = 0; u < 3; u++)
			rgb[u] = parseInt(hex.substring(u*2, u*2+2), 16);
		return rgb;
	}

function newRGB(f, n, d)
	{
		var change;
		if (d == 1) change = fiBy
		else change = foBy;
		for (var g = 0; g < 3; g++)
			{
				if (n[g] > f[g] && n[g] - change >= 0) n[g] -= change;
				if (n[g] < f[g] && n[g] + change <= 255) n[g] += change;
			}
		return n;
	}

function fade(index, d)
	{
		var fc, nc, temp = new Array(), finished = false;
		nc = convert2Dec(currentColour(index));
		if (d == 1) fc = convert2Dec(fadeTo)
		else fc = convert2Dec(ocs[x]);
		temp = convert2Dec(currentColour(index));
		nc = newRGB(fc, nc, d);
		if ((nc[0] == temp[0]) && (nc[1] == temp[1]) && (nc[2] == temp[2]))
			finished = true;
		if (!finished) document.links[x].style.color = "rgb(" + nc[0] + "," + nc[1] + "," + nc[2] + ")"
		else clearInterval(fader);
	}

function findLink(over)
	{
		if (document.layers) return;
		if (fader)
			{
				clearInterval(fader);
				document.links[x].style.color = "#" + ocs[x];
			}
		if (over && !this.id) this.id = over;
		x = 0;
		while (!(this.id == document.links[x].id) && (x < document.links.length))
			x++;
		if (this.id == document.links[x].id)
			{
				oc = currentColour(x);
				fader = setInterval("fade(" + x  + ", 1)", speed);
			}
	}

function clearFade()
	{
		if (document.layers) return;
		if (fader) clearInterval(fader);
		fader = setInterval("fade(" + x + ", 0)", speed);
	}

function init()
	{
		for (var i = 0; i < document.links.length; i++)
			{
				ocs[i] = currentColour(i);
				var currentOver = document.links[i].onmouseover;
				var currentOut = document.links[i].onmouseout;
				var ignoreIt = document.links[i].className == ignoreClass;
				if (!ignoreIt) document.links[i].id = "link" + i;
				if (!currentOver && !currentOut && !ignoreIt)
					{
						document.links[i].onmouseover = findLink;
						document.links[i].onmouseout = clearFade;
					}
			}		
}

if (opera || ie || dom) window.onload = init;

//--------------------image banner transitions


<!--

//Pixelating Image slideshow
//Copyright Dynamic Drive 2001
//Visit http://www.dynamicdrive.com for this script

//specify interval between slide (in mili seconds)
var slidespeed=3000
//specify images
var slideimages=new Array("PIC1.jpg","PIC2.jpg","PIC3.jpg","PIC4.jpg")
//specify corresponding links
var slidelinks=new Array("#","#","#")

var imageholder=new Array()
var ie55=window.createPopup
for (i=0;i<slideimages.length;i++){
imageholder[i]=new Image()
imageholder[i].src=slideimages[i]
}

function gotoshow(){
window.location=slidelinks[whichlink]
}

//-->

//--------------------ROLLOVER SCRIPT
function imageholderclass(){
	this.over=new Array();
	this.down=new Array();
	this.src=new Array();
	this.store=store;
	
	function store(src, down, over){
		var AL=this.src.length;
		this.src[AL]=new Image(); this.src[AL].src=src;
		this.over[AL]=new Image(); this.over[AL].src=over;
		this.down[AL]=new Image(); this.down[AL].src=down;
	}
}

var ih = new imageholderclass();
var mouseisdown=0;

function preloader(t){
	for(i=0;i<t.length;i++){
		if(t[i].getAttribute('srcover')||t[i].getAttribute('srcdown')){
			
			storeimages(t[i]);
			var checker='';
			checker=(t[i].getAttribute('srcover'))?checker+'A':checker+'';
			checker=(t[i].getAttribute('srcdown'))?checker+'B':checker+'';
			
			switch(checker){
			case 'A' : mouseover(t[i]);mouseout(t[i]); break;
			case 'B' : mousedown(t[i]); mouseup2(t[i]); break;
			case 'AB' : mouseover(t[i]);mouseout(t[i]); mousedown(t[i]); mouseup(t[i]); break;
			default : return;			
			}
			
			if(t[i].src){t[i].setAttribute("oldsrc",t[i].src);}
		}
	}
}
function mouseup(t){
	var newmouseup;
	if(t.onmouseup){
		t.oldmouseup=t.onmouseup;
		newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("srcover");this.oldmouseup();}

	}
	else{newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("srcover");}}
	t.onmouseup=newmouseup;
}

function mouseup2(t){
	var newmouseup;
	if(t.onmouseup){
		t.oldmouseup=t.onmouseup;
		newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("oldsrc");this.oldmouseup();}
		}
	else{newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("oldsrc");}}
	t.onmouseup = newmouseup;
}

function mousedown(t){
	var newmousedown;
	if(t.onmousedown){
		t.oldmousedown=t.onmousedown;
		newmousedown=function(){if(mouseisdown==0){this.src=this.getAttribute("srcdown");this.oldmousedown();}}
	}
	else{newmousedown=function(){if(mouseisdown==0){this.src=this.getAttribute("srcdown");}}}
	t.onmousedown=newmousedown;
}

function mouseover(t){
	var newmouseover;
	if(t.onmouseover){
		t.oldmouseover=t.onmouseover;
		newmouseover=function(){this.src=this.getAttribute("srcover");this.oldmouseover();}
	}
	else{newmouseover=function(){this.src=this.getAttribute("srcover");}}
	t.onmouseover=newmouseover;
}

function mouseout(t){
	var newmouseout;
	if(t.onmouseout){
		t.oldmouseout=t.onmouseout;
		newmouseout=function(){this.src=this.getAttribute("oldsrc");this.oldmouseout();}
	}
	else{newmouseout=function(){this.src=this.getAttribute("oldsrc");}}
	t.onmouseout=newmouseout;
}

function storeimages(t){
	var s=(t.getAttribute('src'))?t.getAttribute('src'):'';
	var d=(t.getAttribute('srcdown'))?t.getAttribute('srcdown'):'';
	var o=(t.getAttribute('srcover'))?t.getAttribute('srcover'):'';
	ih.store(s,d,o);
}

function preloadimgsrc(){
	if(!document.getElementById) return;
	var it=document.getElementsByTagName('IMG');
	var it2=document.getElementsByTagName('INPUT');
	preloader(it);
	preloader(it2);
}

if(window.addEventListener){window.addEventListener("load", preloadimgsrc, false);} 
else{
	if(window.attachEvent){window.attachEvent("onload", preloadimgsrc);}
	else{if(document.getElementById){window.onload=preloadimgsrc;}}
}

