/*
 javascript Healthplus
Author: Remigiusz Zmuda
Email r_zmuda(at)yahoo.de
*/

function initInhalt(){

		var flip =0;
		$("#hp_inhalt").show("normal");
		$("#hp_inhalt_butt").click(
			function(){
				$("#hp_inhalt").toggle("slow");
			} 
		);
}

function setPrevNext(){

 pic = document.getElementById('prevNextPic');
 if(!pic) return;
 picWidth  = pic.offsetWidth;
 picHeight = pic.offsetHeight;
 if(document.all){ 
	 picTop   = document.all.prevNextPic.offsetTop;
	 picLeft  = document.all.prevNextPic.offsetLeft;
 }
 //alert(picWidth+" / "+picHeight+"\n"+picTop+" / "+ picLeft);

  element = document.getElementById('prevNextPic');   // Element dessen Abstand gemessen wird
  abstLeft = 0;   // init
  abstTop  = 0;
  text="";
  while(element.offsetParent){    // if element hat Parrent
    abstLeft  += element.offsetLeft;
    abstTop   += element.offsetTop;
    element = element.offsetParent;   // rekursiv zur&uuml;ck
  }
//  alert ("left= "+abstLeft + "\ntop= "+abstTop);
  
 // Image prev
 prev = document.getElementById('prevButton');           //getElementById('prevButton');
 if(prev){
   prev.style.width   = picWidth/2 + ".px";
   prev.style.height  = picHeight  + ".px";
   prev.style.left    = abstLeft + "px";    // immer left
   prev.style.top     = abstTop + "px"; 
   prev.style.visibility  ="visible";
  }
 
 // Image next
 next = document.getElementById('nextButton');         //getElementById('nextButton');
 if(next){
   next.style.width   = picWidth/2 + ".px";
   next.style.height  = picHeight  + ".px";
   next.style.left    = abstLeft+picWidth/2 + "px";    // immer right
   next.style.top     = abstTop + "px"; 
   next.style.visibility  ="visible";
 }
}

window.onload = function(){

  setPrevNext();
  initInhalt();
}//end on load
