// init loader
var loader = new Loader();
loader.setScriptPath("/static/cms/system/modules/at.wbag.opencms.cms.ceeseg/resources/js/");
loader.addFile("lib/prototype.js");

loader.addFile("src/scriptaculous.js");
loader.addFile("src/effects.js");
loader.addFile("lightbox.js");

loader.addFile("lib/animator.js");
loader.addFile("lib/swfobject.js");
loader.addFile("lib/trimpath-template.js");
loader.addFile("cookie.js");

loader.addClass("at.ceeseg.main_navigation.hover");

loader.load();
//loader.loadProxy("http://www.ceeseg.at/tools/scriptproxy/loader.php");


function onDocumentLoad ()
{
	new at.ceeseg.main_navigation.hover( [ $$('#metanav li')] );

	//initLightbox();

}

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(target == "_blank") {
		window.open(destinationURL);
	}
	else {
		location.href = destinationURL;
	}
}