



jQuery(document).ready(function() {


	/* Logoleiste */
	if ( jQuery(".logos img").length > 0 ) {
		jQuery(".logos").css('display','block');
		
		//var imagewrap = jQuery(".logos .csc-textpic-imagewrap").html();
		//imagewrap = imagewrap.replace(/div/g, "li");
		//alert(imagewrap)
		//jQuery(".logos ul").html(imagewrap);
	}






	jQuery(".li_main").hover(function() {
		jQuery(this).children('ul').addClass('active');
		jQuery(this).children('a').addClass('active');
	}, function() {
		jQuery(this).children('ul').removeClass('active');
		jQuery(this).children('a').removeClass('active');
	});

	jQuery(".submitDiv .submit").hover(function() {
		jQuery(this).addClass('active');
	}, function() {
		jQuery(this).removeClass('active');
	});



	jQuery("div.logout input").hover(function() {
		jQuery(this).addClass('active');
	}, function() {
		jQuery(this).removeClass('active');
	});









	function formatText(index, panel) {
	  return index + "";
	}


	
	jQuery('.anythingSlider_typ1, .anythingSlider_typ2').anythingSlider({
			easing: "linear",        // Anything other than "linear" or "swing" requires the easing plugin
			autoPlay: false,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
			delay: 5000,                    // How long between slide transitions in AutoPlay mode
			startStopped: false,            // If autoPlay is on, this can force it to start stopped
			animationTime: 500,             // How long the slide transition takes
			hashTags: false,                // Should links change the hashtag in the URL?
			buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
			pauseOnHover: false,            // If true, and autoPlay is enabled, the show will pause on hover
			startText: "Go",             	// Start text
			stopText: "Stop",               // Stop text
			navigationFormatter: formatText // Details at the top of the file on this use (advanced use)
	});

	jQuery('.anythingSlider_Logos').anythingSlider({
			easing: "linear",        // Anything other than "linear" or "swing" requires the easing plugin
			autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
			delay: 0,                    // How long between slide transitions in AutoPlay mode
			startStopped: false,            // If autoPlay is on, this can force it to start stopped
			animationTime: 15000,             // How long the slide transition takes
			hashTags: false,                // Should links change the hashtag in the URL?
			buildNavigation: false,          // If true, builds and list of anchor links to link to each slide
			pauseOnHover: false,            // If true, and autoPlay is enabled, the show will pause on hover
			startText: "Go",             	// Start text
			stopText: "Stop",               // Stop text
			navigationFormatter: formatText // Details at the top of the file on this use (advanced use)
	});

	



	/*carousels - breite fuer ul setzen*/
	jQuery('.anythingSlider ul').each(function() {
		var li_count 	= jQuery(this).find('li').length;
		var li_width 	= parseInt( jQuery(this).find('li').width() );

		var ul_sum		= li_count*li_width;
		//jQuery(this).css('width', ul_sum);
		
		//jQuery(this).css('width', '1000000px');
	});


	
	/* prev-link im carouselpager flexibel machen */
	/* gezählt wird die pager-link-anzahl, nicht die li's, wegen der cloned li's */
	jQuery('.anythingSlider').each(function() {
		var pL_count 	= jQuery(this).find('.thumbNav a').length;
		var pL_width 	= parseInt( jQuery(this).find('.thumbNav a').css('width') );
		var pL_margin	= parseInt( jQuery(this).find('.thumbNav a').css('margin-right') );
		var thNav_right	= parseInt( jQuery(this).find('.thumbNav').css('right') );

		var pl_sum		= pL_count*(pL_width+pL_margin)+thNav_right+pL_margin;
		//jQuery(this).find('.back').css('right', (pl_sum+'px'));
	});
	
	
	//ergebnis = jQuery('.frm_suchergebnisDiv .tx_indexedsearch_sword').val();
	//jQuery('#tx_indexedsearch2 .tx_indexedsearch_sword').val(ergebnis)
	
		
		
	//Suche (Anzahl Treffer pro Seite)
	jQuery(".breadcrumb a").click(function() {
		trefferZahl = jQuery(this).html();
		if(isNaN(trefferZahl)) trefferZahl = 10000;
		jQuery('#frm_suchergebnis .lastHidden').prev().val(trefferZahl);
		jQuery('#frm_suchergebnis').submit();
		return false;
	});

	anzahlTreffer = jQuery('.anzahlTreffer').html();
	suchwort = jQuery('.tx-indexedsearch-sw').html();
	if(anzahlTreffer) {
		jQuery(".breadcrumb .left").html(anzahlTreffer + '<b>"' + suchwort + '<b>"');
	}
	else {
		noresults = jQuery(".tx-indexedsearch-noresults").html();
		jQuery(".breadcrumb .left").html(noresults);
		jQuery(".breadcrumb .right").html('');
	}
	

});





function showVideo(id){
	
	jQuery('#video' + id).show();
	
	//alert(jQuery('#video' + id).height());
	//alert(jQuery('#video' + id).css('height'));
	
	jQuery.blockUI({ 
        	message: jQuery('.videoPlayer'),
        	css: { 
                left: (jQuery(window).width() - 1017)/2 + 'px',  
                left: '100px',
                top: '200px',
                width: jQuery('#video' + id).css('width'),
                height: jQuery('#video' + id).css('height'),
                background: '#fff',
                border: '0'
            }, 
            overlayCSS:  { 
        		backgroundColor: '#000', 
        		opacity: 0.7 
    		}
    
		}); 
	
		
	jQuery('.closeGallery').click(function() { 
		
		jQuery.unblockUI();
        
		return false;
        
     
	}); 

}



function update_select(){
	reset_select2();
	//alert(document.formular.select1.selectedIndex);
	var currAr = myAr[document.formular.select1.selectedIndex];
		
		
	for (var i = 0; i < currAr.length; i++){
		var addme = new Option(currAr[i], currAr[i]);
		//alert(addme)
		document.formular.select2[i] = addme;
	}
}

function reset_select2() {
	//alert(document.formular.select2.length);
	var laenge = document.formular.select2.length;
	for (var i=1; i < laenge; i++) {
		//document.formular.auswahl[i].text = 'Eintrag'+i;
		//alert(i);
		document.formular.select2[0] = null;
	}
}


