var quote_style;
var officePlanner_array; 
var bom_array;
var color_array; 
var newProduct_array;
var quote_extras;

var subTotal;  
 
var flash;
var browser; 

var seriesCell_visibility;// = 'visible';
var skuCell_visibility;// = 'visible';
var descCell_visibility;// = 'visible';
var finishCell_visibility;// = 'visible';
var listPriceCell_visibility;// = 'visible'; 
var sellPriceCell_visibility;// = 'visible';
var totalCell_visibility;// = 'visible'; 
var discountCell_visibility;

var quote_type;


// variables that are used to compute 
// the number of textarea row for:
// series, sku, finish, and description column
// NOTE: only needed for Firefox 
//////////////////////////////////
var dummySeries_height; 
var dummySku_height; 
var dummyFinish_height; 
var dummyDesc_heigth; 
//////////////////////////////////

//fix error from using RESTART button under IE, causes second popUp and does not work afterwards 072208
var confirmation = true;
///////////////////////////////////////////////	
function reloadPlanner()
{
	confirmation = false;
	//window.location.reload();
	window.location.replace(location.href.split("&sess")[0]);
}
///////////////////////////////////////////////	


//Popup function for Help, Walls and Search functions
///////////////////////////////////////////////	
function launchPopup(URL, ht, wd, scroll)
{
	var posLeft = (screen.width/2) - (wd/2);
	var posTop = (screen.height/2) - (ht/2);
	popupWindow = window.open(URL,'Help','height='+ht+',width='+wd+',top='+posTop+',left='+posLeft+',toolbar=No,location=No,scrollbars='+scroll+',status=No,resizable=yes,fullscreen=No');
	if(!popupWindow)
	{
		alert("Please turn off your popup blocker to view this feature.");
	}
} 
///////////////////////////////////////////////

