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





//Function to hilight menu items.
function hilight(what)
{
 with(what)
 {
  filters.item(0).Apply();
  className="hilight";
  filters.item(0).Play();
 }
}
//function to unhilight menu items.
function normal(what)
{
 with(what)
 {
  filters.item(0).Apply();
  className="normal";
  filters.item(0).Play();
 }
}



//function to generate comets (This script written as a tutrial by Eric (Aorta) of offend.org/eric)

function comet(color,speed,width,height)
{
document.write("<table width="+width+" cellspacing=0 cellpadding=0><tr><td width=50%><marquee scrollamount="+speed+" direction=right><table width=100% height="+height+" cellspacing=0 cellpadding=0><tr><td width=95% bgcolor=\""+color+"\" style=\"filter:alpha(style=1,opacity=0,finishopacity=100)\"><td width=5% bgcolor=\""+color+"\" style=\"filter:alpha(style=1,opacity=100,finishopacity=0)\"></table></marquee><td width=50%><marquee scrollamount="+speed+" direction=left><table width=100% height="+height+" cellspacing=0 cellpadding=0><tr><td width=5% bgcolor=\""+color+"\" style=\"filter:alpha(style=1,opacity=0,finishopacity=100)\"><td width=95% bgcolor=\""+color+"\" style=\"filter:alpha(style=1,opacity=100,finishopacity=0)\"></table></marquee></table>");
}




    //<![CDATA[

    <!--

    function scrollerObj(name,initH,initW,heightB,widthB,content,initBg,Bg,speed,initFl){

    //**data**//

    this.name=name;

    this.initH=initH;

    this.initW=initW;

    this.heightB=heightB;

    this.widthB=widthB;

    this.content=content;

    this.initBg=initBg;

    this.Bg=Bg;

    this.iniFl=initFl;

    this.speed=parseInt(speed);

    this.timer = name + "Timer";

    this.elem;





    //**methods**//

    this.getElement = getElement;

    this.createLayer=createLayer;

    this.scrollLayer = scrollLayer; 

    this.scrollLoop=scrollLoop;



    //**initiate methods**//

    this.createLayer();

    this.getElement();

    this.scrollLayer();

    }



    //**call this method to stop scrolling**//

    function scrollLoop(s){

    this.speed = s;

    }



    //**pretty obvious**//

    function scrollLayer(){

    if(parseInt(this.elem.style.top)>(this.elem.offsetHeight*(-1))){

        this.elem.style.top = parseInt(this.elem.style.top)-this.speed;

        //alert(parseInt(this.elem.style.top)+"\n"+this.elem.id);

    }

    else {this.elem.style.top = this.initH;}

    }



    //**get the specific dom-expression**//

    function getElement(){

    if(document.getElementById){

        this.elem = document.getElementById(this.name);

        }

    else if (document.all){

    this.elem = document.all[name];

        }

    else if (document.layers){

    this.elem = document.layers[name];

        }

    }



    //**pretty obvious - if NS4 - please upgrade to a standard compliant browser**//

    function createLayer(){

    if(document.getElementById || document.all){

    document.write('<div id="layer'+this.name+'" style="position:relative;overflow:hidden;float:'+this.initFl+';background-image:#'+this.initBg+';border:1px solid black;width:'+this.initW+'px;height:'+this.initH+'px;" onMouseover="'+this.name+'.scrollLoop(0)" onMouseout="'+this.name+'.scrollLoop('+this.speed+')">');

    document.write('<div id="'+this.name+'" style="position:absolute;top:'+this.initH+'px;left:0px;border:0px solid black;width:'+this.widthB+'px;height:'+this.heightB+'px;background-color:#'+this.Bg+'">');

    document.write(this.content);

    document.write('<\/div><\/div>');}

    else if(document.layers){

        document.write('<ilayer name="'+this.name+'" bgcolor="#'+this.Bg+'" width="'+this.widthB+'" height="'+this.heightB+'">'+this.content+'<\/ilayer>');

        return;

    }

    if(this.scrollLayer){

      this.timer = setInterval(this.name+'.scrollLayer()','30');

    }

    }



    //-->





    //]]>