
// init loader
var loader = new Loader();
loader.setScriptPath("/static/js/");
loader.addFile("lib/prototype.js");
loader.addFile("lib/animator.js");
loader.addFile("lib/swfobject.js");
loader.addFile("lib/trimpath-template.js");
loader.addFile("lib/clearbox.js");
loader.addClass("at.elements.calendar.init");
loader.addClass("at.elements.calendar.de");
loader.addClass("at.elements.textreplace.image");


loader.addClass("at.classes.webcamslider");
loader.addClass("at.classes.portalslider");
loader.addClass("at.classes.webcamdetailslider");

loader.load();
//loader.loadProxy("/tools/gzipproxy/loader.php");


function onDocumentLoad ()
{
	
	// replace text to images
	var imageReplacer = new at.elements.textreplace.image("/static/cache/headlines/",{appendFilename: true});
	
	
	//
	var h1BaseConfig = {
		font: 'Interstate-Regular.ttf',
		width: '650',
		height: '',
		color: '283746',
		size: '14',
		positionx: 0,
		positiony: 17,
		replaceElement: {
			tagName: "span",
			className: "h1"
		}
	}
	
	if(season == "summer")
	{
		var h1SummerConfig = h1BaseConfig;
		h1SummerConfig.color = "e7b900";
		imageReplacer.add({
			elements: $$("h1"),
			options: h1SummerConfig
		});
	}
	else
	{
		var h1WinterConfig = h1BaseConfig;
		h1WinterConfig.color = "5287c1";
		imageReplacer.add({
			elements: $$("h1"),
			options: h1WinterConfig
		});
	}
	
	
	imageReplacer.add({
		elements: $$("#nav em"),
		options: {
			font: 'Interstate-Regular.ttf',
			width: '',
			height: '',
			color: 'ffffff',
			size: '10',
			positionx: 0,
			positiony: 12,
			replaceElement: {
				tagName: "span",
				className: "em"
			}
		}
	});
	
	//imageReplacer.start();
	
	var webcamdetailbox = document.getElementById('detail_webcams');
	if(webcamdetailbox != undefined)
	{
		cams = $(webcamdetailbox).getElementsByClassName('webcam');
		var webcamentries = new at.classes.webcamdetailslider(cams);
	}
	

}

window.onload = onDocumentLoad;


function getLink (linkx)
{
	location.href = linkx;
}


function openWebcams() {
	$('webcams').style.display = 'block';	
	if(webcamslider) {
		webcamslider.start();
	}
}

function closeWebcams() {
	$('webcams').style.display = 'none';
}


 


function gotoLink (htmlElement) {
	
	try {
		if(webedition_editmode) {
			return;
		}
	} catch (e) {}
	
	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;
	}
}