//main function 
//generates quote page 
//////////////////////////////////////////////////
function buildQuote(plannerObj,colorObj,style,newProductObj,checkBoxObj,extras,quoteColor){
//alert(plannerObj[0].un_price + " " + plannerObj[1].un_price );
	// setting the type of quote page
	///////////////////////////////
	if(flash.bomConfig() == "midmarket" && (flash.userId() == "Y" || flash.tempUser() == "Y" || flash.tempUser() == undefined || flash.tempUser() == "undefined" ||  flash.userId() == undefined || flash.userId() == "undefined")){
		//alert("locked one = " + flash.userId() + " " + flash.tempUser());
		quote_type = "midmarketLocked";
	}
	else  if(flash.bomConfig() == "midmarket" && (flash.tempUser() == "N")){
		//alert("Unlocked one = " + flash.tempUser());
		quote_type = "midmarket"; 
	}
	else if(flash.bomConfig() == "inwood" && (flash.userId() == "Y" || flash.tempUser() == "Y" || flash.tempUser() == undefined || flash.tempUser() == "undefined" ||  flash.userId() == undefined || flash.userId() == "undefined")){
		//alert("locked one = " + flash.userId() + " " + flash.tempUser());
		quote_type = "inwoodLocked";
	}
	else  if(flash.bomConfig() == "inwood" && (flash.tempUser() == "N")){
		//alert("Unlocked one = " + flash.tempUser());
		quote_type = "inwood"; 
	}
	///////////////////////////////

	// assigning objects to global variables
	//////////////////////////////
	//officePlanner_array = officePlannerObj; 
	quote_style = style;
	quote_extras = extras;// needed for officemax for extra page, comments, and address
	bom_array = plannerObj; 
	color_array = colorObj;
	newProduct_array = newProductObj;

	seriesCell_visibility = checkBoxObj.seriesCell_visibility;
	skuCell_visibility= checkBoxObj.skuCell_visibility;
	descCell_visibility = checkBoxObj.descCell_visibility;
	finishCell_visibility = checkBoxObj.finishCell_visibility;
	listPriceCell_visibility = checkBoxObj.listPriceCell_visibility; 
	sellPriceCell_visibility= checkBoxObj.sellPriceCell_visibility;
	totalCell_visibility= checkBoxObj.totalCell_visibility;
	discountCell_visibility= checkBoxObj.discountCell_visibility; 
	//////////////////////////////
	//alert(seriesCell_visibility + " " + skuCell_visibility + " " + descCell_visibility + " " + finishCell_visibility + " " + listPriceCell_visibility + " " + sellPriceCell_visibility + " " + totalCell_visibility)


	var finish = false;  


	if(navigator.appName.indexOf("Microsoft") != -1)//IE
		flash.hidePlanner();

	else // Firefox
		document.getElementById("flashcontent").style.visibility="hidden"; 



	//top
	/////
	/*var quoteInfo = '<div id="top" style="margin-top:0px">';
	quoteInfo += '<img src="quote/quote_top.jpg" class="topBar" width=780px>';
	quoteInfo += '</div>';*/
	var quoteInfo = '<div id="top" class="topBar" style="margin-top:0px">';
	//quoteInfo += '<embed src="quote/quote_top.swf" quality="high" bgcolor="#ffffff" width="778" AllowScriptAccess="always" height="25" name="quote_top" align="middle"/>';
	quoteInfo += '<embed src="quote/quote_top.swf" quality="high" bgcolor="#ffffff" width="778" AllowScriptAccess="always" height="25" name="quote_top" align="middle" flashvars="load_bottomMargin='+quoteColor+'"/>'; // added colors
	quoteInfo += '</div>';
	//////

	quoteInfo += '<div id="mainQuote" class="mainQuote" >';

	if(flash.dealerId() != '346'){
		//logo
		///////////
		if(logo && logoName != ""){
			imgHeight=50;
			quoteInfo += '<div id= "logo" style="height:50px;margin-top:6px;margin-left:4px">';
			quoteInfo += '<img src="dealer_logos/'+logoName+'">';
			quoteInfo += '</div>';
		}
		else{
			imgHeight=50;
			quoteInfo += '<div id= "logo" style="height:50px;margin-top:6px;margin-left:4px">';
			quoteInfo += '<img src="dealer_logos/default.jpg">';
			quoteInfo += '</div>';
		}
		////////////

		//////////////////////
		tempInfo = '<div id= "dealerInfo" style="margin-top:6px; margin-left:4px">';
		if(quote_extras == "OMX"){
			tempInfo += dealerInfo(custName,custAddress,custCity,custPhone,custWebsite);//for Office Max Updated 021709
		}
		else{
			tempInfo += dealerInfo(custName,custAddress,custCity+", "+custState+". "+custZip,custPhone,custWebsite);
		}
		tempInfo += '</div>';
		quoteInfo += tempInfo; 
		//////////////////////////

		// get height of dealerInfo box
		/////////
		h = getOffsetHeight(tempInfo);
		////////

		////////////////////////////////////////////////
		quoteInfo += '<div id= "projectInfo" style="margin-top:'+(-1*h-imgHeight)+'px;margin-left:424px">';
		quoteInfo += projectInfo();
		quoteInfo += '</div>';
		///////////////////////////////////////////////


		////////////////////////////////////////////////
		quoteInfo += '<div id= "customerInfo" style="margin-top:20px; margin-left:424px">';
		quoteInfo += customerInfo();
		quoteInfo += '</div>';
		///////////////////////////////////////////////

		/*var ch = document.getElementById("projectInfo");
		alert(ch.offsetHeight);*/

		//lline
		/////////////////
		quoteInfo += '<hr width=720px style="margin-left:4px" align=left>';
		/////////////////////
	}
		
	quoteInfo += '<div id="plannerQuote" style="margin-left:4px; margin-top:5px">';
	//var quoteInfo += '<table id ="plannerTable" style="font-size:9px; font-family:Verdana; width:750px;border-collapse:collapse;"  cellpadding = 5 border = 1 >';
	quoteInfo += tableHeader();
	//header rows
	quoteInfo += headerRows();

	// bom rows NOte: edit 
	////////////////
	quoteInfo += bomRows(quote_style);

	//BUILD ADDITIONAL PRODUCT ROWS NOte: edit or add
	///////////
	quoteInfo += newProductsRows("edit");

	//empty default row
	////////////////////////////////
	if(bom_array.length == 0 && newProduct_array.length == 0)
		quoteInfo += defaultRow(); 
	////////////////////////////////////

	//qoute total
	/////
	quoteInfo += quoteTotal();
	////

	//quoteInfo += '</table>';
	quoteInfo += tableFooter();
	quoteInfo += '</div>'; 
	
	if(quote_extras == "OMX" || quote_extras =="GENERICPLANNER"){
		if(flash.dealerId() != "346"){
			//signature line
			/////////
			quoteInfo += '<div id= "signature" style="margin-left:4px;margin-top:10px">';
			quoteInfo += signature();
			quoteInfo += '</div>';
			//////
		}
	}

	// comment restrictions
	/////
	quoteInfo += '<div style="margin-left:4px;margin-top:5px">';
	if(quote_extras == "OMX"){
		quoteInfo += '<font color="black"><b>Order Detail & Special Instructions:</b></font>';
	}else if (quote_extras == "GENERICPLANNER") {
		quoteInfo += '<font color="black"><b>PLEASE ENTER NOTES/COMMENTS BELOW:</b></font>';
	}
	else{
		quoteInfo += '<font size="1" color="black">Comments</font>';
	}
	quoteInfo += '</div>';
	/////
	//lline
	/////////////////
	quoteInfo += '<hr width=720px style="margin-left:4px" align=left>';
	/////////////////////

	//comment box
	/////////
	var comments =  flash.comments();
	if(comments == null || comments == "null" || comments == "undefined" || comments == undefined){
		comments = "";
		if(quote_extras == "OMX"){
			comments += "Account Number: \n";
			comments += "Consignee: \n";
			comments += "Ship To Attn: Name&Phone: \n";
			comments += "Order Confirmation: \n";
			comments += "Fax Confirmation: \n";
			comments += "Purchase Order #: \n";
			comments += "Account Cost Center: \n";
			comments += "Release: \n";
			comments += "Routing: \n";
			comments += "Delivery Notes: \n";
		}
	}
	if(navigator.appName.indexOf("Microsoft") != -1){
		if(quote_extras == "OMX"){
			quoteInfo +=  '<textarea rows="10" class="commentIE" onfocusout="updateComments(this);" style="background-color:#F5F5F5; overflow:visible;">'+comments+'</textarea>';
		}
		else{
			quoteInfo +=  '<textarea rows=5 class="commentIE" onfocusout="updateComments(this);">'+comments+'</textarea>';
		}
	}
	else{
		if(quote_extras == "OMX"){
			quoteInfo +=  '<textarea rows="10" class="commentFF" onblur="updateComments(this);" style="background-color:#F5F5F5; overflow:visible;">'+comments+'</textarea>';
		}
		else{
			quoteInfo +=  '<textarea rows=5 class="commentFF" onblur="updateComments(this);">'+comments+'</textarea>';
		}
	}
	///////////

	
	if(quote_extras == "OMX"){
		quoteInfo += '<div id="commentHolder" class="commentPrint" style="page-break-after:always;word-wrap: break-word;">'+formatComments(comments)+'</div>'; 
	}
	else{
		quoteInfo += '<div id="commentHolder" class="commentPrint">'+formatComments(comments)+'</div>'; 
	}
		
	

	if(quote_extras == "OMX"){
		//here goes the paragraph
		//terms
		//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(!logo || logoName == "")
		logoName = "default.jpg"; 
		//quoteInfo += '<div id="terms" class="terms">testing.... </br> testing.... </br> testing..</div>';
		quoteInfo += '<div id="terms" class="terms">'
		//quoteInfo += '<embed src="quote/proposal.pdf#toolbar=0&navpanes=0&scrollbar=0" width="720" height="375">'; 
		quoteInfo += '<div id= "logo" style="height:50px;margin-top:6px;margin-left:4px">';
		quoteInfo += '<img src="dealer_logos/'+logoName+'">';
		quoteInfo += '</div>';
		
		//quoteInfo +='</br><b>ORDER TERMS AND CONDITIONS:</b>';
		quoteInfo +='<ol>';
		quoteInfo +='<b>ORDER TERMS AND CONDITIONS:</b>';
		quoteInfo +='<li>Price quotes are honored for (30) days. Beyond (30) days, all quotes must be revalidated.</li>';
		quoteInfo +='<li>Taxes shown are based on the rate provided by the buyer.  Final invoices taxes applied may vary slightly.</li>';
		quoteInfo +='<li>Install quotes are based on standard M-F daytime estimates under normal conditions.  Final actuals may vary.</li>';
		quoteInfo +='<li>Typical leadtime for Catalog items ranges between 2-5 days, depending on inventory at time of order.</li>';
		quoteInfo +='<li>All leadtimes for Catalog items that Drop Ship from a supplier, normally require ship time of 2-3 weeks.</li>';
		quoteInfo +='<li>Furniture Support cannot process orders using MaxPerks rewards. (Available only in store or at officemax.com)</li>';
		quoteInfo +='<li>All orders require a credit check prior to processing and standard payment terms of Net 20 days from invoice apply, unless stated otherwise by contract.</li>';
		quoteInfo +='<li>Returns must be conducted within 14 days from product receipt and be in original packaging for consideration.</li>';
		quoteInfo +='<li>Returns are not allowed on any Special Order or assembled items.</li>';
		quoteInfo +='<li>Any quote for Special Order items would be provided under separate proposal.</li>';
		quoteInfo +='</ol>';

		
		/*quoteInfo += '</br></br>'; 
		
		quoteInfo += dealerInfo(custName,custAddress,custCity+", "+custState+". "+custZip,custPhone,custWebsite);*/
		
		quoteInfo += '</div>'; // end of terms div 
		//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	}

	quoteInfo += '</div>'; /// end of main quote 

	var buttonHeight = 0; 
	
	// EZDOCK send an order button 
	///////////////////////
	//quoteInfo += '<input style="margin-left:4px" type="button" class="sendOrderBtn" onClick="show(\'contactUs\');" value="REQUEST A QUOTE" style="cursor:pointer">';
	//buttonHeight = 23; 
	///////////////////////
	
	quoteInfo += '<table  id ="btnTbl" style="width:730px;border:0px;margin-left:2px"  >';
	quoteInfo += '<tr>';
	
	quoteInfo += '<td>';
	// add button 
	///////////////////////
	if(quote_type == "midmarket" || quote_type == "inwood"){
		//quoteInfo += '<input type="image" class="addBtn" src="quote/addItems.png" onClick="addLine();" style="width:100px; height:18px">';
		quoteInfo += '<input type="button" class="addBtn" onClick="addLine();" value="ADD NEW ITEM" style="cursor:pointer">';
		buttonHeight = 29; 
	}
	//else 
		//buttonHeight = 0; 
	////////////////////

	//print button
	///////////////////////
	//if(quote_type == "midmarket" || quote_type == "inwood"){
	if(flash.userId() != undefined && flash.userId() != "undefined"){
		//quoteInfo += '<input type="image" class="printBtn" src="quote/print.png" onClick="printPage()" style="width:54px; height:18px">';
		quoteInfo += '<input type="button" class="printBtn" onClick="printPage()" value = "PRINT" style="cursor:pointer">';
		buttonHeight = 29; 
	}
	else{
		//temporary message before PRINT button appears JM122310
		quoteInfo += '<div class="printBtn" ></div>';
		buttonHeight = 29; 
	}
	//else 
		//buttonHeight = 0; 
	////////////////////
	quoteInfo += '</td>';
	
	// EZDOCK send an order button 
	///////////////////////
	if(flash.dealerId() == "346"){
		btnStyle="style='visibility:hidden'";
	}
	else{
		btnStyle="";
	}
	quoteInfo += '<td align="right" '+btnStyle+' >';
	quoteInfo += '<input style="margin-right:4px" type="button" class="sendOrderBtn" onClick="show(\'contactUs\');" value="REQUEST A QUOTE" style="cursor:pointer">';
	quoteInfo += '</td>';
	buttonHeight = 29; 
	
	///////////////////////
	
	quoteInfo += '</tr>';
	quoteInfo += '</table>';
	
	
	//hide/show terms n conditions from print out
	///////////////////
	if(quote_type == "midmarket" || quote_type == "inwood"){
		if(quote_extras == "OMX" || quote_extras == "EZDOCK"){
			var printChecked = ""; 
			var hideChecked = "";
			if(flash.terms_conditions() == true){
				printChecked = "checked";
			}
			else{
				hideChecked = "checked";
			}
			//quoteInfo +=  '<span class="printTerms"><input type="radio" name="printTerms"  value="terms" onclick=hideShowTerms(this.value) /> Show Terms <input type="radio" name="printTerms"  value="terms_hidden" onclick=hideShowTerms(this.value) /> Hide Terms</span>'; 
			quoteInfo +=  '<div style="margin-left:6px;font-size:11px; font-family:Verdana" class="printTerms"> Print Warranty Information? <input type="radio" name="printTerms"  value="terms" onclick=hideShowTerms(this.value) '+printChecked+' /> Yes <input type="radio" name="printTerms"  value="terms_hidden" onclick=hideShowTerms(this.value) '+hideChecked+' /> No</div>'; 
			buttonHeight += 20; 
		}
	}
	///////////////////
	// bottom bar
	//////////
	quoteInfo += '<div id="bottom" class="bottomBar" style="margin-top:'+(55-buttonHeight)+'px;margin-left:0px">';
	//quoteInfo += '<embed src="quote/quote_bottom.swf" quality="high" bgcolor="#ffffff" width="780" AllowScriptAccess="always" height="40" name="quote_bottom" align="middle" />';
	//the HEIGHT tag was adjusted to the NEW height of the FLASH movie v 081110 JM
	quoteInfo += '<embed src="quote/quote_bottom.swf" quality="high" bgcolor="#ffffff" width="780" AllowScriptAccess="always" height="50" name="quote_bottom" align="middle" flashvars="load_bottomMargin='+quoteColor+'"/>'; // color added 
	quoteInfo += '</div>';
	///////////


	//setting the class name for quote page
	//////////////////
	if(navigator.appName.indexOf("Microsoft") != -1)
		document.getElementById("quote").className="quotepageIE";
	else
		document.getElementById("quote").className="quotepageFF";
	//////////////////


	document.getElementById("quote").innerHTML = quoteInfo; 
	//hideColumn(true,"seriesCell_");


	document.getElementById("quote").style.visibility="visible";

	// for ie 
	//////////////////////
	if(navigator.appName.indexOf("Microsoft") != -1){
		var objDiv = document.getElementById("container");
		objDiv.scrollTop = objDiv.scrollHeight;
	}
	/////////////////////

}//end of buildquote()
//////////////////////////////////////////////////



// getting flash info.
///////////////////////////////////////////////		
window.onload = function() {
	if(navigator.appName.indexOf("Microsoft") != -1) {
		flash = window.Visual_Planner;
		browser = "ie";
	
	}else {
		flash = window.document.Visual_Planner;
		browser = "firefox"; 
		dummySeries_height = document.getElementById("dummy_series").scrollHeight; 
		dummySku_height = document.getElementById("dummy_sku").scrollHeight;
		dummyDesc_height = document.getElementById("dummy_desc").scrollHeight; 
		dummyFinish_height = document.getElementById("dummy_finish").scrollHeight;
		
	}
	
}// end of onload()
/////////////////////////////////////////////

//computes number of rows for textarea
///////////////////////////////////////////////		
function computeRows(dummyId,value,height,id){
	//alert(dummyId);
	var oElement = document.getElementById(dummyId); 
	oElement.value = value; 
	var scrollHeight = oElement.scrollHeight; 
	var rows = scrollHeight/height; 
	if(id){
		document.getElementById(id).rows = rows; 
	}
	else{
		return rows;
	}
}

///////////////////////////////////////////////		

//format comments
/////////////////////////////////////////////
function formatComments(comments){
	var lines = comments.split(/\n|\r\n/g);
	var text = ""; 
	for (var i=0; i<lines.length; i++){
		text += lines[i] + "<br>";
	}
	
	return text; 
}
/////////////////////////////////////////////

//update comments
/////////////////////////////////////////////
function updateComments(oElement){
	flash.setComments(oElement.value);
	
	var lines = oElement.value.split(/\n|\r\n/g);
	var text = ""; 
	for (var i=0; i<lines.length; i++){
		text += lines[i] + "<br>";
	}
	
	document.getElementById("commentHolder").innerHTML = text;
}
/////////////////////////////////////////////

// converts string into a number for table cell
//////////////////////////////////////////////////
function toNumber(oCell){

	////////////////
	var patt1 = /,/g;
	if(!oCell.innerHTML){ // Generic planner
		var total = "0";
	}
	else{
		var total = oCell.innerHTML.split("$")[1];
	}

	if(total.match(patt1) == null)
		var len = 0; 
	else
		var len = total.match(patt1).length;

	var numStr = "";

	for(i=0; i <= len; i++)
	{
		numStr += total.split(",")[i];
	}

	total = numStr; 
	////////////////
	return total;
	
}// end of toNumber()
//////////////////////////////////////////////////

// converts string into a number for input box
//////////////////////////////////////////////////
function toNum(ototalPriceBox){

	////////////////
	var patt1 = /,/g;

	var total = ototalPriceBox.value.split("$")[1];

	if(total.match(patt1) == null)
		var len = 0; 
	else
		var len = total.match(patt1).length;

	var numStr = "";

	for(i=0; i <= len; i++)
	{
		numStr += total.split(",")[i];
	}

	total = numStr; 
	////////////////
	return total;
	
}// end of toNum()
//////////////////////////////////////////////////

//converts number into currency format
//////////////////////////////////////////////////
function formatCurrency(val, noComma) {

	val = parseFloat(val).toFixed(2);
	
	if (val<1 || isNaN(val)) {
		return "0";
	}

	var valStr = val.toString();
	var decimalIndex = valStr.indexOf(".");
	
	if (decimalIndex>0) {
		var dollars= valStr.substr(0, decimalIndex);
		var cents= valStr.substr(decimalIndex+1, valStr.length);
	} 
	else {
		var dollars = valStr;
		var cents= "00";
	}
	
	if (cents.length == 0) {
		cents = cents+"00";
	} 
	else if (cents.length == 1) {
		cents = cents+"0";
	} 
	else if (cents.length>=3) {
		cents = cents.substr(0, 2);
	}
	
	if (dollars.length>=4) {
		var thousands = dollars.substr(0, dollars.length-3);
		var hundreds = dollars.substr(dollars.length-3, dollars.length);
	} 
	else {
		var thousands = "";
		var hundreds = dollars;
	}
	
	var valStrF;
	if (thousands.length>0) {
		if (noComma == true) {
			valStrF = thousands+""+hundreds+"."+cents;
		} 
		else {
			valStrF = thousands+","+hundreds+"."+cents;
		}
	} 
	else {
		valStrF = hundreds+"."+cents;
	}
	return valStrF;
	
}// end of formatCurrency()
//////////////////////////////////////////////////

//update total on windows key up event 
//////////////////////////////////////////////////
function updateTotal(e,type){

	if(type == "tax"){

		var subTotalWithTaxBox = document.getElementById("subTotalWithTax");
		var grandTotalBox = document.getElementById("grandTotal");
		var tax = (!document.getElementById("tax").value) ? 0 : parseFloat(document.getElementById("tax").value);
		var design = (!document.getElementById("design").value) ? 0 : parseFloat(document.getElementById("design").value);
		var delivery = (!document.getElementById("delivery").value) ? 0 : parseFloat(document.getElementById("delivery").value);
		var installation = (!document.getElementById("installation").value) ? 0 : parseFloat(document.getElementById("installation").value);

		var total = parseFloat(generateSubTotal("edit"));
		total += (total * parseFloat(tax)/100);
		subTotalWithTaxBox.value = "$"+ formatCurrency(total);

		total += (design + delivery + installation);
		grandTotalBox.value = "$" + formatCurrency(total);
	}

	else if(type == "design" || type == "delivery" || type == "installation" ){

		var grandTotalBox = document.getElementById("grandTotal");
		var tax = (!document.getElementById("tax").value) ? 0 : parseFloat(document.getElementById("tax").value);
		var design = (!document.getElementById("design").value) ? 0 : parseFloat(document.getElementById("design").value);
		var delivery = (!document.getElementById("delivery").value) ? 0 : parseFloat(document.getElementById("delivery").value);
		var installation = (!document.getElementById("installation").value) ? 0 : parseFloat(document.getElementById("installation").value);

		var total = parseFloat(generateSubTotal("edit"));
		total += (total * parseFloat(tax)/100);
		total += (design + delivery + installation);
		grandTotalBox.value = "$" + formatCurrency(total);

	}

}//end of updateTotal()
//////////////////////////////////////////////////

// generate subtotal 
//////////////////////////////////////////////////
function generateSubTotal(reason){

	var subTotal = parseFloat(0); 

	if(reason == "new"){
		for(var i=0; i<bom_array.length; i++){
			//if (bom_array[i].newPrice == "undefined" || bom_array[i].newPrice == undefined || bom_array[i].newPrice == 0 || bom_array[i].newPrice == null || bom_array[i].newPrice == "null"){
			if (bom_array[i].newPrice == "undefined" || bom_array[i].newPrice == undefined ||  bom_array[i].newPrice == null || bom_array[i].newPrice == "null"){
				// do nothing  if quote type is midmarket and level =1 
				// else following if block gets executed
				if(flash.bomConfig() == "midmarket" && flash.dealerLevel() != "1"){
					if(bom_array[i].newQuant == "" || bom_array[i].newQuant == "undefined" || bom_array[i].newQuant == undefined || bom_array[i].newQuant == null || bom_array[i].newQuant == "null") {
						subTotal += parseFloat(bom_array[i].ass_price * bom_array[i].quant);
					}
					else{
						subTotal += parseFloat(bom_array[i].ass_price * bom_array[i].newQuant);
					}
				}
			}
			else {
				if(bom_array[i].newQuant == "" || bom_array[i].newQuant == "undefined" || bom_array[i].newQuant == undefined || bom_array[i].newQuant == null || bom_array[i].newQuant == "null") {

					//subTotal += parseFloat(bom_array[i].newPrice * bom_array[i].quant);
					if(quote_style == 'edit'){
						subTotal += parseFloat(newSellPrice(bom_array[i].disc,bom_array[i].un_price,bom_array[i].newlistPrice,bom_array[i].newPrice) * bom_array[i].quant);
					}
					else if(quote_style == 'non-edit'){
						subTotal += parseFloat(newSellPrice(bom_array[i].disc,bom_array[i].un_price,"",bom_array[i].newPrice) * bom_array[i].quant);
					}
					
				}
				else{
					//subTotal += parseFloat(bom_array[i].newPrice * bom_array[i].newQuant);
					if(quote_style == 'edit'){
						subTotal += parseFloat(newSellPrice(bom_array[i].disc,bom_array[i].un_price,bom_array[i].newlistPrice,bom_array[i].newPrice) * bom_array[i].newQuant);
					}
					else if(quote_style == 'non-edit'){
						subTotal += parseFloat(newSellPrice(bom_array[i].disc,bom_array[i].un_price,"",bom_array[i].newPrice) * bom_array[i].newQuant);
					}
				}
			}
		}
		for( var j=0 ; j<newProduct_array.length; j++){
			if (newProduct_array[j].sellPrice == "null" || newProduct_array[j].sellPrice == 0 ||newProduct_array[j].newQuant == "" ){ 
			// do nothing 
			}
			else {
				if(newProduct_array[j].newQuant == "" || newProduct_array[j].newQuant == "null") {
					subTotal += parseFloat(newProduct_array[j].sellPrice * newProduct_array[j].quant);
				}
				else{
					subTotal += parseFloat(newProduct_array[j].sellPrice * newProduct_array[j].newQuant);
				}
			}
		}
	}

	else if (reason == "edit"){

		for(var i=0; i<bom_array.length; i++){
		
			var total_Id = 'total_' + i; 
			var totalPriceBox = document.getElementById(total_Id);

			////////////////
			var total = toNum(totalPriceBox);
			////////////////

			//alert(total);
			//subTotal += parseFloat(totalPriceBox.value.split("$")[1]);
			subTotal += parseFloat(total);

		}

		for(var j=0; j<newProduct_array.length; j++){
		
		var k = j+bom_array.length;
		total_Id = 'total_' + k; 
		totalPriceBox = document.getElementById(total_Id);

		////////////////
		var total = toNum(totalPriceBox);
		////////////////

		//subTotal += parseFloat(totalPriceBox.value.split("$")[1]);
		subTotal += parseFloat(total);

		}

	}

	//alert(subTotal);
	return (subTotal == 0) ? 0 : subTotal;//.toFixed(2);
	
}// end of generateSubTotal()
//////////////////////////////////////////////////

//quote Total layout 
//////////////////////////////////////////////////
function quoteTotal(){

	var bool;
	var style; 
	if(flash.dealerId() == "346"){
		style = "style='display:none'";
	}
	else{
		style = ""; 
	}

	/////////////
	if(quote_type == "midmarket" || quote_type == "inwood"){
		var lineSpan = 7;
		var columnSpan = 9; 
	}
	else if(quote_type == "midmarketLocked" || quote_type == "inwoodLocked"){
		var lineSpan = 6;
		var columnSpan = 8; 
	}
	/////////////


	var subTotal = parseFloat(generateSubTotal("new"));//(generateSubTotal() == 0) ? 0 : generateSubTotal().toFixed(2) ;
	
	var quoteInfo = '<tr>';
	quoteInfo += '<td colspan='+(columnSpan + 1)+' align=right style = "border:1px solid #FFFFFF; border-top:1px solid #000000;" ></td>'
	quoteInfo += '<td style = "border:1px solid #FFFFFF; "></td>'; 
	quoteInfo += '</tr>';

	// subtotal row
	////////////////////////////////////
	quoteInfo += '<tr '+style+' >';
	quoteInfo += '<th colspan='+columnSpan+' align=right style = "border:1px solid #FFFFFF; " >Sub Total</th>';
	if(subTotal == 0)
		quoteInfo += '<td style = "border:1px solid #FFFFFF; " ><input type="text" value ="$0" id= "subTotal"  class="total"  readonly= "readonly"></td>';
	else
		quoteInfo += '<td style = "border:1px solid #FFFFFF; " ><input type="text" value ="$'+formatCurrency(subTotal)+'" id= "subTotal"  class="total"  readonly= "readonly"></td>';
	quoteInfo += '<td style = "border:1px solid #FFFFFF; "></td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////

	//tax(%) row
	////////////////////////////////////
	var tax =  flash.tax();
	if(tax == null || tax == "null" || tax == "undefined" || tax == undefined)
	{
		tax = "";
		tax_ = 0; 
	}
	else
		tax_ = parseFloat(tax); 

	quoteInfo += '<tr '+style+' >';
	quoteInfo += '<th colspan='+columnSpan+' align=right style = "border:1px solid #FFFFFF; " >Tax (%)</th>';

	if(quote_type == "midmarket" || quote_type == "inwood")
		quoteInfo += '<td style = "border:1px solid #FFFFFF; " ><input type="text" value ="'+tax+'" id= "tax"  class="tax" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="updateTotal(bool,\'tax\')" onblur="flash.setTax(this.value)"></td>';
	else if (quote_type == "midmarketLocked" || quote_type == "inwoodLocked")
		quoteInfo += '<td style = "border:1px solid #FFFFFF; " ><input type="text" value ="'+tax+'" id= "tax"  class="taxLocked" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="updateTotal(bool,\'tax\')" onblur="flash.setTax(this.value)" readonly= "readonly"></td>';

	quoteInfo += '<td style = "border:1px solid #FFFFFF; "></td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////

	// breaking line row
	////////////////////////////////////
	quoteInfo += '<tr '+style+' >';
	quoteInfo += '<th colspan='+lineSpan+' align=right style = "border:1px solid #FFFFFF; " ></th>';
	quoteInfo += '<td colspan="3" style = "border:1px solid #FFFFFF; " ><hr></td>';
	quoteInfo += '<td style = "border:1px solid #FFFFFF; "></td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////

	//subtotal with tax row
	////////////////////////////////////
	var total = subTotal + (subTotal * tax_/100);

	quoteInfo += '<tr '+style+' >';
	quoteInfo += '<th colspan='+columnSpan+' align=right style = "border:1px solid #FFFFFF; " >Sub Total after Tax</th>';
	if(total == 0)
		quoteInfo += '<td style = "border:1px solid #FFFFFF; " ><input type="text" value ="$0" id= "subTotalWithTax"  class="total"  readonly= "readonly"></td>';
	else
		quoteInfo += '<td style = "border:1px solid #FFFFFF; " ><input type="text" value ="$'+ formatCurrency(total)+'" id= "subTotalWithTax"  class="total"  readonly= "readonly"></td>';
	quoteInfo += '<td style = "border:1px solid #FFFFFF; "></td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////

	// breaking line row
	////////////////////////////////////
	quoteInfo += '<tr '+style+' >';
	quoteInfo += '<th colspan='+lineSpan+' align=right style = "border:1px solid #FFFFFF; " ></th>';
	quoteInfo += '<td colspan="3" style = "border:1px solid #FFFFFF; " ><hr></td>';
	quoteInfo += '<td style = "border:1px solid #FFFFFF; "></td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////

	//design row
	////////////////////////////////////
	var design = flash.design();
	if(design == null || design == "null" || design == "undefined" || design == undefined){
		design = "";
		design_ = 0; 
	}
	else 
		design_ = parseFloat(design); 

	quoteInfo += '<tr '+style+' >';
	quoteInfo += '<th colspan='+columnSpan+' align=right style = "border:1px solid #FFFFFF; " >Design $</th>';

	if (quote_type == "midmarket" || quote_type == "inwood")
		quoteInfo += '<td style = "border:1px solid #FFFFFF; " ><input type="text" value ="'+design+'" id= "design"  class="design" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="updateTotal(bool,\'design\')" onblur="flash.setDesign(this.value)"></td>';
	else if (quote_type == "midmarketLocked" || quote_type == "inwoodLocked")
		quoteInfo += '<td style = "border:1px solid #FFFFFF; " ><input type="text" value ="'+design+'" id= "design"  class="designLocked" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="updateTotal(bool,\'design\')" onblur="flash.setDesign(this.value)" readonly= "readonly"></td>';

	quoteInfo += '<td style = "border:1px solid #FFFFFF; "></td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////

	//delivery row
	////////////////////////////////////
	var delivery =  flash.delivery();
	if(delivery == null || delivery == "null" || delivery == "undefined" || delivery == undefined){
		delivery = "";
		delivery_ = 0; 
	}
	else 
		delivery_ = parseFloat(delivery);

	quoteInfo += '<tr '+style+' >';
	quoteInfo += '<th colspan='+columnSpan+' align=right style = "border:1px solid #FFFFFF; " >Delivery $</th>';

	if (quote_type == "midmarket" || quote_type == "inwood")
		quoteInfo += '<td style = "border:1px solid #FFFFFF; " ><input type="text" value ="'+delivery+'" id= "delivery"  class="delivery" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="updateTotal(bool,\'delivery\')" onblur="flash.setDelivery(this.value)"></td>';
	else if (quote_type == "midmarketLocked" || quote_type == "inwoodLocked")
		quoteInfo += '<td style = "border:1px solid #FFFFFF; " ><input type="text" value ="'+delivery+'" id= "delivery"  class="deliveryLocked" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="updateTotal(bool,\'delivery\')" onblur="flash.setDelivery(this.value)" readonly= "readonly"></td>';

	quoteInfo += '<td style = "border:1px solid #FFFFFF; "></td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////

	//installation row
	////////////////////////////////////
	var installation =  flash.installation();
	if(installation == null || installation == "null" || installation == "undefined" || installation == undefined){
		installation = "";
		installation_ = 0; 
	}
	else 
		installation_ = parseFloat(installation); 

	quoteInfo += '<tr '+style+' >';
	quoteInfo += '<th colspan='+columnSpan+' align=right style = "border:1px solid #FFFFFF; " >Installation $</th>';

	if (quote_type == "midmarket" || quote_type == "inwood")
		quoteInfo += '<td style = "border:1px solid #FFFFFF; " ><input type="text" value ="'+installation+'" id= "installation"  class="installation" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="updateTotal(bool,\'installation\')" onblur="flash.setInstallation(this.value)"></td>';
	else if (quote_type == "midmarketLocked" || quote_type == "inwoodLocked")
		quoteInfo += '<td style = "border:1px solid #FFFFFF; " ><input type="text" value ="'+installation+'" id= "installation"  class="installationLocked" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="updateTotal(bool,\'installation\')" onblur="flash.setInstallation(this.value)" readonly= "readonly"></td>';

	quoteInfo += '<td style = "border:1px solid #FFFFFF; "></td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////

	// breaking line row
	////////////////////////////////////
	quoteInfo += '<tr '+style+' >';
	quoteInfo += '<th colspan='+lineSpan+' align=right style = "border:1px solid #FFFFFF; " ></th>';
	quoteInfo += '<td colspan="3" style = "border:1px solid #FFFFFF; " ><hr></td>';
	quoteInfo += '<td style = "border:1px solid #FFFFFF; "></td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////

	//Grand Total  row
	////////////////////////////////////
	total += (design_ + delivery_ + installation_);

	quoteInfo += '<tr>';
	quoteInfo += '<th colspan='+columnSpan+' align=right style = "border:1px solid #FFFFFF; " >Grand Total</th>';
	if(total == 0)
		quoteInfo += '<td style = "border:1px solid #FFFFFF; " ><input type="text" value ="$0" id= "grandTotal"  class="total"  readonly= "readonly"></td>';
	else
		quoteInfo += '<td style = "border:1px solid #FFFFFF; " ><input type="text" value ="$'+ formatCurrency(total)+'" id= "grandTotal"  class="total"  readonly= "readonly"></td>';
	quoteInfo += '<td style = "border:1px solid #FFFFFF; "></td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////


	return quoteInfo; 

}// end of quoteTotal()
//////////////////////////////////////////////////

//default row 
//////////////////////////////////////////////////
function defaultRow(){


	var quoteInfo = '<tr>';

	//SERIES FIELD
	/////////////////////////////
	quoteInfo += '<td id="seriesCell_"  style="visibility:hidden"><input type="text" value="" id="series_"  class="series" /></td>';
	//////////////////////////////

	/// SKU FIELD
	///////////////////////////
	quoteInfo += '<td id="skuCell_" style="visibility:hidden"><input type="text" value="" id="sku_"  class="sku" /></td>';
	/////////////////////////////

	// DESCRIPTION FIELD
	///////////////////
	quoteInfo += '<td id="descCell_" style="visibility:hidden"><input type="text" value="" id="desc_"  class="desc" /></td>'; 
	////////////////

	//// FINISH FIELD 
	//////////////////////////////////
	quoteInfo += '<td id="finishCell_" style="visibility:hidden"><input type="text" value="" id="finish_"  class="finish" /></td>';
	///////////////////////////////////////////////

	// QUANTITY FIELD
	/////////////////////
	quoteInfo += '<td id="quantCell_" style="visibility:hidden" >0</td>';
	/////////////////////////

	// NEW QUANTITY FIELD
	/////////////////////
	quoteInfo += '<td id ="newQuantCell_" style="visibility:hidden"  ><input type="text" value="" id="newQuant_" class="newQuant" /></td>';
	/////////////////////////

	// LIST PRICE FIELD 
	//////////////////////////
	quoteInfo += '<td id="listPriceCell_" style="visibility:hidden"><input type="text" value="" id="listPrice_"  class="listPrice" /></td>'; 
	///////////////////////////


	// DISCOUNT FIELD
	//////////////////////////
	if(quote_type == "midmarket" || quote_type == "inwood")
		quoteInfo += '<td id="discountCell_" style="visibility:visible"><input type="text" value="" id="discount_"  class="discount" /></td>'; 
	/*else if(quote_type == "midmarketLocked")
	quoteInfo += '<td id="discountCell_" style="visibility:visible"></td>'; */
	///////////////////////////////////

	// SELL PRICE FIELD
	///////////////////////////////////
	if(quote_type == "midmarket" || quote_type == "inwood")
		quoteInfo += '<td id= "sellPriceCell_" style="visibility:visible"><input type="text" value="" id="sellPrice_"  class="sellPrice" /></td>';
	else if(quote_type == "midmarketLocked" || quote_type == "inwoodLocked")
		quoteInfo += '<td id= "sellPriceCell_" style="visibility:visible"></td>';
	////////////////////////////////////

	// TOTAL PRICE FIELD
	/////////////////////////////////
	quoteInfo += '<td id= "totalCell_" style="visibility:hidden"><input type="text" value="$0" id="total_"  class="total" readonly = "readonly"/></td>';
	////////////////////////////////

	////OPTIONS FIELDS
	////////////////////////////
	//quoteInfo += '<td id="option1_'+k+'" class = "imgInfo" ><input type="image" id="'+k+'"title="Update" src="acceptBtn.png" onclick="updateNewProduct(this.id)" style="width:16px; height:16px"/></td>';
	quoteInfo += '<td id="option_" class = "imgInfo" style="visibility:hidden" ></td>';


	////////////////////////
	quoteInfo += '</tr>'; 

return quoteInfo; 

}// end of defaultRow()
//////////////////////////////////////////////////

// get image hieght on the fly
//////////////////////////////////////////////////
function getOffsetHeight(oElement){

	var oDiv=document.createElement("DIV");
	oDiv.setAttribute("id", "temp");
	oDiv.setAttribute("style", "visibility:hidden");
	document.body.appendChild(oDiv);

	document.getElementById("temp").innerHTML = oElement;
	var h = document.getElementById("temp").offsetHeight;


	var o = document.getElementById("temp");
	o.parentNode.removeChild(o);

	return h; 

}// end of getOffsetHeight()
//////////////////////////////////////////////////


//customer's information
//////////////////////////////////////////////////
function customerInfo(){

	//table header
	////////
	if(navigator.appName.indexOf("Microsoft") != -1)
		var quoteInfo = '<table style="font-size:9px; font-family:Verdana; width:300px;border-collapse:collapse;table-layout:fixed;" cellpadding = 1 border = 0>';
	else 
		var quoteInfo = '<table style="font-size:9px; font-family:Verdana; width:300px;border-collapse:collapse;" cellpadding = 1 border = 0>';
	////

	//table body
	////
	////////////////////////////////////////////////////////////////
	var customerName =  flash.customerName();

	if(customerName == null || customerName == "null" || customerName == "undefined" || customerName == undefined)
		customerName = "";

	quoteInfo += '<tr>';
	quoteInfo += '<td  align=right>Customer:</td>';
	quoteInfo += '<td colspan=3><input type="text" id="customerName" class="customerInfo" onkeypress="return noSpecialChars(event)" value="'+customerName+'" onblur="flash.setCustomerName(this.value);"/></td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////////////////////////////////

	////////////////////////////////////////////////////////////////
	var customerCompany =  flash.customerCompany();

	if(customerCompany == null || customerCompany == "null" || customerCompany == "undefined" || customerCompany == undefined)
		customerCompany = "";

	quoteInfo += '<tr>';
	quoteInfo += '<td align=right>Company:</td>';
	quoteInfo += '<td colspan=3><input type="text" id="customerCompany" class="customerInfo" onkeypress="return noSpecialChars(event)" value="'+customerCompany+'" onblur="flash.setCustomerCompany(this.value);"/></td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////////////////////////////////

	////////////////////////////////////////////////////////////////
	var customerAddress1 =  flash.customerAddress1();

	if(customerAddress1 == null || customerAddress1 == "null" || customerAddress1 == "undefined" || customerAddress1 == undefined)
		customerAddress1 = "";

	quoteInfo += '<tr>';
	quoteInfo += '<td align=right>Address:</td>';
	quoteInfo += '<td colspan=3><input type="text" id="customerAddress1" class="customerInfo" onkeypress="return noSpecialChars(event)" value="'+customerAddress1+'" onblur="flash.setCustomerAddress1(this.value);"/></td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////////////////////////////////

	////////////////////////////////////////////////////////////////
	var customerAddress2 =  flash.customerAddress2();

	if(customerAddress2 == null || customerAddress2 == "null" || customerAddress2 == "undefined" || customerAddress2 == undefined)
		customerAddress2 = "";

	quoteInfo += '<tr>';
	quoteInfo += '<td style="visibility:hidden">Address2:</td>';
	quoteInfo += '<td colspan=3><input type="text" id="customerAddress2" class="customerInfo" onkeypress="return noSpecialChars(event)" value="'+customerAddress2+'" onblur="flash.setCustomerAddress2(this.value);"/></td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////////////////////////////////

	////////////////////////////////////////////////////////////////
	var customerTelephone =  flash.customerTelephone();

	if(customerTelephone == null || customerTelephone == "null" || customerTelephone == "undefined" || customerTelephone == undefined)
		customerTelephone = "";

	var customerFax =  flash.customerFax();

	if(customerFax == null || customerFax == "null" || customerFax == "undefined" || customerFax == undefined)
		customerFax = "";

	quoteInfo += '<tr>';
	quoteInfo += '<td width=20% align=right>Tel:</td>';
	quoteInfo += '<td width=35%><input type="text" id="customerTelephone" class="customerInfo" onkeypress="return noSpecialChars(event)" value="'+customerTelephone+'" onblur="flash.setCustomerTelephone(this.value);"/></td>'; 
	quoteInfo += '<td width=10% align=right>Fax:</td>';
	quoteInfo += '<td width=35%><input type="text" id="customerFax" class="customerInfo" onkeypress="return noSpecialChars(event)" value="'+customerFax+'" onblur="flash.setCustomerFax(this.value);"/></td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////////////////////////////////



	////////////////////////////////////////////////////////////////
	var customerEmail =  flash.customerEmail();

	if(customerEmail == null || customerEmail == "null" || customerEmail == "undefined" || customerEmail == undefined)
		customerEmail = "";

	quoteInfo += '<tr>';
	quoteInfo += '<td align=right>Email:</td>';
	quoteInfo += '<td colspan=3><input type="text" id="customerEmail" class="customerInfo" onkeypress="return noSpecialChars(event)" value="'+customerEmail+'" onblur="flash.setCustomerEmail(this.value);"/></td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////////////////////////////////

	//table footer
	////
	quoteInfo += '</table>';
	////
	return quoteInfo; 

}// end of customerInfo()
//////////////////////////////////////////////////


//signature 
//////////////////////////////////////////////////
function signature(){
	
	var quoteInfo = '<table style="width:600px;border-collapse:collapse;" cellpadding = 1 border = 0>';
	quoteInfo += '<tr>';
	quoteInfo += '<td colspan="4"><br/></td>';
	quoteInfo += '</tr>';	
	quoteInfo += '<tr>';
	quoteInfo += '<td colspan="4">Customer agrees to all order terms and conditions found attached.</td>';
	quoteInfo += '</tr>';
	quoteInfo += '<tr>';
	quoteInfo += '<td colspan="4"><br/></td>';
	quoteInfo += '</tr>';
	quoteInfo += '<tr>';
	quoteInfo += '<td width=23%>Customer Signature:</td>';
	quoteInfo += '<td width=40% style = "border:1px solid #FFFFFF; border-bottom:1px solid #000000;"></td>';
	quoteInfo += '<td width=8%>Date:</td>';
	quoteInfo += '<td width=29% style = "border:1px solid #FFFFFF; border-bottom:1px solid #000000;"></td>';
	quoteInfo += '</tr>';
	quoteInfo += '<tr>';
	quoteInfo += '<td colspan="4"><br/></td>';
	quoteInfo += '</tr>';
	quoteInfo += '</table>';
	//quoteInfo = "hello";
	return quoteInfo;
}
//////////////////////////////////////////////////
//end of signature

//project information 
//////////////////////////////////////////////////
function projectInfo(){

	//table header
	////////
	/*if(navigator.appName.indexOf("Microsoft") != -1)
		var quoteInfo = '<table style="font-size:9px; font-family:Verdana; width:300px;border-collapse:collapse;table-layout:fixed;" cellpadding = 1 border = 0>'; 
	else */
		var quoteInfo = '<table class="projInfoTable" style="font-size:9px; font-family:Verdana; width:300px;border-collapse:collapse;" cellpadding = 1 border = 0>'; 
	////

	//table body
	////
	////////////////////////////////////////////////////////////////
	var projectName =  flash.projectName();

	if(projectName == null || projectName == "null" || projectName == "undefined" || projectName == undefined)
		projectName = "";

	quoteInfo += '<tr>';
	if(quote_extras == "OMX"){
		quoteInfo += '<td  align=right>Rep#/Proposal#:</td>';
	}
	else{
		quoteInfo += '<td  align=right>Project Name:</td>';
	}
	quoteInfo += '<td colspan=3><input type="text" id="projectName" class="projectInfo" onkeypress="return noSpecialChars(event)" value="'+projectName+'" onblur="flash.setProjectName(this.value);" /></td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////////////////////////////////

	////////////////////////////////////////////////////////////////
	var sessionId =  flash.sessionId();

	if(sessionId == null || sessionId == "null" || sessionId == "undefined" || sessionId == undefined)
		sessionId = "";

	quoteInfo += '<tr>';
	quoteInfo += '<td align=right>Session ID#:</td>';
	quoteInfo += '<td colspan=3>'+sessionId+'</td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////////////////////////////////

	////////////////////////////////////////////////////////////////
	var projectDate =  flash.projectDate();

	var dateNeeded =  flash.dateNeeded();

	if(projectDate == null || projectDate == "null" || projectDate == "undefined" || projectDate == undefined)
		projectDate = "";

	var dateNeeded =  flash.dateNeeded();

	if(dateNeeded == null || dateNeeded == "null" || dateNeeded == "undefined" || dateNeeded == undefined)
		dateNeeded = "";

	quoteInfo += '<tr>';
	quoteInfo += '<td width=25% align=right>Project Date:</td>';
	quoteInfo += '<td width=25%>'+projectDate+'</td>'; 
	quoteInfo += '<td width=25% align=right>Date Needed:</td>';
	quoteInfo += '<td width=25%><input type="text" id="dateNeeded" class="projectInfo" onkeypress="return noSpecialChars(event)" value="'+dateNeeded+'" onblur="flash.setDateNeeded(this.value);"/></td>'; 
	quoteInfo += '</tr>';
	////////////////////////////////////////////////////////////////


	//table footer
	////
	quoteInfo += '</table>';
	////
	return quoteInfo; 

}// end of projectInfo()
//////////////////////////////////////////////////



//table Header
//////////////////////////////////////////////////
function tableHeader(){

	var quoteInfo; 
	
	if(navigator.appName.indexOf("Microsoft") != -1)
		quoteInfo = '<table  id ="plannerTable" style="font-size:9px; font-family:Verdana; width:750px;border-collapse:collapse;border-style:none;table-layout:fixed;word-wrap:break-word"  cellpadding = 1 border = 1>';
	else 
		quoteInfo = '<table  id ="plannerTable" style="font-size:9px; font-family:Verdana; width:750px;border-collapse:collapse;"  cellpadding = 4 border = 1 >';

	return quoteInfo; 

}// end of tableHeader()
//////////////////////////////////////////////////

// table footer 
//////////////////////////////////////////////////
function tableFooter(){

	var quoteInfo = '</table>';
	return quoteInfo; 

}// end of tableFooter()
//////////////////////////////////////////////////

// header rows of a table 
// contain check boxes and titles 
//////////////////////////////////////////////////
function headerRows(){

	if(seriesCell_visibility == "hidden"){
		series_checked = "checked";
		series_col_title = "";
	}
	else{
		series_checked = ""; 
		series_col_title = "MFR";
	}
	if(skuCell_visibility == "hidden"){
		sku_checked = "checked";
		sku_col_title =  "";
	}
	else{
		sku_checked = ""; 
		sku_col_title =  "SKU";
	}
	if(finishCell_visibility == "hidden"){
		finish_checked = "checked";
		finish_col_title =  "";
	}
	else{
		finish_checked = "";
		finish_col_title =  "FINISH";
	}
	if(descCell_visibility == "hidden"){
		desc_checked = "checked";
		desc_col_title =  "";
	}
	else{
		desc_checked = ""; 
		desc_col_title =  "DESCRIPTION";
	}
	if(sellPriceCell_visibility == "hidden"){
		sellPrice_checked = "checked";
		sellPrice_col_title =  "";
	}
	else{
		sellPrice_checked = ""; 
		sellPrice_col_title =  "SELL";
	}
	if(listPriceCell_visibility == "hidden"){
		listPrice_checked = "checked";
		listPrice_col_title =  "";
	}
	else{
		listPrice_checked = ""; 
		listPrice_col_title =  "LIST";
	}	
	if(totalCell_visibility == "hidden"){
		total_checked = "checked";
		total_col_title =  "";
	}
	else{
		total_checked = ""; 
		total_col_title =  "TOTAL";
	}
	if(discountCell_visibility == "hidden"){
		discount_checked = "checked";
		discount_col_title =  "";
	}
	else{
		discount_checked = ""; 
		discount_col_title =  "%";
	}
	
	var quoteInfo = "";
	
	if(quote_type == "midmarket" || quote_type == "inwood"){
		// check boxes row
		/////////////////////////////
		quoteInfo += '<tr align = center class="checkboxRow">';
		quoteInfo += '<td class = "checkBoxInfo" width = 8%><input type="checkbox" '+series_checked+' onClick="hideColumn(this.checked,\'seriesCell_\',\'MFR\');"></td>';
		quoteInfo += '<td class = "checkBoxInfo" width = 15% ><input type="checkbox" '+sku_checked+' onClick="hideColumn(this.checked,\'skuCell_\',\'SKU\');"></td>';
		quoteInfo += '<td class = "checkBoxInfo" width = 15%><input type="checkbox" '+desc_checked+' onClick="hideColumn(this.checked,\'descCell_\',\'DESCRIPTION\');"></td>';
		quoteInfo += '<td class = "checkBoxInfo"  width = 14%><input type="checkbox" '+finish_checked+' onClick="hideColumn(this.checked,\'finishCell_\',\'FINISH\');"></td>';
		quoteInfo += '<td class = "checkBoxInfo"  width = 5%></td>';
		quoteInfo += '<td class = "checkBoxInfo"   width = 5%></td>';
		quoteInfo += '<td class = "checkBoxInfo"  width = 10%><input type="checkbox" '+listPrice_checked+' onClick="hideColumn(this.checked,\'listPriceCell_\',\'LIST\');"></td>';
		quoteInfo += '<td class = "checkBoxInfo" width = 4% ><input type="checkbox" '+discount_checked+' onClick="hideColumn(this.checked,\'discountCell_\',\'%\');"></td>';
		quoteInfo += '<td class = "checkBoxInfo"  width = 10% ><input type="checkbox" '+sellPrice_checked+' onClick="hideColumn(this.checked,\'sellPriceCell_\',\'SELL\');"></td>';
		quoteInfo += '<td class = "checkBoxInfo" width = 10% ><input type="checkbox" '+total_checked+' onClick="hideColumn(this.checked,\'totalCell_\',\'TOTAL\');"></td>';
		//quoteInfo += '<td class = "checkBoxInfo" colspan=2></td>';
		quoteInfo += '<td class = "checkBoxInfo" width = 4% ></td>';
		//quoteInfo += '<td class = "checkBoxInfo" width = 4%></td>';
		quoteInfo += '</tr>';
		//////////////////////////////
		
		// header row
		//////////////////////////////////////////
		quoteInfo += '<tr>';
		quoteInfo += '<th class ="headerInfo" id="seriesCell_">'+series_col_title+'</th>';
		quoteInfo += '<th class ="headerInfo" id="skuCell_">'+sku_col_title+'</th>';
		quoteInfo += '<th class ="headerInfo" id="descCell_">'+desc_col_title+'</th>';
		quoteInfo += '<th class ="headerInfo" id="finishCell_">'+finish_col_title+'</th>';
		quoteInfo += '<th class ="headerInfo">PLAN QTY</th>';
		quoteInfo += '<th class ="headerInfo">NEW QTY</th>';
		quoteInfo += '<th class ="headerInfo" id="listPriceCell_">'+listPrice_col_title+'</th>';
		quoteInfo += '<th class ="headerInfo" id="discountCell_">'+discount_col_title+'</th>';
		quoteInfo += '<th class ="headerInfo" id="sellPriceCell_">'+sellPrice_col_title+'</th>';
		quoteInfo += '<th class ="headerInfo" id="totalCell_">'+total_col_title+'</th>';
		//quoteInfo += '<th class ="imgHeader" colspan=2></th>';
		quoteInfo += '<th class ="imgHeader"></th>';
		//quoteInfo += '<th class ="imgHeader"></th>';
		quoteInfo += '</tr>';
		///////////////////////////////////////////
		

		
	}
	else if (quote_type == "midmarketLocked" || quote_type == "inwoodLocked"){
	
		// header row
		//////////////////////////////////////////
		quoteInfo += '<tr>';
		quoteInfo += '<th class ="headerInfo" width = 8% id="seriesCell_">'+series_col_title+'</th>';
		quoteInfo += '<th class ="headerInfo" width = 16% id="skuCell_">'+sku_col_title+'</th>';
		quoteInfo += '<th class ="headerInfo" width = 16% id="descCell_">'+desc_col_title+'</th>';
		quoteInfo += '<th class ="headerInfo" width = 16% id="finishCell_">'+finish_col_title+'</th>';
		quoteInfo += '<th class ="headerInfo" width = 5%>PLAN QTY</th>';
		quoteInfo += '<th class ="headerInfo" width = 5%>NEW QTY</th>';
		quoteInfo += '<th class ="headerInfo" width = 10% id="listPriceCell_">'+listPrice_col_title+'</th>';
		quoteInfo += '<th class ="headerInfo" width = 10% id="sellPriceCell_">'+sellPrice_col_title+'</th>';
		quoteInfo += '<th class ="headerInfo" width = 10% id="totalCell_">'+total_col_title+'</th>';
		//quoteInfo += '<th class ="imgHeader" colspan=2></th>';
		quoteInfo += '<th class ="imgHeader" width = 4%></th>';
		//quoteInfo += '<th class ="imgHeader"></th>';
		quoteInfo += '</tr>';
		///////////////////////////////////////////
	
	}
	
	return quoteInfo; 

} // end of headerRows()
//////////////////////////////////////////////////

//Takes every thing from the floor plan and generates table rows 
//////////////////////////////////////////////////
function bomRows(style,lineNum){

	var quoteInfo = ""; 

	if (style == "edit"){
		if(quote_type == "midmarket" || quote_type == "inwood"){
			for(var i = 0 ; i < bom_array.length; i++){
				var finish = false; 
				var bool; 
				var bool2; 

				if(i%2==0){
					cssInfoClass = "infoOdd";
					cssTotalClass = "totalOdd";
				}
				else{
					cssInfoClass = "infoEven"; 
					cssTotalClass = "totalEven";
				}

				quoteInfo += '<tr class='+cssInfoClass+'>';

				//SERIES FIELD
				/////////////////////////////
				//quoteInfo += '<td id="q_itemmenu_'+i+'">'+ bom_array[i].series + '</td>';
				//quoteInfo += '<td  id="seriesCell_'+i+'" style="visibility:'+seriesCell_visibility+'">'+ bom_array[i].series + '</td>';
				
				if(navigator.appName.indexOf("Microsoft") != -1){//ie 
					if(bom_array[i].newseries != "null" && bom_array[i].newseries != null && bom_array[i].newseries != "undefined" && bom_array[i].newseries != undefined && bom_array[i].newseries != "")
						quoteInfo += '<td id="seriesCell_'+i+'"  style="visibility:'+seriesCell_visibility+'"><textarea id="series_'+i+'"  class="seriesIE" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)">'+bom_array[i].newseries+'</textarea></td>';
					else
						quoteInfo += '<td id="seriesCell_'+i+'"  style="visibility:'+seriesCell_visibility+'"><textarea id="series_'+i+'"  class="seriesIE" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)">'+bom_array[i].series+'</textarea></td>';
				}
				else{//firefox
				
					if(bom_array[i].newseries != "null" && bom_array[i].newseries != null && bom_array[i].newseries != "undefined" && bom_array[i].newseries != undefined && bom_array[i].newseries != ""){
						rows = computeRows("dummy_series",bom_array[i].newseries,dummySeries_height)
						quoteInfo += '<td id="seriesCell_'+i+'"  style="visibility:'+seriesCell_visibility+'"><textarea rows='+rows+' id="series_'+i+'"  class="seriesFF" onkeypress="return noSpecialChars(event)"onchange="updateBomProduct(this.id,this.value)" oninput=computeRows("dummy_series",this.value,dummySeries_height,this.id) >'+bom_array[i].newseries+'</textarea></td>';
					}
					else{
						rows = computeRows("dummy_series",bom_array[i].series,dummySeries_height)
						quoteInfo += '<td id="seriesCell_'+i+'"  style="visibility:'+seriesCell_visibility+'"><textarea rows='+rows+' id="series_'+i+'"  class="seriesFF" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)" oninput=computeRows("dummy_series",this.value,dummySeries_height,this.id) >'+bom_array[i].series+'</textarea></td>';
					}
					/*if(bom_array[i].series == "null")
						quoteInfo += '<td id="seriesCell_'+i+'" style="visibility:'+seriesCell_visibility+'"><input type="text" value="" id="series_'+i+'"  class="series" onkeypress="return noSpecialChars(event)" onblur="newfunction"/></td>';
					else
						quoteInfo += '<td id="seriesCell_'+i+'" style="visibility:'+seriesCell_visibility+'"><input type="text" value="'+bom_array[i].series+'" id="series_'+i+'"  class="series" onkeypress="return noSpecialChars(event)" onblur="newfunction"/></td>';*/
				}
				//////////////////////////////

				// SKU FIELD
				///////////////////////////
				//quoteInfo += '<td id="q_skunum_'+i+'">' + bom_array[i].colorSku + '</td>';
				//quoteInfo += '<td id="skuCell_'+i+'" style="visibility:'+skuCell_visibility+'">' + bom_array[i].colorSku.toString() + '</td>';
				
				if(navigator.appName.indexOf("Microsoft") != -1){//ie 
					if(bom_array[i].newsku != "null" && bom_array[i].newsku != null && bom_array[i].newsku != "undefined" && bom_array[i].newsku != undefined && bom_array[i].newsku != "")
						quoteInfo += '<td id="skuCell_'+i+'" style="visibility:'+skuCell_visibility+'"><textarea id="sku_'+i+'"  class="skuIE" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)">'+bom_array[i].newsku+'</textarea></td>';
					else
						quoteInfo += '<td id="skuCell_'+i+'" style="visibility:'+skuCell_visibility+'"><textarea id="sku_'+i+'"  class="skuIE" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)">'+bom_array[i].colorSku.toString()+'</textarea></td>';
				}
				else{//firefox
					if(bom_array[i].newsku != "null" && bom_array[i].newsku != null && bom_array[i].newsku != "undefined" && bom_array[i].newsku != undefined && bom_array[i].newsku != ""){
						rows = computeRows("dummy_sku",bom_array[i].newsku,dummySku_height)
						quoteInfo += '<td id="skuCell_'+i+'" style="visibility:'+skuCell_visibility+'"><textarea rows='+rows+' id="sku_'+i+'"  class="skuFF" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)" oninput=computeRows("dummy_sku",this.value,dummySku_height,this.id)>'+bom_array[i].newsku+'</textarea></td>';
					}
					else{
						rows = computeRows("dummy_sku",bom_array[i].colorSku.toString(),dummySku_height)
						quoteInfo += '<td id="skuCell_'+i+'" style="visibility:'+skuCell_visibility+'"><textarea rows='+rows+' id="sku_'+i+'"  class="skuFF" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)" oninput=computeRows("dummy_sku",this.value,dummySku_height,this.id)>'+bom_array[i].colorSku.toString()+'</textarea></td>';
					}
					/*(if(bom_array[i].sku == "null")
						quoteInfo += '<td id="skuCell_'+i+'" style="visibility:'+skuCell_visibility+'"><input type="text" value="" id="sku_'+i+'"  class="sku" onkeypress="return noSpecialChars(event)" onblur="newfunction"/></td>';
					else
						quoteInfo += '<td id="skuCell_'+i+'" style="visibility:'+skuCell_visibility+'"><input type="text" value="'+bom_array[i].colorSku.toString()+'" id="sku_'+i+'"  class="sku" onkeypress="return noSpecialChars(event)" onblur="newfunction"/></td>';*/
				}
				/////////////////////////////

				// DESCRIPTION FIELD
				///////////////////
				//quoteInfo += '<td id="q_itemdesc_'+i+'">' + bom_array[i].productName + '</td>'; 
				//quoteInfo += '<td id="descCell_'+i+'" style="visibility:'+descCell_visibility+'">' + bom_array[i].productName + '</td>'; 
				
				if(navigator.appName.indexOf("Microsoft") != -1){//ie 
					if(bom_array[i].newdesc != "null" && bom_array[i].newdesc != null && bom_array[i].newdesc != "undefined" && bom_array[i].newdesc != undefined && bom_array[i].newdesc != "")
						quoteInfo += '<td id="descCell_'+i+'" style="visibility:'+descCell_visibility+'" ><textarea  id="desc_'+i+'"  class="descIE" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)">'+bom_array[i].newdesc+'</textarea></td>';
					else 
						quoteInfo += '<td id="descCell_'+i+'" style="visibility:'+descCell_visibility+'" ><textarea  id="desc_'+i+'"  class="descIE" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)">'+bom_array[i].productName+'</textarea></td>';
				}
				else{//firefox
					if(bom_array[i].newdesc != "null" && bom_array[i].newdesc != null && bom_array[i].newdesc != "undefined" && bom_array[i].newdesc != undefined && bom_array[i].newdesc != ""){
						rows = computeRows("dummy_desc",bom_array[i].newdesc,dummyDesc_height)
						quoteInfo += '<td id="descCell_'+i+'" style="visibility:'+descCell_visibility+'" ><textarea  rows='+rows+' id="desc_'+i+'"  class="descFF" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)" oninput=computeRows("dummy_desc",this.value,dummyDesc_height,this.id)>'+bom_array[i].newdesc+'</textarea></td>';
					}
					else{
						rows = computeRows("dummy_desc",bom_array[i].productName,dummyDesc_height)
						quoteInfo += '<td id="descCell_'+i+'" style="visibility:'+descCell_visibility+'" ><textarea  rows='+rows+' id="desc_'+i+'"  class="descFF" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)" oninput=computeRows("dummy_desc",this.value,dummyDesc_height,this.id)>'+bom_array[i].productName+'</textarea></td>';
					}
					/*if(bom_array[i].productName == "null")
						quoteInfo += '<td id="descCell_'+i+'" style="visibility:'+descCell_visibility+'" ><input type="text" value="" id="desc_'+i+'"  class="desc" onkeypress="return noSpecialChars(event)" onblur="newfunction"/></td>';
					else 
						quoteInfo += '<td id="descCell_'+i+'" style="visibility:'+descCell_visibility+'" ><input type="text" value="'+bom_array[i].productName+'" id="desc_'+i+'"  class="desc" onkeypress="return noSpecialChars(event)" onblur="newfunction"/></td>';*/
				}
				////////////////

				//// FINISH FIELD 
				//////////////////////////////////
				for ( var g = 0; g < color_array.length; g++) {
					if (color_array[g].file_name == bom_array[i].colorSelector) {
						/////////////////////////////
						if (bom_array[i].sku.indexOf("%") != -1  /*&& 
						((_root.bom_array[i].group == "Tables-Conf and Meeting") || 
						(_root.bom_array[i].parent_group_name == "TYPICAL PARTS" && _root.bom_array[i].group == "Conference Tables") || 
						(_root.bom_array[i].parent_group_name == "TYPICAL PARTS" && _root.bom_array[i].group == "Conference Tables") || 
						(_root.bom_array[i].group == "Tables-Conf and Meeting" && _root.bom_array[i].parent_group_name == "Conference Tables") || 
						(_root.bom_array[i].group == "Tables-Training and Meeting" && _root.bom_array[i].parent_group_name == "Officeworks Tables")) 
						((bom_array[i].group == "Tables-Conference" && bom_array[i].parent_group == "Conference Tables")||
						(bom_array[i].group == "Conference Tables" && bom_array[i].parent_group == "TYPICAL PARTS") ||
						(bom_array[i].group == "Tables-Conference" && bom_array[i].parent_group == "TYPICAL PARTS") ||
						(bom_array[i].group == "Tables-Conference" && bom_array[i].parent_group == "Conf Table w/Wd Bullnose") ||
						(bom_array[i].group == "Tables-Conference" && bom_array[i].parent_group == "Racetrack Conf Tables") ||
						(bom_array[i].group == "Tables-Training and Meeting" && bom_array[i].parent_group == "Officeworks Tables")|| 
						(flash.bomConfig() == "inwood"))*/){
							//lineItem.q_itemfinish.text = _level0.color_file_data[g].hardw_desc;
							//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].hardw_desc+ '</td>';
								if (bom_array[i].sku.indexOf("^") != -1) {
									
									if (color_array[g].hardw_desc != "" && color_array[g].hardw_desc != undefined && color_array[g].hardw_desc != "" && color_array[g].hardw_desc != "undefined" && color_array[g].hardw_desc != "null" && color_array[g].hardw_desc != null) {
										//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].fab_wood_desc+"/"+color_array[g].hardw_desc + '</td>';
										//lineItem.q_itemfinish.text = _level0.color_file_data[g].fab_wood_desc+"/"+_level0.color_file_data[g].hardw_desc;
										
										if(navigator.appName.indexOf("Microsoft") != -1){//ie 
											if(bom_array[i].newfinish != "null" && bom_array[i].newfinish != null && bom_array[i].newfinish != "undefined" && bom_array[i].newfinish != undefined && bom_array[i].newfinish != "")
												quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea id="finish_'+i+'"  class="finishIE" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)">'+bom_array[i].newfinish+'</textarea></td>';
											else
												quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea id="finish_'+i+'"  class="finishIE" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)">'+color_array[g].fab_wood_desc+"/"+color_array[g].hardw_desc+'</textarea></td>';
										}
										else{//firefox
											if(bom_array[i].newfinish != "null" && bom_array[i].newfinish != null && bom_array[i].newfinish != "undefined" && bom_array[i].newfinish != undefined && bom_array[i].newfinish != ""){
												rows = computeRows("dummy_finish",bom_array[i].newfinish,dummyFinish_height)
												quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea rows='+rows+' id="finish_'+i+'"  class="finishFF" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)" oninput=computeRows("dummy_finish",this.value,dummyFinish_height,this.id)>'+bom_array[i].newfinish+'</textarea></td>';
											}
											else{
												rows = computeRows("dummy_finish",color_array[g].fab_wood_desc+"/"+color_array[g].hardw_desc,dummyFinish_height)
												quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea rows='+rows+' id="finish_'+i+'"  class="finishFF" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)" oninput=computeRows("dummy_finish",this.value,dummyFinish_height,this.id)>'+color_array[g].fab_wood_desc+"/"+color_array[g].hardw_desc+'</textarea></td>';
											}
											//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><input type="text" value="'+color_array[g].fab_wood_desc+"/"+color_array[g].hardw_desc+'" id="finish_'+i+'"  class="finish" onkeypress="return noSpecialChars(event)" onblur="newfunction"/></td>';
										}
										
									} else {
										//lineItem.q_itemfinish.text = _level0.color_file_data[g].fab_wood_desc;
										//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].fab_wood_desc + '</td>';
										
										if(navigator.appName.indexOf("Microsoft") != -1){//ie 
											if(bom_array[i].newfinish != "null" && bom_array[i].newfinish != null && bom_array[i].newfinish != "undefined" && bom_array[i].newfinish != undefined && bom_array[i].newfinish != "")
												quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea id="finish_'+i+'"  class="finishIE" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)">'+bom_array[i].newfinish+'</textarea></td>';
											else
												quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea id="finish_'+i+'"  class="finishIE" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)">'+color_array[g].fab_wood_desc+'</textarea></td>';
										}
										else{//firefox
											if(bom_array[i].newfinish != "null" && bom_array[i].newfinish != null && bom_array[i].newfinish != "undefined" && bom_array[i].newfinish != undefined && bom_array[i].newfinish != ""){
												rows = computeRows("dummy_finish",bom_array[i].newfinish,dummyFinish_height)
												quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea rows='+rows+' id="finish_'+i+'"  class="finishFF" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)" oninput=computeRows("dummy_finish",this.value,dummyFinish_height,this.id)>'+bom_array[i].newfinish+'</textarea></td>';
											}
											else{
												rows = computeRows("dummy_finish",color_array[g].fab_wood_desc,dummyFinish_height)
												quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea rows='+rows+' id="finish_'+i+'"  class="finishFF" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)" oninput=computeRows("dummy_finish",this.value,dummyFinish_height,this.id)>'+color_array[g].fab_wood_desc+'</textarea></td>';
											}
											//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><input type="text" value="'+color_array[g].fab_wood_desc+'" id="finish_'+i+'"  class="finish" onkeypress="return noSpecialChars(event)" onblur="newfunction"/></td>';
										}
										
									}
									//lineItem.q_itemfinish_2.text = "N/A";
								} else {
									if (flash.bomConfig() == "inwood") {
										//lineItem.q_itemfinish.text = _level0.color_file_data[g].fab_wood_desc;
										//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].fab_wood_desc + '</td>';
										
										if(navigator.appName.indexOf("Microsoft") != -1){//ie 
											if(bom_array[i].newfinish != "null" && bom_array[i].newfinish != null && bom_array[i].newfinish != "undefined" && bom_array[i].newfinish != undefined && bom_array[i].newfinish != "")
												quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea id="finish_'+i+'"  class="finishIE" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)">'+bom_array[i].newfinish+'</textarea></td>';
											else
												quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea id="finish_'+i+'"  class="finishIE" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)">'+color_array[g].hardw_desc+'</textarea></td>';
										}
										else{//firefox
											if(bom_array[i].newfinish != "null" && bom_array[i].newfinish != null && bom_array[i].newfinish != "undefined" && bom_array[i].newfinish != undefined && bom_array[i].newfinish != ""){
												rows = computeRows("dummy_finish",bom_array[i].newfinish,dummyFinish_height)
												quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea rows='+rows+' id="finish_'+i+'"  class="finishFF" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)" oninput=computeRows("dummy_finish",this.value,dummyFinish_height,this.id)>'+bom_array[i].newfinish+'</textarea></td>';
											}
											else{
												rows = computeRows("dummy_finish",color_array[g].fab_wood_desc,dummyFinish_height)
												quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea rows='+rows+' id="finish_'+i+'"  class="finishFF" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)" oninput=computeRows("dummy_finish",this.value,dummyFinish_height,this.id)>'+color_array[g].hardw_desc+'</textarea></td>';
											}
											//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><input type="text" value="'+color_array[g].fab_wood_desc+'" id="finish_'+i+'"  class="finish" onkeypress="return noSpecialChars(event)" onblur="newfunction"/></td>';
										}
										
									} else {
										//lineItem.q_itemfinish.text = _level0.color_file_data[g].hardw_desc;
										//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].hardw_desc + '</td>';
										
										if(navigator.appName.indexOf("Microsoft") != -1){//ie 
											if(bom_array[i].newfinish != "null" && bom_array[i].newfinish != null && bom_array[i].newfinish != "undefined" && bom_array[i].newfinish != undefined && bom_array[i].newfinish != "")
												quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea id="finish_'+i+'"  class="finishIE" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)">'+bom_array[i].newfinish+'</textarea></td>';
											else
												quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea id="finish_'+i+'"  class="finishIE" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)">'+color_array[g].hardw_desc+'</textarea></td>';
										}
										else{//firefox
											if(bom_array[i].newfinish != "null" && bom_array[i].newfinish != null && bom_array[i].newfinish != "undefined" && bom_array[i].newfinish != undefined && bom_array[i].newfinish != ""){
												rows = computeRows("dummy_finish",bom_array[i].newfinish,dummyFinish_height)
												quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea rows='+rows+' id="finish_'+i+'"  class="finishFF" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)" oninput=computeRows("dummy_finish",this.value,dummyFinish_height,this.id)>'+bom_array[i].newfinish+'</textarea></td>';
											}
											else{
												rows = computeRows("dummy_finish",color_array[g].hardw_desc,dummyFinish_height)
												quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea rows='+rows+' id="finish_'+i+'"  class="finishFF" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)" oninput=computeRows("dummy_finish",this.value,dummyFinish_height,this.id)>'+color_array[g].hardw_desc+'</textarea></td>';
											}
											//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><input type="text" value="'+color_array[g].hardw_desc+'" id="finish_'+i+'"  class="finish" onkeypress="return noSpecialChars(event)" onblur="newfunction"/></td>';
										}
									}
									//lineItem.q_itemfinish_2.text = "N/A";
								
							}
						}
					
					/////////////////////////////
						else{
							if(color_array[g].fab_wood_desc == "null" || color_array[g].fab_wood_desc == null || color_array[g].fab_wood_desc == "")
								color_array[g].fab_wood_desc = 'N/A';
							// hard coded for inwood/midmarket
							//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].fab_wood_desc + '</td>';
							
							if(navigator.appName.indexOf("Microsoft") != -1){//ie 
								if(bom_array[i].newfinish != "null" && bom_array[i].newfinish != null && bom_array[i].newfinish != "undefined" && bom_array[i].newfinish != undefined && bom_array[i].newfinish != "")
									quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea id="finish_'+i+'"  class="finishIE" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)">'+bom_array[i].newfinish+'</textarea></td>';
								else
									quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea id="finish_'+i+'"  class="finishIE" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)">'+color_array[g].fab_wood_desc+'</textarea></td>';
							}
							else{//firefox
								if(bom_array[i].newfinish != "null" && bom_array[i].newfinish != null && bom_array[i].newfinish != "undefined" && bom_array[i].newfinish != undefined && bom_array[i].newfinish != ""){
									rows = computeRows("dummy_finish",bom_array[i].newfinish,dummyFinish_height)
									quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea rows='+rows+' id="finish_'+i+'"  class="finishFF" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)" oninput=computeRows("dummy_finish",this.value,dummyFinish_height,this.id)>'+bom_array[i].newfinish+'</textarea></td>';
								}
								else{
									rows = computeRows("dummy_finish",color_array[g].fab_wood_desc,dummyFinish_height)
									quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea rows='+rows+' id="finish_'+i+'"  class="finishFF" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)" oninput=computeRows("dummy_finish",this.value,dummyFinish_height,this.id)>'+color_array[g].fab_wood_desc+'</textarea></td>';
								}
								//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><input type="text" value="'+color_array[g].fab_wood_desc+'" id="finish_'+i+'"  class="finish" onkeypress="return noSpecialChars(event)" onblur="newfunction"/></td>';
							}
						}
		
						finish = true; 
						break; 
					}
				}
				if (finish == false){

					//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">N/A</td>';
					
					if(navigator.appName.indexOf("Microsoft") != -1){//ie 
						if(bom_array[i].newfinish != "null" && bom_array[i].newfinish != null && bom_array[i].newfinish != "undefined" && bom_array[i].newfinish != undefined && bom_array[i].newfinish != "")
							quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea id="finish_'+i+'"  class="finishIE" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)">'+bom_array[i].newfinish+'</textarea></td>';
						else
							quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea id="finish_'+i+'"  class="finishIE" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)">N/A</textarea></td>';
					}
					else{//firefox
						if(bom_array[i].newfinish != "null" && bom_array[i].newfinish != null && bom_array[i].newfinish != "undefined" && bom_array[i].newfinish != undefined && bom_array[i].newfinish != ""){
							rows = computeRows("dummy_finish",bom_array[i].newfinish,dummyFinish_height)
							quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea rows='+rows+' id="finish_'+i+'"  class="finishFF" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)" oninput=computeRows("dummy_finish",this.value,dummyFinish_height,this.id)>'+bom_array[i].newfinish+'</textarea></td>';
						}
						else{
							rows = computeRows("dummy_finish","N/A",dummyFinish_height)
							quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><textarea rows='+rows+' id="finish_'+i+'"  class="finishFF" onkeypress="return noSpecialChars(event)" onchange="updateBomProduct(this.id,this.value)" oninput=computeRows("dummy_finish",this.value,dummyFinish_height,this.id)>N/A</textarea></td>';
						}
						//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'"><input type="text" value="N/A" id="finish_'+i+'"  class="finish" onkeypress="return noSpecialChars(event)" onblur="newfunction"/></td>';
					}
				}
				///////////////////////////////////////////////

				// QUANTITY FIELD
				/////////////////////

				quoteInfo += '<td id="quantCell_'+i+'" align="right">'+ bom_array[i].quant + '</td>';
				/////////////////////////

				// NEW QUANTITY FIELD
				/////////////////////
				if (bom_array[i].newQuant == "undefined" || bom_array[i].newQuant == undefined || bom_array[i].newQuant == null || bom_array[i].newQuant == "null" || bom_array[i].newQuant == "" ){
					quoteInfo += '<td id ="newQuantCell_'+i+'" ><input type="text" value ="" id="newQuant_'+i+'"  class="newQuant" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateNewTotal(bool,this.value,'+i+')" onchange="updateQty('+i+')"/></td>';//onblur="updateQty('+i+')"></td>';
				}
				else{

					quoteInfo += '<td id ="newQuantCell_'+i+'" ><input type="text" value ="'+bom_array[i].newQuant+'" id="newQuant_'+i+'"  class="newQuant" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateNewTotal(bool,this.value,'+i+')" onchange="updateQty('+i+')"/></td>';// onblur="updateQty('+i+')"></td>';

				}
				/////////////////////////

				// LIST PRICE FIELD 
				///////////////////////////

				//quoteInfo += '<td id="listPriceCell_'+i+'" style="visibility:'+listPriceCell_visibility+'" align="right">$'+ formatCurrency(bom_array[i].un_price)+ '</td>'; 
				//alert(bom_array[i].un_price);
				if(bom_array[i].newlistPrice != "null" && bom_array[i].newlistPrice != null && bom_array[i].newlistPrice != "undefined" && bom_array[i].newlistPrice != undefined && bom_array[i].newlistPrice != "" ){
					if(bom_array[i].newlistPrice == 0 ){
						quoteInfo += '<td id="listPriceCell_'+i+'" style="visibility:'+listPriceCell_visibility+'"><input type="text" value="" id="listPrice_'+i+'"  class="listPrice" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateProductSell(bool,'+i+')" onchange="updateBomListPrice('+i+')"/></td>';
					}
					else{
						quoteInfo += '<td id="listPriceCell_'+i+'" style="visibility:'+listPriceCell_visibility+'"><input type="text" value="'+parseFloat(bom_array[i].newlistPrice).toFixed(2)+'" id="listPrice_'+i+'"  class="listPrice" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateProductSell(bool,'+i+')" onchange="updateBomListPrice('+i+')"/></td>';
					}	
				}
				else{
					if(bom_array[i].un_price == 1){ // Generic Planner 
						quoteInfo += '<td id="listPriceCell_'+i+'" style="visibility:'+listPriceCell_visibility+'"><input type="text" value="" id="listPrice_'+i+'"  class="listPrice" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateProductSell(bool,'+i+')" onchange="updateBomListPrice('+i+')"/></td>';
					}
					else{
						quoteInfo += '<td id="listPriceCell_'+i+'" style="visibility:'+listPriceCell_visibility+'"><input type="text" value="'+parseFloat(bom_array[i].un_price).toFixed(2)+'" id="listPrice_'+i+'"  class="listPrice" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateProductSell(bool,'+i+')" onchange="updateBomListPrice('+i+')"/></td>';
					}
				}
				///////////////////////////


				// DISCOUNT FIELD
				//////////////////////////
				if (bom_array[i].disc != undefined && bom_array[i].disc != "undefined" && bom_array[i].disc != 0 && bom_array[i].disc != null && bom_array[i].disc != "null") {

					//quoteInfo += '<td id="discountCell_'+i+'" style="visibility:'+discountCell_visibility+'"><input type="text" value ="'+bom_array[i].disc+'" id="discount_'+i+'"    class="discount" onfocus="bool =  false" onkeypress="return bool = onlyNumbers(event)" onkeydown="return bool = onlyNumbers2(event)" onkeyup="generateSell(bool,this.value,'+i+','+bom_array[i].un_price+')" onblur="updatePlanner('+i+')"/> </td>';//onblur="updatePlanner('+i+')"></td>'; 
					quoteInfo += '<td id="discountCell_'+i+'" style="visibility:'+discountCell_visibility+'"><input type="text" value ="'+bom_array[i].disc+'" id="discount_'+i+'"    class="discount" onfocus="bool =  false" onkeypress="return bool = onlyNumbers(event)" onkeydown="return bool = onlyNumbers2(event)" onkeyup="generateProductSell(bool,'+i+')" onblur="updatePlanner('+i+')"/> </td>';//onblur="updatePlanner('+i+')"></td>'; 


				} else {
					//quoteInfo += '<td id="discountCell_'+i+'" style="visibility:'+discountCell_visibility+'"><input type="text" value ="" id="discount_'+i+'"   class="discount" onfocus="bool =  false" onkeypress="return bool = onlyNumbers(event)" onkeydown="return bool = onlyNumbers2(event)" onkeyup="generateSell(bool,this.value,'+i+','+bom_array[i].un_price+')" onblur="updatePlanner('+i+')"/></td>';//onblur="updatePlanner('+i+')"></td>'; 
					quoteInfo += '<td id="discountCell_'+i+'" style="visibility:'+discountCell_visibility+'"><input type="text" value ="" id="discount_'+i+'"   class="discount" onfocus="bool =  false" onkeypress="return bool = onlyNumbers(event)" onkeydown="return bool = onlyNumbers2(event)" onkeyup="generateProductSell(bool,'+i+')" onblur="updatePlanner('+i+')"/></td>';//onblur="updatePlanner('+i+')"></td>'; 
				}
				///////////////////////////////////

				// SELL PRICE FIELD
				///////////////////////////////////
				//onkeypress="return onlyNumbers(event)" 
				//if (bom_array[i].newPrice == "undefined" || bom_array[i].newPrice == undefined || bom_array[i].newPrice == 0 || bom_array[i].newPrice == null || bom_array[i].newPrice == "null" ){
				if (bom_array[i].newPrice == "undefined" || bom_array[i].newPrice == undefined || bom_array[i].newPrice == null || bom_array[i].newPrice == "null" ){
			
					if((flash.bomConfig() == "inwood") || (flash.bomConfig() == "midmarket" && flash.dealerLevel() == "1"))
						quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'"><input type="text" value ="" id= "sellPrice_'+i+'"   class="sellPrice"  onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)"  onkeyup="generateProductTotal(bool,this.value,'+i+')" onblur="updatePlanner('+i+')"/></td>';// onblur="updatePlanner('+i+')"></td>';
					else if(flash.bomConfig() == "midmarket" && flash.dealerLevel() != "1")
						quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'"><input type="text" value ="'+parseFloat(bom_array[i].ass_price).toFixed(2)+'" id= "sellPrice_'+i+'"   class="sellPrice"  onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)"  onkeyup="generateProductTotal(bool,this.value,'+i+')" onblur="updatePlanner('+i+')"/></td>';// onblur="updatePlanner('+i+')"></td>';

				}
				else{
					if(newSellPrice(bom_array[i].disc,bom_array[i].un_price,bom_array[i].newlistPrice,bom_array[i].newPrice) == 0)
						quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'"><input type="text" value ="" id="sellPrice_'+i+'" class="sellPrice"  onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)"  onkeyup="generateProductTotal(bool,this.value,'+i+')" onblur="updatePlanner('+i+')"/></td>';// onblur="updatePlanner('+i+')"></td>';
					else 
						quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'"><input type="text" value ="'+parseFloat(newSellPrice(bom_array[i].disc,bom_array[i].un_price,bom_array[i].newlistPrice,bom_array[i].newPrice)).toFixed(2)+'" id="sellPrice_'+i+'" class="sellPrice"  onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)"  onkeyup="generateProductTotal(bool,this.value,'+i+')" onblur="updatePlanner('+i+')"/></td>';// onblur="updatePlanner('+i+')"></td>';
				
					//quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'"><input type="text" value ="'+parseFloat(bom_array[i].newPrice).toFixed(2)+'" id="sellPrice_'+i+'" class="sellPrice"  onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)"  onkeyup="generateTotal(bool,this.value,'+i+')" onblur="updatePlanner('+i+')"/></td>';// onblur="updatePlanner('+i+')"></td>';
				}
				////////////////////////////////////


				// TOTAL PRICE FIELD
				/////////////////////////////////
				//if (bom_array[i].newPrice == "undefined" || bom_array[i].newPrice == undefined || bom_array[i].newPrice == 0 || bom_array[i].newPrice == null || bom_array[i].newPrice == "null"){
				if (bom_array[i].newPrice == "undefined" || bom_array[i].newPrice == undefined || bom_array[i].newPrice == null || bom_array[i].newPrice == "null"){

					if((flash.bomConfig() == "inwood") || (flash.bomConfig() == "midmarket" && flash.dealerLevel() == "1"))
						quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$0" id= "total_'+i+'" class="'+cssTotalClass+'"   readonly= "readonly"></td>';

					else if(flash.bomConfig() == "midmarket" && flash.dealerLevel() != "1"){
						if(bom_array[i].newQuant == "" || bom_array[i].newQuant == "undefined" || bom_array[i].newQuant == undefined || bom_array[i].newQuant == null || bom_array[i].newQuant == "null") {
							//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+(bom_array[i].newPrice * bom_array[i].quant).toFixed(2)+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
							quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((bom_array[i].ass_price * bom_array[i].quant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						}
						else{
							//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+(bom_array[i].newPrice * bom_array[i].newQuant).toFixed(2)+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
							quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((bom_array[i].ass_price * bom_array[i].newQuant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						}
					}
				}
				else {
					if(bom_array[i].newQuant == "" || bom_array[i].newQuant == "undefined" || bom_array[i].newQuant == undefined || bom_array[i].newQuant == null || bom_array[i].newQuant == "null") {
						//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+(bom_array[i].newPrice * bom_array[i].quant).toFixed(2)+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((bom_array[i].newPrice * bom_array[i].quant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((newSellPrice(bom_array[i].disc,bom_array[i].un_price,bom_array[i].newlistPrice,bom_array[i].newPrice) * bom_array[i].quant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';	
					}
					else{
						//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+(bom_array[i].newPrice * bom_array[i].newQuant).toFixed(2)+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((bom_array[i].newPrice * bom_array[i].newQuant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((newSellPrice(bom_array[i].disc,bom_array[i].un_price,bom_array[i].newlistPrice,bom_array[i].newPrice) * bom_array[i].newQuant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
					}
				}
				////////////////////////////////

				////OPTIONS FIELDS
				////////////////////////////
				//quoteInfo += '<td id="option1_'+i+'" class = "imgInfo" ></td>';
				quoteInfo += '<td id="option_'+i+'" class = "imgInfo" ></td>';

				////////////////////////
				quoteInfo += '</tr>'; 
			}

		}//end if 

		else if (quote_type == "midmarketLocked" || quote_type == "inwoodLocked"){
			for(var i = 0 ; i < bom_array.length; i++){
				var finish = false; 
				var bool; 
				var bool2; 

				if(i%2==0){
					cssInfoClass = "infoOdd";
					cssTotalClass = "totalOdd";
				}
				else{
					cssInfoClass = "infoEven"; 
					cssTotalClass = "totalEven";
				}

				quoteInfo += '<tr class='+cssInfoClass+'>';

				//SERIES FIELD
				/////////////////////////////
				//quoteInfo += '<td id="q_itemmenu_'+i+'">'+ bom_array[i].series + '</td>';
				if(bom_array[i].newseries != "null" && bom_array[i].newseries != null && bom_array[i].newseries != "undefined" && bom_array[i].newseries != undefined && bom_array[i].newseries != ""){
					quoteInfo += '<td id="seriesCell_'+i+'" style="visibility:'+seriesCell_visibility+'">'+ bom_array[i].newseries + '</td>';
				}
				else {
					quoteInfo += '<td id="seriesCell_'+i+'" style="visibility:'+seriesCell_visibility+'">'+ bom_array[i].series + '</td>';
				}
				//////////////////////////////

				//SKU FIELD
				///////////////////////////
				//quoteInfo += '<td id="q_skunum_'+i+'">' + bom_array[i].colorSku + '</td>';
				if(bom_array[i].newsku != "null" && bom_array[i].newsku != null && bom_array[i].newsku != "undefined" && bom_array[i].newsku != undefined && bom_array[i].newsku != ""){
					quoteInfo += '<td id="skuCell_'+i+'" style="visibility:'+skuCell_visibility+'">' + bom_array[i].newsku + '</td>';
				}
				else{
					quoteInfo += '<td id="skuCell_'+i+'" style="visibility:'+skuCell_visibility+'">' + bom_array[i].colorSku.toString() + '</td>';
				}
				/////////////////////////////

				// DESCRIPTION FIELD
				///////////////////
				//quoteInfo += '<td id="q_itemdesc_'+i+'">' + bom_array[i].productName + '</td>'; 
				if(bom_array[i].newdesc != "null" && bom_array[i].newdesc != null && bom_array[i].newdesc != "undefined" && bom_array[i].newdesc != undefined && bom_array[i].newdesc != ""){
					quoteInfo += '<td id="descCell_'+i+'" style="visibility:'+descCell_visibility+'">' + bom_array[i].newdesc + '</td>';
				}
				else{
					quoteInfo += '<td id="descCell_'+i+'" style="visibility:'+descCell_visibility+'">' + bom_array[i].productName + '</td>';
				}
				////////////////

				//// FINISH FIELD 
				//////////////////////////////////
				/*alert(bom_array[i].sku); 
				alert(bom_array[i].group + " : " + bom_array[i].parent_group); */
				if(bom_array[i].newfinish != "null" && bom_array[i].newfinish != null && bom_array[i].newfinish != "undefined" && bom_array[i].newfinish != undefined && bom_array[i].newfinish != ""){
					quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + bom_array[i].newfinish + '</td>';
				}
				else{
					for ( var g = 0; g < color_array.length; g++) {
						if (color_array[g].file_name == bom_array[i].colorSelector) {
						/////////////////////////////
							if (bom_array[i].sku.indexOf("%") != -1  /*&& 
								((_root.bom_array[i].group == "Tables-Conf and Meeting") || 
								(_root.bom_array[i].parent_group_name == "TYPICAL PARTS" && _root.bom_array[i].group == "Conference Tables") || 
								(_root.bom_array[i].parent_group_name == "TYPICAL PARTS" && _root.bom_array[i].group == "Conference Tables") || 
								(_root.bom_array[i].group == "Tables-Conf and Meeting" && _root.bom_array[i].parent_group_name == "Conference Tables") || 
								(_root.bom_array[i].group == "Tables-Training and Meeting" && _root.bom_array[i].parent_group_name == "Officeworks Tables")) 
								((bom_array[i].group == "Tables-Conference" && bom_array[i].parent_group == "Conference Tables")||
								(bom_array[i].group == "Conference Tables" && bom_array[i].parent_group == "TYPICAL PARTS") ||
								(bom_array[i].group == "Tables-Conference" && bom_array[i].parent_group == "TYPICAL PARTS") ||
								(bom_array[i].group == "Tables-Conference" && bom_array[i].parent_group == "Conf Table w/Wd Bullnose") ||
								(bom_array[i].group == "Tables-Conference" && bom_array[i].parent_group == "Racetrack Conf Tables") ||
								(bom_array[i].group == "Tables-Training and Meeting" && bom_array[i].parent_group == "Officeworks Tables")|| 
								(flash.bomConfig() == "inwood"))*/){
								//lineItem.q_itemfinish.text = _level0.color_file_data[g].hardw_desc;
								//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].hardw_desc+ '</td>';
									if (bom_array[i].sku.indexOf("^") != -1) {
										
										if (color_array[g].hardw_desc != "" && color_array[g].hardw_desc != undefined && color_array[g].hardw_desc != "" && color_array[g].hardw_desc != "undefined" && color_array[g].hardw_desc != "null" && color_array[g].hardw_desc != null) {
										
											quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].fab_wood_desc+"/"+color_array[g].hardw_desc + '</td>';
										
											//lineItem.q_itemfinish.text = _level0.color_file_data[g].fab_wood_desc+"/"+_level0.color_file_data[g].hardw_desc;
										} else {
											//lineItem.q_itemfinish.text = _level0.color_file_data[g].fab_wood_desc;
											
											quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].fab_wood_desc + '</td>';
											
										}
										//lineItem.q_itemfinish_2.text = "N/A";
									} else {
										if (flash.bomConfig() == "inwood") {
											//lineItem.q_itemfinish.text = _level0.color_file_data[g].fab_wood_desc;
											quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].hardw_desc + '</td>';
											
										} else {
											//lineItem.q_itemfinish.text = _level0.color_file_data[g].hardw_desc;
										
											quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].hardw_desc + '</td>';
											
											//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">testing1</td>';
										}
										//lineItem.q_itemfinish_2.text = "N/A";
									
									}
							}
						
						/////////////////////////////
							else {
							if(color_array[g].fab_wood_desc == "null" || color_array[g].fab_wood_desc == null || color_array[g].fab_wood_desc == "")
								color_array[g].fab_wood_desc = 'N/A';
							// hard coded for inwood/midmarket
							quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].fab_wood_desc + '</td>';
							//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">testing2</td>';
							}

							finish = true; 
							break; 
						}
					}
					if (finish == false){

						quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">N/A</td>';
					}
				}
				///////////////////////////////////////////////

				// QUANTITY FIELD
				/////////////////////

				quoteInfo += '<td id="quantCell_'+i+'" align="right">'+ bom_array[i].quant + '</td>';
				/////////////////////////

				// NEW QUANTITY FIELD
				/////////////////////
				if (bom_array[i].newQuant == "undefined" || bom_array[i].newQuant == undefined || bom_array[i].newQuant == null || bom_array[i].newQuant == "null" || bom_array[i].newQuant == "" ){
					quoteInfo += '<td id ="newQuantCell_'+i+'" align="right"></td>';//onblur="updateQty('+i+')"></td>';
				}
				else{

					quoteInfo += '<td id ="newQuantCell_'+i+'" align="right">'+bom_array[i].newQuant+'</td>';// onblur="updateQty('+i+')"></td>';

				}
				/////////////////////////

				// LIST PRICE FIELD 
				///////////////////////////
				if(bom_array[i].newlistPrice != "null" && bom_array[i].newlistPrice != null && bom_array[i].newlistPrice != "undefined" && bom_array[i].newlistPrice != undefined && bom_array[i].newlistPrice != ""){
					if(bom_array[i].newlistPrice == 0 ){
						quoteInfo += '<td id="listPriceCell_'+i+'" style="visibility:'+listPriceCell_visibility+'" align="right"></td>'; 
					}
					else{
						quoteInfo += '<td id="listPriceCell_'+i+'" style="visibility:'+listPriceCell_visibility+'" align="right">$'+ formatCurrency((bom_array[i].newlistPrice))+ '</td>'; 
					}
				}
				else{
					if(bom_array[i].un_price == 1){ // Generic Planner 
						quoteInfo += '<td id="listPriceCell_'+i+'" style="visibility:'+listPriceCell_visibility+'" align="right"></td>'; 
					}
					else{
						quoteInfo += '<td id="listPriceCell_'+i+'" style="visibility:'+listPriceCell_visibility+'" align="right">$'+ formatCurrency((bom_array[i].un_price))+ '</td>'; 
					}
				}
				///////////////////////////


				// DISCOUNT FIELD
				//////////////////////////
				/*(if (bom_array[i].disc != undefined && bom_array[i].disc != "undefined" && bom_array[i].disc != 0 && bom_array[i].disc != null && bom_array[i].disc != "null") {

				quoteInfo += '<td id="discountCell_'+i+'" align="right">'+bom_array[i].disc+'</td>';//onblur="updatePlanner('+i+')"></td>'; 


				} else {
				quoteInfo += '<td id="discountCell_'+i+'" align="right"></td>';//onblur="updatePlanner('+i+')"></td>'; 
				}*/
				///////////////////////////////////

				// SELL PRICE FIELD
				///////////////////////////////////
				//onkeypress="return onlyNumbers(event)" 
				//if (bom_array[i].newPrice == "undefined" || bom_array[i].newPrice == undefined || bom_array[i].newPrice == 0 || bom_array[i].newPrice == null || bom_array[i].newPrice == "null" ){
				if (bom_array[i].newPrice == "undefined" || bom_array[i].newPrice == undefined ||  bom_array[i].newPrice == null || bom_array[i].newPrice == "null" ){
					if((flash.bomConfig() == "inwood") || (flash.bomConfig() == "midmarket" && flash.dealerLevel() == "1"))
						quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'" align="right"></td>';// onblur="updatePlanner('+i+')"></td>';
					else if(flash.bomConfig() == "midmarket" && flash.dealerLevel() != "1")
						quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'" align="right">$'+formatCurrency((bom_array[i].ass_price))+'</td>';// onblur="updatePlanner('+i+')"></td>';

				}
				else{
					if(newSellPrice(bom_array[i].disc,bom_array[i].un_price,bom_array[i].newlistPrice,bom_array[i].newPrice) == 0){
						quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'" align="right"></td>';// onblur="updatePlanner('+i+')"></td>';
					}
					else{
						//quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'" align="right">$'+formatCurrency((bom_array[i].newPrice))+'</td>';// onblur="updatePlanner('+i+')"></td>';
						quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'" align="right">$'+formatCurrency(newSellPrice(bom_array[i].disc,bom_array[i].un_price,bom_array[i].newlistPrice,bom_array[i].newPrice))+'</td>';// onblur="updatePlanner('+i+')"></td>';
					}

				}
				////////////////////////////////////


				// TOTAL PRICE FIELD
				/////////////////////////////////
				//if (bom_array[i].newPrice == "undefined" || bom_array[i].newPrice == undefined || bom_array[i].newPrice == 0 || bom_array[i].newPrice == null || bom_array[i].newPrice == "null"){
				if (bom_array[i].newPrice == "undefined" || bom_array[i].newPrice == undefined || bom_array[i].newPrice == null || bom_array[i].newPrice == "null"){
					if((flash.bomConfig() == "inwood") || (flash.bomConfig() == "midmarket" && flash.dealerLevel() == "1"))
						quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$0" id= "total_'+i+'" class="'+cssTotalClass+'"   readonly= "readonly"></td>';

					else if(flash.bomConfig() == "midmarket" && flash.dealerLevel() != "1"){
						if(bom_array[i].newQuant == "" || bom_array[i].newQuant == "undefined" || bom_array[i].newQuant == undefined || bom_array[i].newQuant == null || bom_array[i].newQuant == "null") {
							//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+(bom_array[i].newPrice * bom_array[i].quant).toFixed(2)+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
							quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((bom_array[i].ass_price * bom_array[i].quant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						}
						else{
							//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+(bom_array[i].newPrice * bom_array[i].newQuant).toFixed(2)+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
							quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((bom_array[i].ass_price * bom_array[i].newQuant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						}
					}
				}
				else {
					if(bom_array[i].newQuant == "" || bom_array[i].newQuant == "undefined" || bom_array[i].newQuant == undefined || bom_array[i].newQuant == null || bom_array[i].newQuant == "null") {
						//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+(bom_array[i].newPrice * bom_array[i].quant).toFixed(2)+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((bom_array[i].newPrice * bom_array[i].quant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((newSellPrice(bom_array[i].disc,bom_array[i].un_price,bom_array[i].newlistPrice,bom_array[i].newPrice) * bom_array[i].quant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
					}
					else{
						//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+(bom_array[i].newPrice * bom_array[i].newQuant).toFixed(2)+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((bom_array[i].newPrice * bom_array[i].newQuant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((newSellPrice(bom_array[i].disc,bom_array[i].un_price,bom_array[i].newlistPrice,bom_array[i].newPrice) * bom_array[i].newQuant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
					}
				}
				////////////////////////////////

				////OPTIONS FIELDS
				////////////////////////////
				//quoteInfo += '<td id="option1_'+i+'" class = "imgInfo" ></td>';
				quoteInfo += '<td id="option_'+i+'" class = "imgInfo" ></td>';

				////////////////////////
				quoteInfo += '</tr>'; 
			}

		}//end else if 
	}
	else if (style == "non-edit"){
		if(quote_type == "midmarket" || quote_type == "inwood"){
			for(var i = 0 ; i < bom_array.length; i++){
				var finish = false; 
				var bool; 
				var bool2; 

				if(i%2==0){
					cssInfoClass = "infoOdd";
					cssTotalClass = "totalOdd";
				}
				else{
					cssInfoClass = "infoEven"; 
					cssTotalClass = "totalEven";
				}

				quoteInfo += '<tr class='+cssInfoClass+'>';

				//SERIES FIELD
				/////////////////////////////
				//quoteInfo += '<td id="q_itemmenu_'+i+'">'+ bom_array[i].series + '</td>';
				quoteInfo += '<td  id="seriesCell_'+i+'" style="visibility:'+seriesCell_visibility+'">'+ bom_array[i].series + '</td>';
				//////////////////////////////

				// SKU FIELD
				///////////////////////////
				//quoteInfo += '<td id="q_skunum_'+i+'">' + bom_array[i].colorSku + '</td>';
				quoteInfo += '<td id="skuCell_'+i+'" style="visibility:'+skuCell_visibility+'">' + bom_array[i].colorSku.toString() + '</td>';
				/////////////////////////////

				// DESCRIPTION FIELD
				///////////////////
				//quoteInfo += '<td id="q_itemdesc_'+i+'">' + bom_array[i].productName + '</td>'; 
				quoteInfo += '<td id="descCell_'+i+'" style="visibility:'+descCell_visibility+'">' + bom_array[i].productName + '</td>'; 
				////////////////

				//// FINISH FIELD 
				//////////////////////////////////
				for ( var g = 0; g < color_array.length; g++) {
					if (color_array[g].file_name == bom_array[i].colorSelector) {
						/////////////////////////////
						if (bom_array[i].sku.indexOf("%") != -1  /*&& 
						((_root.bom_array[i].group == "Tables-Conf and Meeting") || 
						(_root.bom_array[i].parent_group_name == "TYPICAL PARTS" && _root.bom_array[i].group == "Conference Tables") || 
						(_root.bom_array[i].parent_group_name == "TYPICAL PARTS" && _root.bom_array[i].group == "Conference Tables") || 
						(_root.bom_array[i].group == "Tables-Conf and Meeting" && _root.bom_array[i].parent_group_name == "Conference Tables") || 
						(_root.bom_array[i].group == "Tables-Training and Meeting" && _root.bom_array[i].parent_group_name == "Officeworks Tables")) 
						((bom_array[i].group == "Tables-Conference" && bom_array[i].parent_group == "Conference Tables")||
						(bom_array[i].group == "Conference Tables" && bom_array[i].parent_group == "TYPICAL PARTS") ||
						(bom_array[i].group == "Tables-Conference" && bom_array[i].parent_group == "TYPICAL PARTS") ||
						(bom_array[i].group == "Tables-Conference" && bom_array[i].parent_group == "Conf Table w/Wd Bullnose") ||
						(bom_array[i].group == "Tables-Conference" && bom_array[i].parent_group == "Racetrack Conf Tables") ||
						(bom_array[i].group == "Tables-Training and Meeting" && bom_array[i].parent_group == "Officeworks Tables")|| 
						(flash.bomConfig() == "inwood"))*/){
							//lineItem.q_itemfinish.text = _level0.color_file_data[g].hardw_desc;
							//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].hardw_desc+ '</td>';
								if (bom_array[i].sku.indexOf("^") != -1) {
									
									if (color_array[g].hardw_desc != "" && color_array[g].hardw_desc != undefined && color_array[g].hardw_desc != "" && color_array[g].hardw_desc != "undefined" && color_array[g].hardw_desc != "null" && color_array[g].hardw_desc != null) {
										quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].fab_wood_desc+"/"+color_array[g].hardw_desc + '</td>';
										//lineItem.q_itemfinish.text = _level0.color_file_data[g].fab_wood_desc+"/"+_level0.color_file_data[g].hardw_desc;
									} else {
										//lineItem.q_itemfinish.text = _level0.color_file_data[g].fab_wood_desc;
										quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].fab_wood_desc + '</td>';
									}
									//lineItem.q_itemfinish_2.text = "N/A";
								} else {
									if (flash.bomConfig() == "inwood") {
										//lineItem.q_itemfinish.text = _level0.color_file_data[g].fab_wood_desc;
										quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].hardw_desc + '</td>';
									} else {
										//lineItem.q_itemfinish.text = _level0.color_file_data[g].hardw_desc;
										quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].hardw_desc + '</td>';
									}
									//lineItem.q_itemfinish_2.text = "N/A";
								
								}
						}
					
					/////////////////////////////
						else{
						if(color_array[g].fab_wood_desc == "null" || color_array[g].fab_wood_desc == null || color_array[g].fab_wood_desc == "")
							color_array[g].fab_wood_desc = 'N/A';
						// hard coded for inwood/midmarket
						quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].fab_wood_desc + '</td>';
						}
		
						finish = true; 
						break; 
					}
				}
				if (finish == false){

					quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">N/A</td>';
				}
				///////////////////////////////////////////////

				// QUANTITY FIELD
				/////////////////////

				quoteInfo += '<td id="quantCell_'+i+'" align="right">'+ bom_array[i].quant + '</td>';
				/////////////////////////

				// NEW QUANTITY FIELD
				/////////////////////
				if (bom_array[i].newQuant == "undefined" || bom_array[i].newQuant == undefined || bom_array[i].newQuant == null || bom_array[i].newQuant == "null" || bom_array[i].newQuant == "" ){
					quoteInfo += '<td id ="newQuantCell_'+i+'" ><input type="text" value ="" id="newQuant_'+i+'"  class="newQuant" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateNewTotal(bool,this.value,'+i+')" onblur="updateQty('+i+')"/></td>';//onblur="updateQty('+i+')"></td>';
				}
				else{

					quoteInfo += '<td id ="newQuantCell_'+i+'" ><input type="text" value ="'+bom_array[i].newQuant+'" id="newQuant_'+i+'"  class="newQuant" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateNewTotal(bool,this.value,'+i+')" onblur="updateQty('+i+')"/></td>';// onblur="updateQty('+i+')"></td>';

				}
				/////////////////////////

				// LIST PRICE FIELD 
				///////////////////////////
				if(bom_array[i].un_price == 1){ // Generic Planner 
					quoteInfo += '<td id="listPriceCell_'+i+'" style="visibility:'+listPriceCell_visibility+'" align="right"></td>'; 
				}
				else{
					quoteInfo += '<td id="listPriceCell_'+i+'" style="visibility:'+listPriceCell_visibility+'" align="right">$'+ formatCurrency(bom_array[i].un_price)+ '</td>'; 
				}
				///////////////////////////


				// DISCOUNT FIELD
				//////////////////////////
				if (bom_array[i].disc != undefined && bom_array[i].disc != "undefined" && bom_array[i].disc != 0 && bom_array[i].disc != null && bom_array[i].disc != "null") {

					quoteInfo += '<td id="discountCell_'+i+'" style="visibility:'+discountCell_visibility+'"><input type="text" value ="'+bom_array[i].disc+'" id="discount_'+i+'"    class="discount" onfocus="bool =  false" onkeypress="return bool = onlyNumbers(event)" onkeydown="return bool = onlyNumbers2(event)" onkeyup="generateSell(bool,this.value,'+i+','+bom_array[i].un_price+')" onblur="updatePlanner('+i+')"/> </td>';//onblur="updatePlanner('+i+')"></td>'; 


				} else {
					quoteInfo += '<td id="discountCell_'+i+'" style="visibility:'+discountCell_visibility+'"><input type="text" value ="" id="discount_'+i+'"   class="discount" onfocus="bool =  false" onkeypress="return bool = onlyNumbers(event)" onkeydown="return bool = onlyNumbers2(event)" onkeyup="generateSell(bool,this.value,'+i+','+bom_array[i].un_price+')" onblur="updatePlanner('+i+')"/></td>';//onblur="updatePlanner('+i+')"></td>'; 
				}
				///////////////////////////////////

				// SELL PRICE FIELD
				///////////////////////////////////
				//onkeypress="return onlyNumbers(event)" 
				if (bom_array[i].newPrice == "undefined" || bom_array[i].newPrice == undefined ||  bom_array[i].newPrice == null || bom_array[i].newPrice == "null" ){

					if((flash.bomConfig() == "inwood") || (flash.bomConfig() == "midmarket" && flash.dealerLevel() == "1"))
						quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'"><input type="text" value ="" id= "sellPrice_'+i+'"   class="sellPrice"  onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)"  onkeyup="generateTotal(bool,this.value,'+i+')" onblur="updatePlanner('+i+')"/></td>';// onblur="updatePlanner('+i+')"></td>';
					else if(flash.bomConfig() == "midmarket" && flash.dealerLevel() != "1")
						quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'"><input type="text" value ="'+parseFloat(bom_array[i].ass_price).toFixed(2)+'" id= "sellPrice_'+i+'"   class="sellPrice"  onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)"  onkeyup="generateTotal(bool,this.value,'+i+')" onblur="updatePlanner('+i+')"/></td>';// onblur="updatePlanner('+i+')"></td>';

				}
				else{
					if(newSellPrice(bom_array[i].disc,bom_array[i].un_price,"",bom_array[i].newPrice) == 0){
						quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'"><input type="text" value ="" id="sellPrice_'+i+'" class="sellPrice"  onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)"  onkeyup="generateTotal(bool,this.value,'+i+')" onblur="updatePlanner('+i+')"/></td>';// onblur="updatePlanner('+i+')"></td>';
					}
					else{
					//quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'"><input type="text" value ="'+parseFloat(bom_array[i].newPrice).toFixed(2)+'" id="sellPrice_'+i+'" class="sellPrice"  onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)"  onkeyup="generateTotal(bool,this.value,'+i+')" onblur="updatePlanner('+i+')"/></td>';// onblur="updatePlanner('+i+')"></td>';
						quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'"><input type="text" value ="'+parseFloat(newSellPrice(bom_array[i].disc,bom_array[i].un_price,"",bom_array[i].newPrice)).toFixed(2)+'" id="sellPrice_'+i+'" class="sellPrice"  onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)"  onkeyup="generateTotal(bool,this.value,'+i+')" onblur="updatePlanner('+i+')"/></td>';// onblur="updatePlanner('+i+')"></td>';
					}
				}
				////////////////////////////////////


				// TOTAL PRICE FIELD
				/////////////////////////////////
				if (bom_array[i].newPrice == "undefined" || bom_array[i].newPrice == undefined || bom_array[i].newPrice == null || bom_array[i].newPrice == "null"){

					if((flash.bomConfig() == "inwood") || (flash.bomConfig() == "midmarket" && flash.dealerLevel() == "1"))
						quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$0" id= "total_'+i+'" class="'+cssTotalClass+'"   readonly= "readonly"></td>';

					else if(flash.bomConfig() == "midmarket" && flash.dealerLevel() != "1"){
						if(bom_array[i].newQuant == "" || bom_array[i].newQuant == "undefined" || bom_array[i].newQuant == undefined || bom_array[i].newQuant == null || bom_array[i].newQuant == "null") {
							//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+(bom_array[i].newPrice * bom_array[i].quant).toFixed(2)+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
							quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((bom_array[i].ass_price * bom_array[i].quant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						}
						else{
							//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+(bom_array[i].newPrice * bom_array[i].newQuant).toFixed(2)+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
							quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((bom_array[i].ass_price * bom_array[i].newQuant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						}
					}
				}
				else {
					if(bom_array[i].newQuant == "" || bom_array[i].newQuant == "undefined" || bom_array[i].newQuant == undefined || bom_array[i].newQuant == null || bom_array[i].newQuant == "null") {
						//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+(bom_array[i].newPrice * bom_array[i].quant).toFixed(2)+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((bom_array[i].newPrice * bom_array[i].quant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((newSellPrice(bom_array[i].disc,bom_array[i].un_price,"",bom_array[i].newPrice) * bom_array[i].quant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';	
					}
					else{
						//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+(bom_array[i].newPrice * bom_array[i].newQuant).toFixed(2)+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((bom_array[i].newPrice * bom_array[i].newQuant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((newSellPrice(bom_array[i].disc,bom_array[i].un_price,"",bom_array[i].newPrice) * bom_array[i].newQuant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
					}
				}
				////////////////////////////////

				////OPTIONS FIELDS
				////////////////////////////
				//quoteInfo += '<td id="option1_'+i+'" class = "imgInfo" ></td>';
				quoteInfo += '<td id="option_'+i+'" class = "imgInfo" ></td>';

				////////////////////////
				quoteInfo += '</tr>'; 
			}

		}//end if 

		else if (quote_type == "midmarketLocked" || quote_type == "inwoodLocked"){
			for(var i = 0 ; i < bom_array.length; i++){
				var finish = false; 
				var bool; 
				var bool2; 

				if(i%2==0){
					cssInfoClass = "infoOdd";
					cssTotalClass = "totalOdd";
				}
				else{
					cssInfoClass = "infoEven"; 
					cssTotalClass = "totalEven";
				}

				quoteInfo += '<tr class='+cssInfoClass+'>';

				//SERIES FIELD
				/////////////////////////////
				//quoteInfo += '<td id="q_itemmenu_'+i+'">'+ bom_array[i].series + '</td>';
				quoteInfo += '<td id="seriesCell_'+i+'" style="visibility:'+seriesCell_visibility+'">'+ bom_array[i].series + '</td>';
				//////////////////////////////

				/// SKU FIELD
				///////////////////////////
				//quoteInfo += '<td id="q_skunum_'+i+'">' + bom_array[i].colorSku + '</td>';
				quoteInfo += '<td id="skuCell_'+i+'" style="visibility:'+skuCell_visibility+'">' + bom_array[i].colorSku.toString() + '</td>';
				/////////////////////////////

				// DESCRIPTION FIELD
				///////////////////
				//quoteInfo += '<td id="q_itemdesc_'+i+'">' + bom_array[i].productName + '</td>'; 
				quoteInfo += '<td id="descCell_'+i+'" style="visibility:'+descCell_visibility+'">' + bom_array[i].productName + '</td>'; 
				////////////////

				//// FINISH FIELD 
				//////////////////////////////////
				/*alert(bom_array[i].sku); 
				alert(bom_array[i].group + " : " + bom_array[i].parent_group); */
				for ( var g = 0; g < color_array.length; g++) {
					if (color_array[g].file_name == bom_array[i].colorSelector) {
					/////////////////////////////
						if (bom_array[i].sku.indexOf("%") != -1  /*&& 
							((_root.bom_array[i].group == "Tables-Conf and Meeting") || 
							(_root.bom_array[i].parent_group_name == "TYPICAL PARTS" && _root.bom_array[i].group == "Conference Tables") || 
							(_root.bom_array[i].parent_group_name == "TYPICAL PARTS" && _root.bom_array[i].group == "Conference Tables") || 
							(_root.bom_array[i].group == "Tables-Conf and Meeting" && _root.bom_array[i].parent_group_name == "Conference Tables") || 
							(_root.bom_array[i].group == "Tables-Training and Meeting" && _root.bom_array[i].parent_group_name == "Officeworks Tables")) 
							((bom_array[i].group == "Tables-Conference" && bom_array[i].parent_group == "Conference Tables")||
							(bom_array[i].group == "Conference Tables" && bom_array[i].parent_group == "TYPICAL PARTS") ||
							(bom_array[i].group == "Tables-Conference" && bom_array[i].parent_group == "TYPICAL PARTS") ||
							(bom_array[i].group == "Tables-Conference" && bom_array[i].parent_group == "Conf Table w/Wd Bullnose") ||
							(bom_array[i].group == "Tables-Conference" && bom_array[i].parent_group == "Racetrack Conf Tables") ||
							(bom_array[i].group == "Tables-Training and Meeting" && bom_array[i].parent_group == "Officeworks Tables")|| 
							(flash.bomConfig() == "inwood"))*/){
							//lineItem.q_itemfinish.text = _level0.color_file_data[g].hardw_desc;
							//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].hardw_desc+ '</td>';
								if (bom_array[i].sku.indexOf("^") != -1) {
									
									if (color_array[g].hardw_desc != "" && color_array[g].hardw_desc != undefined && color_array[g].hardw_desc != "" && color_array[g].hardw_desc != "undefined" && color_array[g].hardw_desc != "null" && color_array[g].hardw_desc != null) {
										quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].fab_wood_desc+"/"+color_array[g].hardw_desc + '</td>';
										//lineItem.q_itemfinish.text = _level0.color_file_data[g].fab_wood_desc+"/"+_level0.color_file_data[g].hardw_desc;
									} else {
										//lineItem.q_itemfinish.text = _level0.color_file_data[g].fab_wood_desc;
										quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].fab_wood_desc + '</td>';
									}
									//lineItem.q_itemfinish_2.text = "N/A";
								} else {
									if (flash.bomConfig() == "inwood") {
										//lineItem.q_itemfinish.text = _level0.color_file_data[g].fab_wood_desc;
										quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].hardw_desc + '</td>';
									} else {
										//lineItem.q_itemfinish.text = _level0.color_file_data[g].hardw_desc;
										quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].hardw_desc + '</td>';
										//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">testing1</td>';
									}
									//lineItem.q_itemfinish_2.text = "N/A";
								
								}
						}
					
					/////////////////////////////
						else {
						if(color_array[g].fab_wood_desc == "null" || color_array[g].fab_wood_desc == null || color_array[g].fab_wood_desc == "")
							color_array[g].fab_wood_desc = 'N/A';
						// hard coded for inwood/midmarket
						quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">' + color_array[g].fab_wood_desc + '</td>';
						//quoteInfo += '<td id="finishCell_'+i+'" style="visibility:'+finishCell_visibility+'">testing2</td>';
						}

						finish = true; 
						break; 
					}
				}
				if (finish == false){

					quoteInfo += '<td id="finishCell_'+i+'" >N/A</td>';
				}
				///////////////////////////////////////////////

				// QUANTITY FIELD
				/////////////////////

				quoteInfo += '<td id="quantCell_'+i+'" align="right">'+ bom_array[i].quant + '</td>';
				/////////////////////////

				// NEW QUANTITY FIELD
				/////////////////////
				if (bom_array[i].newQuant == "undefined" || bom_array[i].newQuant == undefined || bom_array[i].newQuant == null || bom_array[i].newQuant == "null" || bom_array[i].newQuant == "" ){
					quoteInfo += '<td id ="newQuantCell_'+i+'" align="right"></td>';//onblur="updateQty('+i+')"></td>';
				}
				else{

					quoteInfo += '<td id ="newQuantCell_'+i+'" align="right">'+bom_array[i].newQuant+'</td>';// onblur="updateQty('+i+')"></td>';

				}
				/////////////////////////

				// LIST PRICE FIELD 
				///////////////////////////
				if(bom_array[i].un_price == 1){ // Generic Planner 
					quoteInfo += '<td id="listPriceCell_'+i+'" style="visibility:'+listPriceCell_visibility+'" align="right"></td>'; 
				}
				else{
					quoteInfo += '<td id="listPriceCell_'+i+'" style="visibility:'+listPriceCell_visibility+'" align="right">$'+ formatCurrency((bom_array[i].un_price))+ '</td>'; 
				}
				///////////////////////////


				// DISCOUNT FIELD
				//////////////////////////
				/*(if (bom_array[i].disc != undefined && bom_array[i].disc != "undefined" && bom_array[i].disc != 0 && bom_array[i].disc != null && bom_array[i].disc != "null") {

				quoteInfo += '<td id="discountCell_'+i+'" align="right">'+bom_array[i].disc+'</td>';//onblur="updatePlanner('+i+')"></td>'; 


				} else {
				quoteInfo += '<td id="discountCell_'+i+'" align="right"></td>';//onblur="updatePlanner('+i+')"></td>'; 
				}*/
				///////////////////////////////////

				// SELL PRICE FIELD
				///////////////////////////////////
				//onkeypress="return onlyNumbers(event)" 
				if (bom_array[i].newPrice == "undefined" || bom_array[i].newPrice == undefined ||  bom_array[i].newPrice == null || bom_array[i].newPrice == "null" ){

					if((flash.bomConfig() == "inwood") || (flash.bomConfig() == "midmarket" && flash.dealerLevel() == "1"))
						quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'" align="right"></td>';// onblur="updatePlanner('+i+')"></td>';
					else if(flash.bomConfig() == "midmarket" && flash.dealerLevel() != "1")
						quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'" align="right">$'+formatCurrency((bom_array[i].ass_price))+'</td>';// onblur="updatePlanner('+i+')"></td>';

				}
				else{
					if(newSellPrice(bom_array[i].disc,bom_array[i].un_price,"",bom_array[i].newPrice) == 0){
						quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'" align="right"></td>';// onblur="updatePlanner('+i+')"></td>';
					}
					else{
						quoteInfo += '<td id= "sellPriceCell_'+i+'" style="visibility:'+sellPriceCell_visibility+'" align="right">$'+formatCurrency(newSellPrice(bom_array[i].disc,bom_array[i].un_price,"",bom_array[i].newPrice))+'</td>';// onblur="updatePlanner('+i+')"></td>';
					}

				}
				////////////////////////////////////


				// TOTAL PRICE FIELD
				/////////////////////////////////
				if (bom_array[i].newPrice == "undefined" || bom_array[i].newPrice == undefined ||  bom_array[i].newPrice == null || bom_array[i].newPrice == "null"){

					if((flash.bomConfig() == "inwood") || (flash.bomConfig() == "midmarket" && flash.dealerLevel() == "1"))
						quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$0" id= "total_'+i+'" class="'+cssTotalClass+'"   readonly= "readonly"></td>';

					else if(flash.bomConfig() == "midmarket" && flash.dealerLevel() != "1"){
						if(bom_array[i].newQuant == "" || bom_array[i].newQuant == "undefined" || bom_array[i].newQuant == undefined || bom_array[i].newQuant == null || bom_array[i].newQuant == "null") {
							//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+(bom_array[i].newPrice * bom_array[i].quant).toFixed(2)+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
							quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((bom_array[i].ass_price * bom_array[i].quant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						}
						else{
							//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+(bom_array[i].newPrice * bom_array[i].newQuant).toFixed(2)+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
							quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((bom_array[i].ass_price * bom_array[i].newQuant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						}
					}
				}
				else {
					if(bom_array[i].newQuant == "" || bom_array[i].newQuant == "undefined" || bom_array[i].newQuant == undefined || bom_array[i].newQuant == null || bom_array[i].newQuant == "null") {
						//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+(bom_array[i].newPrice * bom_array[i].quant).toFixed(2)+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((bom_array[i].newPrice * bom_array[i].quant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((newSellPrice(bom_array[i].disc,bom_array[i].un_price,"",bom_array[i].newPrice) * bom_array[i].quant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';	
					}
					else{
						//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+(bom_array[i].newPrice * bom_array[i].newQuant).toFixed(2)+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						//quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((bom_array[i].newPrice * bom_array[i].newQuant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
						quoteInfo += '<td id= "totalCell_'+i+'" style="visibility:'+totalCell_visibility+'"><input type="text" value ="$'+formatCurrency((newSellPrice(bom_array[i].disc,bom_array[i].un_price,"",bom_array[i].newPrice) * bom_array[i].newQuant))+'" id= "total_'+i+'"  class="'+cssTotalClass+'"  readonly= "readonly"></td>';
					}
				}
				////////////////////////////////

				////OPTIONS FIELDS
				////////////////////////////
				//quoteInfo += '<td id="option1_'+i+'" class = "imgInfo" ></td>';
				quoteInfo += '<td id="option_'+i+'" class = "imgInfo" ></td>';

				////////////////////////
				quoteInfo += '</tr>'; 
			}

		}//end else if 
	}
	return quoteInfo; 
	
}// end of bomRows()
//////////////////////////////////////////////////

