jQuery(window).bind("load", function() {
	jQuery("div#slider1").codaSlider()
});

$(document).ready(function() {	

    $(document).pngFix(); 

	$('.scroll-pane').jScrollPane(
		{
			showArrows: true,
			arrowScrollOnHover: true
		}
	);

	// IE does not support text-shadow
	var option = {
	  x:      1, 
	  y:      1, 
	  radius: 3,
	  color:  "#333"
	}
	$("h1").textShadow( option );

	var key = "hoehe";

	$(".accordion").accordion({
		header: 'a.more', 
	    active: false, 
	    alwaysOpen: false, 
	    animated: false, 
	    autoheight: true, 
		collapsible: true, 
		navigation: true
	});
	
	$("a.more").click(function () {
		$("a.more").hide();
		// aktuellen wert der hoehe speichern
		var data = {
		    height270: $(".c270down").height()
		}
		$.jCache.setItem(key, data);
		//$('.equalize').equalHeights(); 
   	});  

	$("#footerContainer").footer();

/* 	
	equalheights deaktiviert, da es 3px Abstand nach unten
	produziert im IE -> Abstand unter bündigem Bild, und die 
	Berechnung fuer den Vorhang stimmt auch nicht mehr
*/
	//$('.equalize').equalHeights(); 
    
	// Schliessen-Button bei geoeffnetem Accordion
	$('.accordion a.close').each(function (index, elm) {
   		$(elm).click(function() {
        	$('.accordion').accordion('activate', true);
			// equalheights wieder rueckgaengig machen
			var myData = $.jCache.getItem(key);
			if ($.browser.msie && $.browser.version == 6.0) { $(".c270down").css({'height': myData.height270}); }
			$(".c270down").css({'min-height': myData.height270}); 
			if ($.browser.msie && $.browser.version == 6.0) { $(".c710down").css({'height': myData.height270}); }
			$(".c710down").css({'min-height': myData.height270}); 
     	});
	});

	$("a.close").click(function () {
	    $("a.more").show();
	});

});
	

// JS function for uncrypting spam-protected emails:
function UnCryptMailto(s) {	//
	var n=0;
	var r="";
	for(var i=0; i < s.length; i++) {
		n=s.charCodeAt(i);
		if (n>=8364) {n = 128;}
		r += String.fromCharCode(n-(1));
	}
	return r;
}
	
// JS function for uncrypting spam-protected emails:
function linkTo_UnCryptMailto(s) {
	location.href=UnCryptMailto(s);
}
