function showChoices( art ){
	if(art == 'prod_gruppe'){
		$('#prod_gruppe_choices').show();
	}else{
		$('#prod_gruppe_choices').hide();
	}
	if(art == 'collection'){
		$('#collection_choices').show();
	}else{
		$('#collection_choices').hide();
	}
	if(art == 'holzart'){
		$('#holzart_choices').show();
	}else{
		$('#holzart_choices').hide();
	}
	if(art == 'verlegeoptik'){
		$('#verlegeoptik_choices').show();
	}else{
		$('#verlegeoptik_choices').hide();
	}
	if(art == 'struktur'){
		$('#struktur_choices').show();
	}else{
		$('#struktur_choices').hide();
	}
	if(art == 'format'){
		$('#format_choices').show();
	}else{
		$('#format_choices').hide();
	}
}


jQuery(function(){

	if(produktgruppe == 'laminat'){
		var tmp_string = 'group_laminat';
	}else if(produktgruppe == 'parkett'){
		var tmp_string = 'group_parkett';
	}else if(produktgruppe == 'massivholzdielen'){
		var tmp_string = 'group_massivholzdielen';
	}else if(produktgruppe == 'paneele'){
		var tmp_string = 'group_paneele';	
	}else{
		var tmp_string = 'nichts';
	}
	if( tmp_string != 'nichts' ){
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}

if(filter == true){
	/* Filterergbinsseite: */
	if( group_paneele == 1){
		var tmp_string = 'group_paneele';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	
	if( group_laminat == 1){
		var tmp_string = 'group_laminat';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}

	if( group_parkett == 1){
		var tmp_string = 'group_parkett';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	
	if( group_massivholzdielen == 1){
		var tmp_string = 'group_massivholzdielen';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	
	
	if( collection_home == 1){
		var tmp_string = 'collection_home';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( collection_style == 1){
		var tmp_string = 'collection_style';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	
	
	if( holzart_Wildkirsche == 1){
		var tmp_string = 'holzart_Wildkirsche';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( holzart_Walnuss == 1){
		var tmp_string = 'holzart_Walnuss';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( holzart_Raeuchereiche == 1){
		var tmp_string = 'holzart_Raeuchereiche';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( holzart_Pinie == 1){
		var tmp_string = 'holzart_Pinie';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( holzart_Nussbaum == 1){
		var tmp_string = 'holzart_Nussbaum';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( holzart_Kirsche == 1){
		var tmp_string = 'holzart_Kirsche';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( holzart_Floral_weiss == 1){
		var tmp_string = 'holzart_Floral_weiss';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( holzart_Esche == 1){
		var tmp_string = 'holzart_Esche';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( holzart_Eiche_Sutter == 1){
		var tmp_string = 'holzart_Eiche_Sutter';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( holzart_Eiche == 1){
		var tmp_string = 'holzart_Eiche';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( holzart_Douglasie == 1){
		var tmp_string = 'holzart_Douglasie';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( holzart_Buche == 1){
		var tmp_string = 'holzart_Buche';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( holzart_Birke == 1){
		var tmp_string = 'holzart_Birke';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( holzart_Beton == 1){
		var tmp_string = 'holzart_Beton';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( holzart_Arktisweiss == 1){
		var tmp_string = 'holzart_Arktisweiss';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( holzart_Apfel == 1){
		var tmp_string = 'holzart_Apfel';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( holzart_Ahorn == 1){
		var tmp_string = 'holzart_Ahorn';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	
	if( verlegeoptik_Schiffsboden_3_Stab == 1){
		var tmp_string = 'verlegeoptik_Schiffsboden_3_Stab';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( verlegeoptik_Schiffsboden_2_Stab == 1){
		var tmp_string = 'verlegeoptik_Schiffsboden_2_Stab';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( verlegeoptik_Landhausdiele_2_Stab == 1){
		var tmp_string = 'verlegeoptik_Landhausdiele_2_Stab';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( verlegeoptik_Landhausdiele == 1){
		var tmp_string = 'verlegeoptik_Landhausdiele';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	
	
	if( struktur_oel == 1){
		var tmp_string = 'struktur_oel';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( struktur_seidenmatt == 1){
		var tmp_string = 'struktur_seidenmatt';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( struktur_feinholz == 1){
		var tmp_string = 'struktur_feinholz';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( struktur_holz == 1){
		var tmp_string = 'struktur_holz';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( struktur_rustikalstruktur == 1){
		var tmp_string = 'struktur_rustikalstruktur';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( struktur_authentisch == 1){
		var tmp_string = 'struktur_authentisch';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( struktur_lackversiegelt == 1){
		var tmp_string = 'struktur_lackversiegelt';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	
	
	if( formate_890x1790x34 == 1){
		var tmp_string = 'formate_890x1790x34';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_3000x45x70 == 1){
		var tmp_string = 'formate_3000x45x70';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_2579x165x10 == 1){
		var tmp_string = 'formate_2579x165x10';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_2570x60x35 == 1){
		var tmp_string = 'formate_2570x60x35';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_2570x34x12 == 1){
		var tmp_string = 'formate_2570x34x12';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_2570x16x50 == 1){
		var tmp_string = 'formate_2570x16x50';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_2570x149x10 == 1){
		var tmp_string = 'formate_2570x149x10';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_2350x115x21 == 1){
		var tmp_string = 'formate_2350x115x21';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_2200x185x13 == 1){
		var tmp_string = 'formate_2200x185x13';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_1900x90x90 == 1){
		var tmp_string = 'formate_1900x90x90';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_1790x890x34 == 1){
		var tmp_string = 'formate_1790x890x34';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_1790x590x34 == 1){
		var tmp_string = 'formate_1790x590x34';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_1790x1790x34 == 1){
		var tmp_string = 'formate_1790x1790x34';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_1787x890x38 == 1){
		var tmp_string = 'formate_1787x890x38';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_1787x1790x38 == 1){
		var tmp_string = 'formate_1787x1790x38';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_1285x192x7 == 1){
		var tmp_string = 'formate_1285x192x7';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_1285x158x8 == 1){
		var tmp_string = 'formate_1285x158x8';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_1274x165x10 == 1){
		var tmp_string = 'formate_1274x165x10';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_1250x149x10 == 1){
		var tmp_string = 'formate_1250x149x10';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_1080x185x13 == 1){
		var tmp_string = 'formate_1080x185x13';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
	if( formate_1000x90x90 == 1){
		var tmp_string = 'formate_1000x90x90';
		$('#' + tmp_string + '_form').attr('value','1');
		$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
		$('#' + tmp_string ).setHead( 'add' );
	}
}


	$('#closeIt').click(function(){
		$('#choices').animate({
				'height': '0px',
				'opacity' : '0'
			},500);
	});


	$('#filter_opt').click(function(){
		$('#choices').animate({
				'height': '0px',
				'opacity' : '0'
			},500,function(){
				$('#choices').animate({
					'height': '140px',
					'opacity' : '1'
				},500);
		});
	});
	
	$('#prod_gruppe_view').click(function(){
		$(this).removeCheck();
		setTimeout("showChoices('prod_gruppe')", 500);
	});
	
	$('#collection_view').click(function(){
		$(this).removeCheck();
		$(this).checkAvailable();
		setTimeout("showChoices('collection')", 500);
	});
	
	$('#holzart_view').click(function(){
		$(this).removeCheck();
		$(this).checkAvailable();
		setTimeout("showChoices('holzart')", 500);
	});
	
	$('#verlegeoptik_view').click(function(){
		$(this).removeCheck();
		$(this).checkAvailable();
		setTimeout("showChoices('verlegeoptik')", 500);
	});
	
	$('#struktur_view').click(function(){
		$(this).removeCheck();
		$(this).checkAvailable();
		setTimeout("showChoices('struktur')", 500);
	});
	
	$('#format_view').click(function(){
		$(this).removeCheck();
		$(this).checkAvailable();
		setTimeout("showChoices('format')", 500);
	});
	
	$('#choices').find('.cross').each(function(){
			$(this).parent().click(function(){
			var tmp_string = $(this).attr('id');
			if($('#' + tmp_string ).children('.cross_label').css('color') != 'rgb(153, 153, 153)'){
				if($('#' + tmp_string + '_form').attr('value') == 0 ){
					$('#' + tmp_string + '_form').attr('value','1');
					$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
					$('#choices').animate({
						opacity: 0.9999999
					},0);
					$('#choices').animate({
						opacity: 1
					},0);
					$(this).setHead( 'add' );
				}else{
					$('#' + tmp_string + '_form').attr('value','0');
					$('#' + tmp_string ).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_false.png');
					$('#choices').animate({
						opacity: 0.9999999
					},0);
					$('#choices').animate({
						opacity: 1
					},0);
					$(this).setHead( 'remove' );
				}
			}
		});
	});
});

$.fn.check = function( ){
$(this).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_true.png');
}

/* Text in Leiste anpassen */
$.fn.setHead = function( method ){
	var gruppe = $(this).parent().parent().attr('id').replace('_choices','');
	
	if( gruppe == 'prod_gruppe'){
		var standardtext = 'nach Produktgruppe';
	}else if( gruppe == 'collection' ){
		var standardtext = 'nach Collections';
	}else if( gruppe == 'holzart' ){
		var standardtext = 'nach Holzart/Dekoren';
	}else if( gruppe == 'verlegeoptik' ){
		var standardtext = 'nach Verlegeoptiken';
	}else if( gruppe == 'struktur' ){
		var standardtext = 'nach Struktur/Sortierung';
	}else if( gruppe == 'format' ){
		var standardtext = 'nach Formaten';
	}

	var text = $(this).children('.cross_label').html();

	if( method == 'add' ){
		$('#' + gruppe).html($('#' + gruppe).html().replace(", " + text,"").replace(standardtext,"") + ", " + text);
	}else{
		$('#' + gruppe).html($('#' + gruppe).html().replace(", " + text,"").replace(text,""));
		
		if($('#' + gruppe).html() == ""){
			$('#' + gruppe).html(standardtext);
		}	
	}
	
	if($('#' + gruppe).html().substring(0,2) == ', '){
		$('#' + gruppe).html($('#' + gruppe).html().substring(2));
	}
	if($('#' + gruppe).html().length > 19){
		$('#' + gruppe + '_view').html($('#' + gruppe).html().substring(0,19) + '..');
	}else{
		$('#' + gruppe + '_view').html($('#' + gruppe).html());
	}

	$('.options').not('#head').each(function(){
		if($(this).html().substring(0,4) != 'nach'){
			$(this).css('background','url(\'fileadmin/templates/_images/content/produkte/filter_a.gif\') no-repeat left center').css('padding-left','20px').css('font-weight','normal');
		}else{
			$(this).css('background','url(\'fileadmin/templates/_images/content/produkte/filter.gif\') no-repeat left center').css('padding-left','20px').css('font-weight','normal');
		}
	});
	
}

$.fn.removeCheck = function(){
	if( $(this).attr('id').substring(0,5) == 'prod_' ){
		$('#hiddenfelder').children().each(function(){
			if( $(this).attr('id').substring(0,5) != 'group' ){
				 $(this).attr('value', '0');
			}
		});
		$('#collection_choices').children('div').each(function(){
			$(this).children('div').each(function(){
				$(this).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_false.png');
				$(this).setHead( 'remove' );
			});
		});
		$('#holzart_choices').children('div').each(function(){
			$(this).children('div').each(function(){
				$(this).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_false.png');
				$(this).setHead( 'remove' );
			});
		});
		$('#verlegeoptik_choices').children('div').each(function(){
			$(this).children('div').each(function(){
				$(this).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_false.png');
				$(this).setHead( 'remove' );
			});
		});
		$('#struktur_choices').children('div').each(function(){
			$(this).children('div').each(function(){
				$(this).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_false.png');
				$(this).setHead( 'remove' );
			});
		});
		$('#format_choices').children('div').each(function(){
			$(this).children('div').each(function(){
				$(this).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_false.png');
				$(this).setHead( 'remove' );
			});
		});
	}else if( $(this).attr('id').substring(0,5) == 'colle'){
		$('#hiddenfelder').children().each(function(){
			if( $(this).attr('id').substring(0,5) != 'group' && $(this).attr('id').substring(0,5) != 'colle' ){
				 $(this).attr('value', '0');
			}
		});
		$('#holzart_choices').children('div').each(function(){
			$(this).children('div').each(function(){
				$(this).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_false.png');
				$(this).setHead( 'remove' );
			});
		});
		$('#verlegeoptik_choices').children('div').each(function(){
			$(this).children('div').each(function(){
				$(this).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_false.png');
				$(this).setHead( 'remove' );
			});
		});
		$('#struktur_choices').children('div').each(function(){
			$(this).children('div').each(function(){
				$(this).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_false.png');
				$(this).setHead( 'remove' );
			});
		});
		$('#format_choices').children('div').each(function(){
			$(this).children('div').each(function(){
				$(this).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_false.png');
				$(this).setHead( 'remove' );
			});
		});
	}else if( $(this).attr('id').substring(0,5) == 'holza'){
		$('#hiddenfelder').children().each(function(){
			if( $(this).attr('id').substring(0,5) != 'group' && $(this).attr('id').substring(0,5) != 'colle' && $(this).attr('id').substring(0,5) != 'holza' ){
				 $(this).attr('value', '0');
			}
		});
		$('#verlegeoptik_choices').children('div').each(function(){
			$(this).children('div').each(function(){
				$(this).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_false.png');
				$(this).setHead( 'remove' );
			});
		});
		$('#struktur_choices').children('div').each(function(){
			$(this).children('div').each(function(){
				$(this).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_false.png');
				$(this).setHead( 'remove' );
			});
		});
		$('#format_choices').children('div').each(function(){
			$(this).children('div').each(function(){
				$(this).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_false.png');
				$(this).setHead( 'remove' );
			});
		});
	}else if( $(this).attr('id').substring(0,5) == 'verle'){
		$('#hiddenfelder').children().each(function(){
			if( $(this).attr('id').substring(0,5) != 'group' && $(this).attr('id').substring(0,5) != 'colle' && $(this).attr('id').substring(0,5) != 'holza' && $(this).attr('id').substring(0,5) != 'verle' ){
				 $(this).attr('value', '0');
			}
		});
		$('#struktur_choices').children('div').each(function(){
			$(this).children('div').each(function(){
				$(this).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_false.png');
				$(this).setHead( 'remove' );
			});
		});
		$('#format_choices').children('div').each(function(){
			$(this).children('div').each(function(){
				$(this).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_false.png');
				$(this).setHead( 'remove' );
			});
		});
	}else if( $(this).attr('id').substring(0,5) == 'struk'){
		$('#hiddenfelder').children().each(function(){
			if( $(this).attr('id').substring(0,5) != 'group' && $(this).attr('id').substring(0,5) != 'colle' && $(this).attr('id').substring(0,5) != 'holza' && $(this).attr('id').substring(0,5) != 'verle' && $(this).attr('id').substring(0,5) != 'struk' ){
				 $(this).attr('value', '0');
			}
		});
		$('#format_choices').children('div').each(function(){
			$(this).children('div').each(function(){
				$(this).children('.cross').children('img').attr('src','fileadmin/templates/_images/checkbox_false.png');
				$(this).setHead( 'remove' );
			});
		});
	}
}

$.fn.checkAvailable = function(){
	var getVariable = '';
	var tmp_string = $(this).attr('id').replace('_view','');
	$('#hiddenfelder').children().each(function(){
			getVariable = getVariable + $(this).attr('id').replace('_form','') + '---' + $(this).attr('value') + '___';
			
	});
	$('#hiddenfelder').children().each(function(){
		if( $(this).attr('id').substring(0, tmp_string.length) == tmp_string ){
			$('#' + tmp_string + '_choices').children('div').each(function(){
				$(this).children('div').each(function(){
					$.ajax({
						url: '/fileadmin/templates/_php/produktfilter_check.php?element=' + $(this).attr('id') + '&params=' + getVariable,
						success: function(msg){
							
							if(msg.substring(0,1) == '0'){
								var element = msg.replace('0','');
								$('#' + element).children('.cross_label').css('color','#999999');
							}else{
								var element = msg.replace('1','');
								$('#' + element).children('.cross_label').css('color','#000000');
							}
						}
					});
				});
			});
			return false;
		}
	});
}