//Takes new products that were added to the quote page and generates table rows 
//////////////////////////////////////////////////
function newProductsRows(reason,lineNum){
	
	var quoteInfo = ""; 
	
	////////////////////
	if(reason == "edit"){
		if(quote_type == "midmarket" || quote_type == "inwood"){
			for(var j = 0; j<newProduct_array.length; j++){
				
				var k = j+bom_array.length; 
				var bool; 
				
				if(k%2==0){
				cssInfoClass = "infoOdd";
				cssTotalClass = "totalOdd";
				}
				else{
				cssInfoClass = "infoEven"; 
				cssTotalClass = "totalEven";
				}
				quoteInfo += '<tr class='+cssInfoClass+'>';

				//SERIES FIELD
				/////////////////////////////
				if(navigator.appName.indexOf("Microsoft") != -1){//ie 
					if(newProduct_array[j].series == "null")
						quoteInfo += '<td id="seriesCell_'+k+'"  style="visibility:'+seriesCell_visibility+'"><textarea id="series_'+k+'"  class="seriesIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"></textarea></td>';
					else
						quoteInfo += '<td id="seriesCell_'+k+'"  style="visibility:'+seriesCell_visibility+'"><textarea id="series_'+k+'"  class="seriesIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)">'+newProduct_array[j].series+'</textarea></td>';
				}
				else{//firefox
					/*if(newProduct_array[j].series == "null")
						quoteInfo += '<td id="seriesCell_'+k+'" style="visibility:'+seriesCell_visibility+'"><input type="text" value="" id="series_'+k+'"  class="series" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';
					else
						quoteInfo += '<td id="seriesCell_'+k+'" style="visibility:'+seriesCell_visibility+'"><input type="text" value="'+newProduct_array[j].series+'" id="series_'+k+'"  class="series" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';*/
				
					if(newProduct_array[j].series == "null"){
						quoteInfo += '<td id="seriesCell_'+k+'"  style="visibility:'+seriesCell_visibility+'"><textarea rows="1" id="series_'+k+'"  class="seriesFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_series",this.value,dummySeries_height,this.id)></textarea></td>';
					}
					else{
						rows = computeRows("dummy_series",newProduct_array[j].series,dummySeries_height)
						quoteInfo += '<td id="seriesCell_'+k+'"  style="visibility:'+seriesCell_visibility+'"><textarea rows='+rows+' id="series_'+k+'"  class="seriesFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_series",this.value,dummySeries_height,this.id)>'+newProduct_array[j].series+'</textarea></td>';
					}
				}
				//////////////////////////////

				// SKU FIELD
				///////////////////////////
				if(navigator.appName.indexOf("Microsoft") != -1){//ie 
					if(newProduct_array[j].sku == "null")
						quoteInfo += '<td id="skuCell_'+k+'" style="visibility:'+skuCell_visibility+'"><textarea id="sku_'+k+'"  class="skuIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"></textarea></td>';
					else
						quoteInfo += '<td id="skuCell_'+k+'" style="visibility:'+skuCell_visibility+'"><textarea id="sku_'+k+'"  class="skuIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)">'+newProduct_array[j].sku+'</textarea></td>';
				}
				else{//firefox
					/*if(newProduct_array[j].sku == "null")
						quoteInfo += '<td id="skuCell_'+k+'" style="visibility:'+skuCell_visibility+'"><input type="text" value="" id="sku_'+k+'"  class="sku" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';
					else
						quoteInfo += '<td id="skuCell_'+k+'" style="visibility:'+skuCell_visibility+'"><input type="text" value="'+newProduct_array[j].sku+'" id="sku_'+k+'"  class="sku" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';*/
						
					if(newProduct_array[j].sku == "null"){
						quoteInfo += '<td id="skuCell_'+k+'" style="visibility:'+skuCell_visibility+'"><textarea rows="1" id="sku_'+k+'"  class="skuFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_sku",this.value,dummySku_height,this.id)></textarea></td>';
					}
					else{
						rows = computeRows("dummy_sku",newProduct_array[j].sku,dummySku_height)
						quoteInfo += '<td id="skuCell_'+k+'" style="visibility:'+skuCell_visibility+'"><textarea rows='+rows+' id="sku_'+k+'"  class="skuFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_sku",this.value,dummySku_height,this.id)>'+newProduct_array[j].sku+'</textarea></td>';
					}
				}
				/////////////////////////////

				// DESCRIPTION FIELD
				///////////////////
				if(navigator.appName.indexOf("Microsoft") != -1){//ie 
					if(newProduct_array[j].desc == "null" )
						quoteInfo += '<td id="descCell_'+k+'" style="visibility:'+descCell_visibility+'" ><textarea  id="desc_'+k+'"  class="descIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"></textarea></td>';
					else 
						quoteInfo += '<td id="descCell_'+k+'" style="visibility:'+descCell_visibility+'" ><textarea  id="desc_'+k+'"  class="descIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)">'+newProduct_array[j].desc+'</textarea></td>';
				}
				else{
					/*if(newProduct_array[j].desc == "null")
						quoteInfo += '<td id="descCell_'+k+'" style="visibility:'+descCell_visibility+'" ><input type="text" value="" id="desc_'+k+'"  class="desc" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';
					else 
					quoteInfo += '<td id="descCell_'+k+'" style="visibility:'+descCell_visibility+'" ><input type="text" value="'+newProduct_array[j].desc+'" id="desc_'+k+'"  class="desc" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';*/
					
					if(newProduct_array[j].desc == "null" ){
						quoteInfo += '<td id="descCell_'+k+'" style="visibility:'+descCell_visibility+'" ><textarea  rows="1" id="desc_'+k+'"  class="descFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_desc",this.value,dummyDesc_height,this.id)></textarea></td>';
					}
					else{
						rows = computeRows("dummy_desc",newProduct_array[j].desc,dummyDesc_height)
						quoteInfo += '<td id="descCell_'+k+'" style="visibility:'+descCell_visibility+'" ><textarea  rows='+rows+' id="desc_'+k+'"  class="descFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_desc",this.value,dummyDesc_height,this.id)>'+newProduct_array[j].desc+'</textarea></td>';
					}
				}
				////////////////

				//// FINISH FIELD 
				//////////////////////////////////
				if(navigator.appName.indexOf("Microsoft") != -1){//ie 
					if(newProduct_array[j].finish == "null")
						quoteInfo += '<td id="finishCell_'+k+'" style="visibility:'+finishCell_visibility+'"><textarea id="finish_'+k+'"  class="finishIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"></textarea></td>';
					else
						quoteInfo += '<td id="finishCell_'+k+'" style="visibility:'+finishCell_visibility+'"><textarea id="finish_'+k+'"  class="finishIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)">'+newProduct_array[j].finish+'</textarea></td>';
				}
				else{//firefox
					/*if(newProduct_array[j].finish == "null")
						quoteInfo += '<td id="finishCell_'+k+'" style="visibility:'+finishCell_visibility+'" ><input type="text" value="" id="finish_'+k+'"  class="finish" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';
					else
						quoteInfo += '<td id="finishCell_'+k+'" style="visibility:'+finishCell_visibility+'"><input type="text" value="'+newProduct_array[j].finish+'" id="finish_'+k+'"  class="finish" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';*/
					
					if(newProduct_array[j].finish == "null"){
						quoteInfo += '<td id="finishCell_'+k+'" style="visibility:'+finishCell_visibility+'"><textarea rows="1" id="finish_'+k+'"  class="finishFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_finish",this.value,dummyFinish_height,this.id)></textarea></td>';
					}
					else{
						rows = computeRows("dummy_finish",newProduct_array[j].finish,dummyFinish_height)
						quoteInfo += '<td id="finishCell_'+k+'" style="visibility:'+finishCell_visibility+'"><textarea rows='+rows+' id="finish_'+k+'"  class="finishFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_finish",this.value,dummyFinish_height,this.id)>'+newProduct_array[j].finish+'</textarea></td>';
					}
				}
				///////////////////////////////////////////////

				// QUANTITY FIELD
				/////////////////////
				if(newProduct_array[j].quant == "null")
				quoteInfo += '<td id="quantCell_'+k+'" align="right"></td>';
				else
				quoteInfo += '<td id="quantCell_'+k+'" align="right">'+newProduct_array[j].quant+'</td>';

				/////////////////////////

				// NEW QUANTITY FIELD
				/////////////////////
				
				if(newProduct_array[j].newQuant == "null")
				quoteInfo += '<td id="newQuantCell_'+k+'" ><input type="text" value="" id="newQuant_'+k+'"  class="newQuant" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateNewTotal(bool,this.value,'+k+')" onblur="updateNewProduct(this.id,this.value)"/></td>';
				else
				quoteInfo += '<td id="newQuantCell_'+k+'" ><input type="text" value="'+newProduct_array[j].newQuant+'" id="newQuant_'+k+'"  class="newQuant" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateNewTotal(bool,this.value,'+k+')" onblur="updateNewProduct(this.id,this.value)"/></td>';
				

				/////////////////////////

				// LIST PRICE FIELD 
				///////////////////////////
				
				if(newProduct_array[j].listPrice == "null")
				quoteInfo += '<td id="listPriceCell_'+k+'" style="visibility:'+listPriceCell_visibility+'"><input type="text" value="" id="listPrice_'+k+'"  class="listPrice" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateProductSell(bool,'+k+')" onblur="updateListPrice('+k+')"/></td>';
				else
				quoteInfo += '<td id="listPriceCell_'+k+'" style="visibility:'+listPriceCell_visibility+'"><input type="text" value="'+newProduct_array[j].listPrice+'" id="listPrice_'+k+'"  class="listPrice" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateProductSell(bool,'+k+')" onblur="updateListPrice('+k+')"/></td>';
				
				///////////////////////////


				// DISCOUNT FIELD
				//////////////////////////

				if(newProduct_array[j].discount == "null")
				quoteInfo += '<td id="discountCell_'+k+'" style="visibility:'+discountCell_visibility+'"><input type="text" value="" id="discount_'+k+'"  class="discount" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateProductSell(bool,'+k+')" onblur="updateProduct('+k+')"/></td>';
				else
				quoteInfo += '<td id="discountCell_'+k+'" style="visibility:'+discountCell_visibility+'"><input type="text" value="'+newProduct_array[j].discount+'" id="discount_'+k+'"  class="discount" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateProductSell(bool,'+k+')" onblur="updateProduct('+k+')"/></td>';
				
				
				///////////////////////////////////

				// SELL PRICE FIELD
				///////////////////////////////////
				
				if(newProduct_array[j].sellPrice == "null")
				quoteInfo += '<td id="sellPriceCell_'+k+'" style="visibility:'+sellPriceCell_visibility+'"><input type="text" value="" id="sellPrice_'+k+'"  class="sellPrice" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)"  onkeyup="generateProductTotal(bool,this.value,'+k+')" onblur="updateProduct('+k+')"/></td>';
				else 
				quoteInfo += '<td id="sellPriceCell_'+k+'" style="visibility:'+sellPriceCell_visibility+'"><input type="text" value="'+newProduct_array[j].sellPrice+'" id="sellPrice_'+k+'"  class="sellPrice" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)"  onkeyup="generateProductTotal(bool,this.value,'+k+')" onblur="updateProduct('+k+')"/></td>';
				
				
				////////////////////////////////////

				// TOTAL PRICE FIELD
				/////////////////////////////////////
				
				if (newProduct_array[j].sellPrice == "null" || newProduct_array[j].sellPrice == 0 ||newProduct_array[j].newQuant == "" ) 
				quoteInfo += '<td id="totalCell_'+k+'" style="visibility:'+totalCell_visibility+'"><input type="text" value="$0" id="total_'+k+'"  class="'+cssTotalClass+'" readonly="readonly"/></td>';
				else {
				if(newProduct_array[j].newQuant == "" || newProduct_array[j].newQuant == "null") 
				quoteInfo += '<td id= "totalCell_'+k+'" style="visibility:'+totalCell_visibility+'"><input type="text" value="$'+formatCurrency((newProduct_array[j].sellPrice * newProduct_array[j].quant))+'" id="total_'+k+'"  class="'+cssTotalClass+'" readonly="readonly"/></td>';
				else 
				quoteInfo += '<td id= "totalCell_'+k+'" style="visibility:'+totalCell_visibility+'"><input type="text" value="$'+formatCurrency((newProduct_array[j].sellPrice * newProduct_array[j].newQuant))+'" id="total_'+k+'"  class="'+cssTotalClass+'" readonly="readonly"/></td>';
				}
				///////////////////////////////////////////////
				
				////OPTIONS FIELDS
				////////////////////////////
				
				//quoteInfo += '<td id="option1_'+k+'" class = "imgInfo" ><input type="image" id="'+k+'"title="Edit" src="editBtn.png" onclick="editNewLine(this.id)" style="width:16px; height:16px"/></td>';
				quoteInfo += '<td id="option_'+k+'" class = "imgInfo" ><input type="image" class="deleteImg" id="'+k+'"title="Delete" src="quote/deleteBtn.png" onclick="deleteNewLine(this.id)" style="width:16px; height:16px"/></td>';
				//quoteInfo += '<td id="option1_'+k+'" class = "imgInfo" ></td>';
				////////////////////////
				quoteInfo += '</tr>'; 
			}
		}// end if 
		
		else if(quote_type == "midmarketLocked" || quote_type == "inwoodLocked"){
		
			for(var j = 0; j<newProduct_array.length; j++){
			
			var k = j+bom_array.length; 
			var bool; 
			
			if(k%2==0){
			cssInfoClass = "infoOdd";
			cssTotalClass = "totalOdd";
			}
			else{
			cssInfoClass = "infoEven"; 
			cssTotalClass = "totalEven";
			}
			quoteInfo += '<tr class='+cssInfoClass+'>';

			//SERIES FIELD
			/////////////////////////////
			
			if(newProduct_array[j].series == "null")
			quoteInfo += '<td id="seriesCell_'+k+'" style="visibility:'+seriesCell_visibility+'" ></td>';
			else
			quoteInfo += '<td id="seriesCell_'+k+'" style="visibility:'+seriesCell_visibility+'" >'+newProduct_array[j].series+'</td>';
			
			//////////////////////////////

			/// SKU FIELD
			///////////////////////////
			if(newProduct_array[j].sku == "null")
			quoteInfo += '<td id="skuCell_'+k+'" style="visibility:'+skuCell_visibility+'" ></td>';
			else
			quoteInfo += '<td id="skuCell_'+k+'" style="visibility:'+skuCell_visibility+'">'+newProduct_array[j].sku+'</td>';

			/////////////////////////////

			// DESCRIPTION FIELD
			///////////////////
			
			if(newProduct_array[j].desc == "null")
			quoteInfo += '<td id="descCell_'+k+'" style="visibility:'+descCell_visibility+'" ></td>';
			else 
			quoteInfo += '<td id="descCell_'+k+'" style="visibility:'+descCell_visibility+'" >'+newProduct_array[j].desc+'</td>';

			////////////////

			//// FINISH FIELD 
			//////////////////////////////////

			if(newProduct_array[j].finish == "null")
			quoteInfo += '<td id="finishCell_'+k+'" style="visibility:'+finishCell_visibility+'" ></td>';
			else
			quoteInfo += '<td id="finishCell_'+k+'" style="visibility:'+finishCell_visibility+'">'+newProduct_array[j].finish+'</td>';
			
			///////////////////////////////////////////////

			// QUANTITY FIELD
			/////////////////////
			if(newProduct_array[j].quant == "null")
			quoteInfo += '<td id="quantCell_'+k+'" align="right"></td>';
			else
			quoteInfo += '<td id="quantCell_'+k+'" align="right">'+newProduct_array[j].quant+'</td>';

			/////////////////////////

			// NEW QUANTITY FIELD
			/////////////////////
			
			if(newProduct_array[j].newQuant == "null")
			quoteInfo += '<td id="newQuantCell_'+k+'" align="right"></td>';
			else
			quoteInfo += '<td id="newQuantCell_'+k+'" align="right">'+newProduct_array[j].newQuant+'</td>';
			

			/////////////////////////

			// LIST PRICE FIELD 
			///////////////////////////
			
			if(newProduct_array[j].listPrice == "null")
			quoteInfo += '<td id="listPriceCell_'+k+'" style="visibility:'+listPriceCell_visibility+'" align="right"></td>';
			else
			quoteInfo += '<td id="listPriceCell_'+k+'" style="visibility:'+listPriceCell_visibility+'" align="right">$'+formatCurrency(newProduct_array[j].listPrice)+'</td>';
			
			///////////////////////////


			// DISCOUNT FIELD
			//////////////////////////

			/*if(newProduct_array[j].discount == "null")
			quoteInfo += '<td id="discountCell_'+k+'" align="right"></td>';
			else
			quoteInfo += '<td id="discountCell_'+k+'" align="right">'+newProduct_array[j].discount+'</td>';*/
			
			
			///////////////////////////////////

			// SELL PRICE FIELD
			///////////////////////////////////
			
			if(newProduct_array[j].sellPrice == "null")
			quoteInfo += '<td id="sellPriceCell_'+k+'" style="visibility:'+sellPriceCell_visibility+'" align="right"></td>';
			else 
			quoteInfo += '<td id="sellPriceCell_'+k+'" style="visibility:'+sellPriceCell_visibility+'" align="right">$'+formatCurrency(newProduct_array[j].sellPrice)+'</td>';
			
			
			////////////////////////////////////

			// TOTAL PRICE FIELD
			/////////////////////////////////////
			
			if (newProduct_array[j].sellPrice == "null" || newProduct_array[j].sellPrice == 0 ||newProduct_array[j].newQuant == "" ) 
			quoteInfo += '<td id="totalCell_'+k+'" style="visibility:'+totalCell_visibility+'"><input type="text" value="$0" id="total_'+k+'"  class="'+cssTotalClass+'" readonly="readonly"/></td>';
			else {
			if(newProduct_array[j].newQuant == "" || newProduct_array[j].newQuant == "null") 
			quoteInfo += '<td id= "totalCell_'+k+'" style="visibility:'+totalCell_visibility+'"><input type="text" value="$'+formatCurrency((newProduct_array[j].sellPrice * newProduct_array[j].quant))+'" id="total_'+k+'"  class="'+cssTotalClass+'" readonly="readonly"/></td>';
			else 
			quoteInfo += '<td id= "totalCell_'+k+'" style="visibility:'+totalCell_visibility+'"><input type="text" value="$'+formatCurrency((newProduct_array[j].sellPrice * newProduct_array[j].newQuant))+'" id="total_'+k+'"  class="'+cssTotalClass+'" readonly="readonly"/></td>';
			}
			///////////////////////////////////////////////
			
			////OPTIONS FIELDS
			////////////////////////////
			
			//quoteInfo += '<td id="option1_'+k+'" class = "imgInfo" ><input type="image" id="'+k+'"title="Edit" src="editBtn.png" onclick="editNewLine(this.id)" style="width:16px; height:16px"/></td>';
			quoteInfo += '<td id="option_'+k+'" class = "imgInfo" ></td>';
			//quoteInfo += '<td id="option1_'+k+'" class = "imgInfo" ></td>';
			////////////////////////
			quoteInfo += '</tr>'; 
			}
		
		}//end else if 
	}
	//////////////////
	
	else if (reason == "add"){
		for(var j = 0; j<newProduct_array.length; j++){
			var k = j+bom_array.length; 
			var bool; 
			
			if(k%2==0){
			cssInfoClass = "infoOdd";
			cssTotalClass = "totalOdd";
			}
			else{
			cssInfoClass = "infoEven"; 
			cssTotalClass = "totalEven";
			}
			
			
			if(j == newProduct_array.length-1){
			
				quoteInfo += '<tr class='+cssInfoClass+'>';

				//SERIES FIELD
				/////////////////////////////
				if(navigator.appName.indexOf("Microsoft") != -1)//ie 
					quoteInfo += '<td id="seriesCell_'+k+'"  style="visibility:'+seriesCell_visibility+'"><textarea id="series_'+k+'"  class="seriesIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"></textarea></td>';
				else
					quoteInfo += '<td id="seriesCell_'+k+'"  style="visibility:'+seriesCell_visibility+'"><textarea rows="1" id="series_'+k+'"  class="seriesFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_series",this.value,dummySeries_height,this.id)></textarea></td>';
					//quoteInfo += '<td id="seriesCell_'+k+'"  style="visibility:'+seriesCell_visibility+'"><input type="text" value="" id="series_'+k+'"  class="series" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';
				//////////////////////////////
				

				/// SKU FIELD
				///////////////////////////
				if(navigator.appName.indexOf("Microsoft") != -1)//ie 
					quoteInfo += '<td id="skuCell_'+k+'" style="visibility:'+skuCell_visibility+'"><textarea id="sku_'+k+'"  class="skuIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"></textarea></td>';
				else
					quoteInfo += '<td id="skuCell_'+k+'" style="visibility:'+skuCell_visibility+'"><textarea rows="1" id="sku_'+k+'"  class="skuFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_sku",this.value,dummySku_height,this.id)></textarea></td>';
					//quoteInfo += '<td id="skuCell_'+k+'" style="visibility:'+skuCell_visibility+'"><input type="text" value="" id="sku_'+k+'"  class="sku" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';
				/////////////////////////////

				// DESCRIPTION FIELD
				///////////////////
				if(navigator.appName.indexOf("Microsoft") != -1)//ie 
					quoteInfo += '<td id="descCell_'+k+'" style="visibility:'+descCell_visibility+'"><textarea  id="desc_'+k+'"  class="descIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"></textarea></td>'; 
				else
					quoteInfo += '<td id="descCell_'+k+'" style="visibility:'+descCell_visibility+'" ><textarea  rows="1" id="desc_'+k+'"  class="descFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_desc",this.value,dummyDesc_height,this.id)></textarea></td>';
					//quoteInfo += '<td id="descCell_'+k+'" style="visibility:'+descCell_visibility+'"><input type="text" value="" id="desc_'+k+'"  class="desc" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>'; 
				////////////////

				//// FINISH FIELD 
				//////////////////////////////////
				if(navigator.appName.indexOf("Microsoft") != -1)//ie 
					quoteInfo += '<td id="finishCell_'+k+'" style="visibility:'+finishCell_visibility+'"><textarea id="finish_'+k+'"  class="finishIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"></textarea></td>';
				else
					quoteInfo += '<td id="finishCell_'+k+'" style="visibility:'+finishCell_visibility+'"><textarea rows="1" id="finish_'+k+'"  class="finishFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_finish",this.value,dummyFinish_height,this.id)></textarea></td>';
					//quoteInfo += '<td id="finishCell_'+k+'" style="visibility:'+finishCell_visibility+'"><input type="text" value="" id="finish_'+k+'"  class="finish" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';
				///////////////////////////////////////////////

				// QUANTITY FIELD
				/////////////////////
				quoteInfo += '<td id="quantCell_'+k+'" align="right">0</td>';
				/////////////////////////

				// NEW QUANTITY FIELD
				/////////////////////
				quoteInfo += '<td id ="newQuantCell_'+k+'" ><input type="text" value="" id="newQuant_'+k+'" class="newQuant" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateNewTotal(bool,this.value,'+k+')" onblur="updateNewProduct(this.id,this.value)"/></td>';
				/////////////////////////

				// LIST PRICE FIELD 
				//////////////////////////
				quoteInfo += '<td id="listPriceCell_'+k+'" style="visibility:'+listPriceCell_visibility+'"><input type="text" value="" id="listPrice_'+k+'"  class="listPrice" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateProductSell(bool,'+k+')" onblur="updateListPrice('+k+')"/></td>'; 
				///////////////////////////


				// DISCOUNT FIELD
				//////////////////////////
				quoteInfo += '<td id="discountCell_'+k+'" style="visibility:'+discountCell_visibility+'"><input type="text" value="" id="discount_'+k+'"  class="discount" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateProductSell(bool,'+k+')" onblur="updateProduct('+k+')"/></td>'; 
				///////////////////////////////////

				// SELL PRICE FIELD
				///////////////////////////////////
				quoteInfo += '<td id= "sellPriceCell_'+k+'" style="visibility:'+sellPriceCell_visibility+'"><input type="text" value="" id="sellPrice_'+k+'"  class="sellPrice" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)"  onkeyup="generateProductTotal(bool,this.value,'+k+')" onblur="updateProduct('+k+')"/></td>';
				////////////////////////////////////

				// TOTAL PRICE FIELD
				/////////////////////////////////
				quoteInfo += '<td id= "totalCell_'+k+'" style="visibility:'+totalCell_visibility+'"><input type="text" value="$0" id="total_'+k+'"  class="'+cssTotalClass+'" readonly = "readonly"/></td>';
				////////////////////////////////

				////OPTIONS FIELDS
				////////////////////////////
				//quoteInfo += '<td id="option1_'+k+'" class = "imgInfo" ><input type="image" id="'+k+'"title="Update" src="acceptBtn.png" onclick="updateNewProduct(this.id)" style="width:16px; height:16px"/></td>';
				quoteInfo += '<td id="option_'+k+'" class = "imgInfo" ><input type="image" class="deleteImg" id="'+k+'"title="Delete" src="quote/deleteBtn.png" onclick="deleteNewLine(this.id)" style="width:16px; height:16px"/></td>';
				//quoteInfo += '<td id="option1_'+k+'" class = "imgInfo" ></td>';
				//quoteInfo += '<td id="option1_'+k+'" class = "imgInfo" ><img src="acceptBtn.png"/></td>';
				//quoteInfo += '<td id="option2_'+k+'" class = "imgInfo" ><img src="deleteBtn.png"/></td>';

				////////////////////////
				quoteInfo += '</tr>'; 
			}
			
			/////////////
			else {
			
				quoteInfo += '<tr class='+cssInfoClass+'>';

				//SERIES FIELD
				/////////////////////////////
				if(navigator.appName.indexOf("Microsoft") != -1){//ie 
					if(newProduct_array[j].series == "null")
						quoteInfo += '<td id="seriesCell_'+k+'"  style="visibility:'+seriesCell_visibility+'"><textarea id="series_'+k+'"  class="seriesIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"></textarea></td>';
					else
						quoteInfo += '<td id="seriesCell_'+k+'"  style="visibility:'+seriesCell_visibility+'"><textarea id="series_'+k+'"  class="seriesIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)">'+newProduct_array[j].series+'</textarea></td>';
				}
				else{//firefox
					/*if(newProduct_array[j].series == "null")
						quoteInfo += '<td id="seriesCell_'+k+'" style="visibility:'+seriesCell_visibility+'"><input type="text" value="" id="series_'+k+'"  class="series" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';
					else
						quoteInfo += '<td id="seriesCell_'+k+'" style="visibility:'+seriesCell_visibility+'"><input type="text" value="'+newProduct_array[j].series+'" id="series_'+k+'"  class="series" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';*/
						
					if(newProduct_array[j].series == "null"){
						quoteInfo += '<td id="seriesCell_'+k+'"  style="visibility:'+seriesCell_visibility+'"><textarea rows="1" id="series_'+k+'"  class="seriesFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_series",this.value,dummySeries_height,this.id)></textarea></td>';
					}
					else{
						rows = computeRows("dummy_series",newProduct_array[j].series,dummySeries_height)
						quoteInfo += '<td id="seriesCell_'+k+'"  style="visibility:'+seriesCell_visibility+'"><textarea rows='+rows+' id="series_'+k+'"  class="seriesFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_series",this.value,dummySeries_height,this.id)>'+newProduct_array[j].series+'</textarea></td>';
					}
				}
				//////////////////////////////

				/// SKU FIELD
				///////////////////////////
				if(navigator.appName.indexOf("Microsoft") != -1){//ie 
					if(newProduct_array[j].sku == "null")
						quoteInfo += '<td id="skuCell_'+k+'" style="visibility:'+skuCell_visibility+'"><textarea id="sku_'+k+'"  class="skuIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"></textarea></td>';
					else
						quoteInfo += '<td id="skuCell_'+k+'" style="visibility:'+skuCell_visibility+'"><textarea id="sku_'+k+'"  class="skuIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)">'+newProduct_array[j].sku+'</textarea></td>';
				}
				else{//firefox
					/*if(newProduct_array[j].sku == "null")
						quoteInfo += '<td id="skuCell_'+k+'" style="visibility:'+skuCell_visibility+'"><input type="text" value="" id="sku_'+k+'"  class="sku" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';
					else
						quoteInfo += '<td id="skuCell_'+k+'" style="visibility:'+skuCell_visibility+'"><input type="text" value="'+newProduct_array[j].sku+'" id="sku_'+k+'"  class="sku" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';*/
						
					if(newProduct_array[j].sku == "null"){
						quoteInfo += '<td id="skuCell_'+k+'" style="visibility:'+skuCell_visibility+'"><textarea rows="1" id="sku_'+k+'"  class="skuFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_sku",this.value,dummySku_height,this.id)></textarea></td>';
					}
					else{
						rows = computeRows("dummy_sku",newProduct_array[j].sku,dummySku_height)
						quoteInfo += '<td id="skuCell_'+k+'" style="visibility:'+skuCell_visibility+'"><textarea rows='+rows+' id="sku_'+k+'"  class="skuFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_sku",this.value,dummySku_height,this.id)>'+newProduct_array[j].sku+'</textarea></td>';
					}
				}
				/////////////////////////////

				// DESCRIPTION FIELD
				///////////////////
				if(navigator.appName.indexOf("Microsoft") != -1){//ie 
					if(newProduct_array[j].desc == "null")
						quoteInfo += '<td id="descCell_'+k+'" style="visibility:'+descCell_visibility+'" ><textarea  id="desc_'+k+'"  class="descIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"></textarea></td>';
					else 
						quoteInfo += '<td id="descCell_'+k+'" style="visibility:'+descCell_visibility+'" ><textarea  id="desc_'+k+'"  class="descIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)">'+newProduct_array[j].desc+'</textarea></td>';
				}
				else{
					/*if(newProduct_array[j].desc == "null")
						quoteInfo += '<td id="descCell_'+k+'" style="visibility:'+descCell_visibility+'" ><input type="text" value="" id="desc_'+k+'"  class="desc" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';
					else 
						quoteInfo += '<td id="descCell_'+k+'" style="visibility:'+descCell_visibility+'" ><input type="text" value="'+newProduct_array[j].desc+'" id="desc_'+k+'"  class="desc" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';*/
						
					if(newProduct_array[j].desc == "null" ){
						quoteInfo += '<td id="descCell_'+k+'" style="visibility:'+descCell_visibility+'" ><textarea  rows="1" id="desc_'+k+'"  class="descFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_desc",this.value,dummyDesc_height,this.id)></textarea></td>';
					}
					else{
						rows = computeRows("dummy_desc",newProduct_array[j].desc,dummyDesc_height)
						quoteInfo += '<td id="descCell_'+k+'" style="visibility:'+descCell_visibility+'" ><textarea  rows='+rows+' id="desc_'+k+'"  class="descFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_desc",this.value,dummyDesc_height,this.id)>'+newProduct_array[j].desc+'</textarea></td>';
					}
				}
				////////////////

				//// FINISH FIELD 
				//////////////////////////////////
				if(navigator.appName.indexOf("Microsoft") != -1){//ie 
					if(newProduct_array[j].finish == "null")
						quoteInfo += '<td id="finishCell_'+k+'" style="visibility:'+finishCell_visibility+'"><textarea id="finish_'+k+'"  class="finishIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"></textarea></td>';
					else
						quoteInfo += '<td id="finishCell_'+k+'" style="visibility:'+finishCell_visibility+'"><textarea id="finish_'+k+'"  class="finishIE" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)">'+newProduct_array[j].finish+'</textarea></td>';
				}
				else{//firefox
					/*if(newProduct_array[j].finish == "null")
						quoteInfo += '<td id="finishCell_'+k+'" style="visibility:'+finishCell_visibility+'" ><input type="text" value="" id="finish_'+k+'"  class="finish" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';
					else
						quoteInfo += '<td id="finishCell_'+k+'" style="visibility:'+finishCell_visibility+'"><input type="text" value="'+newProduct_array[j].finish+'" id="finish_'+k+'"  class="finish" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)"/></td>';*/
					
					if(newProduct_array[j].finish == "null"){
						quoteInfo += '<td id="finishCell_'+k+'" style="visibility:'+finishCell_visibility+'"><textarea rows="1" id="finish_'+k+'"  class="finishFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_finish",this.value,dummyFinish_height,this.id)></textarea></td>';
					}
					else{
						rows = computeRows("dummy_finish",newProduct_array[j].finish,dummyFinish_height)
						quoteInfo += '<td id="finishCell_'+k+'" style="visibility:'+finishCell_visibility+'"><textarea rows='+rows+' id="finish_'+k+'"  class="finishFF" onkeypress="return noSpecialChars(event)" onblur="updateNewProduct(this.id,this.value)" oninput=computeRows("dummy_finish",this.value,dummyFinish_height,this.id)>'+newProduct_array[j].finish+'</textarea></td>';
					}
					
				}
				///////////////////////////////////////////////

				// QUANTITY FIELD
				/////////////////////
				if(newProduct_array[j].quant == "null")
				quoteInfo += '<td id="quantCell_'+k+'" align="right"></td>';
				else
				quoteInfo += '<td id="quantCell_'+k+'" align="right">'+newProduct_array[j].quant+'</td>';

				/////////////////////////

				// NEW QUANTITY FIELD
				/////////////////////
				
				if(newProduct_array[j].newQuant == "null")
				quoteInfo += '<td id="newQuantCell_'+k+'" ><input type="text" value="" id="newQuant_'+k+'"  class="newQuant" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateNewTotal(bool,this.value,'+k+')" onblur="updateNewProduct(this.id,this.value)"/></td>';
				else
				quoteInfo += '<td id="newQuantCell_'+k+'" ><input type="text" value="'+newProduct_array[j].newQuant+'" id="newQuant_'+k+'"  class="newQuant" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateNewTotal(bool,this.value,'+k+')" onblur="updateNewProduct(this.id,this.value)"/></td>';
				

				/////////////////////////

				// LIST PRICE FIELD 
				///////////////////////////
				
				if(newProduct_array[j].listPrice == "null")
				quoteInfo += '<td id="listPriceCell_'+k+'" style="visibility:'+listPriceCell_visibility+'"><input type="text" value="" id="listPrice_'+k+'"  class="listPrice" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateProductSell(bool,'+k+')" onblur="updateListPrice('+k+')"/></td>';
				else
				quoteInfo += '<td id="listPriceCell_'+k+'" style="visibility:'+listPriceCell_visibility+'"><input type="text" value="'+newProduct_array[j].listPrice+'" id="listPrice_'+k+'"  class="listPrice" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateProductSell(bool,'+k+')" onblur="updateListPrice('+k+')"/></td>';
				
				///////////////////////////


				// DISCOUNT FIELD
				//////////////////////////

				if(newProduct_array[j].discount == "null")
				quoteInfo += '<td id="discountCell_'+k+'" style="visibility:'+discountCell_visibility+'"><input type="text" value="" id="discount_'+k+'"  class="discount" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateProductSell(bool,'+k+')" onblur="updateProduct('+k+')"/></td>';
				else
				quoteInfo += '<td id="discountCell_'+k+'" style="visibility:'+discountCell_visibility+'"><input type="text" value="'+newProduct_array[j].discount+'" id="discount_'+k+'"  class="discount" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)" onkeyup="generateProductSell(bool,'+k+')" onblur="updateProduct('+k+')"/></td>';
				
				
				///////////////////////////////////

				// SELL PRICE FIELD
				///////////////////////////////////
				
				if(newProduct_array[j].sellPrice == "null")
				quoteInfo += '<td id="sellPriceCell_'+k+'" style="visibility:'+sellPriceCell_visibility+'"><input type="text" value="" id="sellPrice_'+k+'"  class="sellPrice" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)"  onkeyup="generateProductTotal(bool,this.value,'+k+')" onblur="updateProduct('+k+')"/></td>';
				else 
				quoteInfo += '<td id="sellPriceCell_'+k+'" style="visibility:'+sellPriceCell_visibility+'"><input type="text" value="'+newProduct_array[j].sellPrice+'" id="sellPrice_'+k+'"  class="sellPrice" onfocus="bool = false" onkeypress="return bool = onlyNumbers(event)"  onkeyup="generateProductTotal(bool,this.value,'+k+')" onblur="updateProduct('+k+')"/></td>';
				
				
				////////////////////////////////////

				// TOTAL PRICE FIELD
				/////////////////////////////////////
				
				if (newProduct_array[j].sellPrice == "null" || newProduct_array[j].sellPrice == 0 ||newProduct_array[j].newQuant == "" ) 
				quoteInfo += '<td id="totalCell_'+k+'" style="visibility:'+totalCell_visibility+'"><input type="text" value="$0" id="total_'+k+'"  class="'+cssTotalClass+'" readonly="readonly"/></td>';
				else {
				if(newProduct_array[j].newQuant == "" || newProduct_array[j].newQuant == "null") 
				quoteInfo += '<td id= "totalCell_'+k+'" style="visibility:'+totalCell_visibility+'"><input type="text" value="$'+(newProduct_array[j].sellPrice * newProduct_array[j].quant).toFixed(2)+'" id="total_'+k+'"  class="'+cssTotalClass+'" readonly="readonly"/></td>';
				else 
				quoteInfo += '<td id= "totalCell_'+k+'" style="visibility:'+totalCell_visibility+'"><input type="text" value="$'+(newProduct_array[j].sellPrice * newProduct_array[j].newQuant).toFixed(2)+'" id="total_'+k+'"  class="'+cssTotalClass+'" readonly="readonly"/></td>';
				}
				
				///////////////////////////////////////////////

				////OPTIONS FIELDS
				////////////////////////////
				
				
				//quoteInfo += '<td id="option1_'+k+'" class = "imgInfo" ><input type="image" id="'+k+'"title="Edit" src="editBtn.png" onclick="editNewLine(this.id)" style="width:16px; height:16px"/></td>';
				quoteInfo += '<td id="option_'+k+'" class = "imgInfo" ><input type="image" class="deleteImg" id="'+k+'"title="Delete" src="quote/deleteBtn.png" onclick="deleteNewLine(this.id)" style="width:16px; height:16px"/></td>';
				//quoteInfo += '<td id="option1_'+k+'" class = "imgInfo" ></td>';

				////////////////////////
				quoteInfo += '</tr>'; 
			
			}
			/////////////
		}
	
	}
	
	return quoteInfo; 
	
}//end of newProductsRows()
//////////////////////////////////////////////////

