//<script>// tabelle-gen.js - strumpfhosen-test

function showtooltip (idname, onoff)
{
 if(document.getElementById)
 {
   if (onoff == false)
     document.getElementById(idname).style.visibility = "hidden";
   else
     document.getElementById(idname).style.visibility = "visible";
 }
}

function wfenster()
{
  var win=0;
  win = window.open("../rechner/euro-franken.php","rechner","dependent=Yes,width=565,height=500");
  win.window.focus();
}

function getSummeTxt (summe)
{
  var summetext;
  if (summe >= 45)
  	   summetext = "Premiumklasse *****"; 
  else if (summe >= 40)
  	   summetext = "Komfortklasse ****"; 
  else if (summe >= 35)
	   summetext = "Luxusklasse ***"; 
  else if (summe >= 30)
	   summetext = "sehr gute Qualität **"; 
  else if (summe >= 25)
	   summetext = "gute Qualität *";
  else if (summe >= 20)
	   summetext = "befriedigende Qualität";
  else if (summe >= 15)
	   summetext = "ausreichende Qualität";
  else if (summe >= 10)
	   summetext = "notfalls noch tragbar";
  else summetext = "unbrauchbar";
  return summetext;
}


 
function TabRowStart (idx, text)
{
  document.write('<tr class=');
  if (idx == 2 || idx == 4 || idx == 6 || idx == 8 || idx == 10 || idx == 12 || idx == 14 || idx == 16 || idx == 18 || idx == 20)
  { document.write('"smld">');
	document.write('<td width="380" colspan="2" class="smld">'+idx+' - '+text+'</td>');
  }
  else
  { document.write('"smlh">');
    document.write('<td width="380" colspan="2" class="smlh">'+idx+' - '+text+'</td>');
  }
}

function TabRowEnd (tooltip, text, idx)
{
  document.write('<td width="40" title="'+tooltip+'" class="pkte">'+idx+'</td>');
  document.write('<td width="280" colspan="2">'+text+'</td>');
  document.write('</tr>');
}

