﻿(function($){
	$(document).ready(function(){
		
        //Volltextsuche
        /*
        $("#ajaxSearch_form #website").click(function () {
            //$("#ajaxSearch_form").attr("action","de/suchergebnis-produkte.html");
            $("#ajaxSearch_input").attr("value","Produktbezeichnung...");
            //$("#search form").focus();
        });

        $("#ajaxSearch_form #nr").click(function () {
            //$("#ajaxSearch_form").attr("action","de/suchergebnis-produkte.html");
            $("#ajaxSearch_input").attr("value","Teile-Nr...");
            //$("#search form").focus();
        });
            
        $("#ajaxSearch_formENG #website").click(function () {
            //$("#ajaxSearch_formENG").attr("action","en/search-results-products.html");
            $("#ajaxSearch_input").attr("value","Product name...");
            //$("#search form").focus();
        });

        $("#ajaxSearch_formENG #nr").click(function () {
            //$("#ajaxSearch_formENG").attr("action","en/search-results-products.html");
            $("#ajaxSearch_input").attr("value","Part No...");
            //$("#search form").focus();
        });
        */
      
      // Input-Feld wird bei "focus" geleert und bei "blur" gefüllt
	  $("#ajaxSearch_input").focus(function () {
			$(this).attr("value","");
	  });
      
      /*
	  $("#ajaxSearch_form  #ajaxSearch_input").blur(function () {
			$(this).attr("value","Suchbegriff eingeben");
	  });
      
	  $("#ajaxSearch_formENG  #ajaxSearch_input").blur(function () {
			$(this).attr("value","Suchbegriff eingeben");
	  });
      */
				
		// Styleswitcher (Products)
	  $(".switchList").click(function () {
			$('.products').addClass('list');
			$('.products').removeClass('grid');
		});
		
		$(".switchGrid").click(function () {
			$('.products').addClass('grid');
			$('.products').removeClass('list');
			$('.products li img').addClass('showtip');
		});
		
		// Metanav
		$('#metanav li:last-child').addClass('lastmeta');

		// Boxes
		$('.rightCol .box:nth-child(3n+2)').addClass('last');

		// Search-Box
	  /* $("#ajaxSearch_input").focus(function () {
			$(this).attr("value","");
			$('#search').css('background-image', 'url(/assets/templates/default/images/bg_suchen_hover.png)');
			$('#ajaxSearch_input_expand').show();
	  });*/
	
	  $("#head").blur(function () {
			$(this).attr("value","");
			//$('#search').css('background-image', 'url(images/bg_suchen.gif)');
			//$('#ajaxSearch_input_expand').hide('fast');
	  });
	
		// Product-Table
		$('.details tr:nth-child(odd)').addClass('alt');
		$('.details tr:last-child').addClass('last');
		$('.details tr td:last-child').addClass('last');


		
		// Colorbox
	  $(".zoom").colorbox();
	
	  // Cycle
		$('#slideshow').cycle({ 
		    fx:     'scrollHorz', 
		    speed:   300, 
		    timeout: 3000,
		    prev:   '.prev',  
		    next:   '.next', 
		    pause:   1 
		});
		
		// ImgHover
		$(".hover").imghover({suffix: "_hover"});
		$(".btn").imghover({suffix: "_hover"});
		
		// Tooltip
		$(".showtip").tooltip({
			 effect: 'slide'
		});

	});
})(jQuery);
