/*Lieferzeit prüfen*/
var shippingArray = new Array;
shippingArray[0] = "Artikel sofort lieferbar";
shippingArray[1] = "Artikel leider nicht lieferbar";
shippingArray[2] = "Lieferbar in XX Tagen";

function displayShipping(which) {
	$("#displayShipping a").hide();
	$("#displayShipping").append("<span></span>");
	$("#displayShipping span").text(shippingArray[which]);
}

/*Produktdetailseite: Mehr Text / Weniger Text anzeigen*/
function toggleMoreOrLess() {
	$('.txtBox .text .moreorless').toggle();
	if ($('.txtBox .text .lessText').is(":visible")) {
		$('.txtBox .text .lessText').hide();
		$('.txtBox .text .moreText').show();
	}
	else {
		$('.txtBox .text .lessText').show();
		$('.txtBox .text .moreText').hide();
	}
}

/*Loginbox ein- bzw. ausblenden*/
function toggleLoginBox() {
	$('.loginBox').toggle();
	if ($('.userInfo .login').hasClass('active')) {
		$('.userInfo .login').removeClass('active');
	}
	else {
		$('.userInfo .login').addClass('active');
	}
}

/*Inhalt der Loginbox toggeln*/
function toggleLoginBoxContent() {
	if ($('.loginBox .loginNumber').is(":visible")) {
		$('.loginBox .loginNumber').hide();
		$('.loginBox .loginEmail').show();
	}
	else {
		$('.loginBox .loginNumber').show();
		$('.loginBox .loginEmail').hide();
	}
}

/*Tooltip-Toggle für Größen (Cup / Größe)*/
function tooltipSizes(which) {
	$('#'+which).toggleClass("noSizes");
	$('#'+which+"tt").toggle();
}

/*Resize Thickbox in Store-Select Layer*/
//var newSize = 275;
var newSize = 140;
var layerMargin;
var newLayerMargin;
var layerHeight;
var newLayerHeight;
function showStore() {
	$('.layerContent .selectedStore').toggle();	
	if ($('.layerContent .selectedStore').is(":visible")) {
		layerMargin = $('#TB_window').css("margin-top");
		layerMargin = parseInt(layerMargin.replace(/px/g, ""));
		newLayerMargin = layerMargin - (newSize/2);
		$('#TB_window').css("margin-top", newLayerMargin);
		$('#TB_ajaxContent').css("height", "500");	
	}
	else {
		$('#TB_window').css("margin-top", layerMargin);
		$('#TB_ajaxContent').css("height", "380");
	}
}

/*Text-Toggle am Ende der Seite*/
function footerText() {
	$('.footer2 .text .moreText').toggle();
	if ($('.footer2 .text .link1').is(":visible")) {
		$('.footer2 .text .link1').hide();
	}
	else {
		$('.footer2 .text .link1').show();
	}
}

/*Filter mit Inhalt überschreiben 01*/
	var filterNamesArray = new Array;
	var allColors = "";

/*Filter (wird onclick aufgerufen)*/
function filterClick(which){
	if ($(which).parent().hasClass("active")) {
		if ($.browser.msie) {
			$(which).parent().children(".filterLayer").hide();
		}
		else {
			$(which).parent().children(".filterLayer").fadeOut(200);
		}		
		$(which).parent().removeClass("active");
	}
	else {
		if ($.browser.msie) {
			$(which).parent().children(".filterLayer").show();
		}
		else {
			$(which).parent().children(".filterLayer").fadeIn(200);
		}		
		$(which).parent().addClass("active");
		$(which).parent().topZIndex();
		$(which).parent().children(".filterLayer").topZIndex();		
	}
}


