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

var debugModus = 1	; // 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;
}

/*################################################################################
Accordions
################################################################################*/

//Accordion Content
window.addEvent('load', function() {
var accordion = new Accordion(
					$$('.toggler'),
					$$('.element'), 
					{
						opacity: false,
						alwaysHide: true,
						show: -1,
						onActive: function(toggler, element){},
						onBackground: function(toggler,element){}
					}
				);
});

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

/*================================================================================
	Scroller
================================================================================*/

var scrollCont = null;
var cont = null;

function startScroll(bt,pos)
{
	bt.onmouseup = stopScroll;
	bt.onmouseout = stopScroll;
	cont = document.getElementById('bpr__scrollContent');
	scrollCont = setInterval("scroll" + pos + "()", 40);
	
}

function scrolldown() { cont.scrollTop += 11; }
function scrollup() { cont.scrollTop -= 11; }
function stopScroll() { clearInterval(scrollCont); }

function encEM(u,h,s) {
	var link = 'm';
	link += 'a';
	link += 'i';
	link += 'l';
	link += 't';
	link += 'o';
	link += ':'+u+'@'+h+'.'+s;
	
	document.location.href = link;
}