var product = new Array();
var family = new Array();
var carac = new Array();
var info = new Array();
var urlinfo = new Array();
var uom = new Array(); 
var type = new Array();
var name2 = new Array();
var info2 = new Array();
var model = new Array();
var curSel = new Array();
var itemOk = new Array();
var images = new Array();
var template = "TABULAR";
var tabular = true;
var msgCounter = "";
var formInfo="";
var indif = nlmessages["VLT_BS_UNSELECT"]+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
indif=indif+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
indif=indif+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
indif=indif+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
indif=indif+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
indif=indif+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
var helpMessage = new Array();
helpMessage[0] = nlmessages["VLT_BS_ASSIS_IMPOS"];
helpMessage[1] = nlmessages["VLT_BS_ASSIS_SELECT"];
helpMessage[2] = nlmessages["VLT_BS_ASSIS_UNSEL"];
var mode;
var parentSection;
var urlpopup;
var limite=10000;

    
function Car(str)
{
	this.name = str;
	this.values = new Array();
	this.allCars ="";
}


function CarVal(value)
{
	this.value = value;
	this.state = 1;
	this.nbDefined = 0;
}


function compare(a,b)
{
	if (a.value < b.value) return -1;
	if (a.value == b.value) return 0;
	if (a.value > b.value) return 1;
	return -1
}

function compareN(a,b)
{
	na = parseFloat(a.value);
	nb = parseFloat(b.value);
	if (na < nb) return -1;
	if (na == nb) return 0;
	if (na > nb) return 1;
	return -1;
}

function initModel(mod)
{
	var i,j;
	var item;
	if (mod == "prod")
	{
		item = product;
	} else
	{
		item = family;
    }
    
	for (i = 0; i < model.length; i++)
	{
		eName = model[i].name;
		curSel[eName]="*";
		for (j=1;j<item.length;j++)
		{
			var values = new Array();
			iName="'"+item[j]+"'";
			if (typeof(carac[iName]) != 'undefined')
			{
	    		val = carac[iName][eName];
	    		if(typeof(val)!='undefined')
	    		{
	    			if (type[eName]=="S")
	    			{
	    				values = splitSet(val);
	    			} else
	    			{
	    				values[0] = val;
	    			}
	    		
    			}
			}
			
			for (var k=0; k < values.length; k++)
			{
				val = values[k];
				if (model[i].allCars.indexOf("&#?"+val+"&#?")<0)
				{
					model[i].values[model[i].values.length]=(new CarVal(val));
					model[i].allCars =model[i].allCars+"&#?"+val+"&#?";	
				}
			}
		}
		if((type[eName]=="C")||(type[eName]=="L")||(type[eName]=="S")||(type[eName]=="R")||(type[eName]=="I"))
			model[i].values.sort(compare);
		if(type[eName]=="N")
			model[i].values.sort(compareN);
	}		
}

function initprod() {
	mode = "prod";
	initModel(mode);
	testItem(mode);
	draw(mode);
}


function initfam() {
	mode = "fam";
	initModel(mode);
	testItem(mode);
	draw(mode);
}


