/*----EVENT LISTENERS ----*/
/*------------------------------- BEGIN ----------------------------------*/
function addEvent(obj, evt_ty, fn) {
	if(obj.addEventListener)
		obj.addEventListener(evt_ty, fn, false);
	else if (obj.attachEvent)
		obj.attachEvent('on'+evt_ty, fn);
}

function removeEvent(obj, evt_ty, fn) {
	if(obj.removeEventListener)
		obj.removeEventListener(evt_ty, fn, false);
	else if (obj.detachEvent)
		obj.detachEvent('on'+evt_ty, fn);
}

/*---------------------------- END ----------------------------------------*/






/*------------------------------- BEGIN ----------------------------------*/
function setup_index() {
	hideDivs();
	addListeners_index();
}
/*---------------------------- END ----------------------------------------*/
/*------------------------------- BEGIN ----------------------------------*/
function hideDivs() {
	var div = document.getElementsByTagName('div');
	for(i=0; i<div.length; i++){
		if(div[i].getAttribute('class') == "hidden" || div[i].getAttribute('className') == "hidden"){
			div[i].style.display = "none";
		}
	}
}
/*---------------------------- END ----------------------------------------*/
/*------------------------------- BEGIN ----------------------------------*/
function addListeners_index() {
	var links = document.getElementsByTagName('a');
	for(i=0; i<links.length; i++){
		if(links[i].getAttribute('class') == "activator" || links[i].getAttribute('className') == "activator"){
			links[i].parentNode.onclick = SpecialToggle;
		}
	}
}
/*---------------------------- END ----------------------------------------*/
/*------------------------------- BEGIN ----------------------------------*/
function SpecialToggle() {

	var el = this.getElementsByTagName('div');
	if(this.getAttribute('class') == "inActive" || this.getAttribute('className') == "inActive") {
		new Effect.BlindDown(el[0], {duration: .50});
		this.setAttribute('class','active');
		this.setAttribute('className','active');
		return false;
	}
	else{
		new Effect.BlindUp(el[0], {duration: .30});
		this.setAttribute('class','inActive');
		this.setAttribute('className','inActive');
		return false;
	}
	
}
/*---------------------------- END ----------------------------------------*/





/*------------------------------- BEGIN ----------------------------------*/
function addListeners_SOA() {
	var images = document.getElementById("navigation").getElementsByTagName('img');
	for(i=0; i<images.length; i++){
		images[i].onmouseover = MouseOver;
		images[i].onmouseout = MouseOver;
	}
}
/*---------------------------- END ----------------------------------------*/
/*------------------------------- BEGIN ----------------------------------*/
function MouseOver() {
	if (document.getElementById){
		var src = this.getAttribute('src');
		var file = src.split("_");
		
		if(file[file.length-1] == "InActive.jpg"){
			src = src.replace("InActive.jpg","Active.jpg");
			this.setAttribute('src',src);
		}
		else{
			src = src.replace("Active.jpg","InActive.jpg");
			this.setAttribute('src',src);	
		}
		
	}
}
/*---------------------------- END ----------------------------------------*/