		item_width = 159;

        function slidershift(dir) {
        	if (document.getElementById('slhandle') && document.getElementById('slgallery')) {
				//alert(document.getElementById('slgallery').offsetLeft);
				w = document.getElementById('slgallery').offsetWidth;
				//alert(document.getElementById('slgallery').offsetLeft / item_width / 6);
				if (dir == 1) {
					sliderskip(Math.floor(((document.getElementById('slgallery').offsetLeft * -1) + 1) / item_width / 6) + 2);
				}
				else if (dir == -1) {
					sliderskip(Math.floor(((document.getElementById('slgallery').offsetLeft * -1)) / item_width / 6));
				}
        	}
        }
        function sliderskip(page) {

        }
		function findPosX(obj)
  		{
    		var curleft = 0;
    		if(obj.offsetParent)
        		while(1) 
        		{
          			curleft += obj.offsetLeft;
          			if(!obj.offsetParent)
            			break;
          			obj = obj.offsetParent;
        		}
    		else if(obj.x)
        	curleft += obj.x;
    		return curleft;
  		}

		function findPosY(obj)
		{
			var curtop = 0;
			if(obj.offsetParent)
				while(1)
				{
					curtop += obj.offsetTop;
					if(!obj.offsetParent)
						break;
					obj = obj.offsetParent;
				}
			else if(obj.y)
        	curtop += obj.y;
    		return curtop;
  		}
  		var spopup_open = false;
  		var adata = new Array();

  		function findeArtikel(nummer) {
  			for (i = 0; i < adata.length; i++) {
  				if (adata[i][0] == nummer) return adata[i];
  			}
  		}
  		
  		function softpophover(id) {
  			if (spopup_open && spopup_open != id) softpop();
  		}
  		
		function softpop(id) {
			b = document.body;
			if (spopup_open && document.getElementById("sp-"+spopup_open)) {
				// altes löschen
				document.getElementById("sp-"+spopup_open).parentNode.removeChild(document.getElementById("sp-"+spopup_open));
			}

			if (id && spopup_open != id) {
				var art = findeArtikel(id);
				spopup_open = id;
				se = document.getElementById("li-"+id);
				if (document.documentElement.clientWidth) w = document.documentElement.clientWidth;
				else if (document.body.clientWidth)  w = document.body.clientWidth;
				else w = window.innerWidth;
				iw = findPosX(se) - (w - 980) / 2;
				if (iw < 408) dir = "r";
				else dir = "l";
				d = document.createElement("div");
				d.id = "sp-"+id;
				d.setAttribute("id", "sp-"+id);
				d.className = "softpop"+dir+' '+'softpop_'+art[7]+dir;
				if (dir == "r") {
					d.style.top = (findPosY(se)-90-30)+"px";
					d.style.left = (findPosX(se)+136)+"px";
				}
				else {
					d.style.top = (findPosY(se)-90-30)+"px";
					d.style.left = (findPosX(se)-352)+"px";
				}
				divi = document.createElement("div");
				divi.className = "softpop_content";

				a = document.createElement("a");
				a.setAttribute("href", '/weine/'+art[12]+'-'+id+"/");
				a.appendChild(document.createTextNode("Details"));
				a.className = "softpop_more";
				divi.appendChild(a);
				
				a = document.createElement("a");
				a.setAttribute("href", 'jav'+'ascript:softpop()');
				a.appendChild(document.createTextNode("schließen"));
				a.className = "softpop_close";
				divi.appendChild(a);

				divi2 = document.createElement("div");
				divi2.className = "softpop_actions";
				
				dwk = document.createElement("div");
                                
				if (art[8] > 0) { // verfuegbar
					form = document.createElement("form");
					form.setAttribute('method', 'post');
					form.setAttribute('action', '#');
					form.style.display = 'block';
					form.style.verticalAlign = 'middle';
					sel = document.createElement("select");
					sel.setAttribute('name', 'menge');
					sel.setAttribute('id', 'quantity'+id);
					sel.setAttribute('on'+'change', "add2cart('"+fxl_rwkid+"', '"+id+"', this[this.selectedIndex].value)");
					stzahlen = new Array(1,2,3,4,5,6,7,8,9,10,11,12,18,24,30,36,48);
                                        count = 0;
					for (i = 0; i < stzahlen.length; i++) {
                                            if (stzahlen[i] <= count) continue;
                                            j = stzahlen[i];
                                            if (art[13]) {
                                                if (!(stzahlen[i] % art[13])) {
                                                    j = stzahlen[i]+' + '+stzahlen[i] / art[13] * art[14];
                                                    count = stzahlen[i] + stzahlen[i] / art[13] * art[14];
                                                }
                                                else if (!(stzahlen[i] % (art[13] + art[14]))) {
                                                    j = stzahlen[i] - (stzahlen[i] / (art[13] + art[14]))+' + '+(stzahlen[i] / (art[13] + art[14]));
                                                    count = stzahlen[i];
                                                }
                                            }
                                            opt = document.createElement("option");
                                            opt.setAttribute("value", stzahlen[i]);
                                            opt.appendChild(document.createTextNode(j));
                                            sel.appendChild(opt);
					}
					form.appendChild(sel);
				
					addl = document.createElement("a");
					str = 'jav'+"ascript:add2cart('"+fxl_rwkid+"', '"+id+"', document.getElementById('quantity"+id+"')[document.getElementById('quantity"+id+"').selectedIndex].value)";
					addl.setAttribute('href', str);
					addl.appendChild(document.createTextNode("    "));
					form.appendChild(addl);
					dwk.appendChild(form);
				}
				else {
                                    dwk.appendChild(document.createTextNode('leider vergriffen'));
                                }
				dwk.className = "softpop_wk";
				br = document.createElement("br");
				br.style.clear = 'both';
				dwk.appendChild(br);
				divi2.appendChild(dwk);

                                if (art[13] && art[8] > 0) {
                                    addl = document.createElement("a");
                                    addl.className = "softpop_special";
                                    str = 'jav'+"ascript:add2cart('"+fxl_rwkid+"', '"+id+"', "+art[13]+")";
                                    addl.setAttribute('href', str);
                                    addl.appendChild(document.createTextNode(art[13]+art[14]+' für '+art[13]+' Paket in den Warenkorb'));
                                    divi2.appendChild(addl);
                                }

				a = document.createElement("a");
				a.setAttribute("href", 'jav'+'ascript:recommendForm("'+fxl_rwkid+'", '+id+')');
				a.appendChild(document.createTextNode("Einem Freund empfehlen"));
				a.className = "softpop_empf";
				divi2.appendChild(a);
				
				a = document.createElement("a");
				if (kdnr > 0) {
					a.setAttribute("href", 'jav'+'ascript:wishlist('+id+');');
                    a.style.cursor = 'pointer';
				}
				else {
					a.setAttribute("href", '/meinmeevio/?artikelalt='+id+'&showalt=merkzettel');
					a.setAttribute('title', 'Sie müssen angemeldet sein, um diese Funktion nutzen zu können');
				}
				a.appendChild(document.createTextNode("Artikel auf den Merkzettel"));
				a.className = "softpop_merk";
				divi2.appendChild(a);

				a = document.createElement("a");
				if (kdnr > 0) {
					a.setAttribute("href", 'jav'+'ascript:voteForm("'+fxl_rwkid+'", '+id+')');
				}
				else {
					a.setAttribute("href", '/meinmeevio/?artikelalt='+id+'&showalt=bewertung');
					a.setAttribute('title', 'Sie müssen angemeldet sein, um diese Funktion nutzen zu können');
				}
				a.appendChild(document.createTextNode("Artikel bewerten"));
				a.className = "softpop_merk";
				divi2.appendChild(a);

				
				divi.appendChild(divi2);
				
				dp = document.createElement("div");
				dp.appendChild(document.createTextNode(art[5]));
				dp.className = "softpop_preis";
				if (art[10] != 0) {
					dps = document.createElement("span");
					dps.appendChild(document.createTextNode('(-'+art[10]+'%)'));
					dp.appendChild(dps);
				}
				divi.appendChild(dp);

				if (art[11] != 0) {
					dl = document.createElement("div");
					dl.className = "softpop_liste";
					dl.appendChild(document.createTextNode(art[11]));
					divi.appendChild(dl);
				}
				if (art[7]!=19 && art[7]!=70)
				{
					dpp = document.createElement("div");
					dpp.appendChild(document.createTextNode(art[6]));
					dpp.className = "softpop_ppro";
                    if (art[11] != 0) dpp.style.paddingLeft = '60px';
					divi.appendChild(dpp);
				}
				
				var imgsrc='/img/geschmack/wg_bild_'+art[7]+'.jpg';
				if (art[7]>=30 && art[7]<40)
					imgsrc='/img/aromen/b4.jpg';
				
				if (art[7]>=40 && art[7]<50)
					imgsrc='/img/aromen/m4.jpg';
					
				if (art[7]==17)
					imgsrc='/img/aromen/i5.jpg';
				
				if (art[7]==70)
					imgsrc='/img/aromen/j4.jpg';
				
				if (art[7]==19)
					imgsrc='/img/aromen/b4.jpg';
				
				
				img = document.createElement("img");
				img.setAttribute('src', imgsrc);
				img.setAttribute('one'+'rror', 'this.src="/img/no.gif"');
				img.className = "softpop_wgimg";
				divi.appendChild(img);

				imgsrc='/img/geschmack/wg_text_'+art[7]+'.gif';
				if (art[7]>=30 && art[7]<40)
					imgsrc='/img/aromen/p0.jpg';

				if (art[7]>=40 && art[7]<50)
					imgsrc='/img/aromen/q2.jpg';

				if (art[7]==17)
					imgsrc='/img/aromen/i3.jpg';

				if (art[7]==70)
					imgsrc='/img/aromen/j2.jpg';
				
				if (art[7]==19)
					imgsrc='/img/aromen/f4.jpg';
				img = document.createElement("img");
				img.setAttribute('src', imgsrc);
				img.setAttribute('one'+'rror', 'this.src="/img/no.gif"');
				img.className = "softpop_wgtxt";
				divi.appendChild(img);
		

				
				dn = document.createElement("div");
				dn.className = "softpop_name";
				dn.appendChild(document.createTextNode(art[1]));
				dnj = document.createElement("span");
				dnj.appendChild(document.createTextNode(art[2]));
				dn.appendChild(dnj);
				dt = document.createElement("div");
				dt.className = "softpop_beschr";
				dt.appendChild(document.createTextNode(art[4]));
				dn.appendChild(dt);
				divi.appendChild(dn);
				

				
				
				dt = document.createElement("div");
				dt.className = "softpop_teaser";
				dt.appendChild(document.createTextNode(art[3]));
				divi.appendChild(dt);
				
				if (art[9] > 0) {
					dw  = document.createElement("div");
					dw.className = 'softpop_wert';
					for (i=1; i<=art[9]; i++) {
						img = document.createElement("img");
						img.setAttribute('src', '/img/star-on.gif');
						img.setAttribute('alt', '');
						dw.appendChild(img);
					}
					for (i=1; i<=5-art[9]; i++) {
						img = document.createElement("img");
						img.setAttribute('src', '/img/star-off.gif'); 
						img.setAttribute('alt', '');
						dw.appendChild(img);
					}
					divi.appendChild(dw);
					a = document.createElement("a");
					a.setAttribute("href", '/weine/test-'+id+"/bewertung.html");
					a.appendChild(document.createTextNode("Kundenbewertungen"));
					a.className = "softpop_wert_text2";
					divi.appendChild(a);
				}
				

				

				
				d.appendChild(divi);
				b.appendChild(d);
			}
			else spopup_open = false;
		}

