$(document).ready(function () {
			hoheplay = $('div.balken-a-inhalt').height();
				if(!FlashDetect.installed){
					$('div.player').css('height','0px');
					$('div.player-alt').css('height','100%');
				}else{
					$('div.player').css('height','100%');
					$('div.player-alt').css('height','0px');
				}
			}
);

$(document).ready(function() {
	$('a[href*=#]').bind("click", function(event) {
		event.preventDefault();
		var ziel = $(this).attr("href");

		$('html,body').animate({
			scrollTop: $(ziel).offset().top
		}, 1000 , function (){location.hash = ziel;});
});
return false;
});

function auf(dieID) {
	var hohe = $('#infotext_'+dieID+' div.text').height() + 12;
	$('#infotext_'+dieID).stop().animate({'height': hohe}, 500);
	$('#balken-a').stop().animate({'height': hoheplay+hohe}, 500);
	$('#jp-audio-id_'+dieID).stop().animate({'width': 489}, 500);
	
}

function zu(dieID) {
	$('#infotext_'+dieID).stop().animate({'height': 0}, 500);
	$('#jp-audio-id_'+dieID).stop().animate({'width': 21}, 500);
}

function cplayer(pid,wo,datei) {
	$('#infotext_'+wo).after('<div id="jquery_jplayer_'+pid+'" class="jp-jplayer"></div> <div class="jp-audio" id="jp-audio-id_'+pid+'"> <div class="jp-type-single"> <div id="jp_interface_'+pid+'" class="jp-interface"> <ul class="jp-controls"> <li><a href="#" class="jp-play">Play</a></li> <li><a href="#" class="jp-pause">Pause</a></li> </ul> <div class="jp-progress"> <div class="jp-seek-bar">	<div class="jp-play-bar"></div>	</div> </div> <div class="jp-current-time"></div> <div class="jp-duration"></div> </div> </div>	</div>');

	$('#jquery_jplayer_'+pid).jPlayer({
		ready: function () {
			$(this).jPlayer('setMedia', {
				mp3: datei
			});
		},
		
		play: function(event) {
			$(this).jPlayer('pauseOthers');
			$(this).jPlayer('volume', 1);
			andereZu();
			auf(pid);
		},		
		
		swfPath: 'src/js',
		supplied: 'mp3',
		cssSelectorAncestor: '#jp_interface_'+pid
	}); 
}

function andereZu() {
	$('div.infotext').each(function () {
						$(this).stop().animate({'height': '0px'}, 500);
					});
	$('div.jp-audio').each(function () {
						$(this).stop().animate({'width': '21px'}, 500);
					});
}

function opencat(dieID) {
	var hohe = $('div.balken-'+dieID+'-inhalt').height();
	var speed = hohe+300;
	$("#balken-"+dieID).stop().animate({'height': hohe}, speed);
	$("#keil-"+dieID+"2").stop().animate({'opacity': 0}, speed);
	$("#keil-"+dieID+"2").css('z-index',-5);
	$("#keil-"+dieID+"1").stop().animate({'opacity': 1}, speed);
	$("#keil-"+dieID+"1").css('z-index',1);
}

function closecat(dieID) {
	var hohe = $('div.balken-'+dieID+'-inhalt').height();
	var speed = hohe+300;
	$("#balken-"+dieID).stop().animate({'height': 0}, speed);
	$("#keil-"+dieID+"1").stop().animate({'opacity': 0}, speed);
	$("#keil-"+dieID+"1").css('z-index',-5);
	$("#keil-"+dieID+"2").stop().animate({'opacity': 1}, speed);
	$("#keil-"+dieID+"2").css('z-index',1);
}

var FlashDetect=new function(){var self=this;self.installed=false;self.raw="";self.major=-1;self.minor=-1;self.revision=-1;self.revisionStr="";var activeXDetectRules=[{"name":"ShockwaveFlash.ShockwaveFlash.7","version":function(obj){return getActiveXVersion(obj);}},{"name":"ShockwaveFlash.ShockwaveFlash.6","version":function(obj){var version="6,0,21";try{obj.AllowScriptAccess="always";version=getActiveXVersion(obj);}catch(err){}
return version;}},{"name":"ShockwaveFlash.ShockwaveFlash","version":function(obj){return getActiveXVersion(obj);}}];var getActiveXVersion=function(activeXObj){var version=-1;try{version=activeXObj.GetVariable("$version");}catch(err){}
return version;};var getActiveXObject=function(name){var obj=-1;try{obj=new ActiveXObject(name);}catch(err){obj={activeXError:true};}
return obj;};var parseActiveXVersion=function(str){var versionArray=str.split(",");return{"raw":str,"major":parseInt(versionArray[0].split(" ")[1],10),"minor":parseInt(versionArray[1],10),"revision":parseInt(versionArray[2],10),"revisionStr":versionArray[2]};};var parseStandardVersion=function(str){var descParts=str.split(/ +/);var majorMinor=descParts[2].split(/\./);var revisionStr=descParts[3];return{"raw":str,"major":parseInt(majorMinor[0],10),"minor":parseInt(majorMinor[1],10),"revisionStr":revisionStr,"revision":parseRevisionStrToInt(revisionStr)};};var parseRevisionStrToInt=function(str){return parseInt(str.replace(/[a-zA-Z]/g,""),10)||self.revision;};self.majorAtLeast=function(version){return self.major>=version;};self.minorAtLeast=function(version){return self.minor>=version;};self.revisionAtLeast=function(version){return self.revision>=version;};self.versionAtLeast=function(major){var properties=[self.major,self.minor,self.revision];var len=Math.min(properties.length,arguments.length);for(i=0;i<len;i++){if(properties[i]>=arguments[i]){if(i+1<len&&properties[i]==arguments[i]){continue;}else{return true;}}else{return false;}}};self.FlashDetect=function(){if(navigator.plugins&&navigator.plugins.length>0){var type='application/x-shockwave-flash';var mimeTypes=navigator.mimeTypes;if(mimeTypes&&mimeTypes[type]&&mimeTypes[type].enabledPlugin&&mimeTypes[type].enabledPlugin.description){var version=mimeTypes[type].enabledPlugin.description;var versionObj=parseStandardVersion(version);self.raw=versionObj.raw;self.major=versionObj.major;self.minor=versionObj.minor;self.revisionStr=versionObj.revisionStr;self.revision=versionObj.revision;self.installed=true;}}else if(navigator.appVersion.indexOf("Mac")==-1&&window.execScript){var version=-1;for(var i=0;i<activeXDetectRules.length&&version==-1;i++){var obj=getActiveXObject(activeXDetectRules[i].name);if(!obj.activeXError){self.installed=true;version=activeXDetectRules[i].version(obj);if(version!=-1){var versionObj=parseActiveXVersion(version);self.raw=versionObj.raw;self.major=versionObj.major;self.minor=versionObj.minor;self.revision=versionObj.revision;self.revisionStr=versionObj.revisionStr;}}}}}();};FlashDetect.JS_RELEASE="1.0.4";

function gotoImpressum() {
	opencat('i');
}
