oTABLEs = document.getElementsByTagName("TABLE"); var cell = ''; var TDtxt = ''; var THtxt = ''; for (var t = 0; t < oTABLEs.length; t++) { var oTRs = oTABLEs[t].getElementsByTagName("TR"); if (oTABLEs[t].className.indexOf("tabella_dati") != -1) { THtxt = checkTH(oTRs[0].getElementsByTagName("TH")[0].innerHTML); for(i = 0; i < oTRs.length; i++){ TDtxt = ''; var newNode = window.document.createElement(''); switch(i){ case 0: cell = 'TH'; break; case 1: cell = 'TD'; break; case 2: cell = 'TD'; break; case 3: cell = 'TD'; break; default: cell = 'TD'; TDtxt = ''; break; } createCol(oTRs[i], newNode, oTRs[i].getElementsByTagName(cell)[0], TDtxt); } } if (oTABLEs[t].className.indexOf("tabella_speciali") != -1) { THtxt = checkTH(''); for(i = 0; i < oTRs.length; i++){ TDtxt = ''; var newNode = window.document.createElement(''); switch(i){ case 0: cell = 'TD'; break; case 1: cell = 'TD'; break; default: cell = 'TD'; TDtxt = ''; break; } createCol(oTRs[i], newNode, oTRs[i].getElementsByTagName(cell)[0], TDtxt); } } } function createCol(riga, nodo, cella, testo){ riga.insertBefore(nodo, cella); riga.getElementsByTagName("TD")[0].innerHTML = testo; riga.getElementsByTagName("TD")[0].style.verticalAlign = 'middle'; //oTRs[i].getElementsByTagName("TD")[0].style.border = '0'; } function checkTH(th){ var addName = ''; var series = new Array('PMM', 'PMS', 'PMD', 'PME-E', 'PME-E CONT', 'MCT', 'MMC', 'MME'); var nomeProdotto = ''; var suff_lingua = ''; if(th != ''){ if((th.search(/con vasca/i) != -1) || (th.search(/with basin/i) != -1) || (th.search(/mit Auffangwanne/i) != -1)){ addName = ' con vasca'; } if((th.search(/senza vasca/i) != -1) || (th.search(/without basin/i) != -1) || (th.search(/ohne Auffangwanne/i) != -1)){ addName = ' senza vasca'; } if((th.search(/con struttura/i) != -1) || (th.search(/with structure/i) != -1) || (th.search(/mit Untergestell/i) != -1)){ addName = ' con struttura'; } if((th.search(/senza struttura/i) != -1) || (th.search(/without structure/i) != -1) || (th.search(/ohne Untergestell/i) != -1)){ addName = ' senza struttura'; } /*if((th.search(/with basin/i) != -1) || (th.search(/mit Auffangwanne/i) != -1)){ addName = ' con vasca uk'; } if((th.search(/without basin/i) != -1) || (th.search(/ohne Auffangwanne/i) != -1)){ addName = ' senza vasca uk'; } if((th.search(/with structure/i) != -1) || (th.search(/mit Untergestell/i) != -1)){ addName = ' con struttura uk'; } if((th.search(/without structure/i) != -1) || (th.search(/ohne Untergestell/i) != -1)){ addName = ' senza struttura uk'; }*/ } else{ nomeProdotto = window.document.getElementById("nomeProdotto").innerHTML; for(var k = 0; k < series.length; k++){ if(nomeProdotto.match(series[k]) != null){ addName = series[k]; } } } return addName;}