// JavaScript Document
$(document).ready(function(){
	$("#slider_links").easySlider({
		controlsBefore:	'<p id="controls">',
		controlsAfter:	'</p>',
		auto: false,
		continuous: true
	});
	$("#slider_rechts").easySlider({
		controlsBefore:	'<p id="controls2">',
		controlsAfter:	'</p>',
		prevId: 'prevBtn2',
		nextId: 'nextBtn2',
		auto: false,
		continuous: true
	});

	$("#pageheader_wirkweise").easySlider({
		controlsBefore:	'<p id="controls_wirkweise2" style="z-index:200;">',
		controlsAfter:	'</p>',
		prevId: 		'prevBtn_wirkweise',
		prevText: 		'<span class="previous">Zur&uuml;ck</span>',
		nextId: 		'nextBtn_wirkweise',
		nextText: 		'<span class="next">Weiter</span><span class="hint">Klicken Sie hier, um mehr zu erfahren</span>',
		auto: false,
		continuous: false
	});

	$("#controls_wirkweise2 #nextBtn_wirkweise .hint").css({
		'display': 'block',
		'width':'250px',
		'padding': '2px 0 0 35px',
		'color': '#fff'
		});

	animateArrow=true;
	if (!$.browser.msie) animateWeiter(0.25);
	$("#controls_wirkweise2 #nextBtn_wirkweise a").click(function() {
		if (!$.browser.msie) animateWeiter(1.0);
		animateArrow=false;
		$("#controls_wirkweise2 #nextBtn_wirkweise .hint").hide();
	});

});

function animateWeiter(opvar){
	if (animateArrow==true) {
		if (opvar==1.0) {
			$("#controls_wirkweise2 #nextBtn_wirkweise .next").animate({
			    opacity: opvar
			  }, 1000);
		} else {
			$("#controls_wirkweise2 #nextBtn_wirkweise .next").animate({
			    opacity: opvar
			  }, 1000, function() {
			  	if (opvar==0.25) opvar=0.99;
				else opvar=0.25;
			    animateWeiter(opvar);
		 	});
	 	}
 	}
}

function activateSliders(){
	$("#slider_links").easySlider({
		controlsBefore:	'<p id="controls">',
		controlsAfter:	'</p>',
		auto: true,
		continuous: true
	});
	$("#slider_rechts").easySlider({
		controlsBefore:	'<p id="controls2">',
		controlsAfter:	'</p>',
		prevId: 'prevBtn2',
		nextId: 'nextBtn2',
		auto: true,
		continuous: true
	});
}