//deletes the row from quote page and regenerates the table
//////////////////////////////////////////////////
function deleteNewLine(lineNum){

	var index = lineNum - bom_array.length;
	
	// rebuild bom_array
	bom_array = flash.planner();
	
	newProduct_array = flash.deleteProduct(index);

	var oElement = document.getElementById("plannerQuote");
	
	// generate table
	////////////////////////////////////////////////

	//var quoteInfo = '<table  id ="plannerTable" style="font-size:9px; font-family:Verdana; width:750px;border-collapse:collapse;border-style:solid"  cellpadding = 5 border = 1 >';
	var quoteInfo = tableHeader(); 
	//header rows
	quoteInfo += headerRows();
	
	// bom rows 
	////////////////
	quoteInfo += bomRows(quote_style);
	
	//BUILD ADDITIONAL PRODUCT ROWS
	///////////
	quoteInfo += newProductsRows("edit");
	
	//qoute total
	/////
	quoteInfo += quoteTotal();
	////
	
	//quoteInfo += '</table>'; 
	quoteInfo += tableFooter();
	/////////////////////////////////////////////////

	oElement.innerHTML = "";
	oElement.innerHTML = quoteInfo;

}// end of deleteNewLine()
//////////////////////////////////////////////////

//adds new row 
//////////////////////////////////////////////////
function addLine(){

	var oElement = document.getElementById("plannerQuote");

	// rebuild bom_array
	bom_array = flash.planner();

	newProduct_array = flash.resizeNewProduct();
	//alert(newProduct_array.length); 

	// generate table
	////////////////////////////////////////////////

	//var quoteInfo = '<table  id ="plannerTable" style=" font-size:9px; font-family:Verdana; width:750px;border-collapse:collapse;"  cellpadding = 5 border = 1 >';
	var quoteInfo = tableHeader();
	
	//header rows
	quoteInfo += headerRows();

	// bom rows 
	////////////////
	quoteInfo += bomRows(quote_style);
	/////////////////////////////////////////////////////////////////////////////

	// additional product row(s)
	/////////////////////////////////////////////////////////
	quoteInfo += newProductsRows("add");

	//qoute total
	/////
	quoteInfo += quoteTotal();
	////
	//quoteInfo += '</table>'; 
	quoteInfo += tableFooter();
	/////////////////////////////////////////////////

	oElement.innerHTML = "";
	oElement.innerHTML = quoteInfo;

	//set the focus on newly created line
	////////////////////////////////////////////////////////
	var lineNum = (bom_array.length + newProduct_array.length)-1;
	var id = "series_" + lineNum; 
	if(navigator.appName.indexOf("Microsoft") != -1){//ie 
		var objDiv = document.getElementById("mainQuote");
		objDiv.scrollTop = objDiv.scrollHeight;
	}
	else{// Firefox 
		document.getElementById(id).focus();
	}
	//////////////////////////////////////////////////////////

}//end of addLine()
//////////////////////////////////////////////////


