// Main.js

function init() {
	setRasterTable();
	
	$('infoheader').style.display='block';
	
	if($('wrapper'))
		setSlideShow()
}

function setSlideShow() {
	
	$('wait').style.display='none';
	$('slideshow').style.display='none';
	$('wrapper').style.display='block';
	
	slideshow.auto=false;
	slideshow.speed=5;
	slideshow.link="linkhover";
	slideshow.info="information";
	slideshow.thumbs="slider";
	slideshow.left="slideleft";
	slideshow.right="slideright";
	slideshow.scrollSpeed=4;
	slideshow.spacing=5;
	slideshow.active="#fff";
	slideshow.init("slideshow","image","imgprev","imgnext","imglink");
}

function setRasterTable() {
	var tables = document.getElementsByTagName('table');
	
	for (i=0; i < tables.length; i++) {
		var even_odd = "odd";
		
		if (tables[i].className == "raster") {
			var tr = tables[i].getElementsByTagName('tr');
	
			for (var j=0; j < tr.length; j++) {
				tr[j].className = even_odd;
								
				even_odd == "odd" ? even_odd = "even" : even_odd = "odd";
			}
		}
	}
}


function scrollContainer(id, direction) {

	var pos=$(id).style.top?parseInt($(id).style.top):25;

	if (direction == "down") {
		pos -= 2;
	} else if (direction == "up") {
		pos += 2;		
	}
	
	if ($(id).offsetHeight + pos > 220 && pos <= 25)
		$(id).style.top = pos + "px"
	
	
}




function addStartUpAction(action) {
	if (window.addEventListener) window.addEventListener("load", action, false);
	else if (window.attachEvent && !window.opera) window.attachEvent("onload", action);	
}

addStartUpAction(init);