
// jQuery when document is ready loaded
$(document).ready(function() {


   $("ul.sf-menu").superfish();


   // BigTarget (Teaser-Klickfläche erhöhen)
   $("ul.product_carousel_skin a").bigTarget();
   $("div#intro_cycle a").bigTarget({ clickZone: 'div:eq(0)' });


   // JQuery Cycle
   $(function() {
       $('#intro_cycle').cycle({
           fx:      'fade',
           timeout:  6000,
   		speed:    2000, 
           prev:    '#prev',
           next:    '#next',
           pager:   '#nav',
   		// pause:  1,
           pagerAnchorBuilder: pagerFactory
       });
   
       function pagerFactory(idx, slide) {
           var s = idx > 2 ? ' style="display:none"' : '';
           return '<li'+s+'><a href="#">'+(idx+1)+'</a></li>';
       };
   });
   

   // Carousel Produktseite
   jQuery('#product_carousel').jcarousel({
        auto: 0,
        scroll: 7,
	     animation: "fast",
        wrap: 'both',
        initCallback: mycarousel_initCallback
   });
   
   
   // Fancybox      
	$("a[rel=product_carousel_big]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over"> ' + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});


});







// Carousel
function mycarousel_initCallback(carousel) {
       // Disable autoscrolling if the user clicks the prev or next button.
       carousel.buttonNext.bind('click', function() {
           carousel.startAuto(0);
       });
   
       carousel.buttonPrev.bind('click', function() {
           carousel.startAuto(0);
       });
   
       // Pause autoscrolling if the user moves with the cursor over the clip.
       carousel.clip.hover(function() {
           carousel.stopAuto();
       }, function() {
           carousel.startAuto();
       });
};   
      

// IE6 Hinweisleiste    

var $buoop = {} 
$buoop.ol = window.onload; 
window.onload=function(){ 
	if ($buoop.ol) $buoop.ol(); 
	var e = document.createElement("script"); 
	e.setAttribute("type", "text/javascript"); 
	e.setAttribute("src", "http://browser-update.org/update.js"); 
	document.body.appendChild(e); 
} 

// Google Analytics

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17525904-1']);
  _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
    

