function ze_togglevisibility(elem){
	if(document.getElementById('tickets_container_'+elem).style.height=='auto'){
		document.getElementById('tickets_container_'+elem).style.height = '29px';
		document.getElementById('tickets_container_'+elem).style.background = '#fff6a5';
		document.getElementById('tw'+elem).style.background = 'url("fileadmin/templates/images/span_auswaehlen_zu.png") top right no-repeat';
		document.getElementById('td1_'+elem).style.fontWeight = 'normal';
		document.getElementById('td2_'+elem).style.fontWeight = 'normal';
		document.getElementById('td3_'+elem).style.fontWeight = 'normal';
	} else {
		document.getElementById('tickets_container_'+elem).style.height = 'auto';
		//$('#'+elem).animate({height: ['auto', 'swing']}, 5000, 'linear');
		document.getElementById('tickets_container_'+elem).style.background = '#fff8da';
		document.getElementById('tw'+elem).style.background = 'url("fileadmin/templates/images/span_auswaehlen_auf.png") top right no-repeat';
		document.getElementById('td1_'+elem).style.fontWeight = 'bold';
		document.getElementById('td2_'+elem).style.fontWeight = 'bold';
		document.getElementById('td3_'+elem).style.fontWeight = 'bold';
	}
}


scrollcount = 0;
sscrollcount = 0;
bmarginLeft = 0;
smarginLeft = 0;
function ze_bscroll(){
	if((-499)*(scrollcount-1) > bmarginLeft){
		bmarginLeft = 0;
		document.getElementById('scrolleritems1').style.marginLeft = bmarginLeft+'px';
	}
	bmarginLeft = (-499)*scrollcount > bmarginLeft ? 0 : bmarginLeft-499;
	$('#scrolleritems1').animate({ marginLeft: bmarginLeft+'px' }, 1000, 'easeInOutExpo');
	btimeout = window.setTimeout(ze_bscroll, 3000);
}

function ze_bscroll_r(){
	clearTimeout(btimeout);
	if(bmarginLeft>-499){
		bmarginLeft = scrollcount*(-499);
		document.getElementById('scrolleritems1').style.marginLeft = bmarginLeft+'px';
	}
	bmarginLeft = (bmarginLeft == 0) ? 0 : bmarginLeft+499;
	//alert(bmarginLeft);
	$('#scrolleritems1').animate({ marginLeft: bmarginLeft+'px' }, 1000, 'easeInOutExpo');
	btimeout = window.setTimeout(ze_bscroll, 3000);
}

function ze_bscroll_left(){
	clearTimeout(btimeout);
	ze_bscroll();
}

function ze_bscroll_right(){
	clearTimeout(btimeout);
	ze_bscroll_r();
}


function ze_sscroll(){
	if((-279)* (sscrollcount-1) > smarginLeft){
		smarginLeft = 0;
		document.getElementById('scrolleritems2').style.marginLeft = smarginLeft+'px';
	}
	smarginLeft = (-279)*sscrollcount > smarginLeft ? 0 : smarginLeft-279;
	$('#scrolleritems2').animate({ marginLeft: smarginLeft+'px' }, 1000, 'easeInOutExpo');
	stimeout = window.setTimeout(ze_sscroll_left, 3000);
}

function ze_sscroll_r(){
	if(smarginLeft>-279){
		smarginLeft = sscrollcount*(-279);
		document.getElementById('scrolleritems2').style.marginLeft = smarginLeft+'px';
	}
	smarginLeft = smarginLeft+279;
	$('#scrolleritems2').animate({ marginLeft: smarginLeft+'px' }, 1000, 'easeInOutExpo');
	stimeout = window.setTimeout(ze_sscroll_left, 3000);
}

function ze_sscroll_left(){
	clearTimeout(stimeout);
	ze_sscroll();
}

function ze_sscroll_right(){
	clearTimeout(stimeout);
	ze_sscroll_r();
}



$(document).ready(function() {
	var sc1 = document.getElementById('scrolleritems1');
	if(sc1!=null){
		scrollcount = $('.csc-textpic-above').length;
		document.getElementById('scrolleritems1').innerHTML+=document.getElementById('scrolleritems1').innerHTML+document.getElementById('scrolleritems1').innerHTML;
		document.getElementById('scrolleritems1').marginLeft = scrollcount*(-499);
		btimeout = window.setTimeout(ze_bscroll, 3000);
	}

	var sc2 = document.getElementById('scrolleritems2');
	if(sc2!=null){
		sscrollcount = $('.sselem').length;
		document.getElementById('scrolleritems2').innerHTML+=document.getElementById('scrolleritems2').innerHTML+document.getElementById('scrolleritems2').innerHTML;
		stimeout = window.setTimeout(ze_sscroll_left, 3000);
	}

	var fbElem = document.getElementById('facebook-like-button');
	if(fbElem!=null){
		fbElem.innerHTML = '<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fheideparkresort&amp;width=260&amp;colorscheme=light&amp;show_faces=false&amp;border_color&amp;stream=false&amp;header=true&amp;height=62" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:260px; height:62px;" allowTransparency="true"></iframe>';
	}

	var tickerDiv = document.getElementById("ticker01");
	if(tickerDiv != null){
		document.getElementById("ticker01").innerHTML = document.getElementById("ticker01").innerHTML+document.getElementById("ticker01").innerHTML+document.getElementById("ticker01").innerHTML+document.getElementById("ticker01").innerHTML+document.getElementById("ticker01").innerHTML+document.getElementById("ticker01").innerHTML+document.getElementById("ticker01").innerHTML+document.getElementById("ticker01").innerHTML;
		$(function(){
		    $("ul#ticker01").liScroll({travelocity: 0.03});
		});
	}

});