function tabelle (modell,bild,denPreis,w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12,w13,w14,w15,w16,w17,w18,w19,w20,text19,text20,fazit,pfeil,blickdicht,shop,anzeigen)
{
  var text;
  var tooltip;
  var temp;
  var i;

  if (blickdicht == undefined)
  	 var blickdicht=" ";
  if (shop == undefined)
  	 var shop=" ";
  if (anzeigen == undefined)
  	 var anzeigen=" ";
  	 
  var spalte1 = 100;
  var spalte2 = 280;
  var spalte3 = 40;
  var spalte4 = 280;
  var spalte5 = 50;
  
  var dateiname = document.getElementsByTagName("link")[2].href;
  if (dateiname.indexOf("-1152.css") >= 0)	 
  {
      spalte1 = 100;
      spalte2 = 270;
      spalte3 = 40;
      spalte4 = 270;
      spalte5 = 40;
  }
  else if (dateiname.indexOf("-1024.css") >= 0)	 
  {
      spalte1 = 100;
      spalte2 = 255;
      spalte3 = 40;
      spalte4 = 260;
      spalte5 = 40;
  }
  var tabbreite = spalte1 + spalte2 + spalte3 + spalte4 + spalte5;	 

  var summe = w1+w2+w3+w4+w5+w6+w7+w8+w9+w10+w11+w12+w13+w14+w15+w16+w17+w18+w19+w20; 
  var summetext = getSummeTxt (summe);

  document.write('<table border="1" width="'+tabbreite+'">');
  document.write('<tr style="border-style:none">');
  document.write('<td width="'+spalte1+'" style="border-style:none"><img src="images/leer.gif" width="'+spalte1+'" height="0"></td>');
  document.write('<td width="'+spalte2+'" style="border-style:none"><img src="images/leer.gif" width="'+spalte2+'" height="0"></td>');
  document.write('<td width="'+spalte3+'" style="border-style:none"><img src="images/leer.gif" width="'+spalte3+'" height="0"></td>');
  document.write('<td width="'+spalte4+'" style="border-style:none"><img src="images/leer.gif" width="'+spalte4+'" height="0"></td>');
  document.write('<td width="'+spalte5+'" style="border-style:none"><img src="images/leer.gif" width="'+spalte5+'" height="0"></td>');
  document.write('</tr>');
  
  document.write('<tr height="70">');
  document.write('<td width="'+spalte1+'">&nbsp;');
  if (blickdicht == "a" || blickdicht == "A" || shop == "a" || shop == "A" || anzeigen == "a" || anzeigen == "A")
  	document.write('<a href="Verpackung/'+bild+'.jpg" rel="lytebox" title="'+modell+'<br />'+fazit+'"><img src="Verpackung/'+bild+'-1.jpg" border="0" /></a></td>');
	else
  	document.write('<img src="Verpackung/'+bild+'-1.jpg" border="0" /></td>');
  	
  document.write('<td width="'+spalte2+'" class="head">'+modell+'</td>');
  document.write('<td width="'+spalte3+spalte4+spalte5+'" colspan="3" class="head">'+denPreis+'</td>');
  document.write('</tr>');
  
  //alert (getCookieWert('Testanzeige'));
//if (getCookieWert('Testanzeige') == null || // Cookie existiert nicht
//    getCookieWert('Testanzeige') != null && getCookieWert('Testanzeige').indexOf("voll") != -1
//   || navigator.cookieEnabled == false || !document.cookie)
{
	TabRowStart (1, "Wie fühlt sich die Strumpfhose nach dem Auspacken an");
      i = -1;
	  tooltip = "";
	  temp = 0;
	  do {
	  text = "";
	  do {
	  switch (i)
	  { case -1: text="fest, kratzig";	   break;
	    case 0: text="normal";	   break;
	    case 1: text="weich";	   break;
		case 2: text="schön weich";	   break;
	  }
	  if (temp == 0)
	  	 tooltip = tooltip + i + '&nbsp;&nbsp;' + text + '\n';
	  i ++;
	  } while (i <= 2 && temp == 0);
	  temp ++;
	  i = w1;
	  } while (temp <= 1);
	TabRowEnd (tooltip, text, w1);
	TabRowStart (2, "Wie lässt sie sich anziehen");
      i = -2;
	  tooltip = "";
	  temp = 0;
	  do {
	  text = "";
	  do {
	  switch (i)
	  { case -2: text="beide Beine verdreht";	   break;
	    case -1: text="ein Bein verdreht";	   break;
	    case 0: text="man bleibt leicht hängen, oder enges Höschen";	   break;
	    case 1: text="schiefes Höschen, oder etwas eng, fummelig";	   break;
		case 2: text="einwandfrei";	   break;
	  }
	  if (temp == 0)
	  	 tooltip = tooltip + i + '&nbsp;&nbsp;' + text + '\n';
	  i ++;
	  } while (i <= 2 && temp == 0);
	  temp ++;
	  i = w2;
	  } while (temp <= 1);
	TabRowEnd (tooltip, text, w2);
	TabRowStart (3, "Wie fühlt sich die Strumpfhose am Bein an");
      i = -1;
	  tooltip = "";
	  temp = 0;
	  do {
	  text = "";
	  do {
	  switch (i)
	  { case -1: text="fest, kratzig, hart";	   break;
	    case 1: text="normal";	   break;
	    case 3: text="weich bzw. glatt";	   break;
		case 5: text="schön weich";	   break;
	  }
	  if (temp == 0)
	  	 tooltip = tooltip + i + '&nbsp;&nbsp;' + text + '\n';
	  i ++;
	  i ++;
	  } while (i <= 5 && temp == 0);
	  temp ++;
	  i = w3;
	  } while (temp <= 1);
	TabRowEnd (tooltip, text, w3);
	TabRowStart (4, "Passform (ausgehend von meiner Größe 42-44-46)");
      i = -1;
	  tooltip = "";
	  temp = 0;
	  do {
	  text = "";
	  do {
	  switch (i)
	  { case -1: text="zu klein";	   break;
	    case 1: text="etwas knapp";	   break;
	    case 3: text="gut";	   break;
		case 5: text="sehr gut";	   break;
	  }
	  if (temp == 0)
	  	 tooltip = tooltip + i + '&nbsp;&nbsp;' + text + '\n';
	  i ++;
	  i ++;
	  } while (i <= 5 && temp == 0);
	  temp ++;
	  i = w4;
	  } while (temp <= 1);
	TabRowEnd (tooltip, text, w4);
	TabRowStart (5, "Tragekomfort unter einer langen Hose");
      i = -1;
	  tooltip = "";
	  temp = 0;
	  do {
	  text = "";
	  do {
	  switch (i)
	  { case -1: text="stark einengend";	   break;
	    case 0: text="etwas einengend";	   break;
	    case 1: text="leicht";	   break;
		case 2: text="angenehm leicht";	   break;
	  }
	  if (temp == 0)
	  	 tooltip = tooltip + i + '&nbsp;&nbsp;' + text + '\n';
	  i ++;
	  } while (i <= 2 && temp == 0);
	  temp ++;
	  i = w5;
	  } while (temp <= 1);
	TabRowEnd (tooltip, text, w5);
	TabRowStart (6, "Tragekomfort offen");
      i = -1;
	  tooltip = "";
	  temp = 0;
	  do {
	  text = "";
	  do {
	  switch (i)
	  { case -1: text="stark einengend";	   break;
	    case 1: text="etwas einengend";	   break;
	    case 3: text="leicht";	   break;
		case 5: text="angenehm leicht";	   break;
	  }
	  if (temp == 0)
	  	 tooltip = tooltip + i + '&nbsp;&nbsp;' + text + '\n';
	  i ++;
	  i ++;
	  } while (i <= 5 && temp == 0);
	  temp ++;
	  i = w6;
	  } while (temp <= 1);
	TabRowEnd (tooltip, text, w6);
	TabRowStart (7, "wahrscheinliche Haltbarkeit");
      i = -1;
	  tooltip = "";
	  temp = 0;
	  do {
	  text = "";
	  do {
	  switch (i)
	  { case -1: text="undefinierbar, wg. kleinen Mängeln";	   break;
	    case 0: text="niedrig";	   break;
	    case 1: text="normal";	   break;
		case 2: text="hoch";	   break;
	  }
	  if (temp == 0)
	  	 tooltip = tooltip + i + '&nbsp;&nbsp;' + text + '\n';
	  i ++;
	  } while (i <= 2 && temp == 0);
	  temp ++;
	  i = w7;
	  } while (temp <= 1);
	TabRowEnd (tooltip, text, w7);
	TabRowStart (8, "Laufmaschenschutz an den Nähten");
      i = -1;
	  tooltip = "";
	  temp = 0;
	  do {
	  text = "";
	  do {
	  switch (i)
	  { case -1: text="fehlt";	   break;
	    case 0: text="nicht überall";	   break;
		case 2: text="gut, vorhanden";	   break;
	  }
	  if (temp == 0)
	  	 tooltip = tooltip + i + '&nbsp;&nbsp;' + text + '\n';
	  i ++;
	  if (i == 1)  i ++;
	  } while (i <= 2 && temp == 0);
	  temp ++;
	  i = w8;
	  } while (temp <= 1);
	TabRowEnd (tooltip, text, w8);
	TabRowStart (9, "Maschenbild - Optik");
      i = -1;
	  tooltip = "";
	  temp = 0;
	  do {
	   text = "";
	   do {
	    switch (i)
	    { case -1: text="fleckig, streifig";	   break;
	      case 0: text="gleichmäßig, z.B. Krepp";	   break;
	      case 1: text="fein und gleichmäßig";	   break;
		  case 3: text="sehr zart und gleichmäßig";	   break;
	    }
	    if (temp == 0)
	  	   tooltip = tooltip + i + '&nbsp;&nbsp;' + text + '\n';
	    i ++;
	    if (i == 2)  i ++;
	   } while (i <= 3 && temp == 0);
	   temp ++;
	   i = w9;
	  } while (temp <= 1);
	TabRowEnd (tooltip, text, w9);
	TabRowStart (10, "Bündchen");
      i = -2;
	  tooltip = "";
	  temp = 0;
	  do {
	   text = "";
	   do {
	    switch (i)
	    { case -2: text="Fäden reißen, prakt. nicht mehr vorhanden";	   break;
	      case 0: text="vorhanden";	   break;
	      case 1: text="breit";	   break;
		  case 2: text="sehr breit (ab 3cm), bzw. angenähtes Wäschebündchen";	   break;
	    }
	    if (temp == 0)
	  	   tooltip = tooltip + i + '&nbsp;&nbsp;' + text + '\n';
	    i ++;
	    if (i == -1)  i ++;
	   } while (i <= 2 && temp == 0);
	   temp ++;
	   i = w10;
	  } while (temp <= 1);
	TabRowEnd (tooltip, text, w10);
	TabRowStart (11, "Zwickel");
      i = -1;
	  tooltip = "";
	  temp = 0;
	  do {
	   text = "";
	   do {
	    switch (i)
	    { case -1: text="ohne";	   break;
	      case 0: text="Spitzzwickel";	   break;
	      case 1: text="Sattel- Keilzwickel";	   break;
		  case 2: text="Baumwollzwickel";	   break;
		  case 3: text="ohne, weil nahtlos";	   break;
	    }
	    if (temp == 0)
	  	   tooltip = tooltip + i + '&nbsp;&nbsp;' + text + '\n';
	    i ++;
	   } while (i <= 3 && temp == 0);
	   temp ++;
	   i = w11;
	  } while (temp <= 1);
	TabRowEnd (tooltip, text, w11);
	TabRowStart (12, "Spitzenverstärkung");
      i = -1;
	  tooltip = "";
	  temp = 0;
	  do {
	   text = "";
	   do {
	    switch (i)
	    { case -1: text="zu dick";	   break;
	      case 0: text="relativ dick, könnte zarter sein";	   break;
	      case 1: text="transparent";	   break;
		  case 2: text="sehr zart und transparent bzw. gleich wie das Beinmaterial";	   break;
	    }
	    if (temp == 0)
	  	   tooltip = tooltip + i + '&nbsp;&nbsp;' + text + '\n';
	    i ++;
	   } while (i <= 2 && temp == 0);
	   temp ++;
	   i = w12;
	  } while (temp <= 1);
	TabRowEnd (tooltip, text, w12);
	TabRowStart (13, "Ausgeformt");
      i = 0;
	  tooltip = "";
	  temp = 0;
	  do {
	   text = "";
	   do {
	    switch (i)
	    { 
	      case 0: text="nein";	   break;
		  case 2: text="ja, bzw. Rückenschild";	   break;
	    }
	    if (temp == 0)
	  	   tooltip = tooltip + i + '&nbsp;&nbsp;' + text + '\n';
	    i ++;
		i ++;
	   } while (i <= 2 && temp == 0);
	   temp ++;
	   i = w13;
	  } while (temp <= 1);
	TabRowEnd (tooltip, text, w13);
	TabRowStart (14, "Höschenteil");
      i = 0;
	  tooltip = "";
	  temp = 0;
	  do {
	   text = "";
	   do {
	    switch (i)
	    { 
	      case 0: text="standard";	   break;
	      case 1: text="spezielle Form";	   break;
		  case 2: text="randlos";	   break;
	    }
	    if (temp == 0)
	  	   tooltip = tooltip + i + '&nbsp;&nbsp;' + text + '\n';
	    i ++;
	   } while (i <= 2 && temp == 0);
	   temp ++;
	   i = w14;
	  } while (temp <= 1);
	TabRowEnd (tooltip, text, w14);
	TabRowStart (15, "Nähte");
      i = 0;
	  tooltip = "";
	  temp = 0;
	  do {
	   text = "";
	   do {
	    switch (i)
	    { 
	      case 0: text="standard";	   break;
	      case 2: text="Flachnaht";	   break;
	      case 3: text="flache Flachnaht";	   break;
	      case 4: text="Nahtlos";	   break;
	    }
	    if (temp == 0)
	  	   tooltip = tooltip + i + '&nbsp;&nbsp;' + text + '\n';
	    if (i == 0)
		   i ++;
		i ++;
	   } while (i <= 4 && temp == 0);
	   temp ++;
	   i = w15;
	  } while (temp <= 1);
	TabRowEnd (tooltip, text, w15);
	TabRowStart (16, " Elastananteil");
      i = 0;
	  tooltip = "";
	  temp = 0;
	  do {
	   text = "";
	   do {
	    switch (i)
	    { case 0: text="kleiner 5%, bzw. ohne";	   break;
	      case 1: text="mehr als 15%";	   break;
	      case 2: text="5...15% (auch wenn &le; 10 den, sowie Stützmodelle)";	   break;
//		  case 3: text="LYCRA<small><sup>&reg;</sup></small> 3D";	   break;
	    }
	    
	    if (modell.indexOf("Oroblu") > -1)
	    {
	    	if (i == 3)
	    			text="Progress 3D";
	    }
	    else
	    {
	    	if (i == 3)
	    			text="LYCRA<small><sup>&reg;</sup></small> 3D";
	    }
	    
	    
	    if (temp == 0)
	  	   tooltip = tooltip + i + '&nbsp;&nbsp;' + text + '\n';
	    i ++;
	   } while (i <= 3 && temp == 0);
	   temp ++;
	   i = w16;
	  } while (temp <= 1);
	TabRowEnd (tooltip, text, w16);
	TabRowStart (17, "Verarbeitung");
      i = -1;
	  tooltip = "";
	  temp = 0;
	  do {
	   text = "";
	   do {
	    switch (i)
	    { case -1: text="teilweise schief genäht";	   break;
	      case 0: text="teilweise unsauber verarbeitet, ungleichmäßige Verstärkung";	   break;
		  case 1: text="sauber";	   break;
	    }
	    if (temp == 0)
	  	   tooltip = tooltip + i + '&nbsp;&nbsp;' + text + '\n';
	    i ++;
	   } while (i <= 1 && temp == 0);
	   temp ++;
	   i = w17;
	  } while (temp <= 1);
	TabRowEnd (tooltip, text, w17);
	TabRowStart (18, "Verpackung");
      i = -1;
	  tooltip = "";
	  temp = 0;
	  do {
	   text = "";
	   do {
	    switch (i)
	    { 
	      case -1: text="unpraktische Knick-Pappschachtel";	   break;
	      case 0: text="einfache Pappschachtel";	   break;
	      case 1: text="flache Standardverpackung";	   break;
		  case 2: text="aufwendige Verpackung, innen Folie, außen Pappe";	   break;
		  case 3: text="innen besonders geschützt, kein Kontakt zur Pappe";	   break;
	    }
	    if (temp == 0)
	  	   tooltip = tooltip + i + '&nbsp;&nbsp;' + text + '\n';
	    i ++;
	   } while (i <= 3 && temp == 0);
	   temp ++;
	   i = w18;
	  } while (temp <= 1);
  TabRowEnd (tooltip, text, w18);
  TabRowStart (19, "Besondere Highlights");
  document.write('<td>'+w19+'</td>');
  document.write('<td colspan="2">'+text19+'</td>');
  document.write('</tr>');
  TabRowStart (20, "Besondere Mängel");
  document.write('<td>'+w20+'</td>');
  document.write('<td colspan="2">'+text20+'</td>');
  document.write('</tr>');
}
  document.write('<tr class="smlh">');
  document.write('<td colspan="2" class="foot"><b>insgesamt</b></td>');

  tooltip = "ab 45: Premiumklasse\nab 40: Komfortklasse\nab 35: Luxusklasse\nab 30: sehr gute Qualität\nab 25: gute Qualität\nab 20: befriedigende Qualität\nab 15: ausreichende Qualität\nab 10: notfalls noch tragbar\ndarunter: unbrauchbar";

  document.write('<td class="foot" title="'+tooltip+'" style="cursor:help">'+summe+'</td>');
  document.write('<td colspan="2" class="foot">'+summetext+'</td>');
  document.write('</tr>');
  document.write('<tr class="smld">');
  document.write('<td height="20" class="foot">Fazit:&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/'+pfeil+'.gif" border="0"');
  switch (pfeil)
  {		 case "p1": document.write(' title="PLV sehr gut"');
  		 case "p2": document.write(' title="PLV gut"');
		 case "p3": document.write(' title="PLV befriedigend"');
		 case "p4": document.write(' title="PLV ausreichend"');
		 case "p5": document.write(' title="PLV mangelhaft"');
  }
  document.write('></td>');
  document.write('<td colspan="3" height="20" class="foot">'+fazit+'</td>');
	
//  if (blickdicht == undefined)
//  	 var blickdicht=" ";
//  if (shop == undefined)
//  	 var shop=" ";
//  if (anzeigen == undefined)
//  	 var anzeigen=" ";
 
  if (blickdicht.indexOf("http") > -1 || shop.indexOf("http") > -1 || anzeigen.indexOf("http") > -1)
  {
   	 if (blickdicht.indexOf("http") > -1)
	 	var shopurl = blickdicht;
	 else var shopurl = shop;
  	 document.write('<td><a href="'+shopurl+'" title="direkt in einem Shop bestellen" target="_shop"><img src="images/korb.gif" width="20" height="20" border="0"></a></td>');
  }
  else
	  document.write('<td>&nbsp;</td>');

  document.write('</tr>');
  if (blickdicht == "b" || blickdicht == "B")
  {
    summe = w1+w2+w3+w4+Math.round((w5+w6)/2)+w7+w8+w9+w10+w11+w13+w15+w16+w17+w18+w19+w20; 
    tooltip = "gekürzte Bewertung: Tragekomfort gemittelt, ohne Spitzenverstärkung, ohne Höschenteil";
    document.write('<tr class="smlh">');
    document.write('<td height="20" class="foot">Blickdicht:</td>');
    document.write('<td colspan="4" height="20" class="foot" title="'+tooltip+'">spezielle Bewertung: &nbsp;&nbsp;&nbsp;'+summe+'</td></tr>');
  }
  document.write('</table>');
}