$(document).ready(function(){
	
	/*Start Teaser*/
	$('.indexTeaser li:not(a)').click(function(){
		location.href = $(this).find('div a').attr('href');
	});
	
	/*HomeSlider Fade-Effect (Auto, 3 Stück)*/
	if ($('#sliderHome3').length){
		$('#sliderHome3').cycle({
			fx:     'fade', 
		    speed:  'slow',
			timeout: 3500, 
			pause:  1,
			next:   '#fssNext', 
			prev:   '#fssPrev',
			pager:  '#fssList',
			pagerAnchorBuilder: pagerFactory
		});
	}
	function pagerFactory(idx, slide) {
		var s = idx > 4 ? ' style="display:none"' : '';
	    return '<li'+s+' class="fssLi'+ idx +'"><a href="#">'+(idx+1)+'</a></li>';
	};
	
	$('.indexSlider .pauseit').mouseover(function(){
		$('#sliderHome3').cycle('pause');
	});
	
	$('.indexSlider .pauseit').mouseout(function(){
		$('#sliderHome3').cycle('resume');
	});
	
	/*Modewelt Icons Start*/
	$('.infoIcon .icon').click(function(){
		if($(this).parents('.infoIcon').children('.infoIconLayer').is(":visible")){
			$(this).parents('.infoIcon').children('.infoIconLayer').hide();
		}
		else {
			var pos = $(this).parents('.infoIcon').position();
			if (pos.left < 359) {
				$(this).parents('.infoIcon').children('.infoIconLayer').addClass('right');
			}
			$('.infoIcon').children('.infoIconLayer').hide();
			$(this).parents('.infoIcon').children('.infoIconLayer').show();
		}			
	});
	
	$('.infoIcon .infoIconLayer .close').click(function(){
		$(this).parents('.infoIconLayer').hide();
	});
	/*Modewelt Icons Ende*/
	
	/*LoginBox Formulare toggeln*/
	$(".loginSelector .zers").click(function(){
		if($(this).hasClass("act")) {
			$(this).removeClass("act");
			$(".loginSelector").find(".toggleme").slideUp(1000);
		}
		else {
			$(".loginSelector").find(".zers").removeClass("act");
			$(".loginSelector").find(".toggleme").slideUp(1000);
			$(this).addClass("act");
			$(this).parent().children(".toggleme").slideDown(1000);
		}
	});
	
	/*Versand Formulare toggeln*/
	$(".sendInfo .xerxe").click(function(){
		if($(this).hasClass("act")) {
			$(this).removeClass("act");
			$(".sendInfo").find(".toggleSend").slideUp(1000);
		}
		else {
			$(".sendInfo").find(".xerxe").removeClass("act");
			$(".sendInfo").find(".toggleSend").slideUp(1000);
			$(this).addClass("act");
			$(this).parent().children(".toggleSend").slideDown(1000);
		}
	});
	
	/*Mein Konto Formulare toggeln*/
	$(".settings .uHead").click(function(){
		if($(this).hasClass("act")) {
			$(this).removeClass("act");
			$(".settings").find(".uToggle").slideUp(1000);
		}
		else {
			$(".settings").find(".uHead").removeClass("act");
			$(".settings").find(".uToggle").slideUp(1000);
			$(this).addClass("act");
			$(this).parents("li.sLi").children(".uToggle").slideDown(1000);
		}
	});
	
	$('.place .city').click(function(){
		if ($(this).parents('.place').children('.cityLayer').is(":visible")) {
			$(this).parents('.place').children('.cityLayer').hide();
		}
		else {
			$(this).parents('.mbLeft').find('.cityLayer').hide();
			$(this).parents('.place').children('.cityLayer').show();
		}
	});
	
	$('.cityLayer .clInner .close').click(function(){
			$(this).parents('.cityLayer').hide();
	});
	
	/*Colors*/
	$(".colors li a").click(function(){
		$(this).parents(".colors").find("li").each(function(){
			$(this).removeClass("activeSelection");
		});
		$(this).parent().addClass("activeSelection");
		if ($(this).parent().hasClass("selected")) {
			$(this).parent().removeClass("selected");
		}
		else {
			$(this).parent().addClass("selected");
		}
	});
	
	/*Sizes*/
	$("ul.sizes a").click(function(){
		$(this).parents(".sizes").find("li").each(function(){
			$(this).removeClass("activeSelection");
		});
		$(this).parents("ul.sizes li").addClass("activeSelection");
		if ($(this).parents("ul.sizes li").hasClass("selected")) {
			$(this).parents("ul.sizes li").removeClass("selected");
		}
		else {
			$(this).parents("ul.sizes li").addClass("selected");
		}
	});
	
	/*More Filters Toggle*/
	$(".toggleFilters").click(function(){
		if($(".filterRow").find(".moreF").is(":visible")){
			$(".moreF").hide();
			$(".toggleFilters").removeClass("moreFilters");
		}
		else {
			$(".moreF").show();
			$(".toggleFilters").addClass("moreFilters");
		}
	});
	
	/*Filter*/
	$(".filter .filterRow ul li .link").click(function(){		
		filterClick(this);
	});
	$(".tableFilter .link").click(function(){		
		filterClick(this);
	});
	
	/*Close Filter*/
	$(".filterLayer .close").click(function(){
		if ($.browser.msie) {
			$(this).parents(".dis").children(".filterLayer").hide();
		}
		else {
			$(this).parents(".dis").children(".filterLayer").fadeOut(200);
		}		
		$(this).parents(".dis").removeClass("active");
	});
	$(".filterLayer").mouseleave(function(){	
		if ($.browser.msie) {
			$(this).hide();
		}
		else {
			$(this).fadeOut(200);
		}
		$(this).parents(".dis").removeClass("active");
	});
	
	/*Filter mit Inhalt überschreiben 02*/
	$(".dis .link span span").each(function(i) {
		filterNamesArray[i] = new Object();
		for(f=0;f<40;f++) {
			filterNamesArray[i][f] = "";
		}
		filterNamesArray[i][0] = $(this).text();
	});
	
	/*Filter in der Tabelle mit aktuellem Wert vorausfüllen*/
	if($(".tableFilter").length){
		$(".tableFilter .filterArea").find(".activeSelection").each(function(h){
			$(this).parents(".dis").children(".link").children("span").children("span").text($(this).attr("title"));
		});
	}
	
	/*Filter: Aktiv-Zustand setzen / entfernen*/
	$(".filterArea .checkAF").click(function(){
		if ($(this).hasClass("aF")) {
			$(this).removeClass("aF");
		}
		else {
			$(this).addClass("aF");
		}		
		if($(this).parents(".dis").find(".aF").length > 0) {
			$(this).parents(".dis").addClass("selectedItems");
		}
		else {
			$(this).parents(".dis").removeClass("selectedItems");
		}
		/*Filter: Namen in den Selector schreiben*/
		/*if table, hier nur aktiven Namen in Filter schreiben*/
		if($(".tableFilter").length){
			$(this).parents(".dis").children(".link").children("span").children("span").text($(this).attr("title"));
			if ($(this).parents(".dis").hasClass("errorDis")) {
				$(this).parents(".dis").removeClass("errorDis");
			}
		}
		/*else, alle Namen in Filter schreiben*/
		else {
			var selectorNumber = $(this).parents(".dis").index(); //Das jeweilige array 0 - 7
			if (filterNamesArray[selectorNumber][$(this).index()+1] == "") {
				filterNamesArray[selectorNumber][$(this).index()+1] = $(this).attr("title"); //Alle "checkAF" LIs brauchen einen Title!
			}
			else {
				filterNamesArray[selectorNumber][$(this).index()+1] = ""
			}
			allColors = "";
			for (i=1;i<40;i++) {
				if (filterNamesArray[selectorNumber][i] != "") {
					allColors = allColors + filterNamesArray[selectorNumber][i] + ", ";
				}
			}
			if (allColors == "") {
				allColors = filterNamesArray[selectorNumber][0];
			}
			$(this).parents(".dis").children(".link").children("span").children("span").text(allColors);
		}
	});
		
	/*Filter: Einen Filter zurücksetzen*/
	$(".dis .flTop .reset").click(function(){
		$(this).parents(".dis").find(".checkAF").removeClass("selected");
		$(this).parents(".dis").find(".checkAF").removeClass("aF");
		$(this).parents(".dis").removeClass("selectedItems");
		$(this).parents(".dis").find(".sel").remove();
		$(this).parents(".dis").children(".link").children("span").children("span").text(filterNamesArray[$(this).parents(".dis").index()][0]);
		for (i=1;i<40;i++) {
			filterNamesArray[$(this).parents(".dis").index()][i] = "";
		}
	});
	
	/*Filter: Alle Filter zurücksetzen*/
	$(".filter .resetAll").click(function(){
		$(this).parents(".filter").find(".checkAF").removeClass("selected");
		$(this).parents(".filter").find(".checkAF").removeClass("aF");
		$(this).parents(".filter").find(".dis").removeClass("selectedItems");
		$(this).parents(".filter").find(".sel").remove();
		$(".filterRow .dis .link span span").each(function(i) {
			$(this).text(filterNamesArray[i][0]);
			for (u=1;u<40;u++) {
				filterNamesArray[i][u] = "";
			}
		});		
	});
	
	/*Checkbox Checker im Filter*/
	$(".filterLayer .filterLayerInner .selection a").click(function(){
		if ($(this).parents(".filterLayer .filterLayerInner .selection li").hasClass("selected")) {
			$(this).parents(".filterLayer .filterLayerInner .selection li").removeClass("selected");
		}
		else {
			$(this).parents(".filterLayer .filterLayerInner .selection li").addClass("selected");
		}
	});
	
	/*Price Checkbox im Filter*/
	$(".priceRange .prCheck").click(function(){
		if ($(this).hasClass("check")) {
			$(this).removeClass("check");
		}
		else {
			$(this).addClass("check");
		}
	});
	
	/*Produktdetailseite: Text-Scroller*/
	$(function() {
		$('.scroll-pane').jScrollPane();
		$('.txtBox .text .moreText').css('visibility','visible');
		$('.txtBox .text .moreText').hide();
	});
	
	$(".payment #zahlungsArt input").live('change', function(){
		$('.payment .zusatzInfos').hide();
		myC = ".payment .zusatzInfos#"+$(this).attr('alt');
		$(myC).show();
	});
	
	//Workaround wegen jNice-Form Elementen (werden ansonsten nicht gerendert!)	
	$(".loginSelector li .toggleme").hide();
	$(".sendInfo li .toggleSend").hide();
	$('.layer').hide();
	$('.settings .uToggle').hide();
	$('.formList .formularToggle').hide();
	$('.zusatzInfos').hide();	
	
	/*Login Formular ausklappen*/
	$(".sendInfo .openThis .xerxe").addClass("act");
	$(".sendInfo .openThis .toggleSend").show();
	
	/*Function, um Input-Values zu toggeln*/
	swapValue = [];
	$(".swap-value").each(function(i){
		swapValue[i] = $(this).val();
		$(this).focus(function(){
			if ($(this).val() == swapValue[i]) {
				$(this).val("");
			}
			$(this).addClass("focus");   
		}).blur(function(){
			if ($.trim($(this).val()) == "") {
				$(this).val(swapValue[i]);
				$(this).removeClass("focus");
			}
		});
	});
	
	/*Image Zoom Produktdetailseite*/
	var options = {
		zoomWidth: 320,
		zoomHeight: 395,
		position: "right" //and MORE OPTIONS
	};
	$('.zoomImage').jqzoom(options);
	
	/*Modehaeuser-Image-Gallery*/
	$('.imgGallery .bigImg img').attr('src', $('.imgGallery .miniImgs li:first a').attr('href'));
	$('.imgGallery .bigImg a').attr('href', $('.imgGallery .miniImgs li:first a').attr('data-thickbox'));
	
	$('.imgGallery .miniImgs a').click(function(){
		$('.imgGallery .bigImg img').attr('src', $(this).attr('href'));
		$('.imgGallery .bigImg a').attr('href', $(this).attr('data-thickbox'));
		return false;
	});
	
	/*Text im Productcarousel verlinken*/
	$('.productCarousel .pclLi .text').click(function(){
		location.href = $(this).parents('.pclLi').children('.product').children('a').attr('href');
	});
	
	/*Text in der Listenansicht verlinken
	$('.fResult .resultLi .text').click(function(){
		location.href = $(this).parents('.resultLi').children('.product').children('a').attr('href');
	});*/
	
	/*Carousels in verschiedenen Ausführungen*/
	/*Detailseite Detailinfo*/
	$('#detailSlider4').bxSlider({
		displaySlideQty: 4,
		moveSlideQty: 1
	});
	
	/*Topseller zum Kombinieren (3 Stück)*/
	$('#sliderTopSeller6').bxSlider({
		displaySlideQty: 6,
		moveSlideQty: 1
	});
	
	/*Passende Artikel zum Kombinieren (3 Stück)*/
	$('#sliderCombineArticles3').bxSlider({
		displaySlideQty: 3,
		moveSlideQty: 1
	});
	
	/*Passende Artikel zum Kombinieren (5 Stück)*/
	$('#sliderCombineArticles5').bxSlider({
		displaySlideQty: 5,
		moveSlideQty: 1
	});
	
	/*Ihre zuletzt angesehenen Artikel (3 Stück)*/
	$('#sliderLastSeenArticles3').bxSlider({
		displaySlideQty: 3,
		moveSlideQty: 1
	});
	
	/*Ihre zuletzt angesehenen Artikel (5 Stück)*/
	$('#sliderLastSeenArticles5').bxSlider({
		displaySlideQty: 5,
		moveSlideQty: 1
	});
	
	/*Passende Artikel zum Kombinieren (3 Stück)*/
	$('#sliderCombineArticlesLayer3').bxSlider({
		displaySlideQty: 3,
		moveSlideQty: 1
	});
	
	/*BrandSlider (4 Stück)*/
	$('#sliderBrands4').bxSlider({
		displaySlideQty: 4,
		moveSlideQty: 1
	});
	
	/*BrandSlider (4 Stück)*/
	$('#sliderFriends3').bxSlider({
		displaySlideQty: 3,
		moveSlideQty: 1
	});
	
	/*AGB Checkbox*/
	$(".agbCheckRow .agbCheck").live('change', function(){
		if ($(this).is(':checked')) {
			$('.agbCheck').attr('checked', true);
		}
		else {
			$('.agbCheck').attr('checked', false);
		}
	});	
	
	/*Outfit Toggle*/
	$(".outfitBox .openInfo").click(function(){
		if ($(this).parents(".obRow").hasClass("opened")) {
			$(this).parents(".obRow").removeClass("opened");
			$(this).parents(".obRow").children(".layMe").slideUp(500);
		}
		else {
			$(this).parents(".obRow").addClass("opened");
			$(this).parents(".obRow").children(".layMe").slideDown(500);
		}
	});
	
	/*Outfit Toggle*/
	$(".eventList .openTog").click(function(){
		if ($(this).parents(".elLi").hasClass("opened")) {
			$(this).parents(".elLi").removeClass("opened");
			$(this).parents(".elLi").children(".toggleEvent").slideUp(500);
		}
		else {
			$(this).parents(".elLi").addClass("opened");
			$(this).parents(".elLi").children(".toggleEvent").slideDown(500);
		}
	});
	
	/*Outfit Toggle*/
	$(".formList .openTog").click(function(){
		if ($(this).parents(".elLi").hasClass("opened")) {
			$(this).parents(".elLi").removeClass("opened");
			$(this).parents(".elLi").children(".formularToggle").slideUp(500);
		}
		else {
			$(this).parents(".elLi").addClass("opened");
			$(this).parents(".elLi").children(".formularToggle").slideDown(500);
		}
	});
	
	/*Newsletter abonnieren ausklappen!*/
	$(".elLi#newsletterAbo").addClass("opened");
	$(".elLi#newsletterAbo").children(".formularToggle").show();
	
	/*Fix Carousel Height*/	
	$("#noSlider .pclLi .colors").equalHeights();
	$("#noSlider .pclLi .text").equalHeights();
	$("#sliderTopSeller3 .pclLi .colors").equalHeights();
	$("#sliderTopSeller3 .pclLi .text").equalHeights();
	$("#sliderCombineArticles3 .pclLi .colors").equalHeights();
	$("#sliderCombineArticles3 .pclLi .text").equalHeights();
	$("#sliderCombineArticles5 .pclLi .colors").equalHeights();
	$("#sliderCombineArticles5 .pclLi .text").equalHeights();
	$("#sliderLastSeenArticles3 .pclLi .colors").equalHeights();
	$("#sliderLastSeenArticles3 .pclLi .text").equalHeights();
	$("#sliderLastSeenArticles5 .pclLi .colors").equalHeights();
	$("#sliderLastSeenArticles5 .pclLi .text").equalHeights();
	$("#printArticles5 .pclLi .colors").equalHeights();
	$("#printArticles5 .pclLi .text").equalHeights();
	//$(".praemienListe .formElement").equalHeights();
	//Höhe für Warenkorb-Layer wird in openBasketFromThickbox() angepasst.
	
	//Prämienliste Höhe ausrechnen
	$('.praemienListe li:nth-child(4n+1)').addClass("attr");
	var MAX=4;
	var tempMaxHeight = null;
	var row = new Array();

	$('.praemienListe ul').each(function() {
		var length = $(this).find('li').length;
		$(this).find('li').each(function(i) {
			row.push($(this));
			setTempMaxHeight($(this));	
			if (i != 0 && ((i + 1) % MAX == 0 || i == length - 1))
			{
				$(row).each(function(){
					$(this).height(tempMaxHeight)
				});
				tempMaxHeight = null;
				row = new Array();
			}			
		});
	});

	function setTempMaxHeight(obj)
	{
		var height = obj.height();
		if (tempMaxHeight == null || tempMaxHeight < height)
		{
			tempMaxHeight = height;
		}
		obj.height(tempMaxHeight);
	}

	/*View Toggle 02*/
	$(".filterHead .filterSelection a").hoverIntent(overConfigView);
		
	/*Last / Next Part 02*/
	$(".rightBox .top .last").hoverIntent(overConfigLast);
	$(".rightBox .top .next").hoverIntent(overConfigNext);

	/*Tooltipp Verzögerung 02*/
	$(".showTooltip li").hoverIntent(overConfigTooltip);
	
	/*Small List Over 02*/
	$(document).mousemove(function(e){
        mouseX = e.pageX;
		mouseY = e.pageY;
		if ($("#hoverResult").is(":visible")){
			positionLayer();
		}
    });
	$(".fResult.smallList li").hoverIntent(overConfigSLOver);
	
	/*Höhen angleichen Listenansicht*/
	var productNumber = $(".fResult.normalList ul").find("li.resultLi").length;
	var localHeight;
	$(".fResult.normalList ul li.resultLi:nth-child(3n+1)").addClass("newLine");
	// Höhe der "Color" Blöcke anpassen
	$(".fResult.normalList ul li.newLine").each(function() {
		localHeight = $(this).children(".colors").height();
		if ($(this).next().children(".colors").height() > localHeight) {
			localHeight = $(this).next().children(".colors").height();
		}
		if ($(this).next().next().children(".colors").height() > localHeight) {
			localHeight = $(this).next().next().children(".colors").height();
		}
		$(this).children(".colors").height(localHeight);
		$(this).next().children(".colors").height(localHeight);
		$(this).next().next().children(".colors").height(localHeight);
	});
	// Höhe der "Text" Blöcke anpassen
	$(".fResult.normalList ul li.newLine").each(function() {
		localHeight = $(this).children(".text").height();
		if ($(this).next().children(".text").height() > localHeight) {
			localHeight = $(this).next().children(".text").height();
		}
		if ($(this).next().next().children(".text").height() > localHeight) {
			localHeight = $(this).next().next().children(".text").height();
		}
		$(this).children(".text").height(localHeight);
		$(this).next().children(".text").height(localHeight);
		$(this).next().next().children(".text").height(localHeight);
	});
	// Höhe der "Teaser" anpassen
	$(".fResult.normalList ul li.teaser").each(function() {
		if ($(this).hasClass("newLine")) {
			$(this).children(".teaserInner").height($(this).next().height()-11); //height minus Margin und Border
		}
		else {
			$(this).children(".teaserInner").height($(this).prev().height()-11); //height minus Margin und Border
		}
	});	
	
	//overviewBlock Verlinkung des ganzen Teasers
	$('.overviewBlock ul li').click(function(){
		location.href = $(this).find('a').attr('href');
	});
	
	//Google-Map initialisieren, wenn Map eingebunden
	if ($('#map_canvas').length) {
		gmapInitialize();
	}
});

