// JavaScript Document
$(document).ready(function(){
	/*$("#twitterpostbox").attr("checked",false);*/
	var ref = document.location.href;
	if(ref.indexOf("altbau")>-1){
		$("#altbauhead").next().slideDown();
	}
	if(ref.indexOf("neubau")>-1){
		$("#neubauhead").next().slideDown();
	}
	if(ref.indexOf("erneuerbare")>-1){
		$("#erneuerbarehead").next().slideDown();
	}
	if(ref.indexOf("kwk")>-1){
		$("#kraftwaermehead").next().slideDown();
	}
	if(ref.indexOf("nwg")>-1){
		$("#nichtwohnhead").next().slideDown();
	}
	
	$("#kontaktwidget div").show();
	$("#freitextwidget div").show();
	$(".widget div h2").click(function(){
		$(".widget div").next().slideUp("slow",function(){ $(".widget div h2").css("background","url(/standards/images/widget_headline_arrow_vert.gif) 0px 1px no-repeat"); });
		$.daselement = $(this);
		if($(this).parent().next().is(":hidden")){ 
			$(this).parent().next().slideDown("slow",function(){ $.daselement.css("background","url(/standards/images/widget_headline_arrow_horiz.gif) 0px 1px no-repeat"); });
			
		}
		else{
			$(this).parent().next().slideUp("slow",function(){ $.daselement.css("background","url(/standards/images/widget_headline_arrow_vert.gif) 0px 1px no-repeat"); });
			
		}
		return false;
	});
	
	$(".antragshead").click(function(){ 
		$(".antragshead").next().slideUp("slow");
		$(".antragshead").find("h2").css("background","url(/standards/images/widget_headline_arrow_vert.gif) 13px 31px no-repeat");
		$.daselement = $(this).find("h2");
		if($(this).next().is(":hidden")){ 
			$(this).next().slideDown("slow",function(){ $.daselement.css("background","url(/standards/images/widget_headline_arrow_horiz.gif) 13px 32px no-repeat");});
		}
		else{
			$(this).next().slideUp("slow",function(){ $.daselement.css("background","url(/standards/images/widget_headline_arrow_vert.gif) 13px 31px no-repeat"); });
		}
		
		
		return false;
	});
		
	$(".klappbox_foot").click(function(){
		if($(this).next().is(":hidden")){
			$(this).next().slideDown();
			$(this).html('<span class="text_less">schlie&szlig;en</span>');
		}
		else{
			$(this).next().slideUp();
			$(this).html('<span class="text_more">mehr anzeigen</span>');
		}
		 return false;
	});
	
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'fast', /* fast/slow/normal */
		padding: 40, /* padding for each side of the picture */
		opacity: .7, /* Value betwee 0 and 1 */
		showTitle: true, /* true/false */
		allowresize: true, /* true/false */
		counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
		theme: 'light_square' /* light_rounded / dark_rounded / light_square / dark_square */
	});
									
});
