// JavaScript Document
function addRow()
{
	var tbl = document.getElementById("rfqlisttbl");
	tr = document.createElement("tr");
	
	
	td = document.createElement("td");
	td.setAttribute("style" ,"width:70px");
	td.setAttribute("align" ,"center");
	inputbox = document.createElement("input");
	inputbox.setAttribute("type" ,"checkbox");
	inputbox.setAttribute("name" ,"chkpartid[]");
	
	//td.appendChild(inputbox);
	tr.appendChild(td);
	
	
	
	td = document.createElement("td");
	td.setAttribute("style" ,"width:100px");
	td.setAttribute("align" ,"left");
	inputbox = document.createElement("input");
	inputbox.setAttribute("name" ,"newpart[]");
	inputbox.setAttribute("size" ,"16px");
	td.appendChild(inputbox);
	tr.appendChild(td);
	
	td = document.createElement("td");
	td.setAttribute("style" ,"width:100px");
	inputbox = document.createElement("input");
	inputbox.setAttribute("name" ,"newqty[]");
	inputbox.setAttribute("size" ,"6");
	td.appendChild(inputbox);
	tr.appendChild(td);
	
	td = document.createElement("td");
	td.setAttribute("style" ,"width:120px");
	inputbox = document.createElement("input");
	inputbox.setAttribute("name" ,"newmfg[]");
	inputbox.setAttribute("size" ,"14px");
	td.appendChild(inputbox);
	tr.appendChild(td);
	
	td = document.createElement("td");
	td.setAttribute("style" ,"width:100px");
	inputbox = document.createElement("input");
	inputbox.setAttribute("name" ,"newdc[]");
	inputbox.setAttribute("size" ,"12px");
	td.appendChild(inputbox);
	tr.appendChild(td);
	
	/*td = document.createElement("td");
	td.setAttribute("style" ,"width:100px");
	td.setAttribute("align" ,"center");
	selectbox = document.createElement("select");
	selectbox.setAttribute("name" ,"newstatus[]");
	selectbox.options[0] = new Option('Select Status','');	
	selectbox.options[1] = new Option('Available','1');	
	selectbox.options[2] = new Option('Out of Stock','0');	
	selectbox.setAttribute("style" ,"width:100px");
	td.appendChild(selectbox);
	tr.appendChild(td);*/
	
	
	td = document.createElement("td");
	td.setAttribute("style" ,"width:120px");
	inputbox = document.createElement("input");
	inputbox.setAttribute("name" ,"newremarks[]");
	inputbox.setAttribute("size" ,"12px");
	td.appendChild(inputbox);
	tr.appendChild(td);
	
	
	tbl.appendChild(tr);
}

function deleteRows()
{/*
	alert("delete");
	
	var tbl = document.getElementById("rfqlisttbl");
	frm = document.getElementById("rfqlist");
	elements = frm.elements;
	for(i=0;i<elements.length;i++)
	{
		if(elements[i].type=="checkbox" && elements[i].checked==true)
		{
			var rowid = "tr"+elements[i].value;
			row = document.getElementById(rowid);
			 while( row.hasChildNodes() ) 
			 { 
			 	row.removeChild( row.lastChild ); 
			}
			tbl.removeChild(row);
		}
	}
	
	*/
	var answer = confirm ("Do you really want to delete all the products");
if(answer==true)
{
document.getElementById("rfqlist").action="index.php?products/deleterfq/";
return true;
}
return false;
	
}
function deleteRowsadmin()
{/*
	alert("delete");
	
	var tbl = document.getElementById("rfqlisttbl");
	frm = document.getElementById("rfqlist");
	elements = frm.elements;
	for(i=0;i<elements.length;i++)
	{
		if(elements[i].type=="checkbox" && elements[i].checked==true)
		{
			var rowid = "tr"+elements[i].value;
			row = document.getElementById(rowid);
			 while( row.hasChildNodes() ) 
			 { 
			 	row.removeChild( row.lastChild ); 
			}
			tbl.removeChild(row);
		}
	}
	
	*/
	var answer = confirm ("Do you really want to delete all the products");
if(answer==true)
{
document.getElementById("rfqlist").action="index.php?admin/rfq/";
return true;
}
return false;
	
}