//Stores Array
Store = function(lat, lng) {
	this.lat = lat;
	this.lng = lng;
}
Store.prototype.lat = "";
Store.prototype.lng = "";
var gmapArray = new Array;
	gmapArray[0] = new Store(53.545714, 9.986744); //Hamburg
	gmapArray[1] = new Store(52.02095, 8.53154); //Bielefeld
	gmapArray[2] = new Store(51.45412, 7.01343); //Essen
	gmapArray[3] = new Store(50.939697, 6.952972); //Köln
	gmapArray[4] = new Store(50.776052, 6.090353); //Aachen
	gmapArray[5] = new Store(50.081296, 8.241441); //Wiesbaden
	gmapArray[6] = new Store(50.130964, 8.922937); //Hanau
	gmapArray[7] = new Store(49.449937, 11.078918); //Nürnberg
	gmapArray[8] = new Store(49.142308, 9.214854); //Heilbronn
	gmapArray[9] = new Store(49.016491, 12.100904); //Regensburg
	gmapArray[10] = new Store(48.79991, 9.479334); //Winterbach (Modehaus)
	gmapArray[11] = new Store(48.805719, 9.575422); //Uhrbach 
	gmapArray[12] = new Store(48.77413, 9.17626); //Stuttgart
	gmapArray[13] = new Store(48.702829, 9.655802); //Göppingen 
	gmapArray[14] = new Store(48.542921, 9.291215); //Metzingen 
	gmapArray[15] = new Store(48.059424, 8.459151); //Villingen
	gmapArray[16] = new Store(48.135277, 11.572444); //München
	gmapArray[17] = new Store(48.039529, 8.155975); //Freiburg 
	gmapArray[18] = new Store(47.723866, 12.876642); //Bad Reichenhall 

