var tx_denaoafebrev2;
var zrwshopDeliveryForm;

window.onload=function(){
	if (!document.getElementById) return;
	var r=document.getElementsByTagName('tr');
	var l=r.length;
	for (i=0;i<l;i++){if (i%2 == 0){} else {r[i].className+=' altrow';}}

	if (tx_denaoafebrev2) {
		//tx_denaoafebrev2_hideButtons();
		//if (document.getElementById('scrollbar')) document.getElementById("scrollbar").style.display = "block";
		//tx_denaoafebrev2_altTableRows();

		tx_denaoafebrev2_onload();
	}
	if (zrwshopDeliveryForm==false) tx_zrwshop_hideDelivery();
}


/*scrollable teaser*/
var teaserRunOnce = function (teaserID) {
	
	if(!document.getElementById(teaserID)) return;
	var teaserHeight = document.getElementById(teaserID).firstChild.offsetHeight; 
	var margin = 12;
	document.getElementById('addcontent').style.paddingTop = (teaserHeight+margin) + "px";
}

function moveTeaser(teaserID){
	
	//if teaser was not found return
	if(!document.getElementById(teaserID)) return;
	var scrollStart = 235;
	
	if(!window.innerHeight) scrollY=document.documentElement.scrollTop;
	else scrollY=window.pageYOffset;
	if(scrollY>scrollStart){
		menuScroll=scrollY-scrollStart;
		document.getElementById(teaserID).style.top=(menuScroll)+"px";
	}	else {
		document.getElementById(teaserID).style.top=0;
	}
	window.setTimeout("moveTeaser('" + teaserID + "')",100);
}

function winOnload_addEventFunc (func){
	if(typeof window.onload == 'function') {
		var oldevent = window.onload;
		var newEvent = function () {
			oldevent(); //preserve previous event func
			func();
		} 
		window.onload = newEvent;
	} else {
		window.onload = func;
	}
} 

var a = function() {moveTeaser('scrollableTeaser');};
var b = function() {teaserRunOnce('scrollableTeaser');};

winOnload_addEventFunc(a);
winOnload_addEventFunc(b);
