	var back_img_adres = '';
	var activeTimer = false;
	var navihovered = false;
	var nextPicTimeout = 9000;
	var speed_pic = 1000;
	var speed_txt = 300;

	var nav_show_speed = 700;

	var bigShown = false;
	var nav_delay = nav_show_speed;
	inmenus = new Array(false, false, false, false);

	jQuery(document).ready(function(){

		var timeoutID = null;


		jQuery("#topLinks li .topLinks_produkte").hover(function(){
			var item = jQuery(this);
			var index = item.parent().index("#topLinks li");
			window.setTimeout(function(){
				if (inmenus[index]) {
					activeTimer = false;
					if(item.parent().hasClass("notActiv")){
						switchToInactiv();

						if(item.parent().hasClass("notActiv")){
							switchToActiv(index);
							loadPic(index);
						}
					}
				}
			},nav_delay);
		});

		activeTimer = true;
		window.setTimeout("nextPicTimer()",nextPicTimeout);

		jQuery('.topLinks_produkte').hover(function() {
			var item = jQuery(this);
			var index = item.parent().index("#topLinks li");
			navihovered = true;
			inmenus[index] = true;
		}, function() {
			var item = jQuery(this);
			var index = item.parent().index("#topLinks li");
			inmenus[index] = false;
			navihovered = false;
			activeTimer = true;
		});

		jQuery(".fb_addcomm").click(function(){
			jQuery('#facebook_single').fadeTo(300,0,function(){
				jQuery('#fb_complete').fadeTo(1000,1);
			});
		});
		jQuery("#fb_addcomm").click(function(){
			jQuery('#fb_addcomm').fadeTo(300,0,function(){
				jQuery('.fb_comments').animate({
					height: "100%"
				}, 1000 );//slideDown(1000);
			});
		});
		jQuery(".tex_slide").toggle(function(){
			jQuery('#text_i_produkte_tex_over').animate({
				height: (jQuery('#text_i_produkte_tex').height()+12)+"px"
			}, 500 );
			jQuery('#tex_slide').html(tex_slide_text_2);
		}, function() {
			jQuery('#text_i_produkte_tex_over').animate({
				height: "66px"
			}, 500 );
			jQuery('#tex_slide').html(tex_slide_text_1);
		});

		jQuery('.technologie_more_lnk').click(function(){
			jQuery('#tech_layer').html(jQuery('#'+this.rel).html());
			jQuery('#text_i_technologien_content').slideUp(400,function(){
				jQuery('#tech_layer').slideDown(400);
			});
			jQuery('.technologie_back').unbind('click');
			jQuery('.technologie_back').bind('click', function(){
				jQuery('#tech_layer').slideUp(400,function(){
					jQuery('#text_i_technologien_content').slideDown(400);
				});
				return false;
			});
			return false;
		});

		jQuery('.showhidden').click(function(){
			jQuery('#TB_overlay').bind('click',function(){
				tb_remove();
			});
			jQuery('.thickclosebtn').bind('click',function(){
				tb_remove();
			});
		});


		//jQuery("select, input:checkbox").uniform();//jQuery("select, input:checkbox, input:radio, input:file").uniform();
		//jQuery(function(){ jQuery("select").uniform(); });
		jQuery("select, input:text, input:password, input:checkbox").uniform();
	});

	function nextPicTimer(){
		if(activeTimer && !navihovered){
			activeTimer = false;
			nextOne();
		}
		window.setTimeout("nextPicTimer()",nextPicTimeout);
	}

	function reactivateTimer(){
		activeTimer = true;
	}

	function switchTo(aitem,aindex){
		if (!inmenus[aindex]) {
			activeTimer = false;
			if(aitem.parent().hasClass("notActiv")){
				switchToInactiv();

				if(aitem.parent().hasClass("notActiv")){
					switchToActiv(aindex);
					loadPic(aindex);
				}
			}
		}
	}

	function nextOne(){
		var length = jQuery('#topLinks li').length;
		var activeIndex = jQuery('#topLinks li.activ').index();
		var nextIndex = activeIndex+1;
		if(length==nextIndex){
			nextIndex = 0;
		}

		switchToInactiv();
		switchToActiv(nextIndex);
		loadPic(nextIndex);

	}

	function switchToInactiv(){
		jQuery("#topLinks li").each(function(){
			if(jQuery(this).hasClass("activ")){
				jQuery(this).removeAttr("class").addClass("notActiv");
			}
		});
	}
	function switchToActiv(x){
		var item = jQuery('#topLinks li:eq(' + x + ')');

		item.removeAttr("class").addClass("activ");
	}

	function loadPic(x){
		var aitem = jQuery('#pic' + (x+1));
		var ateaser = jQuery('#box' + (x+1));
		jQuery('#pic_next').css('display','none');
		jQuery('#pic_next').css('background-image','url(' + aitem.attr('src') + ')');
		jQuery("#start_teaser_text").stop().fadeOut(speed_txt,function(){ jQuery(this).html(ateaser.html())});
		jQuery('#pic_next').fadeTo(speed_pic,1,function(){
			jQuery('#pic_act').css('background-image','url(' + aitem.attr('src') + ')');
			timeoutID = window.setTimeout(function(){
				jQuery("#start_teaser_text").stop().fadeTo(speed_txt,1,function(){
					jQuery("#start_teaser_text").css('filter','');
					activeTimer = true;
				});
			}, 400);
			jQuery('#pic_next').css('display','none');
			Cufon.refresh();
			
            if(typeof updateFancyZoom == 'function') {
            	updateFancyZoom();
            }

		});

	}

	function showLoader(lid,underlayid, lwidth) {
		jQuery('#'+underlayid).css('height',jQuery('#'+underlayid).height()+'px');
		jQuery('#'+lid).css('width',lwidth+'px').css('height',jQuery('#'+underlayid).height()+'px').css('z-index','100000').fadeTo(250,0.8);
	}

	function hideLoader(lid, underlayid) {
		jQuery('#'+underlayid).animate({
			height: "100%"
  		}, 750 );
		jQuery('#'+lid).fadeTo(750,0).css('z-index','0').css('height','0px');
	}

	var f = new Features();
	var Produktkategorie = '';

	function LoadFirstContent(kategorie) {
		Produktkategorie = kategorie;
		GetMerkmaleFromKat(kategorie);
	}

	function preisTocurrency( preis, trenner ) {
  		return parseFloat( preis ).toFixed(2).replace( /\./g, trenner );
 	}


	function MakeCheckBox(myparent,id,ent_name) {
		jQuery('#'+myparent.replace(' ','_')).append( '<div><input type="checkbox" name="check'+id+'" id="check'+id+'" rel="'+id+'" /><div class="produkt_merkmale_feature fl_left">'+ ent_name+ '</div><div class="clear"></div></div>' );
		jQuery("#check"+id)
		.change(function(){
			f.setControl( jQuery(this).attr('rel'), this.checked );
			RefreshProducts();
		});
	}

	function MakeRadioBox(myparent,id,ent_name,ischecked) {
		jQuery('#'+myparent.replace(' ','_')).append( '<div><input type="radio" class="'+myparent.replace(' ','_')+'" name="'+myparent.replace(' ','_')+'" id="radio'+id+'" rel="'+id+'" value="'+ent_name.replace(' ','_')+'" '+ischecked+' /><div class="produkt_merkmale_feature fl_left">'+ ent_name+ '</div><div class="clear"></div></div>' );
		jQuery("#radio"+id)
		.change(function(){
			var parentitem = jQuery(this).attr('name');
			jQuery('#'+parentitem+' .'+parentitem).each(function(index){
				if (jQuery(this).attr('rel') > 0){
					f.setControl( jQuery(this).attr('rel'), this.checked );
				}
			});
			RefreshProducts();
		});
	}

	window.currentId = 0;
	var GetProdukte_activ = false;
	function RefreshProducts() {
		window.setTimeout( makeTimer( ++window.currentId, function(){
			if (jQuery('#produkte_teaser_div').height() > 0) {
				//jQuery('#produkte_teaser_div').slideUp(500);
			}
			GetProdukte(12,0);
		} ), 700);
 	}

	function makeTimer( id, target ) {
		return function() {
			if( window.currentId == id )
				target();
		}
	}
	function DeleteCaption() {
		if (produklinie != '') {
			produklinie = '';
			f.setControl( parseInt(produklinie), false );
			if (webarea == 'en') { teaserkat = '4251' }
			else if (webarea == 'fr') { teaserkat = '4252' }
			else if (webarea == 'it') { teaserkat = '4253' }
			else { teaserkat = '4225' }
			GetTeaserImage(teaserkat,produklinie);
			GetProdukte(8,0);
		}
	}

	function GetMerkmaleFromKat(kategorie){
		showLoader('merkmale_loader','merkmale_div', '198');
		jQuery('#merkmale_div').html('');
		jQuery.getJSON(
			'/xnxite/tool_pdb2010/json.php?action=getMerkmale&webarea='+webarea+'&kategorie='+kategorie+'&callback=?',
			loadData
		);

		function loadData( fdata, textStatus ) {
			f.createFeatures(
				fdata.data,
				function generate_merkmale_div( typ, arg1, arg2, arg3 ) {
					if (arg3 != "CAPTION") {
						switch( typ ) {
							case "combobox":
								entries = arg1;
								name = arg2;
								caption = arg3;
								jQuery('#merkmale_div').append( '<div id="container_'+MD5(name.replace(' ','_'))+'" class="produkt_merkmale box"><div class="produkt_merkmale_titel">' + name + '</div>' );//(Combobox)
								for( var i = 0; i < entries.length; i++ ) {
									if (entries[i].id != '60') {	MakeRadioBox('container_'+MD5(name.replace(' ','_')),entries[i].id,entries[i].name,''); }
								}
								if (webarea == 'en') { tr_beliebig = 'any' }
								else if (webarea == 'fr') { tr_beliebig = 'au choix' }
								else if (webarea == 'it') { tr_beliebig = 'a scelta' }
								else { tr_beliebig = 'Beliebig' }
								MakeRadioBox('container_'+MD5(name.replace(' ','_')),MD5(name.replace(' ','_')),tr_beliebig,'checked="checked"')
								jQuery('#merkmale_div').append( "</div>" );
								break;
							case "checkboxlist":
								entries = arg1;
								name = arg2;
								caption = arg3;
								jQuery('#merkmale_div').append( '<div id="container_'+MD5(name.replace(' ','_'))+'" class="produkt_merkmale box"><div class="produkt_merkmale_titel">' + name + '</div>' );//(Checkboxes)
								for( var i = 0; i < entries.length; i++ ) {
									MakeCheckBox('container_'+MD5(name.replace(' ','_')),entries[i].id,entries[i].name)
								}
								jQuery('#merkmale_div').append( "</div>" );
								break;
							case "checkbox":
								id = arg1;
								name = arg2;
								MakeCheckBox('merkmale_div',id,name)
								break;
							case "textfield":
								id = arg1;
								name = arg2;
								var this_min = 0;
								var this_max = 0;
								var this_min_txt = '';
								var this_max_txt = '';
								switch( id ) {
									case 2:
										this_min = 10;
										this_max = 150;
										this_min_txt = 'klein';
										this_max_txt = 'groß';
										this_range = "max";
										this_val = 10;
										break;
									case 3:
										this_min = 200;
										this_max = 5000;
										if (webarea == 'en') {
											this_min_txt = 'light';
											this_max_txt = 'heavy';
										}
										else if (webarea == 'fr') {
											this_min_txt = 'light';
											this_max_txt = 'heavy';
										}
										else if (webarea == 'it') {
											this_min_txt = 'leggero';
											this_max_txt = 'pesante';
										}
										else {
											this_min_txt = 'leicht';
											this_max_txt = 'schwer';
										}
										this_range = "min";
										this_val = 5000;
										break;
									case 96:
										this_min = 200;
										this_max = 320;
										this_min_txt = '200cm';
										this_max_txt = '320cm';
										this_range = "max";
										this_val = 200;
										break;
								}
								jQuery('#merkmale_div').append( '<div class="produkt_merkmale box"><div class="produkt_merkmale_titel">' + name + '<div class="produkt_merkmale_stand_right" id="stand_'+id+'"></div></div><div class="produkt_merkmale_slider"><div id="slider_max_' + id + '" rel="'+id+'"></div></div><div class="produkt_merkmale_slider_text"><div class="slider_l">'+this_min_txt+'</div><div class="slider_r">'+this_max_txt+'</div><div class="clear"></div></div></div>' );
									jQuery("#slider_max_" + id).slider({
										range: this_range,
										min: this_min,
										max: this_max,
										value: this_val,
										change: function(event, ui) {
											f.setControl( jQuery(this).attr('rel'), ui.value );
											RefreshProducts();
										if(jQuery(this).attr('rel') == 2){
											this_einheit = 'l';
										}else if(jQuery(this).attr('rel') == 3){
											this_einheit = 'g';
										}else{
											this_einheit = 'cm';
										}
											$('#stand_'+jQuery(this).attr('rel')).html('(' + ui.value + ' ' + this_einheit + ')');
										 }
									})
								break;
							case "minmax":
								name = arg1;
								minid = arg2;
								maxid = arg3;
								var this_min = 0;
								var this_max = 0;
								switch( minid ) {
									case 45:
										this_min = -25;
										this_max = 40;
										this_min_txt = '-25°C';
										this_max_txt = '40°C';
										break;
									case 47:
										this_min = 0;
										this_max = 5;
										if (webarea == 'en') {
											this_min_txt = 'low';
											this_max_txt = 'height';
										}
										else if (webarea == 'fr') {
											this_min_txt = 'low';
											this_max_txt = 'height';
										}
										else if (webarea == 'it') {
											this_min_txt = 'basso';
											this_max_txt = 'alto';
										}
										else {
											this_min_txt = 'niedrig';
											this_max_txt = 'hoch';
										}
										break;
								}
								jQuery('#merkmale_div').append( '<div class="produkt_merkmale box"><div class="produkt_merkmale_titel">' + name + '<div  class="produkt_merkmale_stand_left" id="stand_' + minid + '"></div></div><div class="produkt_merkmale_slider"><div id="slider_max_' + minid + '" rel="'+minid+'_'+maxid+'"></div></div><div class="produkt_merkmale_slider_text"><div class="slider_l">'+this_min_txt+'</div><div class="slider_r">'+this_max_txt+'</div><div class="clear"></div></div></div>' );
									jQuery("#slider_max_" + minid).slider({
										range: true,
										min: this_min,
										max: this_max,
										values: [this_min, this_max],
										change: function(event, ui) {
											var this_ids = jQuery(this).attr('rel').split("_");
											f.setControl( this_ids[0], ui.values[0] );
											f.setControl( this_ids[1], ui.values[1] );
											RefreshProducts();
											if(this_ids[0] == '45'){
												this_einheit = '°C';
											}else{
												this_einheit = '';
											}
											$('#stand_'+this_ids[0]).html('(von ' + ui.values[0]  + ' ' + this_einheit + ' bis '+ ui.values[1] +' ' + this_einheit + ')');
											
										 }
									})
								break;
						}
					}
					else {

						}
				}
			);
			if (fdata.data.length < 1 || Produktkategorie == '4167' || Produktkategorie == '4264') {
				jQuery('#merkmale_div').css('display','none');
			}
			else {
				if (webarea == 'en') { tr_allefilter = 'reset all filters' }
				else if (webarea == 'fr') { tr_allefilter = 'Réinitialiser tous les filtres' }
				else if (webarea == 'it') { tr_allefilter = 'Ripristina tutti i filtri' }
				else { tr_allefilter = 'Alle Filter zurücksetzen' }
				jQuery('#merkmale_div').append('<div class="produkt_merkmale box"><div class="produkt_merkmale_clear" onclick="GetMerkmaleFromKat('+kategorie+')">'+tr_allefilter+'</div></div>');
			}
			if (produklinie != '') {
				f.setControl( parseInt(produklinie), true );
			}
			GetProdukte(8,0);
			jQuery("#produkte_teaser_div").slideUp(450,function(){
				jQuery("#produkte_teaser_div").html('');
				if (webarea == 'en') { teaserkat = '4251' }
				else if (webarea == 'fr') { teaserkat = '4252' }
				else if (webarea == 'it') { teaserkat = '4253' }
				else { teaserkat = '4225' }
				GetTeaserImage(teaserkat,produklinie);

			});
			f.setPageSize(12);
			jQuery("input:checkbox, input:radio").uniform();
			hideLoader('merkmale_loader', 'merkmale_div');

		}
		return true;
	}

	function GetTeaserImage(imageCategory,produklinie){
		if ((Produktkategorie != '4166' && Produktkategorie != '4145') || produklinie != '') {
			jQuery.getJSON(
				"/xnxite/tool_pdb2010/json.php?action=getImage&kategorie="+Produktkategorie+"&folder="+currentfolder+"&webarea="+webarea+"&imageCategory="+imageCategory+"&caption="+produklinie+"&callback=?",
				function(data){
					if(data.success == '1') {
						jQuery("#produkte_teaser_div").prepend(
						'<div class="text_u_produkte_top box">'+
							'<a href="'+data.data.detailUrl+'" title="'+data.data.titel+'"><img src="'+data.data.extendedInfo.images[0].urls.big.url+'" alt="'+data.data.titel+'" /></a>'+
						'</div>'
						).slideDown(1);
					} else {
						if($('.prodteaser').length>0){
							jQuery(".produkte_u_alles").css("margin-top","-229px");
							jQuery('#produkte_teaser_div').prepend('<div class="text_u_produkte_top box"></div>').show();
						}
					}
				}
			);
		}
	}

	function GetProdukte(psize,poffset){
		showLoader('produkte_loader','produkte_div', '776');
		f.setPageSize(psize);
		f.setOffset(poffset);

		var specialImages = '';
		if (Produktkategorie == '4168') {
			specialImages = '&fetchImages=1&imageCategory=4228&imageSize=big';
		}
		$.ajax({
		  type: "POST",
		  url: "/xnxite/tool_pdb2010/json.php",
		  dataType: "json",
		  data: "action=getProductList&kategorie="+Produktkategorie+specialImages+"&webarea="+webarea+'&folder='+currentfolder+"&filters="+JSON.stringify(f.getControls())+"&callback=?",
		  success: loadProducts
		  //error: function(XMLHttpRequest, textStatus, errorThrown){
			//  alert(textStatus + " | " + errorThrown);
		  //}
		});
		//jQuery.getJSON(
		//	"/xnxite/tool_pdb2010/json.php?action=getProductList&kategorie="+Produktkategorie+specialImages+"&filters="+JSON.stringify(f.getControls())+"&callback=?",
		//	loadProducts
		//);

	}

	function loadProducts( data ) {
		jQuery("#produkte_div").html("");
		for( var i = 0; i < data.data.length; i++ ) {
			AddProductToDiv(data.data[i]);
		}
		if (data.total == '0') {
			if (webarea == 'en') { noprods = 'No matches found. Please select different features.' }
			else if (webarea == 'fr') { noprods = 'No matches found. Please select different features.' }
			else if (webarea == 'it') { noprods = 'NON SONO STATI TROVATI PRODOTTI CORRISPONDENTI AI CRITERI SELEZIONATI.' }
			else { noprods = 'ES WURDEN KEINE PRODUKTE, AUF DIE DIE AUSGEWÄHLTEN KRITERIEN ZUTREFFEN, GEFUNDEN.' }
			jQuery("#produkte_div").append('<div class="msgBox"><b>'+noprods+'</b></div>');
		}
		var lastappend = ('<div class="clear"></div>');
		if (Math.ceil(data.total/data.limit) > 1) {
			lastappend = lastappend+'<div class="paginate">';
			for( var i = 1; i <= Math.ceil(data.total/data.limit); i++ ) {
				var activclass="";
				if(data.offset == (i*data.limit)-data.limit) {
					activclass=' class="aktiv"';
				}
				lastappend = lastappend+'<a title="Seite '+i+'" href="javascript:GetProdukte('+data.limit+','+((i*data.limit)-data.limit)+')"'+activclass+' rel="noffolow">'+i+'</a>';
			}
			lastappend = lastappend+'</div><div class="clear"></div>';
		}
		jQuery("#produkte_div").append(lastappend);
		hideLoader('produkte_loader', 'produkte_div');
	}


	function AddProductToDiv(myproduct) {
		var myprodcolors = '<div class="produkte_4er_colors">';
		var myproductimg = '';
		for( var fv_i = 0; fv_i < myproduct.extendedInfo.farbvarianten.length; fv_i++ ) {
			var mycolor = myproduct.extendedInfo.farbvarianten[fv_i];
			var mypic = '';
			if (typeof mycolor.image.urls != "undefined") {
				if (typeof mycolor.image.urls.img120 != "undefined") {
					mypic = mycolor.image.urls.img120.url;
				}
			}
			if (mypic == '') {
				if (myproduct.extendedInfo.images.length > 0) {
					if(typeof myproduct.extendedInfo.images[0].urls.big != "undefined") {
						mypic = myproduct.extendedInfo.images[0].urls.big.url;
					}
				}
			}
			if (!myproductimg && mycolor.image && mypic != "") { myproductimg = '<img src="'+mypic+'">';}
			myprodcolors = myprodcolors+'<div class="produkte_4er_color cl_'+mycolor.code+'"><div class="produkte_4er_color_shadow"></div></div>';
		}
		myprodcolors = myprodcolors+'</div>';
		var myproducttitel_split = myproduct.titel.split(" ");
		var specialtitelkat = '';
		if (myproducttitel_split[0] == 'Merino') {
			myproducttitel = '<b>'+myproducttitel_split[0]+' '+myproducttitel_split[1]+'</b><br>'+
			myproduct.titel.replace(myproducttitel_split[0]+' '+myproducttitel_split[1]+' ', '');
		}
		else if (myproducttitel_split[0] == '3L-[mi]' || myproducttitel_split[0] == 'S-Shell-(mi)') {
			myproducttitel = '<b>'+myproducttitel_split[0]+'</b><br>'+
			myproduct.titel.replace(myproducttitel_split[0]+' ', '');
		}
		else {
			myproducttitel = '<b>'+myproduct.titel+'</b>';
			specialtitelkat = ' nomerino';
		}
		mypreis = '';
		if (parseInt(myproduct.preis) > 0 && dobuy == '1') {
			if(myproduct.waehrung == 'USD'){
				trennung = '.';
			}else{
				trennung = ',';
			}
			mypreis = '<div class="produkte_4er_price"><a href="'+myproduct.detailUrl+'">'+preisTocurrency(myproduct.preis,trennung)+' '+myproduct.waehrung+'</a></div>';
		}
		else {
			mypreis = '<div class="produkte_4er_price"></div>';
		}
		if (myproductimg!= '') {
		jQuery("#produkte_div").append(
			'<div class="text_u_produkte_4er box">'+
				'<div class="produkte_4er_head'+specialtitelkat+'"><a href="'+myproduct.detailUrl+'">'+myproducttitel+'</a></div>'+
				'<div class="produkte_4er_img"><a href="'+myproduct.detailUrl+'">'+myproductimg+'</a></div>'+// style="background-image:url('+myproduct.extendedInfo.farbvarianten[0].image.urls.img120.url+')"
				myprodcolors+
				mypreis+
			'</div>'
		);
		}
	}



	var incolor = new Array(false, false, false, false);
	var oncolors = false;
	var middle_height = 0;


	Cufon.replace
	('.text_i_produkte_name', {
		color:		'#464646'
	})
	('h3.topicTitle', {
		fontSize: 	'40px',
		color:		'#FFFFFF'
	})
	('h2', {
		fontSize: '17px'
	})
