/*
Skin Specific JS goes here. The jQuery library has already been loaded by the core templates.
THerfore, if you use jQuery, you are ready to go. We recommend that you write all skin jQuery to be 
noConflict friendly to avoid issues with TYPO3 extensions that use other libraries. This means
using syntax like this:

jQuery('.myClass').hide();

NOT

$('.myClass').hide();

The TemplaViola Framework sets jQuery().noConflict() by default so you will need to unset it
in TypoScript if you want it otherwise.

*/

jQuery(document).ready(function() {
	// jede zweite TR-Zeile mit einer Klasse hinterlegen
	jQuery("tr:odd").addClass("tab-odd");
	
	// Link-Styling mit jQuery
	jQuery('a[href^="mailto:"]').addClass("mailto");
	jQuery('a[href^="javascript:"]').addClass("javalink");
	jQuery('a[href$=".pdf"]').addClass("pdf");
	jQuery('a[href$=".doc"]').addClass("word");
	jQuery('a[href$=".xls"]').addClass("excel");
	jQuery('a[href$=".ppt"]').addClass("powerpoint");
	
	Shadowbox.init();
	
	jQuery(function () {

	    var counter = 0,
	        divs = jQuery('#banner11, #banner12');

	    function showDiv () {
	        	divs.hide() // hide all divs
	            .filter(function (index) { return index == counter % 2; }) // figure out correct div to show
	            .fadeIn('fast'); // and show it

	        counter++;
	    }; // function to loop through divs and show correct div

	    showDiv(); // show first div    

	    setInterval(function () {
	        showDiv(); // show next div
	    }, 10 * 1000); // do this every 10 seconds    

	});
	
	
// jQuery(function() {
//
//   var timer = setInterval( showDiv, 2500);
// 	var counter = 0;
//
//   function showDiv() {
//     if (counter == 0) { counter++; return; }
// 		jQuery('div','#bWerbung')
//       	.stop()
//       	.hide()
//       	.filter( function() { return this.id.match('div' + counter); })   
//       	.show('fast');
//     	counter == 2? counter = 0 : counter++; 
//
//   	}
//
// });

});