function thickBoxCarouselHeightsEqualizer() {
	$("#sliderCombineArticlesLayer3 .pclLi .colors").equalHeights();
	$("#sliderCombineArticlesLayer3 .pclLi .text").equalHeights();
}

/*View Toggle 01*/
function showItView(){
	$("#tooltipBoxDouble div").html($(this).children("span").html());
	var myPosition = $(this).offset();
	if ($.browser.msie) {
		$("#tooltipBoxDouble").show();
	}
	else {
		$("#tooltipBoxDouble").fadeIn(200);
	}	
	$("#tooltipBoxDouble").css("left", myPosition.left - $("#tooltipBoxDouble").width() + 39);
	$("#tooltipBoxDouble").css("top", myPosition.top - 57);
}
function hideItView(){
	if ($.browser.msie) {
		$("#tooltipBoxDouble").hide();
	}
	else {
		$("#tooltipBoxDouble").fadeOut(200);
	}
}
var overConfigView = {    
     over: showItView, // function = onMouseOver callback (REQUIRED)    
     timeout: 200, // number = milliseconds delay before onMouseOut    
     out: hideItView // function = onMouseOut callback (REQUIRED)    
};

/*Last / Next Part 01*/
function showItLast(){
	if ($.browser.msie) {
		$('.rightBox .top .last .showLast').show();
	}
	else {
		$('.rightBox .top .last .showLast').fadeIn(300);
	}	
	$('.rightBox .top .last').addClass("active");
}
function hideItLast(){
	if ($.browser.msie) {
		$('.rightBox .top .last .showLast').hide();
	}
	else {
		$('.rightBox .top .last .showLast').fadeOut(300);
	}
	$('.rightBox .top .last').removeClass("active");
}
var overConfigLast = {    
     over: showItLast, // function = onMouseOver callback (REQUIRED)    
     timeout: 500, // number = milliseconds delay before onMouseOut    
     out: hideItLast // function = onMouseOut callback (REQUIRED)    
};
function showItNext(){
	if ($.browser.msie) {
		$('.rightBox .top .next .showNext').show();
	}
	else {
		$('.rightBox .top .next .showNext').fadeIn(300);
	}
	$('.rightBox .top .next').addClass("active");
}
function hideItNext(){
	if ($.browser.msie) {
		$('.rightBox .top .next .showNext').hide();
	}
	else {
		$('.rightBox .top .next .showNext').fadeOut(300);
	}
	$('.rightBox .top .next').removeClass("active");
}
var overConfigNext = {    
     over: showItNext, // function = onMouseOver callback (REQUIRED)    
     timeout: 500, // number = milliseconds delay before onMouseOut    
     out: hideItNext // function = onMouseOut callback (REQUIRED)    
};

