jQuery(document).ready( function() {
	
	
	// STARTSEITENHEADER
	jQuery("#fce_tabs").tabs({
		event: "click",
		fx: [{opacity:'toggle', duration:'fast'},   // hide option
                        {opacity:'toggle', duration:'slow'}]		
	});
	
	$("#fce_tabs").tabs({ fx: [{opacity:'toggle', duration:'fast'},   // hide option
                        {opacity:'toggle', duration:'slow'}] }).tabs('rotate', 10000);
	
	jQuery('#fce_tabs a').hover(function(){
		$(this).css('cursor', 'pointer');
	});	
	
	
	// CONTENT ACCORDION
	jQuery("#accordion").accordion({
		autoHeight: false,
		navigation: true,
		header: "> span > h3",
		active: 0,
		animated: 'bounceslide'
	});


	// CONTENT TABS
	jQuery("#fce_contenttabs").tabs({
		event: "click",
		fx: [{opacity:'toggle', duration:'fast'},   // hide option
                        {opacity:'toggle', duration:'slow'}]		
	});	
	
	
	// KONTAKTFORMULAR	
	jQuery("#details1").css("height","0px");
	jQuery("#details2").css("height","0px");
	jQuery("#details3").css("height","0px");
	jQuery(':checkbox').css("border", "none");
	jQuery(':radio').css("border", "none");
	jQuery('.mailformplus_contactform input').change(function() {
		
		var tmpAnliegen = "";
		
		if (jQuery("#gebaeudeservice").attr("checked")){
			tmpAnliegen += 'Gebäudeservice:\n---------------------------------\n';
			jQuery.each(jQuery("#dettab1 input"), function() {
				if (jQuery(this).attr("checked") && jQuery(this).attr("type") == "checkbox"){
		      		tmpAnliegen += jQuery(this).val() + "\n";
		      	}
		   	});	
		   	tmpAnliegen += '---------------------------------\n\n';		
		}
		
		if (jQuery("#personalservice").attr("checked")){
			tmpAnliegen += 'Personal:\n---------------------------------\n';
			jQuery.each(jQuery("#dettab2 input"), function() {
				if (jQuery(this).attr("checked") && jQuery(this).attr("type") == "checkbox"){
		      		tmpAnliegen += jQuery(this).val() + "\n";
		      	}
		   	});	
		   	tmpAnliegen += '---------------------------------\n\n';		
		}		
		
		if (jQuery("#mietservice").attr("checked")){
			tmpAnliegen += 'Mietservice:\n---------------------------------\n';
			jQuery.each(jQuery("#dettab3 input"), function() {
				if (jQuery(this).attr("checked")){
		      		tmpAnliegen += jQuery(this).val() + "\n";
		      	} else if (jQuery(this).val() != "" && jQuery(this).attr("type") == "text"){
					tmpAnliegen += jQuery(this).attr("rel") + "" + jQuery(this).val() + "\n";
		      	}
		   	});	
		   	tmpAnliegen += '---------------------------------\n\n';	
		}		
		
		if (jQuery("#allgemeinefrage").attr("checked")){
			tmpAnliegen += 'Allgemeine Frage\n';
		}

	  	jQuery("#anliegen").val(tmpAnliegen);
	});	
	
	
});

function checkb(boxname,boxid){
	if($("#"+boxname+":checked").val()=="X"){
		var height=$("#dettab"+boxid).height();
		
		$("#details"+boxid).css("height",height+"px");	
	}else{
		$("#details"+boxid).css("height","0px");
		$("#details"+boxid+" input").each(function(){
			$(this).removeAttr("checked");
		});
	}
}