/**
	('.tab_middle h2, .tab_middle a', {
		fontSize: '17px',
		color: '#464646'
	})
**/
	('.text_i_headline', {
		fontSize: 	'22px',
		color:		'#464646'
	})
	('.text_i_writer', {
		fontSize:	'18px',
		color:		'#999999'
	})
	('.text_u_athlet', {
		fontSize:	'20px',
		color:		'#666666'
	})
	('.text_u_date', {
		fontSize:	'16px',
		color:		'#999999'
	})
	('.text_u_subline', {
		fontSize:	'16px',
		color:		'#999999'
	})
	('.text_u_headline', {
		fontSize:	'16px',
		color:		'#666666'
	})
	('.text_i_athlet', {
		fontSize:	'30px',
		color:		'#666666'
	})
	('.text_i_athlet_kind', {
		fontSize:	'30px',
		color:		'#999999'
	})
	('#produkt_preis', {
		fontSize:	'22px',
		color:		'#333333'
	})
	('.produkte_top_subline', {
		fontSize:	'20px',
		color:		'#333333'
	})
	('.produkte_top_headline', {
		fontSize:	'37px',
		color:		'#E7DC54'
	})
	('.text_i_date', {
		fontSize:	'22px',
		color:		'#999999'
	})
	('.box_headline', {
		fontSize:	'17px',
		color:		'#333333'
	})
	('h4', {
		fontSize:	'25px',
		color:		'#FFFFFF'
	})
	('h6', {
		fontSize:	'48px',
		color:		'#FFFFFF'
	})
	('.reqItem a', {
		fontSize:	'22px',
		color:		'#464646'
	})
	('.reqItem span', {
		fontSize:	'15px',
		color:		'#999999'
	})
	('.text_i_produkte_teaser', {
		fontSize:	'18px',
		color:		'#333333'
	})
    
    ('.rightLinks h2', {
		fontSize:	'22px',
		color:		'#464646'
	})
    ('.videoLink', {
		fontSize:	'18px',
		color:		'#666666'
	})	
    ('.gewinnspiel .element legend', {
		fontSize:	'18px',
		color:		'#666666'
	})
    ('.uetop .prodteaser div h1', {
		fontSize:	'30px',
		color:		'#323031'
	})
    ('.uetop .prodteaser div div', {
		fontSize:	'14px',
		color:		'#323031'
	})
    ('.uetop .prodteaser div h3', {
		fontSize:	'16px',
		color:		'#323031'
	})
    ('.uetop .prodteaser div span', {
		fontSize:	'15px',
		color:		'#6F6E6C'
	})
	('#teaserBox .text_i_content b', {
		fontSize:	'22px',
		color:		'#323031'
	})
    ('.videoLinkText', {
		fontSize:	'15px',
		color:		'#999999'
	});
    
    


	function showSuccess( msg ) {
		$("#cartConfirm").css("visibility","visible");
    	$("#cartConfirm").fadeIn(500, function () {
    		$("#cartConfirm").fadeOut(3000);
    	});
	}

	function CreateDelegate(contextObject, delegateMethod){
		return function() {
			return delegateMethod.apply(contextObject, arguments);
		}
	}

	function imgTesting_onload(){
		if (middle_height < this.height) {
			middle_height = this.height;
			$('.text_i_produkte_middle').css('height',this.height);
		}
	}


	$(function() {
        $("a.lightbox_image,a.lightbox_produkt").fancybox({
            'titleShow' : false            
        });
	});
	function openlightboxprodukt() {
		jQuery("#firstproduktbild").trigger("click");
		return false;
	}
	function openlightboximage() {
		jQuery("#firstpic").trigger("click");
		return false;
	}

	$(document).ready(function(){
		var imgTesting = new Image();
		imgTesting.onload = CreateDelegate(imgTesting, imgTesting_onload);
		imgTesting.src = $('#produkte_pic_1').attr('src');

		$('.produkte_klick').click(function() {
			
				var rootitem = $(this);
				var aitem = $(this).parent().children('.text_i_prodcontent');
				if (!($(this).hasClass('active'))) {
					$('.produkte_klick.active').each(function(){
						var delitem = $(this).parent().children('.text_i_prodcontent');
						var delid = delitem.attr('id');
						var aid = aitem.attr('id');
						$('#'+delid).slideUp(500,function(){
						$('#'+aid).slideDown(500,function() {
							$('.produkte_klick.active').removeClass('active');
							rootitem.removeAttr('class').addClass('produkte_klick text_i_prodhead active');
						});
					});
					});
				}
	
			
			return (false);
		});

		$('.text_i_produkte_color_pic').hover(function() {
			var index = $(this).index(".text_i_produkte_color_pics li");
			incolor[index] = true;
		}, function() {
			var index = $(this).index(".text_i_produkte_color_pics li");
			incolor[index] = false;
		});

		$(".text_i_produkte_color_pics li").mouseover(function(){
			var index = $(this).index(".text_i_produkte_color_pics li");
			window.setTimeout(function(){
				if (incolor[index]) {
					loadColor(index);
				}
			},500);
		});

		$(".text_i_produkte_color_pics li").click(function(){
			var index = $(this).index(".text_i_produkte_color_pics li");
			switchVariante(index);
			document.getElementById("colorcombo").selectedIndex = index;
			$.uniform.update("#colorcombo");
		});

		$('.text_i_produkte_color_pics').hover(function() {
			oncolors = true;
		}, function() {
			oncolors = false;
		});

		$('.text_i_produkte_color_pics').mouseleave(function(){
			window.setTimeout(function(){
				if (!oncolors) {
					var item = $('.text_i_produkte_color_pics .active');
					var index = item.index(".text_i_produkte_color_pics li");
					loadColor(index);
				}

			},500);
		});

		$('#colorcombo').change(function(){
			var index =this.selectedIndex;
			switchVariante(index);
		});
		$('#sizecombo').change(function(){
			setCartLink();
		});
	});

	function setCartLink () {
		if (document.getElementById('colorcombo')) {
			acolor = document.getElementById("colorcombo").selectedIndex;
			if (document.getElementById('size_combo')) {
				asize  = document.getElementById("sizecombo").selectedIndex;
			}
			else {
				asize  = 0;
			}
			if (avail_variants[acolor][asize][0] == '1') {
				jQuery('#carto').html('<a href="javascript:goCartGo()"><div class="arrow_grey"></div>'+tr_inWarenkorb+'</a>');
			}
			else {
				if (avail_variants[acolor][asize][1] == '') {var instock = '';}
				else {var instock = tr_wiederverfuegbar+avail_variants[acolor][asize][1];}
				jQuery('#carto').html('<div style="color:red;margin:15px 10px 5px 5px;">'+tr_nichtverfuegbar+instock+'</div>');
			}
		}
	}

	function switchVariante(index){
		switchTonotSelected();
		switchToSelected(index);
		loadColor(index);
	}

	function switchTonotSelected(){
		$(".text_i_produkte_color_pics li").each(function(){
			var item = $(this);
			if(item.hasClass("active")){
				item.removeAttr("class").addClass("text_i_produkte_color_pic notActiv");
			}
		});
	}

	function switchToSelected(x){
		var item = $('.text_i_produkte_color_pics li:eq(' + x + ')');

		item.removeAttr("class").addClass("text_i_produkte_color_pic active");
	}

	function loadColor(x){
		var item = $('.text_i_produkte_color_pics li:eq(' + x + ')').children('a');
		$('#produkte_pic_2').attr('src',item.attr('rel'));//     .css('background-image','url('+item.attr('rel')+')');
		var imgTesting = new Image();
		imgTesting.onload = CreateDelegate(imgTesting, imgTesting_onload);
		imgTesting.src = $('#produkte_pic_2').attr('src');
		$('#produkte_pic_2_div').stop().fadeTo(700,1,function(){
			$('#produkte_pic_1').attr('src',$('#produkte_pic_2').attr('src'));//     .css('background-image',$('#produkte_pic_2').css('background-image'));
			$('#produkte_pic_2_div').fadeTo(1,0);
			setCartLink();
		});
	}




	// AJAX für Redaktionsinhalte-Text
	function getRed(url,e, folder){

			/*
			if( jQuery.browser == 'mozilla'){
			jQuery.ajaxSetup({
    			'beforeSend' : function(xhr) {
    				if( xhr.overrideMimeType() != undefined ){
        				xhr.overrideMimeType('text/html; charset=iso-8859-1');
        			}
        		}
    		});
    		}

		*/

		jQuery.get( url+'/content.php?folder='+folder+'&e='+e, function(data) {
  				jQuery('#asContent').html(data);

  				/**
  				var subj = '';
  				var myregexp = new RegExp("e_([0-9]*)");

  				jQuery('#asContent .verwandte_artikel a').each( function(){
  					subj = this.href;
  					var mymatch = myregexp.exec( subj );
  					jQuery(this).attr('onclick', 'getRed( http://'+window.location.hostname+', '+ mymatch[1] +' , '+ folder + ');return false;');

  				});

  				**/

  				Cufon.refresh();
  				setAjRequestItemActive( e );

  		});

	}

	var eleidStorage = '';

	function setAjRequestItemActive( eleid ){
		jQuery('#req-'+eleidStorage).removeClass('reqActive');

		eleidStorage = eleid;
		jQuery('#req-'+eleid).addClass('reqActive');
	}

