$(document).ready(
	function()
	{
		$(".accordionPremieren").accordion( { clearStyle: true, autoHeight: false, icons: {'header': 'icon-accordion-closed', 'headerSelected': 'icon-accordion-open'}, active: 0 } );
		$(".accordion").accordion( { clearStyle: true, autoHeight: false, icons: {'header': 'icon-accordion-closed', 'headerSelected': 'icon-accordion-open'}, active: false } );

		
	//	$("ul.submenu").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)  
		
		$("#nav ul.menu li ul.submenu").hide();
		$("#nav ul.menu li a").hover(function()
		{

	        $(this).parent().find("ul.submenu").slideDown('fast').show();

	        $(this).parent().hover(
				function() {  }, 
				function()
				{  
	            	$(this).parent().find("ul.submenu").slideUp('fast'); 
	        	});  

	    });
	}

);

// KS_MOD
// function call in ext/sr_feuser_register/lib/class.tx_srfeuserregister_tca.php
// Line 583


function hideTheaterNew(selected) {

	if(!selected || selected == 0) {
		showFields = new Array (
			'theatertxt_dt',
			'theatertxt_dd',
			'theatername_dt',
			'theatername_dd',
			'theaterstr_dt',
			'theaterstr_dd',
			'theaterstr2_dt',
			'theaterstr2_dd',
			'theaterplz_dt',
			'theaterplz_dd',
			'theatercity_dt',
			'theatercity_dd'
		);
		showThisFields(showFields);
	} else {
		hideFields = new Array (
			'theatertxt_dt',
			'theatertxt_dd',
			'theatername_dt',
			'theatername_dd',
			'theaterstr_dt',
			'theaterstr_dd',
			'theaterstr2_dt',
			'theaterstr2_dd',
			'theaterplz_dt',
			'theaterplz_dd',
			'theatercity_dt',
			'theatercity_dd'
		);
		hideThisFields(hideFields);
	}
}

