//SHOW / HIDE LAYER //
function showLayer (Layer) {
  $(Layer).show();
}
function hideLayer (Layer) {
  $(Layer).hide();
}

// SCROLLFUNKTIONEN VERTIKAL
var hscrolling = false;
var minPos,maxPos;
function scrollDiv(div,scrollSpeed,visibleHeight) {
	minPos = parseInt(document.getElementById(div).offsetHeight)*(-1)+visibleHeight;
	maxPos = 1;
	hscrolling = true;
	scrollRepeater(div,scrollSpeed);	
}
function unscrollDiv(div) {
	hscrolling = false;
}
function scrollRepeater(div,scrollSpeed) {
	actPos = parseInt(getElById(div).style.top);
	if (((actPos+scrollSpeed) > minPos)&&((actPos+scrollSpeed) < maxPos)&&(hscrolling)) {
		hscrolling = true;
	} else {
		hscrolling = false;
	}
	if (hscrolling) {
		newpos= actPos+scrollSpeed;
		getElById(div).style.top =newpos+'px';
		setTimeout("scrollRepeater('"+div+"',"+scrollSpeed+")",25);
	} else {
		hscrolling = false;
	}
}

// SCROLLFUNKTIONEN HORIZONTAL
var vscrolling = false;
var minPos,maxPos;
function scrollDivh(div,scrollSpeed,visibleWidth) {
	minPos = parseInt(document.getElementById(div).offsetWidth)*(-1)+visibleWidth;
	maxPos = 1;
	vscrolling = true;
	scrollRepeaterh(div,scrollSpeed);	
}
function unscrollDivh(div) {
	vscrolling = false;
}
function scrollRepeaterh(div,scrollSpeed) {
	actPos = parseInt(getElById(div).style.left);
	if (((actPos+scrollSpeed) > minPos)&&((actPos+scrollSpeed) < maxPos)&&(vscrolling)) {
		vscrolling = true;
	} else {
		vscrolling = false;
	}
	if (vscrolling) {
		newpos= actPos+scrollSpeed;
		getElById(div).style.left =newpos+'px';
		setTimeout("scrollRepeaterh('"+div+"',"+scrollSpeed+")",25);
	} else {
		vscrolling = false;
	}
}


function getElById(id){
	return(document.getElementById==null) ?
   (document.all==null ? null : document.all[id]) : document.getElementById(id);
}