//--- Script für Übersichtstabelle ---
var farbton;
var anzahl;

function TabStart ()
{
  document.write('<table width="98%" border="1" cellspacing="3" cellpadding="0" >');
  document.write('<tr>');
  document.write('<td width="28%" class="head">Marke-Modell</td>');
  document.write('<td width="12%" class="head">Bild</td>');
  document.write('<td width="60%" class="head">Kommentar</td>');
  document.write('</tr>');
  farbton = 1;
  anzahl = 0;
}

function TabEnde ()
{
  document.write('<tr>');
  document.write('<td width="28%" class="foot">einzelne Wertungen</td>');
  document.write('<td width="12%" class="foot">vergrößertes Bild</td>');
  document.write('<td width="60%" class="foot">ges. Anzahl: '+anzahl+' Modelle</td>');
  document.write('</tr>');
  document.write('</table>');
}

function Zeile (LinkTxt, modell, bild, denPreis, summe, kommentar, neu)
{
    document.write('<tr class=');
	if (farbton == 2)
	{   document.write('"smld" height="70">');
		farbton = 1;
	}
	else
	{   document.write('"smlh" height="70">');
		farbton = 2;
	}

    document.write('<td width="28%" class="uebers"><a href='+LinkTxt+'>'+modell+'</a>');
  	if (neu == "neu")
  		 document.write('<br><img src="../images/ani-punkt.gif" width="12" height="12" border="0">');
    document.write('</td>');
    document.write('<td width="12%">');
	document.write('<img src="Verpackung/'+bild+'-1.jpg" border="0">');
//	document.write('<a href="javascript:fenster(&quot;Verpackung/'+bild+'.jpg&quot;,&quot;'+modell+'&quot;,&quot;'+denPreis+'&quot;,&quot;'+summe+'&quot;,&quot;'+kommentar+'&quot;)"><img src="Verpackung/'+bild+'-1.jpg" border="0"></a>');
    document.write('</td>');
    document.write('<td width="60%" class="uebers"><b>');
	document.write(summe+'</b> Punkte: &nbsp;&nbsp;'+kommentar+' &nbsp; ');
    document.write('</td>');
    document.write('</tr>');
    anzahl ++;

}

var a, Bild;

function tauschen (a, Bild)
{
  if (document.getElementById)
  	 document.getElementById(a).src=Bild;
}