function popUp(URL) {

	//alert(URL);
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=450,height=450,left = 287,top = 234');");

}//end of popUp()

//hides quote page and shows planner
//////////////////////////////////////////////////
function show(reason){
	if(reason == 'contactUs'){
		flash.quoteContactUs();
	}
	else{
		flash.goToPrevStep();
	}
	//alert("hello");
	var oquote = document.getElementById("quote");
	oquote.blur();
	////
	//flash.setCheckboxes(seriesCell_visibility,skuCell_visibility,descCell_visibility,finishCell_visibility,listPriceCell_visibility,sellPriceCell_visibility,totalCell_visibility,discountCell_visibility);
	///
	oquote.innerHTML = ""; 
	oqoute = null; 
	

	/// setting all the arrays to null 
	/////////////////////////////////////
	//officePlanner_array = null;  
	bom_array = null;  
	color_array = null;   
	newProduct_array = null; 
	//////////////////////////////////////

	oquote.style.visibility="hidden";


	if(browser != "ie")
		document.getElementById("flashcontent").style.visibility="visible";
	else 
	{
		var objDiv = document.getElementById("container");
		objDiv.scrollTop = 0;
		flash.showPlanner();
	}
	
}// end of show()
//////////////////////////////////////////////////

// hides/unhides columns
//////////////////////////////////////////////////
function hideColumn(checked,str,colName){

//alert(str);
//alert(checked);
	if(checked){
		eval(str + "visibility = 'hidden'");
		//alert(seriesCell_visibility);
		document.getElementById(str).innerHTML = ''; 
		//document.getElementById(str).style.visibility = 'hidden';
		for(var i = 0 ; i < bom_array.length; i++){
			idStr = str + i;
		
			document.getElementById(idStr).style.visibility = "hidden"; 
			//document.getElementById(idStr).style.color = "white"; 
		}
		for(var j = 0; j<newProduct_array.length; j++){
			var k = j+bom_array.length; 
			idStr = str + k;
			document.getElementById(idStr).style.visibility = "hidden"; 
		}
	}
	else {
		eval(str + "visibility = 'visible'");
		document.getElementById(str).innerHTML = colName; 
		//document.getElementById(str).style.visibility = 'visible';
		for(var i = 0 ; i < bom_array.length; i++){
			idStr = str + i;
			document.getElementById(idStr).style.visibility = "visible"; 
			//document.getElementById(idStr).style.color = "black"; 
		}
		for(var j = 0; j<newProduct_array.length; j++){
			var k = j+bom_array.length; 
			idStr = str + k;
			document.getElementById(idStr).style.visibility = "visible"; 
		}
	}
	flash.setCheckboxes(seriesCell_visibility,skuCell_visibility,descCell_visibility,finishCell_visibility,listPriceCell_visibility,sellPriceCell_visibility,totalCell_visibility,discountCell_visibility);
}//end of hideColumn()
//////////////////////////////////////////////////

