
// init loader
var loader = new Loader();
loader.setScriptPath("/static/js/");
loader.addFile("lib/prototype.js");
loader.addFile("lib/animator.js");

loader.addClass("at.bc.animBackground");

loader.addClass("at.bc.main_navigation.hover");
//loader.addClass("at.bc.main_navigation.switchPicture");

loader.load();


function onDocumentLoad () {
	
	new at.bc.animBackground();
	
	// main navigation:
	try {
		new at.bc.main_navigation.hover( [ $$('#metanav li') ] );
		//new at.bc.main_navigation.switchPicture( [ $$('#metanav li.main') ] );
	} catch (e) {}
	
}


window.onload = onDocumentLoad;


function gotoLink (htmlElement) {
	
	var destinationURL = "";
	var target = "";
	
	if(htmlElement.href) {
		destinationURL = htmlElement.href;
		target = htmlElement.getAttribute("target");
	}
	else {
		if(htmlElement.childNodes) {
			if(htmlElement.getElementsByTagName("a")) {
				destinationURL = htmlElement.getElementsByTagName("a")[0].href;
				target = htmlElement.getElementsByTagName("a")[0].getAttribute("target");
			}
		}
	}
	
	if(destinationURL.length > 0) {
		if(target == "_blank") {
			window.open(destinationURL);
		}
		else {
			location.href = destinationURL;
		}
	}
	return false;
}