function testItem(mod) 
{
	nbItemOk = 0;
	var item;

	if (mod == "prod")
	{ 
		item = product;
	} else
	{
		item = family;
	}

	for (i=0; i<model.length; i++) 
	{
		var car = model[i];
		var cName = car.name;
		for(k=0; k<car.values.length;k++) 
		{
			car.values[k].nbDefined = 0;
		}
	}

	for (j=1; j<item.length; j++) 
	{
		iName = "'"+item[j]+"'";
		itemOk[iName] = true;
		nbItemOk++;
		
		for (k=0; k < model.length; k++) 
		{
			valName = model[k].name;
			if (typeof(carac[iName]) != 'undefined')
			{
                val = carac[iName][valName];
                if (curSel[valName] != "*") 
                {
                    var isSelected = false;
                    
                    if (typeof(val) != 'undefined')
                    {
                        if (type[valName] == "S") 
                        {
                            // test for equal only even in sets, so
                            // "120,1600" shouldnt match with "160"
                            // turn "120,1600" into ",120,1600," and try to match 
                            // with ",160,"
                            valtest = ","+val+",";
                            isSelected = (valtest.indexOf(","+curSel[valName]+",") >= 0);
                        }
                        else 
                        {
                            // SE 2003/12/01: changed else-statement to NOT display 
                            // products without matching attributes
                            isSelected = (val == curSel[valName]);
                        }
                    } 
                    else 
                    {
                        isSelected = false;
                    }	
                    
                    if (!isSelected) 
                    {
                        itemOk[iName] = false;
                        nbItemOk--;
                        break;
                    }
                }
			}
		}
		
		if (itemOk[iName]) 
		{
			for(i=0;i<model.length;i++) 
			{
				var car = model[i];
				var cName = car.name;
				for (k=0; k<car.values.length; k++) 
				{
                    if (typeof(carac[iName]) != 'undefined')
                    {
                        var val = carac[iName][cName];
                        if (typeof(val) != 'undefined')
                        {
                            if(type[cName]=="S") 
                            {
                                var valtest = ","+val+",";
                                var valcomp = ","+car.values[k].value+","
                                if (valtest.indexOf(valcomp) >= 0)
                                {
                                    car.values[k].nbDefined++;
                                }
                            } 
                            else 
                            {
                                if (val == car.values[k].value) 
                                {
                                    car.values[k].nbDefined++;
                                }
                            }
                        }
                    }
				}
			}
		}
	}
	document.assist.nb.value = nbItemOk;
}

function draw(mod)
{
	var i, j, p, car, cName, iName, val;
	var item;
	
	if (mod == "prod") 
	{
		item = product;
	} else
	{
		item = family;
	}
		
	for(i=0;i<model.length;i++)
	{
		car = model[i];
		cName = car.name;
		
		for( j=0; j<car.values.length; j++ )
		{
			car.values[j].state=0;
			val = car.values[j].value;
			for (p=1;p<item.length;p++) {
				iName = "'"+item[p]+"'";
				if(itemOk[iName]) {
					var isSelected = false;
					if ((typeof(carac[iName]) != 'undefined') && (typeof(carac[iName][cName]) != 'undefined')) {
						if(type[cName] != "S")
						{
							isSelected = (val==carac[iName][cName]);
						}
						else if (type[cName]=="S" && (curSel[cName] == val || curSel[cName] == "*")) {
                            var valtest = ","+carac[iName][cName]+",";
                            var valcomp = ","+val+",";                            
							isSelected = (valtest.indexOf(valcomp)>=0);
						} else {
							isSelected = false;
						}
					} else {
						isSelected = true;
					} 	
					if (isSelected) {
						if(val==curSel[cName])
							car.values[j].state=2;
						else 
							car.values[j].state=1;
						break;
					}
				}
			}
		}
	
	}
	if (tabular)
		realDraw(mod);
	else 
		realDrawlist(mod);
}

function redrawList(x) {
	curSel[x.name] = x.options[x.selectedIndex].value;
	testItem(mode);
	draw(mode);
}

function redraw(carName, v)
{
	if(curSel[carName]==v)
		curSel[carName] = "*"; //reclick
	else
		curSel[carName] = v;

	testItem(mode);
	// add a small delay if Netscape 4.X
	MM_setTextOfLayer('helpassist','', '<span class="HelpMessage">'+nlmessages["VLT_BS_LOADING"]+'</span>' );
	if (document.layers) {
		setTimeout("draw(mode)",100);
	} else {
		draw(mode);
	}
	MM_setTextOfLayer('helpassist','', '' );
}

function changeDisplay()
{
	tabular = !tabular;
    // add a small delay if Netscape 4.X
    MM_setTextOfLayer('helpassist','', '<span class="HelpMessage">'+nlmessages["VLT_BS_LOADING"]+'</span>' );
    if (document.layers) setTimeout("redraw(mode)",100);
    else redraw(mode);
    MM_setTextOfLayer('helpassist','', '' );
}