// updates planner on windows key up event
//////////////////////////////////////////////////
function updatePlanner(lineNum){

	var discount_Id = 'discount_' + lineNum; 
	var discountBox = document.getElementById(discount_Id); 
	var sell_Id = 'sellPrice_' + lineNum; 
	var sellPriceBox = document.getElementById(sell_Id);
	

	flash.plannerUpdate(lineNum,discountBox.value,sellPriceBox.value,bom_array);
	
}// end of updatePlanner()
//////////////////////////////////////////////////

// updates sell price and total price on windows key up event
//////////////////////////////////////////////////
function updateProduct(lineNum){
	
	//convert row line # to index of an array
	var index = lineNum - bom_array.length;
	
	var discount_Id = 'discount_' + lineNum; 
	var discountBox = document.getElementById(discount_Id); 
	var sell_Id = 'sellPrice_' + lineNum; 
	var sellPriceBox = document.getElementById(sell_Id); 
	
	//converting ids to point to right index of on array
	//since lineNum is associated with a table
	/////////////////////
	sell_Id = 'sellPrice_' + index;
	discount_Id = 'discount_' + index; 
	////////////////////////////////////////////


	flash.newProductUpdate(discount_Id,discountBox.value);
	flash.newProductUpdate(sell_Id,sellPriceBox.value);
	
}//end of updateProduct()
//////////////////////////////////////////////////