function showMe(field){
		
	if(field == 'tx-srfeuserregister-pi1-tx_dreimaskenreg_group-1'){
		
		// Profis
		
		showFields = new Array (
			'anstellung_dt',
			'anstellung_dd',
			'submit_btn'
		);
		
		hideFields = new Array (
			'email_dt',
			'email_dd',
			'password_dt',
			'password_dd',
			'first_name_dt',
			'first_name_dd',
			'last_name_dt',
			'last_name_dd',
			'theater_dt',
			'theater_dd',
			'theaterprofi_dt',
			'theaterprofi_dd',
			'theateramateur_dt',
			'theateramateur_dd',
			'theatertxt_dt',
			'theatertxt_dd',
			'theatername_dt',
			'theatername_dd',
			'theaterstr_dt',
			'theaterstr_dd',
			'theaterstr2_dt',
			'theaterstr2_dd',
			'theaterplz_dt',
			'theaterplz_dd',
			'theatercity_dt',
			'theatercity_dd',
			'theaterabteilung_dt',
			'theaterabteilung_dd',
			'company_dt',
			'company_dd',
			'sonstige_info_dt',
			'sonstige_info_dd',
			'address_dt',
			'address_dd',
			'zip_dt',
			'zip_dd',
			'city_dt',
			'city_dd',
			'www_dt',
			'www_dd'
		);
		
	} else if(field == 'tx-srfeuserregister-pi1-tx_dreimaskenreg_group-2') {
		
		// Amateure
		showFields = new Array (
			'theateramateur_dt',
			'theateramateur_dd',
			'theatertxt_dt',
			'theatertxt_dd',
			'theatername_dt',
			'theatername_dd',
			'theaterstr_dt',
			'theaterstr_dd',
			'theaterstr2_dt',
			'theaterstr2_dd',
			'theaterplz_dt',
			'theaterplz_dd',
			'theatercity_dt',
			'theatercity_dd',
			'first_name_dd',
			'first_name_dt',
			'last_name_dt',
			'last_name_dd',
			'address_dt',
			'address_dd',
			'zip_dt',
			'zip_dd',
			'city_dt',
			'city_dd',
			'www_dt',
			'www_dd',
			'email_dt',
			'email_dd',
			'password_dd',
			'password_dt',
			'submit_btn'
		);
		
		hideFields = new Array (
			'anstellung_dt',
			'anstellung_dd',
			'theaterprofi_dt',
			'theaterprofi_dd',
			'theaterabteilung_dt',
			'theaterabteilung_dd',
			'company_dt',
			'company_dd',
			'sonstige_info_dt',
			'sonstige_info_dd'
		);
	
	} else if(field == 'tx-srfeuserregister-pi1-tx_dreimaskenreg_group-3') {
	
		// Sonstige
		showFields = new Array (
			'sonstige_info_dt',
			'sonstige_info_dd'
		);
		
		
		hideFields = new Array (
			'anstellung_dt',
			'anstellung_dd',
			'theater_dt',
			'theater_dd',
			'theaterprofi_dt',
			'theaterprofi_dd',
			'theateramateur_dt',
			'theateramateur_dd',
			'theatertxt_dt',
			'theatertxt_dd',
			'theatername_dt',
			'theatername_dd',
			'theaterstr_dt',
			'theaterstr_dd',
			'theaterstr2_dt',
			'theaterstr2_dd',
			'theaterplz_dt',
			'theaterplz_dd',
			'theatercity_dt',
			'theatercity_dd',
			'theaterabteilung_dt',
			'theaterabteilung_dd',
			'company_dt',
			'company_dd',
			'address_dt',
			'address_dd',
			'zip_dt',
			'zip_dd',
			'city_dt',
			'city_dd',
			'www_dt',
			'www_dd',
			'email_dt',
			'email_dd',
			'password_dd',
			'password_dt',
			'first_name_dd',
			'first_name_dt',
			'last_name_dt',
			'last_name_dd',
			'submit_btn'
		);
		
	}	else if(field == 'tx-srfeuserregister-pi1-tx_dreimaskenreg_anstellung-1') {
		
		// angestellt
		showFields = new Array (
			'first_name_dd',
			'first_name_dt',
			'last_name_dt',
			'last_name_dd',
			'email_dt',
			'email_dd',
			'password_dd',
			'password_dt',
			'theaterprofi_dt',
			'theaterprofi_dd',
			'theatertxt_dt',
			'theatertxt_dd',
			'theatername_dt',
			'theatername_dd',
			'theaterstr_dt',
			'theaterstr_dd',
			'theaterstr2_dt',
			'theaterstr2_dd',
			'theaterplz_dt',
			'theaterplz_dd',
			'theatercity_dt',
			'theatercity_dd',
			'theaterabteilung_dt',
			'theaterabteilung_dd',
			'company_dt',
			'company_dd',
			'www_dt',
			'www_dd',
			'submit_btn'
		);
		
		hideFields = new Array ();

	} else if(field == 'tx-srfeuserregister-pi1-tx_dreimaskenreg_anstellung-2') {
					
		// freischaffend
		showFields = new Array (
			'first_name_dd',
			'first_name_dt',
			'last_name_dt',
			'last_name_dd',
			'email_dt',
			'email_dd',
			'password_dd',
			'password_dt',
			'address_dt',
			'address_dd',
			'company_dt',
			'company_dd',
			'zip_dt',
			'zip_dd',
			'city_dt',
			'city_dd',
			'www_dt',
			'www_dd',
			'submit_btn'
		);
		
		hideFields = new Array (
			'theater_dt',
			'theater_dd',
			'theaterprofi_dt',
			'theaterprofi_dd',
			'theateramateur_dt',
			'theateramateur_dd',
			'theatertxt_dt',
			'theatertxt_dd',
			'theatername_dt',
			'theatername_dd',
			'theaterstr_dt',
			'theaterstr_dd',
			'theaterstr2_dt',
			'theaterstr2_dd',
			'theaterplz_dt',
			'theaterplz_dd',
			'theatercity_dt',
			'theatercity_dd',
			'theaterabteilung_dt',
			'theaterabteilung_dd'
		);

	}
	
	
	
	// show / hide Fields
	showThisFields(showFields)
	hideThisFields(hideFields)
	
	/*
	for(i=0; i<showFields.length; i++) {
		try{
			document.getElementById(showFields[i]).style.display='block';
		} catch(e){;}
	}
	
	// hide Fields
	for(i=0; i<hideFields.length; i++) {
		try{
			document.getElementById(hideFields[i]).style.display='none';
		} catch(e){;}
	}
	
	*/
}



function hideThisFields(hideFields){
	for(i=0; i<hideFields.length; i++) {
		try{
			document.getElementById(hideFields[i]).style.display='none';
		} catch(e){;}
	}
}

function showThisFields(showFields){
	for(i=0; i<showFields.length; i++) {
		try{
			document.getElementById(showFields[i]).style.display='block';
		} catch(e){;}
	}
}

	

