$(document).ready(function(){
	$('.contact-item').css('display', 'none');
	 $('.close-item input').click(function() {
                location.reload();
            });
	
	$('.tx-srlanguagemenu-pi1 div:first').addClass('de');
	var _href = $(".tx-srlanguagemenu-pi1 .de a").attr("href");
	$(".tx-srlanguagemenu-pi1 .de a").attr("href", 'http://www.bursr.de/' + _href );
	
	$('.tx-srlanguagemenu-pi1 div:last').addClass('en');
	var _hrefen = $(".tx-srlanguagemenu-pi1 .en a").attr("href");
	$(".tx-srlanguagemenu-pi1 .en a").attr("href", 'http://www.bursr.com/' + _hrefen );



	$('.icon-menu a.pi-icon, .icon-menu a.pp-icon, .icon-menu a.ni-icon, .icon-menu a.sas-icon').fadeTo("fast", 0.4);
	$('.icon-menu a.pi-icon, .icon-menu a.pp-icon, .icon-menu a.ni-icon, .icon-menu a.sas-icon').hover(
	function(){ //mouse over
		var $this=$(this);
		$this.stop().fadeTo("slow", 1);
	},
	function(){ //mouse out
		var $this=$(this);
		$this.stop().fadeTo("slow", 0.4);
	});
	
	$('body#PI .icon-menu a.pi-icon, body#PP .icon-menu a.pp-icon, body#NI .icon-menu a.ni-icon, body#SAS .icon-menu a.sas-icon').fadeTo("fast", 1);
	$('body#PI .icon-menu a.pi-icon, body#PP .icon-menu a.pp-icon, body#NI .icon-menu a.ni-icon, body#SAS .icon-menu a.sas-icon').hover(
	function(){ //mouse over
		var $this=$(this);
		$this.stop().fadeTo("slow", 1);
	},
	function(){ //mouse out
		var $this=$(this);
		$this.stop().fadeTo("slow", 1);
	});


	$('.ausfuehrung, .zulassung, .referenzen').hide();
	$('#anwendung').click(function() {
  		$('.anwendung').fadeIn('slow', function() {
  			});
  		$('.ausfuehrung, .zulassung, .referenzen').fadeOut(0, function() {
  			});
  		return false;
	});
	$('#ausfuehrung').click(function() {
  		$('.ausfuehrung').fadeIn('slow', function() {
  			});
  		$('.anwendung, .zulassung, .referenzen').fadeOut(0, function() {
  			});
  		return false;
	});
	$('#zulassung').click(function() {
  		$('.zulassung').fadeIn('slow', function() {
  			});
  		$('.anwendung, .ausfuehrung, .referenzen').fadeOut(0, function() {
  			});
  		return false;
	});
	$('#referenzen').click(function() {
  		$('.referenzen').fadeIn('slow', function() {
  			});
  		$('.anwendung, .ausfuehrung, .zulassung').fadeOut(0, function() {
  			});
  		return false;
	});

 

	$('a.uid15').click(function() {
  		$('#ProductNav').fadeIn('slow', function() {
  			});
  		$('#Close').css('display','block');
  		return false;
	});
	
	$('#Close, #Navigation a[class!=uid15]').hover(function() {
  		$('#ProductNav').fadeOut('slow', function() {
  			});
  		$('#Close').css('display','none');
	});

	
	// Searchbox
	$('#Closesearch').click(function() {
  		$('#Searchpopup').fadeOut('slow', function() {
  		});
  		$('#Closesearch').css('display','none');
  		$('#SearchLinkPop').fadeIn('slow', function() {
  			});
  	});	  	
	$('#SearchLink').addClass('hidden');
	$('#SearchLinkPop').css('display','block');
	$('a.searchpop').click(function() {
  		$('#Searchpopup').fadeIn('slow', function() {
  		});
  		$('#SearchLinkPop').fadeOut('slow', function() {
  			});
  		$('#Closesearch').css('display','block');
  		//$("#Searchpopup").fadeTo(10000,1).fadeOut(1000); 
  		  return false;
  	});
	
	
	/*------ clear on focus -----------*/
	$('input.searchbox-sword').clearValOnFocus();


	


	
	
	/*----------- Colorbox ------------*/
	$("a.colorbox, .downloaditem .image a").colorbox({
		transition:'fade',
		rel:'colorbox',
		returnFocus:true,
		scrolling:false
		
	});
	
	$('#Productdetail .image li a').prepend('<img src="fileadmin/templates/images/lupe.png" alt="lupe" width="36" height="44" class="lupe"/>');
	$('#Productdetail .image li:first').addClass('first');
	$('#Productdetail .image li').hide();
	//$('#Productdetail .download-items a:nth-child(2n)').hide();
	
	//error meldung bei formhandler
	$('.errornote').css({
		'position'			: 'absolute', 
		'z-index'			: '10000'
		});
	$('.errornote').addClass('errornoteposition');	
	$('.closebutton').css('display', 'block');
	$('.errorhide').click(function() {
  		$('.errornote').hide('fast', function() {
  		});
	});
	
	//bxslider
	var slider = $('#Slider').bxSlider({
		mode : 'fade',
		controls : false,
		speed : 500,
		pager : false,
		pagerLocation : 'top',
		pager_short : false,
		pager_short_separator: ' / ',
		margin : 0,
		next_text : 'vor',
		next_image : '',
		prev_text : 'zurück',
		prev_image : '',
		auto : true,
		pause : 10000,
		auto_direction : 'next',
		auto_hover : true,
		auto_controls : false,
		ticker : false,
		ticker_controls : false,
		ticker_direction : 'next',
		ticker_hover : true,
		stop_text : 'stop',
		start_text : 'start',
		randomStart : false,
		wrapper_class : 'bxslider_wrap', 
		onAfterSlide: function(currentSlide, totalSlides, slideElement){
			$("a.colorbox").colorbox({
				transition	:'fade',
				rel 		: 'nofollow',
				returnFocus	:true
			});
  		}
	});
		
	$('.slidenav a').click(function(){
		var thumbIndex = $('.slidenav a').index(this);
		slider.goToSlide(thumbIndex);
		$('.slidenav a').removeClass('active');
		$(this).addClass('active');
		return false;
	});
			
	$('.slidenav a:first').addClass('active');
	$('.slidenav').css('display', 'block');

	$("#Slider li:nth-child(1)").addClass("blue");
	$("#Slider li:nth-child(2)").addClass("red");
	$("#Slider li:nth-child(3)").addClass("orange");
	$("#Slider li:nth-child(4)").addClass("green");
	$("#Slider li:nth-child(5)").addClass("lightblue");
	
		
	$('.slidenav-products a').click(function(){
		$('.slidenav-products a').removeClass('active');
		$(this).addClass('active');
		return false;
	});
			
	$('.slidenav-products a:first').addClass('active');
	$('.slidenav-products').css('display', 'block');
	
	
	
	//$('.contact-item.xxx').css('display', 'block');
	
	$("#Dropdownclass").change(function(){
			var value = this.value;
			var element = $('#All .'+this.value);
			$('.contact-item').show(); 
			if (value != 0) {
				$('.tx-ttaddress-pi1 > div:not(.'+this.value+')').hide();
			}
		});
//$('#Dropdownclass').customStyle();
	
	$('.tx-indexedsearch-res:last').addClass('last');
	$('.pagination a').removeAttr('title');

	var options = {
						styleClass: "selectDark",
						jScrollPane: 0
						}
	
	//$("#Dropdownclass").styleSelect(options);

});






function blurLink(theObject){if(msie4){theObject.blur();}}function decryptCharcode(n,start,end,offset){n=n+offset;if(offset>0&&n>end){n=start+(n-end-1);}else if(offset<0&&n<start){n=end-(start-n-1);}return String.fromCharCode(n);}function decryptString(enc,offset){var dec="";var len=enc.length;for(var i=0;i<len;i++){var n=enc.charCodeAt(i);if(n>=0x2B&&n<=0x3A){dec+=decryptCharcode(n,0x2B,0x3A,offset);}else if(n>=0x40&&n<=0x5A){dec+=decryptCharcode(n,0x40,0x5A,offset);}else if(n>=0x61&&n<=0x7A){dec+=decryptCharcode(n,0x61,0x7A,offset);}else{dec+=enc.charAt(i);}}return dec;}function linkTo_UnCryptMailto(s){location.href=decryptString(s,-5);}