/*Tooltipp Verzögerung 01*/
function showItTooltip(){
	if ($(this).attr("title")) {			
		$("#tooltipBox div").text($(this).attr("title"));
		var myPosition = $(this).offset();
		if ($.browser.msie) {
			$("#tooltipBox").show();
		}
		else {
			$("#tooltipBox").fadeIn(200);
		}
		$("#tooltipBox").css("left", myPosition.left - $("#tooltipBox").width() + 39);
		$("#tooltipBox").css("top", myPosition.top - 39);
	}
}
function hideItTooltip(){
	if ($.browser.msie) {
		$("#tooltipBox").hide();
	}
	else {
		$("#tooltipBox").fadeOut(200);
	}
}
var overConfigTooltip = {    
     over: showItTooltip, // function = onMouseOver callback (REQUIRED)    
     timeout: 5, // number = milliseconds delay before onMouseOut    
     out: hideItTooltip // function = onMouseOut callback (REQUIRED)    
};

/*Small List Over 01*/
var mouseX;
var mouseY;
function positionLayer() {
	$("#hoverResult").css("left", mouseX - $("#hoverResult").width());
	$("#hoverResult").css("top", mouseY - $("#hoverResult").height());
}
function showItSLOver(){
	$("#hoverResult").html($(this).children(".hover").html());
	positionLayer();
	if ($.browser.msie) {
		$("#hoverResult").show();
	}
	else {
		$("#hoverResult").fadeIn(200);
	}
}
function hideItSLOver(){
	if ($.browser.msie) {
		$("#hoverResult").hide();
	}
	else {
		$("#hoverResult").fadeOut(200);
	}
}
var overConfigSLOver = {    
     over: showItSLOver, // function = onMouseOver callback (REQUIRED)    
     timeout: 200, // number = milliseconds delay before onMouseOut    
     out: hideItSLOver // function = onMouseOut callback (REQUIRED)    
};

function openBasketFromThickbox() {	
	$("#TB_window").remove();
	$("body").append("<div id='TB_window'></div>");
	tb_show("New", "#TB_inline?height=500&amp;width=620&amp;inlineId=layerBasket", "");
	thickBoxCarouselHeightsEqualizer();
}

//Popup öffnen
function popup(url,name,params) {
    var sizeX = 0;
    var sizeY = 0;
    var winX = screen.availWidth;
    var winY = screen.availHeight;
    var tmpArray = params.split(',');
    for (var i = 0; i < tmpArray.length; i++) {
        if (tmpArray[i].indexOf('width') != -1) {
            var tmpArray2 = tmpArray[i].split('=');
            sizeX = tmpArray2[1];
        }
        if (tmpArray[i].indexOf('height') != -1) {
            var tmpArray2 = tmpArray[i].split('=');
            sizeY = tmpArray2[1];
        }
    }
    var centerX = Math.round(winX / 2 - sizeX / 2);
    var centerY = Math.round(winY / 2 - sizeY / 2);
    params += ',left=' + centerX + ',top=' + centerY;
    var pWindow = open(url,name,params).focus();
}
