jQuery(document).ready(function() {
	/* Restyle selectboxes 
	 not for IE6 */
	if (!($.browser.msie && jQuery.browser.version.substr(0,2)=="6.")){
	  jQuery("#lang_selector_pulldown,#domain_selector_pulldown,#faq_Category_pulldown").msDropDown({mainCSS:'dd2'});
	}else {
		/* IE6 hover menue fake*/
		jQuery('#main_navi > li,#main_navi > li > a').hover(
				function () {$(this).addClass("hover");},
				function () {$(this).removeClass("hover");}
			);
	};
	
	/* Searchbox - Suche starten */
	jQuery('#form_searchbox_top').submit(function() {
	});
	
	/* Searchbox - Standard Text entfernen */
	jQuery('input#searchbox_top_query').focus(function() {
	    if(this.value == this.defaultValue){ 
	    	this.value = '';
		}
	});
	jQuery('input#searchbox_top_query').blur(function() {
	    if(jQuery.trim(this.value) == ''){
	    	this.value = (this.defaultValue ? this.defaultValue : '');
		}
	});

	/* Slide 2spaltiges Layout Liste mit Class accordion */
	jQuery('ul.accordion li.accordion_item >*:not(h5)').hide();		//All direct children beneath .accordion_item, which are NOT h5 
	jQuery('ul.accordion li.accordion_item:first').addClass('active');
	jQuery('ul.accordion li.accordion_item:first >*').show();
	
	jQuery('ul.accordion li.accordion_item h5').click(function() {
		if(!jQuery(this).parent().hasClass('active')) { 								
			jQuery(this).parent().children('*:not(h5)').slideDown();
			jQuery(this).parent().addClass('active');
		} 
		else {
			jQuery(this).parent().removeClass('active');
			jQuery(this).parent().children('*:not(h5)').slideUp();			
		}			
		return false;	  
	});
		
	/* Ein-Ausblende-Funktion in Tabellen */
	jQuery('table thead tr td.more').click(function() {
		jQuery(this).parent().parent().parent().children('tbody').children('tr').siblings().toggle();
		return false;
	});
	
	/* Tabbox-Reiter Content Ein-Ausblende-Funktion */
	jQuery('ul.tab_box_navi li a:first').addClass('selected');	
	jQuery('div.tab_box div.tab_box_content').css('display', 'none');	
	jQuery('div.tab_box div.tab_box_content:first').css('display', 'block');	
	jQuery('ul.tab_box_navi li').click(function() {		
		jQuery('ul.tab_box_navi li').removeClass('selected');
		jQuery('div.tab_box div.tab_box_content').css('display', 'none');
		jQuery(this).addClass('selected');
		var indexSelected = jQuery('ul.tab_box_navi li').index(this);
		var activeTabDiv = jQuery('div.tab_box div.tab_box_content').get(indexSelected);
		jQuery(activeTabDiv).css('display', 'block');		
	});
	
	/* Search - Suche starten */
	jQuery('#form_search_top').submit(function() {
	});
	jQuery('#form_search_plz_top').submit(function() {
	});	
	/* Search - Standard Text entfernen */
	jQuery('input#search_top_query').focus(function() {
	    if(this.value == this.defaultValue){ 
	    	this.value = '';
		}
	});
	jQuery('input#search_top_query').blur(function() {
	    if(jQuery.trim(this.value) == ''){
	    	this.value = (this.defaultValue ? this.defaultValue : '');
		}
	});
	
});