//updates listprice for new products  on windows key up event
//////////////////////////////////////////////////
function updateListPrice(lineNum){
	//convert row line # to index of an array
	var index = lineNum - bom_array.length;
	
	var sell_Id = 'sellPrice_' + lineNum; 
	var sellPriceBox = document.getElementById(sell_Id); 
	var list_Id = 'listPrice_' + lineNum;
	var listPriceBox = document.getElementById(list_Id);
	var discount_Id = 'discount_' + lineNum;
	var discountBox = document.getElementById(discount_Id);
	
	//converting ids to point to right index of on array
	//since lineNum is associated with a table
	/////////////////////
	sell_Id = 'sellPrice_' + index;
	list_Id = 'listPrice_' + index; 
	discount_Id = 'discount_' + index; 
	////////////////////////////////////////////
	
	//alert(sell_Id + " " + list_Id);
	/*
	var listPrice; 
	if(!listPriceBox.value)
		listPrice = 0;
	else 
		listPrice = listPriceBox.value.indexOf("$") == -1 ? listPriceBox.value : listPriceBox.value.split("$")[1];
	*/
	flash.newProductUpdate(discount_Id,discountBox.value);
	//flash.newProductUpdate(list_Id,listPrice);
	flash.newProductUpdate(list_Id,listPriceBox.value);
	flash.newProductUpdate(sell_Id,sellPriceBox.value);

}// end of updateListPrice()
//////////////////////////////////////////////////

