//Electriduct JS FILE
function make_accessories_dom(data)
{
	if (data.length <= 2)
		return (false);
	var products_tab = data.split(';');
	var tab = document.createElement('table');
	tab.className = 'table_accessories';
	tab.cellSpacing = 0;
	tab.align = "center";
	var tr = document.createElement('tr');
	var td = document.createElement('td');
	td.className = "top";	
	td.innerHTML = 'Accessories for this product';
	td.colSpan = 2;
	td.align = "center";
	tr.appendChild(td);
	tab.appendChild(tr);
	
	for (i = 0; i < products_tab.length; ++i)
	{
		product = products_tab[i].split(':');
		var tr = document.createElement('tr');
		var td_img = document.createElement('td');
		var a = document.createElement('a');
		a.href = "product.asp?itemid=" + product[1];
		var img = document.createElement('img');
		img.src = 'assets/images/' + product[2];
		img.height = '40';
		img.width = '40';
		img.border = '0';
		a.appendChild(img);
		td_img.appendChild(a);
		td_img.paddingRight = '30px';
		tr.appendChild(td_img);
		
		var td_name = document.createElement('td');
		td_name.style.fontWeight = 'bold';
		var a = document.createElement('a');
		a.href = "product.asp?itemid=" + product[1];
		a.innerHTML = product[0];
		td_name.appendChild(a);
		tr.appendChild(td_name);
		tr.onclick = function()
		{
			document.location = "product.asp?itemid=" + product[1];
		}
		if (i % 2 == 0)
			tr.className = "product_list";
		else
			tr.className = "product_list4";
		tab.appendChild(tr);
	}
	document.getElementById('accessories').appendChild(tab);
	document.getElementById('accessories').style.display = 'block';
}

function make_accessories(data)
{
	if (data.length <= 2)
		return false;
	totaltab = data.split(';');
	document.write('<table border="1px solid" width="95%" cellspacing="0" cellpadding="0" class="ProdTable" align="center">');
	document.write('<tr class="Toptable" align="center">');
	document.write('<th width="95%" >Accessories for this product :</th>');
	document.write('</tr>');
	var pic = null;
	var temp = null;
	var i;
	for (i = 0; i < totaltab.length; i++)
	{	
		temp = totaltab[i].split(':');
		pic = '<img src="assets/images/' + temp[2] + '" border="0" align="left" height="40" width="40"/>';
		if (temp[0].length <= 5) continue;
		document.write('<tr align="left">');
		document.write('<td style="font-weight:bold;" width="95%"><a href="product.asp?itemid=' + temp[1] + '">' + pic + '<br>&nbsp;&nbsp;&nbsp;' + temp[0] + '&nbsp;&nbsp;<img src="assets/templates/layout8/images/more_info_small.jpg" border="0" align="absmiddle"/></a></td>');
		document.write('</tr>');
	}
	document.write(' </table>');
	return true;
}
