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

var debugModus		= 1; // Debugmodus EIN = 1 || AUS = 0
var firebugLight	= 0; // Firebug light EIN = 1 || AUS = 0

if(firebugLight)	{ document.write("<script type='text/javascript' src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>"); }

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


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

// 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
################################################################################*/

function faq(trigger) {
	$$('.QandA').each(function(el){
		el.getNext('div').setStyle('display','none');				  
	});
	trigger.getNext('div').setStyle('display','block');
}

/*=======================================================
	initInfoButtons()
=======================================================*/

function initInfoButtons(bt,txt)
{
	bt.txt = txt;
	bt.box = $('infoBox');
	bt.box_content = $('infoBoxContent');
	bt.box_iFrame = $('infoBox_iFrame');
	
	bt.addEvent("mouseover",function(e){
		this.box.style.left = e.page.x/* - 278*/ + "px";
		this.box.style.top = e.page.y + "px";
		this.box_content.innerHTML = this.txt;
		this.box.style.display = "block";
		if (Browser.Engine.trident && Browser.Engine.version < 5) {
			this.box_iFrame.style.width = this.box.offsetWidth + "px";
			this.box_iFrame.style.height = this.box.offsetHeight + "px";
			this.box_iFrame.style.top = this.box.offsetTop + "px";
			this.box_iFrame.style.left = this.box.offsetLeft + "px";
			this.box_iFrame.style.display = "block";
			this.box_iFrame.setOpacity(0.001);
		}
	});
	bt.onmouseout = function() {
		this.box.style.display = "none";
		if (Browser.Engine.trident && Browser.Engine.version < 7) {
			this.box_iFrame.style.display = "none";
		}
	}
}

/*#################################################################
	Text Scroller
###################################################################*/	

var scrollCont	= null;
var cont 		= null;
	
function startScroll(bt,id, pos)
{
	bt.onmouseup = stopScroll;
	bt.onmouseout = stopScroll;
	cont = document.getElementById(id);
	scrollCont = setInterval("scroll" + pos + "()", 60);
}
function scrolldown() { cont.scrollTop += 11; }
function scrollup() { cont.scrollTop -= 11; }
function stopScroll() { clearInterval(scrollCont); }

/*#################################################################
	Javascript Element Selector
###################################################################*/	
function $E(a_id) {
	return Form.getElement(a_id);
}

function sendForm () {
	if (PageManager.currentPage.check()) {
		Beforeunload.showAlert(false);
		ErrorBox.preloader();
	} else {
		ErrorBox.show (TEXTS['Error_AGB']);
	}
}