//updates listprice for product on the floor on windows key up event
//////////////////////////////////////////////////
function updateBomListPrice(lineNum){
	//convert row line # to index of an array
	//var index = lineNum - bom_array.length;
	
	var sell_Id = 'sellPrice_' + lineNum; 
	var sellPriceBox = document.getElementById(sell_Id); 
	var list_Id = 'listPrice_' + lineNum;
	var listPriceBox = document.getElementById(list_Id);
	var discount_Id = 'discount_' + lineNum;
	var discountBox = document.getElementById(discount_Id);
	
	//converting ids to point to right index of on array
	//since lineNum is associated with a table
	/////////////////////
	sell_Id = 'newPrice_' + lineNum;
	list_Id = 'newlistPrice_' + lineNum; 
	discount_Id = 'disc_' + lineNum; 
	////////////////////////////////////////////
	
	//alert(sell_Id + " " + list_Id);
	
	var listPrice; 
	if(!listPriceBox.value)
		listPrice = 0;
	else 
		listPrice = listPriceBox.value.indexOf("$") == -1 ? listPriceBox.value : listPriceBox.value.split("$")[1];
		
	var sellPrice; 
	if(!sellPriceBox.value)
		sellPrice = 0;
	else 
		sellPrice = sellPriceBox.value.indexOf("$") == -1 ? sellPriceBox.value : sellPriceBox.value.split("$")[1];
	
	//flash.bomProductUpdate(discount_Id,discountBox.value,bom_array);
	flash.bomProductUpdate(list_Id,listPrice,bom_array);
	flash.bomProductUpdate(sell_Id,sellPrice,bom_array);
	//flash.bomProductUpdate(sell_Id,sellPriceBox.value,bom_array);

}// end of updateBomListPrice()
//////////////////////////////////////////////////

//updates new quantity  on windows key up event
//////////////////////////////////////////////////
function updateQty(lineNum){
	
	var newQty_Id = 'newQuant_' + lineNum; 
	var newQuantityBox = document.getElementById(newQty_Id); 
	
	flash.qtyUpdate(lineNum,newQuantityBox.value,bom_array);
	
}// end of updateQty()
//////////////////////////////////////////////////

// print
//////////////////////////////////////////////////
function printPage(){
 
 window.print();
 
}// end of print()
//////////////////////////////////////////////////

// updates new products on windows key up event
//////////////////////////////////////////////////
function updateNewProduct(id,val){

	var strArray = id.split('_'); 
	var str = strArray[0]; 
	var lineNum = parseInt(strArray[1]);

	//convert row line # to index of an array
	var index = lineNum - bom_array.length;

	var newId = str+"_"+index; 
	//alert(newId);

	flash.newProductUpdate(newId,val);

}// end of updateNewProduct()
//////////////////////////////////////////////////

// updates new products on windows key up event
//////////////////////////////////////////////////
function updateBomProduct(id,val){

	var strArray = id.split('_'); 
	var str = "new"+strArray[0]; 
	var lineNum = parseInt(strArray[1]);

	//convert row line # to index of an array
	//var index = lineNum - bom_array.length;

	var newId = str+"_"+lineNum; 
	//alert(newId);

	flash.bomProductUpdate(newId,val,bom_array);

}// end of updateNewProduct()
//////////////////////////////////////////////////

//generates sell price and total price  on windows key up event
//////////////////////////////////////////////////
function generateSell(e,discount,lineNum,listPrice){
	
	if(e){

		var sellPrice; 
		var totalPrice; 

		var sell_Id = 'sellPrice_' + lineNum; 
		var sellPriceBox = document.getElementById(sell_Id); 
		var total_Id = 'total_' + lineNum; 
		var totalPriceBox = document.getElementById(total_Id); 
		var qty_Id = 'quantCell_' + lineNum; 
		var quantityCell = document.getElementById(qty_Id); 
		var newQty_Id = 'newQuant_' + lineNum; 
		var newQuantityBox = document.getElementById(newQty_Id); 
		var subTotalBox = document.getElementById("subTotal");

		var subTotalWithTaxBox = document.getElementById("subTotalWithTax");
		var grandTotalBox = document.getElementById("grandTotal");
		var tax = (!document.getElementById("tax").value) ? 0 : parseFloat(document.getElementById("tax").value);
		var design = (!document.getElementById("design").value) ? 0 : parseFloat(document.getElementById("design").value);
		var delivery = (!document.getElementById("delivery").value) ? 0 : parseFloat(document.getElementById("delivery").value);
		var installation = (!document.getElementById("installation").value) ? 0 : parseFloat(document.getElementById("installation").value);
		
		if(listPrice == 1){ //Generia planner
			listPrice = 0;
		}
		
		if(discount){
			//calculating sell price 
			///////////////////////
			sellPrice = (parseFloat(listPrice)-(parseFloat(listPrice)*(parseFloat(discount)/100))) > 0 ? (parseFloat(listPrice)-(parseFloat(listPrice)*(parseFloat(discount)/100))).toFixed(2) : 0;
			if(!newQuantityBox.value)
			totalPrice = (sellPrice * quantityCell.innerHTML) > 0 ? (sellPrice * quantityCell.innerHTML).toFixed(2) : 0; 
			else 
			totalPrice = (sellPrice * newQuantityBox.value) > 0 ? (sellPrice * newQuantityBox.value).toFixed(2) : 0; 
		}
		else
		{
			if((flash.bomConfig() == "inwood") || (flash.bomConfig() == "midmarket" && flash.dealerLevel() == "1")){
				sellPrice = 0; 
				totalPrice = 0; 
			}
			else if(flash.bomConfig() == "midmarket" && flash.dealerLevel() != "1"){
			
				sellPrice = bom_array[lineNum].ass_price;
				if(bom_array[lineNum].newQuant == "" || bom_array[lineNum].newQuant == "undefined" || bom_array[lineNum].newQuant == undefined || bom_array[lineNum].newQuant == null || bom_array[lineNum].newQuant == "null") {
					totalPrice = bom_array[lineNum].ass_price * bom_array[lineNum].quant
				}
				else{
					totalPrice = bom_array[lineNum].ass_price * bom_array[lineNum].newQuant
				}
				
			}

		}

		sellPriceBox.value = (sellPrice == 0) ? "" : sellPrice; 
		//totalPriceBox.value = "$" + totalPrice; 
		totalPriceBox.value = "$" + formatCurrency(totalPrice); 

		var subTotal = parseFloat(generateSubTotal("edit"));
		//subTotalBox.value = '$'+subTotal.toFixed(2); 
		subTotalBox.value = '$'+ formatCurrency(subTotal);//.toFixed(2); 

		var total = subTotal + (subTotal * parseFloat(tax)/100);
		//subTotalWithTaxBox.value = "$" + total.toFixed(2);
		subTotalWithTaxBox.value = "$" + formatCurrency(total);//.toFixed(2);
		
		
		total += (design + delivery + installation); 
		//grandTotalBox.value = "$" + total.toFixed(2); 
		grandTotalBox.value = "$" + formatCurrency(total);//.toFixed(2); 

	}

}// end of generateSell()
//////////////////////////////////////////////////

//generates sell price and total price for new products on windows key up event
//////////////////////////////////////////////////
function generateProductSell(e,lineNum){

	if(e){
		var sellPrice; 
		var totalPrice; 
		var listPrice;
		var discount; 
		
		var sell_Id = 'sellPrice_' + lineNum; 
		var sellPriceBox = document.getElementById(sell_Id); 
		var total_Id = 'total_' + lineNum; 
		var totalPriceBox = document.getElementById(total_Id); 
		var qty_Id = 'quantCell_' + lineNum; 
		var quantityCell = document.getElementById(qty_Id); 
		var newQty_Id = 'newQuant_' + lineNum; 
		var newQuantityBox = document.getElementById(newQty_Id); 
		var listPrice_Id = 'listPrice_' + lineNum; 
		var listPriceBox = document.getElementById(listPrice_Id);
		var discount_Id = 'discount_' + lineNum; 
		var discountBox = document.getElementById(discount_Id); 
		var subTotalBox = document.getElementById("subTotal");
		
		var subTotalWithTaxBox = document.getElementById("subTotalWithTax");
		var grandTotalBox = document.getElementById("grandTotal");
		var tax = (!document.getElementById("tax").value) ? 0 : parseFloat(document.getElementById("tax").value);
		var design = (!document.getElementById("design").value) ? 0 : parseFloat(document.getElementById("design").value);
		var delivery = (!document.getElementById("delivery").value) ? 0 : parseFloat(document.getElementById("delivery").value);
		var installation = (!document.getElementById("installation").value) ? 0 : parseFloat(document.getElementById("installation").value);
		
		discount = discountBox.value;
		
		if(!listPriceBox.value)
			listPrice = 0;
		else 
			listPrice = listPriceBox.value.indexOf("$") == -1 ? listPriceBox.value : listPriceBox.value.split("$")[1];
		

		if(discount){
		
		
			//calculating sell price 
			///////////////////////
			sellPrice = (parseFloat(listPrice)-(parseFloat(listPrice)*(parseFloat(discount)/100))) > 0 ? (parseFloat(listPrice)-(parseFloat(listPrice)*(parseFloat(discount)/100))).toFixed(2) : 0;
			if(!newQuantityBox.value)
			totalPrice = (sellPrice * quantityCell.innerHTML) > 0 ? (sellPrice * quantityCell.innerHTML).toFixed(2) : 0; 
			
			else 
			totalPrice = (sellPrice * newQuantityBox.value) > 0 ? (sellPrice * newQuantityBox.value).toFixed(2) : 0; 
			
			////////////////////////////

		}
		else
		{
			sellPrice = 0; 
			totalPrice = 0; 
		
		}

		sellPriceBox.value = (sellPrice == 0) ? "" : sellPrice; 
		//totalPriceBox.value = "$" + totalPrice; 
		totalPriceBox.value = "$" + formatCurrency(totalPrice); 

		var subTotal = parseFloat(generateSubTotal("edit"));
		
		subTotalBox.value = '$'+ formatCurrency(subTotal);//.toFixed(2); 

		var total = subTotal + (subTotal * parseFloat(tax)/100);
		subTotalWithTaxBox.value = "$" + formatCurrency(total);//.toFixed(2);
		
		total += (design + delivery + installation); 
		grandTotalBox.value = "$" + formatCurrency(total);//.toFixed(2); 

	}

}// end of generateProductSell()
//////////////////////////////////////////////////

//generates total price  for new products on windows key up event
//////////////////////////////////////////////////
function generateNewTotal(e,qty,lineNum){

	var sell_Id = 'sellPrice_' + lineNum; 
	var sellPriceBox = document.getElementById(sell_Id); 
	var total_Id = 'total_' + lineNum; 
	var totalPriceBox = document.getElementById(total_Id);
	var subTotalBox = document.getElementById("subTotal");

	var subTotalWithTaxBox = document.getElementById("subTotalWithTax");
	var grandTotalBox = document.getElementById("grandTotal");
	var tax = (!document.getElementById("tax").value) ? 0 : parseFloat(document.getElementById("tax").value);
	var design = (!document.getElementById("design").value) ? 0 : parseFloat(document.getElementById("design").value);
	var delivery = (!document.getElementById("delivery").value) ? 0 : parseFloat(document.getElementById("delivery").value);
	var installation = (!document.getElementById("installation").value) ? 0 : parseFloat(document.getElementById("installation").value);

	if(qty){
		if(isNaN(sellPriceBox.value * qty) || !sellPriceBox.value || qty == 0)
			totalPriceBox.value = '$0'; 
		else
			//totalPriceBox.value = '$' + (sellPriceBox.value * qty).toFixed(2); 
			totalPriceBox.value = '$' + formatCurrency((sellPriceBox.value * qty));
	}
	else {
		var qty_Id = 'quantCell_' + lineNum; 
		var quantityCell = document.getElementById(qty_Id); 

		totalPriceBox.value = (!sellPriceBox.value) ? '$0' : '$' + formatCurrency((sellPriceBox.value * quantityCell.innerHTML));
	}
	var subTotal = parseFloat(generateSubTotal("edit"));
	//subTotalBox.value = '$'+subTotal.toFixed(2); 
	subTotalBox.value = '$'+ formatCurrency(subTotal);//.toFixed(2); 

	var total = subTotal + (subTotal * parseFloat(tax)/100);
	//subTotalWithTaxBox.value = "$" + total.toFixed(2);
	subTotalWithTaxBox.value = "$" + formatCurrency(total);//.toFixed(2);

	total += (design + delivery + installation); 
	//grandTotalBox.value = "$" + total.toFixed(2);
	grandTotalBox.value = "$" + formatCurrency(total);//.toFixed(2);

}
//////////////////////////////////////////////////

//generates total price  for new products on windows key up event
//////////////////////////////////////////////////
function generateNewProductTotal(e,qty,lineNum){

	//if(e){
	var sell_Id = 'sellPrice_' + lineNum; 
	var sellPriceBox = document.getElementById(sell_Id); 
	var total_Id = 'total_' + lineNum; 
	var totalPriceBox = document.getElementById(total_Id);
	if(qty){
		if(isNaN(sellPriceBox.value * qty) || !sellPriceBox.value || qty == 0)
			totalPriceBox.value = '$0'; 
		else
			totalPriceBox.value = '$' + (sellPriceBox.value * qty).toFixed(2); 
	}
	else {
		totalPriceBox.value = "$0"; //(!sellPriceBox.value) ? '$0' : '$' + (sellPriceBox.value * quantityBox.innerHTML).toFixed(2);
	}

}// end of generateNewTotal()
//////////////////////////////////////////////////

//generates sell price and total price  on windows key up event
//////////////////////////////////////////////////
function generateTotal(e,sellPrice, lineNum){

	var total_Id = 'total_' + lineNum; 
	var totalPriceBox = document.getElementById(total_Id); 
	var qty_Id = 'quantCell_' + lineNum; 
	var quantityCell = document.getElementById(qty_Id); 
	var discount_Id = 'discount_' + lineNum; 
	var discountBox = document.getElementById(discount_Id); 
	var sell_Id = 'sellPrice_' + lineNum; 
	var sellPriceBox = document.getElementById(sell_Id); 
	var list_Id = 'listPriceCell_' + lineNum;
	var listPriceCell = document.getElementById(list_Id);
	var newQty_Id = 'newQuant_' + lineNum; 
	var newQuantityBox = document.getElementById(newQty_Id); 
	var subTotalBox = document.getElementById("subTotal");

	var subTotalWithTaxBox = document.getElementById("subTotalWithTax");
	var grandTotalBox = document.getElementById("grandTotal");
	var tax = (!document.getElementById("tax").value) ? 0 : parseFloat(document.getElementById("tax").value);
	var design = (!document.getElementById("design").value) ? 0 : parseFloat(document.getElementById("design").value);
	var delivery = (!document.getElementById("delivery").value) ? 0 : parseFloat(document.getElementById("delivery").value);
	var installation = (!document.getElementById("installation").value) ? 0 : parseFloat(document.getElementById("installation").value);
	
	
	// empty discount box
	////////////////////////////////////////////////
	//if((parseFloat(listPriceCell.innerHTML.split("$")[1])-(parseFloat(listPriceCell.innerHTML.split("$")[1])*((discountBox.value)/100))).toFixed(2) != sellPrice)
	if((parseFloat(toNumber(listPriceCell))-(parseFloat(toNumber(listPriceCell))*((discountBox.value)/100))).toFixed(2) != sellPrice)
		discountBox.value = ""; 
		
	////////////////////////////////////////////////

	if(sellPrice){
		if(!newQuantityBox.value){
			if (isNaN(sellPrice * quantityCell.innerHTML)){
				totalPriceBox.value = "$0"; 
				sellPriceBox.value = ""; 
			}
			else 
				//totalPriceBox.value ='$' + (sellPrice * quantityCell.innerHTML).toFixed(2);
				totalPriceBox.value ='$' + formatCurrency((sellPrice * quantityCell.innerHTML));//.toFixed(2);
		}
		else {
			if (isNaN(sellPrice * newQuantityBox.value)){
				totalPriceBox.value = "$0"; 
				sellPriceBox.value = ""; 
			}
			else
				//totalPriceBox.value = '$' + (sellPrice * newQuantityBox.value).toFixed(2);
				totalPriceBox.value = '$' + formatCurrency((sellPrice * newQuantityBox.value));//.toFixed(2);
		}
	}

	else 
		totalPriceBox.value = '$0';

	var subTotal = parseFloat(generateSubTotal("edit"));
	//subTotalBox.value = '$'+subTotal.toFixed(2); 
	subTotalBox.value = '$'+ formatCurrency(subTotal);//.toFixed(2); 

	var total = subTotal + (subTotal * parseFloat(tax)/100);
	//subTotalWithTaxBox.value = "$" + total.toFixed(2);
	subTotalWithTaxBox.value = "$" + formatCurrency(total);//.toFixed(2);


	total += (design + delivery + installation); 
	//grandTotalBox.value = "$" + total.toFixed(2);
	grandTotalBox.value = "$" + formatCurrency(total);//.toFixed(2);
	
}//end of generateTotal()
//////////////////////////////////////////////////

//generates total price  on windows key up event
//////////////////////////////////////////////////
function generateProductTotal(e,sellPrice, lineNum){


	var listPrice;
	var total_Id = 'total_' + lineNum; 
	var totalPriceBox = document.getElementById(total_Id); 
	var qty_Id = 'quantCell_' + lineNum; 
	var quantityCell = document.getElementById(qty_Id); 
	var discount_Id = 'discount_' + lineNum; 
	var discountBox = document.getElementById(discount_Id); 
	var sell_Id = 'sellPrice_' + lineNum; 
	var sellPriceBox = document.getElementById(sell_Id); 
	var list_Id = 'listPrice_' + lineNum;
	var listPriceBox = document.getElementById(list_Id);
	var newQty_Id = 'newQuant_' + lineNum; 
	var newQuantityBox = document.getElementById(newQty_Id); 
	var subTotalBox = document.getElementById("subTotal");
	
	var subTotalWithTaxBox = document.getElementById("subTotalWithTax");
	var grandTotalBox = document.getElementById("grandTotal");
	var tax = (!document.getElementById("tax").value) ? 0 : parseFloat(document.getElementById("tax").value);
	var design = (!document.getElementById("design").value) ? 0 : parseFloat(document.getElementById("design").value);
	var delivery = (!document.getElementById("delivery").value) ? 0 : parseFloat(document.getElementById("delivery").value);
	var installation = (!document.getElementById("installation").value) ? 0 : parseFloat(document.getElementById("installation").value);

	if(!listPriceBox.value)
		listPrice = 0;
	else 
		listPrice = listPriceBox.value.indexOf("$") == -1 ? listPriceBox.value : listPriceBox.value.split("$")[1];
	// empty discount box
	if((parseFloat(listPrice)-(parseFloat(listPrice)*((discountBox.value)/100))).toFixed(2) != sellPrice)
		discountBox.value = ""; 

	if(sellPrice){
		if(!newQuantityBox.value){
			if (isNaN(sellPrice * quantityCell.innerHTML)){
				totalPriceBox.value = "$0"; 
				sellPriceBox.value = ""; 
			}
			else 
				//totalPriceBox.value ='$' + (sellPrice * quantityCell.innerHTML).toFixed(2);
				totalPriceBox.value ='$' + formatCurrency((sellPrice * quantityCell.innerHTML));//.toFixed(2);
		}
		else {
			if (isNaN(sellPrice * newQuantityBox.value)){
				totalPriceBox.value = "$0"; 
				sellPriceBox.value = ""; 
			}
			else
				//totalPriceBox.value = '$' + (sellPrice * newQuantityBox.value).toFixed(2);
				totalPriceBox.value = '$' + formatCurrency((sellPrice * newQuantityBox.value));//.toFixed(2);
		}
	}

	else 
		totalPriceBox.value = '$0';


		
	var subTotal = parseFloat(generateSubTotal("edit"));
	subTotalBox.value = '$'+ formatCurrency(subTotal);//.toFixed(2); 

	var total = subTotal + (subTotal * parseFloat(tax)/100);
	subTotalWithTaxBox.value = "$" + formatCurrency(total);//.toFixed(2);
	
	total += (design + delivery + installation); 
	grandTotalBox.value = "$" + formatCurrency(total);//.toFixed(2);
	

}// end  of generateProductTotal()
//////////////////////////////////////////////////

//only numbers to be typed
//////////////////////////////////////////////////
function onlyNumbers2(e){
  var charCode = (e.which) ? e.which : event.keyCode;
 // keychar = String.fromCharCode(charCode);
       if (charCode > 31 && (charCode < 46 || charCode > 57 || charCode == 47) && (charCode < 96 || charCode > 105)  && charCode != 190 && charCode != 37 && charCode != 39 && charCode != 110)
           return false;
			
  return true;
  
}// end of onlyNumbers2()
//////////////////////////////////////////////////

//only numbers to be typed
//////////////////////////////////////////////////
function onlyNumbers(e){

	var keynum;
	var keychar;
	var numcheck;

	if(window.event){ // IE
		keynum = e.keyCode;
	}
	else if(e.which){ // Netscape/Firefox/Opera
		keynum = e.which;
	}
	keychar = String.fromCharCode(keynum);
	//numcheck = /[:;`~&!@#$%^*()_+={}?><-]|[a-z]|[A-Z]|\[|\]|\,|\'|\"|\//;
	numcheck = /[:;`~&!@#$%^*()_+={}?><-]|[a-z]|[A-Z]|\[|\]|\,|\'|\"|\/|\||\\/;
	return !numcheck.test(keychar);

}// end of onlyNumbers()
//////////////////////////////////////////////////

// no special character to be typed
//////////////////////////////////////////////////
function noSpecialChars(e){

	var keynum;
	var keychar;
	var numcheck;

	if(window.event) // IE
	{
		keynum = e.keyCode;
	}
	else if(e.which) // Netscape/Firefox/Opera
	{
		keynum = e.which;
	}

	keychar = String.fromCharCode(keynum);
	//numcheck = /[:;`~&!#$%^*()_+={}?><]|\[|\]|\,|\'|\"/;
	numcheck = /[:;`~&!#$%^*()_+={}?><]|\[|\]|\,|\'|\"|\||\\/;
	return !numcheck.test(keychar);

}// end of noSpecialChars()
//////////////////////////////////////////////////

function controlContainer(){
	if(navigator.appName.indexOf("Microsoft") != -1){
		oquote = document.getElementById("quote");
		if(oquote.innerHTML != ""){
			var objDiv = document.getElementById("container");
			objDiv.scrollTop = objDiv.scrollHeight;
		}
	}
}// end of controlContainer()



//dealerInformation
//////////////////////////////////////////////////
function dealerInfo(name,address1,address2,phone,website){

	//table header
	////////
	var quoteInfo = '<table id="dealer" style="font-size:10px; font-family:Verdana; width:250px; border-collapse:collapse;" border = 0>'; 
	////

	//table body
	////
	quoteInfo += '<tr>';
	quoteInfo += '<td><b>'+name+'</b></td>'; 
	quoteInfo += '</tr>';

	quoteInfo += '<tr>';
	quoteInfo += '<td>'+address1+'</td>'; 
	quoteInfo += '</tr>';

	quoteInfo += '<tr>';
	quoteInfo += '<td>'+address2+'</td>'; 
	quoteInfo += '</tr>';

	quoteInfo += '<tr>';
	quoteInfo += '<td>'+phone+'</td>'; 
	quoteInfo += '</tr>';

	quoteInfo += '<tr>';
	quoteInfo += '<td>'+website+'</td>'; 
	quoteInfo += '</tr>';
	////


	//table footer
	////
	quoteInfo += '</table>';
	////
	return quoteInfo; 

}// end of dealerInfo()
//////////////////////////////////////////////////

// computes the sellPrice when quote table is generated
function newSellPrice(discount,listPrice,newlistPrice,newPrice){

/*if(discount == null || discount == "null" || discount == undefined || discount == "undefined")
	dis = "nil"
else
	dis = discount; 
	
if(listPrice == null || listPrice == "null" || listPrice == undefined || listPrice == "undefined")
	list = "nil"
else
	list = listPrice; 
	
if(newlistPrice == null || newlistPrice == "null" || newlistPrice == undefined || newlistPrice == "undefined")
	newlist = "nil"
else
	newlist = newlistPrice; 
	
if(newPrice == null || newPrice == "null" || newPrice == undefined || newPrice == "undefined")
	newPr = "nil"
else
	newPr = newPrice; 
	
	
	alert(dis + " : " + list + " : " + newlist + " : " + newPr); */
	
	
	if(discount == null || discount == "null" || discount == undefined || discount == "undefined"){
		
			return newPrice; 
	}
	else{
		if(newlistPrice != "null" && newlistPrice != null && newlistPrice != "undefined" && newlistPrice != undefined && newlistPrice != "" ){
			sellPrice = (parseFloat(newlistPrice)-(parseFloat(newlistPrice)*(parseFloat(discount)/100))) > 0 ? (parseFloat(newlistPrice)-(parseFloat(newlistPrice)*(parseFloat(discount)/100))): 0;
		}
		else{
			if(listPrice == 1) listPrice = 0; //Generic Planner
			sellPrice = (parseFloat(listPrice)-(parseFloat(listPrice)*(parseFloat(discount)/100))) > 0 ? (parseFloat(listPrice)-(parseFloat(listPrice)*(parseFloat(discount)/100))): 0;
		}
		
			return sellPrice; 
	}
}


