// JavaScript Document

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp('(^|\\\\s)'+searchClass+'(\\\\s|$)');
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

function switchElement(element) { 
	turn_on=document.getElementById(element);
	where=document.getElementById('banner_right');
	the_others=getElementsByClass('changeable',where,'div');
	othersLen=the_others.length;
	for(i=0; i < othersLen; i++) { 
		the_others[i].style.display='none';
	}
	turn_on.style.display='block';
}

function hoveron(my_element,what) { 
	for (x in off_array) { 
		document[x].src=off_array[x];
	}
	my_element.className='hoveron';
	document[what].src=on_array[what];
}

function timedCount2() { 
	clearTimeout(t);
	t=setTimeout("timedCount()",30000);

}

function timedCount()
{
switchElement(count_info[c].id);
hoveron(left_side[c],left_side[c].name);
if (c < (count_length - 1) ) 
	c=c+1;
else 
	c=0;
t=setTimeout("timedCount()",5000);
}

function stopCount()
{
clearTimeout(t);
}
