/*################################################################################
	D E B U G
################################################################################*/

var debugModus = 0	; // Debugmodus EIN = 1 || AUS = 0

function debug(txt)
{
	if(!debugModus || typeof(console) != "object") { return; }
	else { console.log(txt); }
}
debug("debugModus = true");


/*################################################################################
	$$$
################################################################################*/

// get Elements by Name

function $$$(obj)
{
	var obj = document.getElementsByName(obj);
	obj = (obj.length==1)?obj[0]:obj;
	return obj;
}


/*################################################################################
	F U N C T I O N S
################################################################################*/

/*--------------------------------------------------------------------------------
	setBackgroundImage()
--------------------------------------------------------------------------------*/

function setBackgroundImage() {
	
	var defWidth	 	= 1920;
	var defHeight		= 1280;
	var defRatio		= defWidth / defHeight;
	var hgbCt			= $('backgroundContainer');
	var img				= $('backgroundContainerIMG');
	
	hgbCt.style.width	= "0px";
	hgbCt.style.height	= "0px";
	
	var w				= window.getSize().x;
	var h				= window.getSize().y;
	
	hgbCt.style.width	= w + "px";
	hgbCt.style.height	= h + "px";
	
	var tmpRatio = w / h;
	if(tmpRatio > defRatio) {
		img.style.width		= w + "px";
		img.style.height	= w/defRatio + "px";
	} else {
		img.style.height	= h + "px";
		img.style.width		= h*defRatio + "px";
	}
	img.style.visibility="visible";
}


function setFooterTrans() 
{
	$('footer').tween("opacity", 0.7);
}

window.addEvent("load", function() {
	if ($chk($('backgroundContainer')) > 0) {
			setBackgroundImage()
	}
	setFooterTrans();
});

window.addEvent("resize", function() {
	if ($chk($('backgroundContainer')) > 0) {
			setBackgroundImage()
	}
	setFooterTrans();
});
