/* JS-Vars */
var resizeMe = true;
/* JS-Vars */

function BS_init() {
	resize();
	setScroller();
	Illustration();
}

/* Illustration */
function Illustration() {
	var IlluAni = new SWFObject("fileadmin/swf/Animation/Animation_01.swf", "BS_Animation", "784", "128", "8", "transparent");
	IlluAni.addParam("menu", "false");
	IlluAni.addParam("wmode", "transparent");
	IlluAni.write("BS_Illustration");
}
/* Illustration ENDE */

/* setScroller */
function setScroller() {
	var init = document.getElementById('BS_Content_InnerWrap').scrollHeight;
	var test = document.getElementById('BS_Content_InnerWrap').style.height;
	var test2 = test.replace(/px/g, "");
	var newBlock =  ( init > test2)?  'block':'none';
	document.getElementById('scroller').style.display = newBlock;
}
/* setScroller ENDE */

/* resize */
function resize() {

  var ref_Heigh;
  if (self.innerHeight)  {
    // all except Explorer
    ref_Heigh = self.innerHeight;
  } else if (document.documentElement && document.documentElement.clientHeight) {
    // Explorer 6 Strict Mode
    ref_Heigh = document.documentElement.clientHeight;
  } else if (document.body)  {
    // other Explorers
    ref_Heigh = document.body.clientHeight;
  }

  var azh=0;
	  azh += document.getElementById('BS_Header').offsetHeight;
	  azh += document.getElementById('BS_Topleiste').offsetHeight;
	  azh += document.getElementById('BS_Footer').offsetHeight;
	  /* paddings /Browserspezifisch */
	  var addPaddings = (navigator.userAgent.indexOf("MSIE") >=0)? 36 : 36; 
	  azh += addPaddings;
  var newHeight = ref_Heigh - azh;
  var ele_aa = document.getElementById('BS_Content');
  var ele_ab = document.getElementById('BS_Content_Wrapper');
  var ele_ad = document.getElementById('BS_Content_InnerWrap');
  var ele_ac = document.getElementById('BS_Content_Right');
  
  var topMargins = 36;
  ele_aa.style.height = eval(newHeight-topMargins)+'px';
  ele_ac.style.height = eval(newHeight-topMargins)+'px';
  ele_ab.style.height = eval(newHeight)+'px';
  ele_ad.style.height = eval(newHeight)+'px';
 
} 
/* resize ENDE */

/* scroll */
function scrolltoTop() {
  if(resizeMe==true) {
  var objDiv = document.getElementById('BS_Content_InnerWrap');
  objDiv.scrollTop = 0;
  } else { 
	window.scrollTo(0,0);
	}
}
/* scroll ENDE */

/* find Position */
function findPos(obj) {
	var curleft = curtop = 0;
	if(obj) {
		if (obj.offsetParent) {
			do {
				curleft += obj.offsetLeft;
				curtop += obj.offsetTop;
			} while (obj = obj.offsetParent);
		}
	}
	return [curleft,curtop];
}
/* find Position ENDE */