function realDraw(mod) {
	var i, car, nbcell, widthcell, texte, uomtexte;
	texte = "";
	var item;
	
	if (mod == "prod") 
	{
		item = product;
	} else
	{
		item = family;
	}
	
	texte = "<TABLE WIDTH='100%' BORDER='0' CELLPADDING='0' CELLSPACING='0' BORDERCOLOR='#FFFFFF' VALIGN='center'><TR><TD WIDTH='172px'>&nbsp;";
	if (template.indexOf("MEN") >= 0) texte = texte + "<A HREF=\"#assistAnchor\" onClick=\"changeDisplay()\">"+nlmessages["VLT_BS_MENU"]+"</A>";
	texte = texte + "<TD valign=\"CENTER\"><A HREF=\"#assistAnchor\" onClick=\"resetChar();return false;\"><IMG src=\"v_images/del.gif\" border=\"0\">&nbsp;"+nlmessages["VLT_BS_ASSIS_RESET"]+"</A></TD></TR></TABLE>";
	texte = texte + "<TABLE WIDTH='100%' BORDER='0' CELLPADDING='0' CELLSPACING='1' BORDERCOLOR='#FFFFFF' VALIGN='center'>";

	for(i = 0; i < model.length; i++)
	{
		car = model[i];
		nbcell = car.values.length;
		widthcell = 100/nbcell;
		cName = car.name;
		
		if (uom[cName] != "")
			uomtexte = " ("+uom[cName]+")";
		else
			uomtexte = "";
			
		texte = texte + "<TR><TD><TABLE BORDER='0' WIDTH='100%' CELLPADDING='0' CELLSPACING='0'><TR><TD WIDTH='150px' CLASS='ArrayCategoryTitle' ALIGN='left'><IMG SRC='v_images/spacer.gif' HEIGHT='15px' WIDTH='0' BORDER='0'/><A CLASS='normal' ONMOUSEOUT=\"showhelp('');\" ONMOUSEOVER=\"showhelp('"+helpMessage[2]+"');\" HREF=\"#assistAnchor\" onClick=\"redraw('"+cName+"','*');return false;\">"+name2[cName]+" "+uomtexte+"</A></TD>";

		if (info[cName] != "")
		{
			texte = texte + "<TD CLASS='ArrayCategoryTitle' WIDTH='25px' ALIGN='center'><A HREF=\""+urlinfo[cName]+"\"><IMG SRC='v_images/help.gif' ALT='info' BORDER='0' /></A></TD>";
		} else
		{
			texte = texte + "<TD CLASS='ArrayCategoryTitle' WIDTH='25px' ALIGN='center'>&nbsp;</TD>";
		}
		
		texte = texte + "<TD><TABLE WIDTH='100%' HEIGHT='100%' BORDER='0' CELLPADDING='0' CELLSPACING='1'><TR>";

		if (type[cName] == "I") { // char=image
			for (j = 0; j < car.values.length; j++) {
				texte = texte + "<TD CLASS='ArrayContent' WIDTH='"+widthcell+"%' ALIGN='center'>";
				var imageCode = cName+"-"+car.values[j].value;
				if (car.values[j].nbDefined == 0) {
					texte = texte + "<SPAN CLASS=\"typeA0\" ONMOUSEOVER=\"showhelp('"+helpMessage[0]+"');\" ONMOUSEOUT=\"showhelp('');\"><IMG  ONMOUSEOVER=\"showhelp('"+helpMessage[0]+"');\" ONMOUSEOUT=\"showhelp('');\"SRC='"+images[imageCode]+"' BORDER='0'/>&#160;</SPAN>";
				} else if (car.values[j].state == 0) {
					texte = texte + "<SPAN CLASS=\"typeA"+car.values[j].state+"\" ONMOUSEOVER=\"showhelp('"+helpMessage[car.values[j].state]+"');\" ONMOUSEOUT=\"showhelp('');\"><IMG SRC='"+images[imageCode]+"' BORDER='0' /></SPAN>";
				} else if (car.values[j].state == 1){
					texte = texte + "<A CLASS=\"typeA"+car.values[j].state+"\" HREF=\"#assistAnchor\" onClick=\"redraw('"+cName+"','"+car.values[j].value.replace("/'/g","\\'")+"');return false;\" ONMOUSEOVER=\"showhelp('"+helpMessage[car.values[j].state]+"');\" ONMOUSEOUT=\"showhelp('');\"><IMG SRC='"+images[imageCode]+"' BORDER='0' /></A>";
				} else {
					texte = texte + "<A CLASS=\"typeA"+car.values[j].state+"\" HREF=\"#assistAnchor\" onClick=\"redraw('"+cName+"','"+car.values[j].value.replace("/'/g","\\'")+"');return false;\" ONMOUSEOVER=\"showhelp('"+helpMessage[car.values[j].state]+"');\" ONMOUSEOUT=\"showhelp('');\"><IMG SRC='"+images[imageCode]+"' BORDER='2' /></A>";
				}
				texte = texte + "</TD>\n";
			}
		} else {
			for (j = 0; j < car.values.length; j++) {
				texte = texte + "<TD  CLASS='ArrayContent' WIDTH='"+widthcell+"%' ALIGN='center'>";
				
				if (car.values[j].nbDefined == 0) {
					texte = texte + "<SPAN CLASS=\"typeA0\" ONMOUSEOVER=\"showhelp('"+helpMessage[0] +"');\" ONMOUSEOUT=\"showhelp('');\">"+car.values[j].value+"</SPAN>\n";
				} else if (car.values[j].state == 0) {
					texte = texte + "<SPAN CLASS=\"typeA"+car.values[j].state+"\" ONMOUSEOVER=\"showhelp('"+helpMessage[car.values[j].state]+ "');\" ONMOUSEOUT=\"showhelp('');\">"+car.values[j].value +"</SPAN>\n";
				} else {
					texte = texte + "<A CLASS=\"typeA"+car.values[j].state+"\" HREF=\"#assistAnchor\" onClick=\"redraw('"+cName.replace(/&/g,"&amp;")+"','"+car.values[j].value.replace(/'/g,"\\'")+"');return false;\" ONMOUSEOVER=\"showhelp('"+helpMessage[car.values[j].state] +"');\" ONMOUSEOUT=\"showhelp('');\">"+car.values[j].value+"</A>\n";
				}
				texte = texte + "</TD>";
			}
		}
		texte = texte + "</TR></TABLE></TD></TR><tr><td></td></tr></TABLE></TD></TR>";	
	}
	texte = texte + "</TABLE>\n";
	MM_setTextOfLayer('tabassist','',formInfo+msgCounter+texte+'<br />'+drawTabResSel(mod)+'</FORM>');
}

function replaceQuote(str) {
	var result = "";
	str = str + " ";
	var values = str.split("\"");
	for (var i=0; i < values.length; i++) {
		if (i==values.length-1)
			result = result + trim(values[i]);
		else
			result = result + trim(values[i]) + "\''";
	}
	return result;
}

function realDrawlist(mod) {
	var i, car, texte, uomtexte, nbcell, widthcell;
	texte = "";
	var item;
	if (mod == "prod") 
		item = product;
	else
		item = family;

	texte = "<TABLE WIDTH='100%' BORDER='0' CELLPADDING='0' CELLSPACING='0' BORDERCOLOR='#FFFFFF' VALIGN='center'><TR><TD WIDTH=172>&nbsp;";

	if (template.indexOf("MEN") >= 0) texte = texte + "<A HREF=\"#assistAnchor\" onClick=\"changeDisplay()\">"+nlmessages["VLT_BS_TABLE"]+"</A>";

	texte = texte + "<TD valign=\"CENTER\"><A HREF=\"#assistAnchor\" onClick=\"resetChar()\"><IMG src=\"v_images/del.gif\" border=\"0\">&nbsp;"+nlmessages["VLT_BS_ASSIS_RESET"]+"</A></TD></TR></TABLE>";
	texte = texte+"<TABLE WIDTH='100%' BORDER='0' CELLPADDING='0' CELLSPACING='0' BORDERCOLOR='#FFFFFF' VALIGN='center'>";
	for(i=0;i<model.length;i++)
	{
		car = model[i];
		nbcell = car.values.length;
		widthcell = 100/nbcell;
		cName = car.name;
		if (uom[cName]!="") {
			uomtexte=" ("+uom[cName]+")";
		} else {
			uomtexte="";
		}
		texte = texte + "<TR><TD><TABLE BORDER='0' WIDTH='100%' CELLPADDING='0' CELLSPACING='0'><TR><TD WIDTH='150px' CLASS='ArrayCategoryTitle' ALIGN='left'><IMG SRC='v_images/spacer.gif' HEIGHT='15px' WIDTH='0' BORDER='0'/><A CLASS='normal' ONMOUSEOUT=\"showhelp('');\" ONMOUSEOVER=\"showhelp('"+helpMessage[2]+"');\" HREF=\"#assistAnchor\" onClick=\"redraw('"+cName+"','*');return false;\">"+name2[cName]+" "+uomtexte+"</A></TD>";
		if (info[cName]!="") {
			texte = texte + "<TD CLASS='ArrayCategoryTitle' WIDTH='25px' ALIGN='center'><A HREF=\""+urlinfo[cName]+"\"><IMG SRC='v_images/help.gif' ALT='info' BORDER='0' /></A></TD>";
		} else {
			texte = texte + "<TD CLASS='ArrayCategoryTitle' WIDTH='25px' ALIGN='center'>&nbsp;</TD>";
		}
		texte = texte + "<TD><TABLE WIDTH='100%' BORDER='0' CELLPADDING='0' CELLSPACING='0'><TR>";

		if (type[cName] == "I")
		{
			for (j = 0; j < car.values.length; j++)
			{
				texte = texte + "<TD CLASS='ArrayContent' WIDTH='"+widthcell+"%' ALIGN='center'>";
				var imageCode = cName+"-"+car.values[j].value;
				if (car.values[j].nbDefined == 0) {
					texte = texte + "<SPAN CLASS=\"typeA0\" ONMOUSEOVER=\"showhelp('"+helpMessage[0]+"');\" ONMOUSEOUT=\"showhelp('');\"><IMG  ONMOUSEOVER=\"showhelp('"+helpMessage[0]+"');\" ONMOUSEOUT=\"showhelp('');\"SRC='"+images[imageCode]+"' BORDER='0'/>&#160;</SPAN>";
				} else if (car.values[j].state == 0) {
					texte = texte + "<SPAN CLASS=\"typeA"+car.values[j].state+"\" ONMOUSEOVER=\"showhelp('"+helpMessage[car.values[j].state]+"');\" ONMOUSEOUT=\"showhelp('');\"><IMG SRC='"+images[imageCode]+"' BORDER='0' /></SPAN>";
				} else if (car.values[j].state == 1){
					texte = texte + "<A CLASS=\"typeA"+car.values[j].state+"\" HREF=\"#assistAnchor\" onClick=\"redraw('"+cName+"','"+car.values[j].value.replace(/'/g,"\\'")+"');return false;\" ONMOUSEOVER=\"showhelp('"+helpMessage[car.values[j].state]+"');\" ONMOUSEOUT=\"showhelp('');\"><IMG SRC='"+images[imageCode]+"' BORDER='0' /></A>";
				} else {
					texte = texte + "<A CLASS=\"typeA"+car.values[j].state+"\" HREF=\"#assistAnchor\" onClick=\"redraw('"+cName+"','"+car.values[j].value.replace(/'/g,"\\'")+"');return false;\" ONMOUSEOVER=\"showhelp('"+helpMessage[car.values[j].state]+"');\" ONMOUSEOUT=\"showhelp('');\"><IMG SRC='"+images[imageCode]+"' BORDER='2' /></A>";
				}
				texte = texte + "</TD>\n";
			}
		} else
		{
			texte = texte + "<TD CLASS='ArrayContent' ALIGN='left'><SELECT CLASS='vltText' NAME='"+cName+"' WIDTH='30px' onchange='redrawList(this)'><OPTION TEXT=\" \" VALUE=\"*\">"+indif+"</OPTION>";
			for(j=0;j< car.values.length;j++) {
				if (typeof(car.values[j].value) != 'undefined') 
				{
					if(car.values[j].nbDefined==0) {
					} else {
						if(car.values[j].state==0) {
						}
						if(car.values[j].state==2) {
							texte = texte + "<OPTION TEXT=\""+car.values[j].value+"\" VALUE=\""+car.values[j].value+"\" SELECTED>"+car.values[j].value+"</OPTION>";
						}
						if(car.values[j].state==1) {
							texte = texte + "<OPTION TEXT=\""+car.values[j].value+"\" VALUE=\""+car.values[j].value+"\">"+car.values[j].value+"</OPTION>";
						}
					}
				}
			}
			texte += "</SELECT></TD>"
		}
		texte = texte + "</TR></TABLE></TD></TR><tr><td></td></tr></TABLE></TD></TR>";	
	}
	texte = texte + "</TABLE>";
	MM_setTextOfLayer('tabassist','',formInfo+msgCounter+texte+'<br />'+drawTabResSel(mod)+'</FORM>');
}

function drawTabResSel(mod)
{
	var itOK = 0;
	var newText = "";
	var item;
	
	if (mod == "prod")
	{
		item = product;
    } else
	{
		item = family;
	}
	
	for (l = 0; l < item.length; l++)
	{
		iName = "'"+item[l]+"'";
		if (itemOk[iName])
		{
			itOK++;
        }
	}

	if (itOK < limite)
	{
		newText = newText + "<table border='0' bordercolor='#FFFFFF' cellpadding='0' cellspacing='1' width='100%'>";
		if (mod == "prod")
		{
            if ((typeof(pid) == "undefined") || (pid == "voltimum"))
            {
                if (TableCol["new_prd"])
                {
                    newText = newText + "<th class='vltListProductTitle' width='15px'>"+nlmessages["VLT_BS_NEW_IN_HEADER"]+"</th>";
                }
                
                if (TableCol["related_product_id"])
                {
                    newText = newText + "<th class='vltListProductTitle' width='75px'>"+nlmessages["VLT_BS_REFERENCE_IN_HEADER"]+"</th>";
                }
                
                if (TableCol["second_ref"])
                {
                    newText = newText + "<th class='vltListProductTitle' width='75px'>"+nlmessages["VLT_BS_REFERENCE2_IN_HEADER"]+"</th>";
                }
                
                if (TableCol["ean_ref"])
                {
                    newText = newText + "<th class='vltListProductTitle' width='75px'>"+nlmessages["VLT_BS_EAN_IN_HEADER"]+"</th>";
                }

                if (TableCol["commercial_description"])
                {
                    newText = newText + "<th class='vltListProductTitle'>"+nlmessages["VLT_BS_DESIGNATION_IN_HEADER"]+"</th>";
                }
                
                if (TableCol["price"])
                {
                    newText = newText + "<th class='vltListProductTitle' width='120px'>"+nlmessages["VLT_BS_PRICE_IN_HEADER"]+"</th>";
                }
                
                if (TableCol["selling_unit"])
                {
                    newText = newText + "<th class='vltListProductTitle' width='50'><input type='image' src='v_images/graphics/select2.gif' alt='"+nlmessages["VLT_BS_ADD_TO_CART"]+"' border='0'></th>";
                }
                            
                if (TableCol["linksS"])
                {
                    newText = newText + "<th class='vltListProductTitle' width='50px'>"+nlmessages["VLT_BS_SHORT_TEXT_IN_HEADER"]+"</th>";
                }

                if (TableCol["linksP"])
                {
                    newText = newText + "<th class='vltListProductTitle' width='50px'>"+nlmessages["VLT_BS_DATASHEET_IN_HEADER"]+"</th>";
                }
                
                if (TableCol["linksO"])
                {
                    newText = newText + "<th class='vltListProductTitle' width='50px'>"+nlmessages["VLT_BS_OPTIONS_IN_HEADER"]+"</th>";
                }
                
                if (TableCol["linksA"])
                {
                    newText = newText + "<th class='vltListProductTitle' width='50px'>"+nlmessages["VLT_BS_DOCS_IN_HEADER"]+"</th></tr>";
                }
                
                
            } else
            {
                // relaunch version 2004-04
                if (TableCol["new_prd"])
                {
                    newText = newText + '<td height="15" width="15" class="bgTdsPad" align="left"><span class="txt10Awhite">' +nlmessages["VLT_BS_NEW_IN_HEADER"]+ '</span></td>';
                }
                
                if (TableCol["related_product_id"])
                {
                    newText = newText + '<td height="15" width="75" class="bgTdsPad" align="left"><span class="txt10Awhite">' +nlmessages["VLT_BS_REFERENCE_IN_HEADER"]+ '</span></td>';
                }
                
                if (TableCol["second_ref"])
                {
                    newText = newText + '<td height="15" width="75" class="bgTdsPad" align="left"><span class="txt10Awhite">' +nlmessages["VLT_BS_REFERENCE2_IN_HEADER"]+ '</span></td>';
                }
                
                if (TableCol["ean_ref"])
                {
                    newText = newText + '<td height="15" width="75" class="bgTdsPad" align="left"><span class="txt10Awhite">' +nlmessages["VLT_BS_EAN_IN_HEADER"]+ '</span></td>';
                }

                if (TableCol["commercial_description"])
                {
                    newText = newText + '<td height="15" class="bgTdsPad" align="left"><span class="txt10Awhite">' +nlmessages["VLT_BS_DESIGNATION_IN_HEADER"]+ '</span></td>';
                }

                if (TableCol["price"])
                {
                    newText = newText + '<td height="15" width="50" class="bgTdsPad" align="left"><span class="txt10Awhite">' +nlmessages["VLT_BS_PRICE_IN_HEADER"]+ '</span></td>';
                }
                
                if (TableCol["linksS"])
                {
                    newText = newText + '<td height="15" width="20" class="bgTdsPad" align="left"><span class="txt10Awhite">' +nlmessages["VLT_BS_SHORT_TEXT_IN_HEADER"]+ '</span></td>';
                }
                                
                if (TableCol["linksO"])
                {
                    newText = newText + '<td height="15" width="20" class="bgTdsPad" align="left"><span class="txt10Awhite">' +nlmessages["VLT_BS_OPTIONS_IN_HEADER"]+ '</span></td>';
                }
                
                if (TableCol["linksA"])
                {
                    newText = newText + '<td height="15" width="20" class="bgTdsPad" align="left"><span class="txt10Awhite">' +nlmessages["VLT_BS_DOCS_IN_HEADER"]+ '</span></td>';
                }                            

                if (TableCol["selling_unit"])
                {
                    newText = newText + '<td height="15" width="70" class="bgTdsPad" align="left"><span class="txt10Awhite">' +nlmessages["VLT_BS_ADD_TO_CART"]+ '</span></td>';
                }
            }
		} else
		{
            if ((typeof(pid) == "undefined") || (pid == "voltimum"))
            {
			    newText = newText + "<TR><TD CLASS='vltListFamilyTitle' >&nbsp;</TD><TD CLASS='vltListFamilyTitle' WIDTH='75px'>"+nlmessages["VLT_BS_LIST_IN_HEADER"]+"</TD><TD CLASS='vltListFamilyTitle' WIDTH='75px'>"+nlmessages["VLT_BS_DISCOVERY_IN_HEADER"]+"</TD><TD CLASS='vltListFamilyTitle' WIDTH='75px'>"+nlmessages["VLT_BS_ASSISTANT_IN_HEADER"]+"</TD></TR>";
		    } else
		    {
			    newText = newText + '<TR><TD CLASS="bgTdsPad">&nbsp;</TD><TD CLASS="bgTdsPad" WIDTH="75px"><span class="txt10Awhite">'+nlmessages["VLT_BS_LIST_IN_HEADER"]+'</span></TD><TD CLASS="bgTdsPad" WIDTH="75px"><span class="txt10Awhite">'+nlmessages["VLT_BS_DISCOVERY_IN_HEADER"]+'</span></TD><TD CLASS="bgTdsPad" WIDTH="75px"><span class="txt10Awhite">'+nlmessages["VLT_BS_ASSISTANT_IN_HEADER"]+'</span></TD></TR>';
		    }
		}
		
		for (i = 0; i < item.length; i++)
		{
			iName = "'"+item[i]+"'";
			if (itemOk[iName])
			{
				newText = newText + info2[iName];
			}
		}
		newText = newText + "</table>";
	} else
	{
		if (mod == "prod")
		{
			newText = "<SPAN CLASS='PageText'><CENTER>"+nlmessages["VLT_BS_REF_ASSISTANT25"]+"</CENTER></SPAN>";
		} else {
			newText = "<SPAN CLASS='PageText'><CENTER>"+nlmessages["VLT_BS_FAM_ASSISTANT25"]+"</CENTER></SPAN>";
		}
	}
	return (newText);
}


<!-- questo oggetto crea  il Tipo di caratteristica:-->
// id -> testo che compare all'estrema sinistra dell'assistant
// help -> stringa di help non meglio identificata
// uom_f -> unita di misura
// type_f -> equivale al characteristicType
// name_f -> allo stato attuale viene passato lo stesso valore di id

function iT(id, help, uom_f, type_f, name_f)
{
	model[model.length] = (new Car(id));
	info[id] = help;
	if (urlpopup)
	{
	    urlinfo[id] = urlpopup.replace("???", id);
	}
	uom[id] = uom_f;
	type[id] = type_f;
	name2[id] = name_f;
}


// questo oggetto corrisponde ad un prodotto
// vengono forniti posizione [creato automaticamente??]
// reference -> product ID
// produit -> descrizione breve
// prezzo
// valuta
// unità di misura standard
// 
// 
// 

function iI(position, reference, second_ref, ean_ref, produit, price, devise, stdu, item, section, link, newok, sellingunit, conversion_rate) {
	product[position] = reference;
	info2["'"+reference+"'"] = wpl(reference, ean_ref, second_ref, produit, price, devise, stdu, item, section, link, newok, sellingunit,catalogType, conversion_rate);
}

function iS(position, sectionID, fName, links) {
	family[position] = sectionID;
	info2["'"+sectionID+"'"] = wpf(fName, sectionID, links);
}

function splitSet(s) {
	values = s.split(",");
	for (var i=0; i < values.length; i++) {
		values[i] = trim(values[i]);
	}
	return(values);	
}

function trim(s) {
	return((s.replace(/ +$/g,"")).replace(/^ +/g,""));
}


// questo oggetto crea un array di caratteristiche
// il primo argomento passato è l'ID del prodotto
// gli altri argomenti passati sono, a coppie, tipo e valore di caratteristica.
// NB per ogni tipo di caratteristica [iT] creato ci deve essere un valore

function iC() {
	var args = arguments;
	var i = 1;
	var prd_key;
	prd_key="'"+args[0]+"'";
	carac[prd_key] = new Array();
	while (i < args.length) {
		carac[prd_key][args[i]] = replaceQuote(args[i + 1]);
		i = i + 2;
	}
}

function showhelp(s) {
	if (document.assist.help.checked) MM_setTextOfLayer('helpassist','', '<span class="HelpMessage">'+s+'</span>' );
}

function resetChar() {
	for (i = 0; i < model.length; i++) {
		eName = model[i].name;
		curSel[eName]="*";
	}
// add a small delay if Netscape 4.X
MM_setTextOfLayer('helpassist','', '<span class="HelpMessage">'+nlmessages["VLT_BS_LOADING"]+'</span>' );
if (document.layers) setTimeout("redraw(mode)",100);
else redraw(mode);
MM_setTextOfLayer('helpassist','', '' );
}

