function addCopyMTO() {
	
	//var title = "Assays in Tubes(Made to Order)";
	var title = "Single Tube Assays - Made-to-order";
	var format = "";
	var noofreactions = getExperimentInfo('noofreplicates')
			* getExperimentInfo('noofsamples') * getExperimentInfo('nooftargets');
	//alert(noofreactions);
	//var formatObj = findOptimumGeneMicroExpTubeRecord(noofreactions, "MTO");
	var formatObj = GetCopyModel();
	//alert(formatObj);
	format = formatObj.get("concatenate");
	format = format.replace(/_/gi,' ');
	format = format.replace(/Gene Expression/gi, 'Gene Expression Assays, ');
	format = format.replace(/miRNA/gi, 'MicroRNA Assays, ');
	format = format.replace(/small/gi, 'Small, ');
	format = format.replace(/Medium/gi, 'Medium, ');
	format = format.replace(/Large/gi, 'Large, ');
	format = "TaqMan® " + format;
	
	var tubenoofreactions = formatObj.get('numberofreactions');
	var noofunits = 0;
	var wellNum = 96;
	if (getExperimentInfo('equipment') == '96-well') {
		noofunits = Math.ceil(noofreactions
				/ formatObj.get('96-wellnumberofreactions'))
				* getExperimentInfo('nooftargets');
	} else if (getExperimentInfo('equipment') == '384-well') {
		wellNum = 384;
		noofunits = Math.ceil(noofreactions
				/ formatObj.get('384-wellnumberofreactions'))
				* getExperimentInfo('nooftargets');
	} else {
		wellNum = 384;
		noofunits = Math.ceil(noofreactions / tubenoofreactions);
		//alert("no " + noofunits);
	}
	noofunits = Math.ceil(noofreactions / tubenoofreactions);
	var mvolume = 0;
	if (getExperimentInfo('equipment') == '96-well') {
		mvolume = masterMixRequirements.wellplate96
				* getExperimentInfo('nooftargets')
				* getExperimentInfo('noofreplicates')
				* getExperimentInfo('noofsamples') / 1000;
	} else if (getExperimentInfo('equipment') == '384-well') {
		mvolume = masterMixRequirements.wellplate384
				* getExperimentInfo('nooftargets')
				* getExperimentInfo('noofreplicates')
				* getExperimentInfo('noofsamples') / 1000;
	} else {
		mvolume = masterMixRequirements.tubes
				* getExperimentInfo('nooftargets')
				* getExperimentInfo('noofreplicates')
				* getExperimentInfo('noofsamples') / 1000;
	}
	var mastermixObj = findOptimumGeneMicroMMXTubeRecord(mvolume);
	var mastermix = mastermixObj.get('product');

	var mnoofunits = Math.ceil(mvolume / mastermixObj.get('volume'));
	var partNumber = formatObj.get('partnumber');
	var assayCostPerUnit = pricelist.findRecord('partnumber', partNumber)
			.regions().findRecord('region', region + "-" + currency).get(
					'price');
	//alert(assayCostPerUnit);
	newTotalCost = assayCostPerUnit * noofunits;
	
	totalNewCostPerReaction = newTotalCost/noofreactions;
	totalNewCostPerSample = newTotalCost/getExperimentInfo('noofsamples');
	//alert(totalNewCostPerSample);
	var volumeDiscount = 0;
	var costWithVolDisc = noofunits * assayCostPerUnit
			* (1 - (volumeDiscount / 100));
	var assayperc = (Ext.get('assayperc').dom.value).split('%')[0];
	var totalAssayCost = costWithVolDisc * (1 - (assayperc / 100));
	var masterMixPartNumber = mastermixObj.get('partnumber');
	var masterMixCostPerUnit = pricelist.findRecord('partnumber',
			masterMixPartNumber).regions().findRecord('region',
			region + "-" + currency).get('price');
	var masterperc = (Ext.get('masterperc').dom.value).split('%')[0];
	var totalMasterMixCost = masterMixCostPerUnit * mnoofunits
			* (1 - (masterperc / 100));
	
	var numPlates = Math.ceil(getExperimentInfo('nooftargets')
			* getExperimentInfo('noofreplicates')
			* getExperimentInfo('noofsamples')/wellNum);
	//console.log("Number of plates: " + numPlates);
	var hours = Math.ceil(65/60 * 1.2 * numPlates);
	
	var totalCost = totalAssayCost + totalMasterMixCost;

	var assayCostPerReaction = totalAssayCost
			/ (getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
	var masterMixCostPerReaction = totalMasterMixCost
			/ (getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
	var optimizationCostPerReaction = 0;
	var totalCostPerReaction = assayCostPerReaction + masterMixCostPerReaction
			+ optimizationCostPerReaction;
	var productUrl = producturls.findRecord('partNumber', partNumber).get('productURL');

	var mmixCostPerSample = totalMasterMixCost
			/ getExperimentInfo('noofsamples');
	var assayCostPerSample = totalAssayCost / getExperimentInfo('noofsamples');
	
	var totalCostPerSample = assayCostPerSample + mmixCostPerSample;

	var totalCostPreDisc = costWithVolDisc
			+ (masterMixCostPerUnit * mnoofunits);
	var totalDiscount = 100 - (totalCost * 100 / totalCostPreDisc);
	
	outputList.add({
		pno : 6,
		title : title,
		partnumber : partNumber,
		format : format.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		noofunits : noofunits,
		noofreactions : noofreactions * getExperimentInfo('nooftargets'),
		mastermix : mastermix.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		mnoofunits : mnoofunits,
		//totalcost : roundNumber(totalCost, 2),
		totalcost : roundNumber(newTotalCost,2),
		volumediscount : volumeDiscount,
		mvolumediscount : masterperc,
		assayscost : roundNumber(costWithVolDisc, 2),
		assayscostperunit : roundNumber(assayCostPerUnit, 2),
		assayscostwithvoldisc : roundNumber(totalAssayCost, 2),
		mastermixvol : roundNumber(mvolume, 2),
		mastermixcostperunit : masterMixCostPerUnit,
		mastermixdisc : masterperc,
		mastermixcostwithdisc : roundNumber(totalMasterMixCost, 2),
		mastermixcostpredisc : roundNumber((masterMixCostPerUnit * mnoofunits),
				2),
		mastermixcost : roundNumber(masterMixCostPerUnit * mnoofunits, 2),
		mastermixpartnumber : masterMixPartNumber,
		mmxcostpersample : roundNumber(mmixCostPerSample, 2),
		assaycostpersample : roundNumber(assayCostPerSample, 2),
		totalcostpersample : roundNumber(totalNewCostPerSample, 2),
		totalcostpredisc : roundNumber(totalCostPreDisc, 2),
		totaldiscount : roundNumber(totalDiscount, 2),
		noofhours : hours,
		assaycostperreaction : assayCostPerReaction,
		mastermixcostperreaction : masterMixCostPerReaction,
		optimizationcostperreaction : roundNumber(optimizationCostPerReaction,
				2),
		totalcostperreaction : totalNewCostPerReaction,
		totalcostpersample : totalNewCostPerSample,
		producturl : productUrl,
		fnName:'addCopyMTO',
		type : 'tube'
	});

}
function addCopyNum() {
	
	//var title = "Assays in Tubes";
	var title = "Single Tube Assays - Made-to-order";
	var format = "";
	var noofreactions = getExperimentInfo('noofreplicates')* getExperimentInfo('noofsamples') * getExperimentInfo('nooftargets');
	var noofreactionspertarget = getExperimentInfo('noofreplicates')* getExperimentInfo('noofsamples');
	//var formatObj = findApproximateCopyNumberPre(noofreactionspertarget);
	var isOtherFormat = getExperimentInfo('isOtherFormat');
	var spno = 6;
	if( isOtherFormat === "YES" ){
		spno = getExperimentInfo('otherFmPano');
		var selOtherForVal = getExperimentInfo('selOtherFormatValue');
		var formatObj = findAppTapRecForOtherFormat(copyModel, 'concatenate', selOtherForVal);
	}else{
		updateExperimentInfo("currFmPno", spno);
		var formatObj = findOptimumCopyNumberTubeRecord(noofreactionspertarget,'Pre-designed assays');
	}
	format = formatObj.get("concatenate");
	format = format.replace(/_/gi,' ');
	format = format.replace(/Gene Expression/gi, 'Gene Expression Assays, ');
	format = format.replace(/miRNA/gi, 'MicroRNA Assays, ');
	format = format.replace(/small/gi, 'Small, ');
	format = format.replace(/Medium/gi, 'Medium, ');
	format = format.replace(/Large/gi, 'Large, ');
	format = format.replace("TaqMan","TaqMan®");
	//format = "TaqMan " + format;
	var refassayObj = Ext.get('referenceassay').dom;
    var assaypartoption = refassayObj.options[refassayObj.selectedIndex].value;
	var tubenoofreactions = formatObj.get('numberofreactions');
	
	var noofunits = getExperimentInfo('nooftargets');
	var wellNum = 96;
	
	var assaypartnumber = findOptimumCopyNumberRefAssay(noofreactions,assaypartoption,'Human');
	var assayrefobject = copyrefassayModel.findRecord('partnumber',assaypartnumber);
	
	if (getExperimentInfo('equipment') == '96-well') {
		tubenoofunits = Math.ceil(noofreactionspertarget/ formatObj.get('96-wellnumberofreactions'));
		var refassayreaction = assayrefobject.get('96-wellnumberofreactions'); 
	} else if (getExperimentInfo('equipment') == '384-well') {
		wellNum = 384;
		tubenoofunits = Math.ceil(noofreactionspertarget
				/ formatObj.get('384-wellnumberofreactions'));
		var refassayreaction = assayrefobject.get('384-wellnumberofreactions'); 
	} else {
		wellNum = 384;
		var refassayreaction = assayrefobject.get('384-wellnumberofreactions');
		tubenoofunits = Math.ceil(noofreactionspertarget / tubenoofreactions);
		//alert("no " + noofunits);
	}
	
     var noofunits_new = tubenoofunits * noofunits;
	refassayunits = Math.ceil(noofreactions / refassayreaction);
	//var priceperrefassayUnit = assayrefobject.regions().findRecord('region', region).prices().findRecord('countrycode', currency).get('value');
	var priceperrefassayUnit = pricelist.findRecord('partnumber', assaypartnumber)
			.regions().findRecord('region',
					region + "-" + currency).get(
					'price');
	var refassayname = assayrefobject.get('concatenate');
	var refassayquantity = refassayunits;
	
	
	var mvolume = 0;
	if (getExperimentInfo('equipment') == '96-well') {
		mvolume = masterMixRequirements.wellplate96
				* getExperimentInfo('nooftargets')
				* getExperimentInfo('noofreplicates')
				* getExperimentInfo('noofsamples') / 1000;
	} else if (getExperimentInfo('equipment') == '384-well') {
		mvolume = masterMixRequirements.wellplate384
				* getExperimentInfo('nooftargets')
				* getExperimentInfo('noofreplicates')
				* getExperimentInfo('noofsamples') / 1000;
	} else {
		mvolume = masterMixRequirements.tubes
				* getExperimentInfo('nooftargets')
				* getExperimentInfo('noofreplicates')
				* getExperimentInfo('noofsamples') / 1000;
	}
	var isOtherMMFormat = getExperimentInfo('isOtherMMFormat');
	if( isOtherMMFormat === "YES" ){
		spno = getExperimentInfo('otherFmPano');
		var selOtherForVal = getExperimentInfo('selOtherFormatMMValue');
		var selOtherForPd = getExperimentInfo('selOtherFormatMMProd');
		var mastermixObj = findAppTapRecForOtherMMFormat(cnvMasterMix, 'productname', selOtherForPd);
		var mastermix = mastermixObj.get('productname');
		var mnoofunits = (Math.ceil( (mvolume * 1000) / mastermixObj.get('volume')));
		var masterMixPartNumber = mastermixObj.get('partnumber');
		var masterMixCostPerUnit = pricelist.findRecord('partnumber',masterMixPartNumber).regions().findRecord('region',region + "-" + currency).get('price');
		var masterperc = (Ext.get('masterperc').dom.value).split('%')[0];
		var totalMasterMixCost = masterMixCostPerUnit * mnoofunits * (1 - (masterperc / 100));
		var masterMixCostPerReaction = totalMasterMixCost / (getExperimentInfo('nooftargets') * 
										getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var mmixCostPerSample = totalMasterMixCost	/ getExperimentInfo('noofsamples');
		var masterMixCostPerReaction1 = 0;
		var masterMixCostPerReaction2 = 0;
		var masterMixCostPerReaction3 = 0;
		var mmixCostPerSample1 = 0;
		var mmixCostPerSample2 = 0;
		var mmixCostPerSample3 = 0;
		var totalMasterMixCost1 = 0;
		var totalMasterMixCost2 = 0;
		var totalMasterMixCost3 = 0;
	} else{
		// Master Mix Combination starts here
		totalQty = [];
		allCombination = [];
		var totQty = Math.ceil( (mvolume * 1000) / 1000  );
		var toGetCombinationVal = pbRatio(0, totQty, (mvolume * 1000), CopyMasterMix);
		var selMM = toGetOptimumPrice(toGetCombinationVal, cnvMasterMix);
			
		//var mastermixObj = findOptimumCopyNumberMicroMMXTubeRecord(mvolume);
		
		var mastermixObj = selMM;
		
		var mastermix = mastermixObj['Product Name1'];
		var mastermix1 = mastermixObj['Product Name2'];
		var mastermix2 = mastermixObj['Product Name3'];
		var mastermix3 = mastermixObj['Product Name4'];

		var mnoofunits = mastermixObj['qty1'];
		var mnoofunits1 = mastermixObj['qty2'];
		if(mnoofunits1 != undefined){
			mnoofunits1 = mnoofunits1;
		} else {
			mnoofunits1 = 0;
		}
		var mnoofunits2 = mastermixObj['qty3'];
		if(mnoofunits2 != undefined){
			mnoofunits2 = mnoofunits2;
		} else {
			mnoofunits2 = 0;
		}
		var mnoofunits3 = mastermixObj['qty4'];
		if(mnoofunits3 != undefined){
			mnoofunits3 = mnoofunits3;
		} else {
			mnoofunits3 = 0;
		}
		
		var masterMixPartNumber = mastermixObj["Part Number1"];
		var masterMixPartNumber1 = mastermixObj["Part Number2"];
		if(masterMixPartNumber1 != undefined){
			masterMixPartNumber1 = masterMixPartNumber1;
		} else {
			masterMixPartNumber1 = 0;
		}
		var masterMixPartNumber2 = mastermixObj["Part Number3"];
		if(masterMixPartNumber2 != undefined){
			masterMixPartNumber2 = masterMixPartNumber2;
		} else {
			masterMixPartNumber2 = 0;
		}
		var masterMixPartNumber3 = mastermixObj["Part Number4"];
		if(masterMixPartNumber3 != undefined){
			masterMixPartNumber3 = masterMixPartNumber3;
		} else {
			masterMixPartNumber3 = 0;
		}
		
		
		var masterMixCostPerUnit = pricelist.findRecord('partnumber', masterMixPartNumber).regions().findRecord('region', region + "-" + currency).get('price');
		
		if(masterMixPartNumber1 != 0){
			var masterMixCostPerUnit1 = pricelist.findRecord('partnumber', masterMixPartNumber1).regions().findRecord('region', region + "-" + currency).get('price');
		} else {
			var masterMixCostPerUnit1 = 0;
		}
		if(masterMixPartNumber2 != 0){
			var masterMixCostPerUnit2 = pricelist.findRecord('partnumber', masterMixPartNumber2).regions().findRecord('region', region + "-" + currency).get('price');
		} else {
			var masterMixCostPerUnit2 = 0;
		}
		if(masterMixPartNumber3 != 0){
			var masterMixCostPerUnit3 = pricelist.findRecord('partnumber', masterMixPartNumber4).regions().findRecord('region', region + "-" + currency).get('price');
		} else {
			var masterMixCostPerUnit3 = 0;
		}
		
		var masterperc = (Ext.get('masterperc').dom.value).split('%')[0];
		var totalMasterMixCost = masterMixCostPerUnit * mnoofunits * (1 - (masterperc / 100));
		var totalMasterMixCost1 = masterMixCostPerUnit1 * mnoofunits1 * (1 - (masterperc / 100));
		var totalMasterMixCost2 = masterMixCostPerUnit2 * mnoofunits2 * (1 - (masterperc / 100));
		var totalMasterMixCost3 = masterMixCostPerUnit3 * mnoofunits3 * (1 - (masterperc / 100));
		
		var masterMixCostPerReaction = (totalMasterMixCost) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var masterMixCostPerReaction1 = (totalMasterMixCost1) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var masterMixCostPerReaction2 = (totalMasterMixCost2) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var masterMixCostPerReaction3 = (totalMasterMixCost3) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		
		var mmixCostPerSample = totalMasterMixCost / getExperimentInfo('noofsamples');
		var mmixCostPerSample1 = totalMasterMixCost1 / getExperimentInfo('noofsamples');
		var mmixCostPerSample2 = totalMasterMixCost2 / getExperimentInfo('noofsamples');
		var mmixCostPerSample3 = totalMasterMixCost3 / getExperimentInfo('noofsamples');
		// Master Mix Combination ends here	
	}
	
	var partNumber = formatObj.get('partnumber');
    var assayCostPerUnit = pricelist.findRecord('partnumber', partNumber)
			.regions().findRecord('region', region + "-" + currency).get(
					'price');
					
					
	newTotalCost = assayCostPerUnit * noofunits * tubenoofunits;
	
	totalNewCostPerSample = newTotalCost/getExperimentInfo('noofsamples');
	
	var volumeDiscount = 0;
	var costWithVolDisc = noofunits * assayCostPerUnit* (1 - (volumeDiscount / 100));
	var assayperc = (Ext.get('assayperc').dom.value).split('%')[0];
	var totalAssayCost = costWithVolDisc * (1 - (assayperc / 100));
	var totalrefcost = refassayquantity * priceperrefassayUnit * (1 - (assayperc / 100));
		
	var numPlates = Math.ceil(getExperimentInfo('nooftargets')
			* getExperimentInfo('noofreplicates')
			* getExperimentInfo('noofsamples')/wellNum);

	var hours = Math.ceil(65/60 * 1.2 * numPlates);

//	var hours = Math.ceil((60 / 60 / wellNum) * getExperimentInfo('nooftargets')
//			* getExperimentInfo('noofreplicates')
//			* getExperimentInfo('noofsamples'));
	var totalCost = totalAssayCost + totalMasterMixCost + totalMasterMixCost1 + totalMasterMixCost2 + totalrefcost;
	
	var assayCostPerReaction = totalAssayCost
			/ (getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
	
	
	var optimizationCostPerReaction = 0;
	var totalCostPerReaction = assayCostPerReaction + masterMixCostPerReaction + masterMixCostPerReaction1 + masterMixCostPerReaction2 + optimizationCostPerReaction;
	var productUrl = producturls.findRecord('partNumber', partNumber).get('productURL');
		
	var assayCostPerSample = totalAssayCost / getExperimentInfo('noofsamples');
	var refCostPerSample = totalrefcost/getExperimentInfo('noofsamples')
	var totalCostPerSample = assayCostPerSample + mmixCostPerSample + mmixCostPerSample1 + mmixCostPerSample2 +refCostPerSample;
	var refassayperreaction = totalrefcost/(getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
	var totalCostPreDisc = costWithVolDisc
			+ (masterMixCostPerUnit * mnoofunits);
			
	totalNewCostPerReaction = totalCost/noofreactions;
	var totalDiscount = 100 - (totalCost * 100 / totalCostPreDisc);
    
	refassayname = refassayname.replace("TaqMan","TaqMan®");
	
	
	
	outputList.add({
		pno : spno,
		title : title,
		partnumber : partNumber,
		format : format.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		noofunits : noofunits_new,
		noofreactions : noofreactions,
		mastermix : mastermix.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		mastermix1 : mastermix1,//.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		mastermix2 : mastermix2,//.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		mastermix3 : mastermix3,//.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		mnoofunits : mnoofunits,
		mnoofunits1 : mnoofunits1,
		mnoofunits2 : mnoofunits2,
		mnoofunits3 : mnoofunits3,
		totalcost : roundNumber(totalCost, 2),
		//totalcost : roundNumber(newTotalCost,2),
		volumediscount : volumeDiscount,
		mvolumediscount : masterperc,
		assayscost : roundNumber(costWithVolDisc, 2),
		assayscostperunit : roundNumber(assayCostPerUnit, 2),
		assayscostwithvoldisc : roundNumber(totalAssayCost, 2),
		mastermixvol : roundNumber(mvolume, 2),
		mastermixcostperunit : masterMixCostPerUnit,
		mastermixcostperunit1 : roundNumber(masterMixCostPerUnit1, 2),
		mastermixcostperunit2 : roundNumber(masterMixCostPerUnit2, 2),
		mastermixcostperunit3 : roundNumber(masterMixCostPerUnit3, 2),
		mastermixdisc : masterperc,
		mastermixcostwithdisc : roundNumber(totalMasterMixCost, 2),
		mastermixcostwithdisc1: roundNumber(totalMasterMixCost1, 2),
		mastermixcostwithdisc2: roundNumber(totalMasterMixCost2, 2),
		mastermixcostwithdisc3: roundNumber(totalMasterMixCost3, 2),
		mastermixcostpredisc : roundNumber((masterMixCostPerUnit * mnoofunits),2),
		mastermixcostpredisc1 : roundNumber((masterMixCostPerUnit1 * mnoofunits1), 2),
		mastermixcostpredisc2 : roundNumber((masterMixCostPerUnit2 * mnoofunits2), 2),
		mastermixcostpredisc3 : roundNumber((masterMixCostPerUnit3 * mnoofunits3), 2),
		mastermixcost : roundNumber(masterMixCostPerUnit * mnoofunits, 2),
		mastermixcost1 : roundNumber(masterMixCostPerUnit1 * mnoofunits1, 2),
		mastermixcost2 : roundNumber(masterMixCostPerUnit2 * mnoofunits2, 2),
		mastermixcost3 : roundNumber(masterMixCostPerUnit3 * mnoofunits3, 2),
		mastermixpartnumber : masterMixPartNumber,
		mastermixpartnumber1 : masterMixPartNumber1,
		mastermixpartnumber2 : masterMixPartNumber2,
		mastermixpartnumber3 : masterMixPartNumber3,
		mmxcostpersample : roundNumber(mmixCostPerSample, 2),
		mmxcostpersample1 : roundNumber(mmixCostPerSample1,2),
		mmxcostpersample2 : roundNumber(mmixCostPerSample2,2),
		mmxcostpersample3 : roundNumber(mmixCostPerSample3,2),
		assaycostpersample : roundNumber(assayCostPerSample, 2),
		totalcostpersample : totalCostPerSample,
		totalcostpredisc : roundNumber(totalCostPreDisc, 2),
		totaldiscount : roundNumber(totalDiscount, 2),
		noofhours : hours,
		assaycostperreaction : assayCostPerReaction,
		mastermixcostperreaction : masterMixCostPerReaction,
		mastermixcostperreaction1 : roundNumber(masterMixCostPerReaction1, 2),
		mastermixcostperreaction2 : roundNumber(masterMixCostPerReaction2, 2),
		mastermixcostperreaction3 : roundNumber(masterMixCostPerReaction3, 2),
		optimizationcostperreaction : roundNumber(optimizationCostPerReaction,2),
		totalcostperreaction : totalNewCostPerReaction,
		totalcostpersample : totalCostPerSample,
		producturl : productUrl,
		refassayname : refassayname,
		refassaypartnumber : assaypartnumber,
		refassayqty : refassayquantity,
		refassaycost : totalrefcost,
		refassaypercost : priceperrefassayUnit,
		refassayperreaction:refassayperreaction,
		refassaycostpersample : roundNumber(refCostPerSample, 2),
		reqnoofunits : noofunits,
		fnName:'addCopyNum',
		type : 'tube'
	});

}
function findApproximateCopyNumberPre(value){
	var record = null;
	if(getExperimentInfo('equipment') == '96-well')
	{
	    if(value <= 360)
		{
			var name = "TaqMan Copy Number, Pre-designed assays,small";
		}else if(value > 360 && value <= 750)
		{
			var name = "TaqMan Copy Number, Pre-designed assays,medium";
		}else if(value > 750 && value <= 2900)
		{
			var name = "TaqMan Copy Number, Pre-designed assays,large";
		}
	}else if(getExperimentInfo('equipment') == '384-well')
	{
		if(value <= 720)
		{
			var name = "TaqMan Copy Number, Pre-designed assays,small";
		}else if(value > 720 && value <= 1500)
		{
			var name = "TaqMan Copy Number, Pre-designed assays,medium";
		}else if(value > 2900 && value <= 5800)
		{
			var name = "TaqMan Copy Number, Pre-designed assays,large";
		}
	}
	var prevRecord = null;

	return copyModel.findRecord('concatenate', name);
}

function findOptimumCopyNumberTubeRecord(noofreactions, type) {
	var recordIndex = 0;
	var price = 0;
	var count = 0;
	copyModel.each(function(e) {			
		var partNumber = e.get('partnumber');
		var application = type;
		var factor = (e.get('concatenate').indexOf('Extra') != -1 || e.get('concatenate').indexOf('small') != -1) ? 3 : 1;
		if (e.get('concatenate').indexOf(application) != -1	&& e.get('concatenate').indexOf(type) != -1) {
			var mnoofunits = 0;
			if (getExperimentInfo('equipment') == '96-well') {				
				mnoofunits = Math.ceil(noofreactions * (1) / e.get('96-wellnumberofreactions'));
			} else if (getExperimentInfo('equipment') == '384-well') {
				mnoofunits = Math.ceil(noofreactions * (1) / e.get('384-wellnumberofreactions'));
			} else {
				mnoofunits = Math.ceil(noofreactions * (1) / e.get('numberofreactions'));
			}
			var mprice = mnoofunits	* pricelist.findRecord('partnumber', partNumber).regions().findRecord('region',region + "-" + currency).get('price');
			
			if (price == 0) {
				price = mprice;
				recordIndex = count;
			}
			if (mprice < price) {
				price = mprice;
				recordIndex = count;
			}
		}
		count++;
	});
	
	return copyModel.getAt(recordIndex);
}
function findOptimumCopyNumberRefAssay(mvolume,type,species){
	//type ="TaqMan Copy Number Reference Assay RNase P";
	
	var type1 = type+",750 reactions";
	var assayrefobject1 = copyrefassayModel.findRecord('concatenate',type1);
	var type2 = type+",3000 reactions";
	var assayrefobject2 = copyrefassayModel.findRecord('concatenate',type2);
	var price1 = getCopyPrice(assayrefobject1);
	var price2 = getCopyPrice(assayrefobject2);
	
	if(price1>price2)
	{
		var partnumber = assayrefobject2.get('partnumber');	
	}else{
		var partnumber = assayrefobject1.get('partnumber');
	}
	
	return partnumber;
	
}
function getCopyPrice(assayrefobject){
	
	var noofreactionspertarget = getExperimentInfo('noofreplicates')* getExperimentInfo('noofsamples');
	var noofunits = noofreactionspertarget * getExperimentInfo('nooftargets');
	if (getExperimentInfo('equipment') == '96-well') {
		//tubenoofunits = Math.ceil(noofreactionspertarget/ formatObj.get('96-wellnumberofreactions'));
		var refassayreaction = assayrefobject.get('96-wellnumberofreactions'); 
	} else if (getExperimentInfo('equipment') == '384-well') {
		wellNum = 384;
		//tubenoofunits = Math.ceil(noofreactionspertarget/ formatObj.get('384-wellnumberofreactions'));
		var refassayreaction = assayrefobject.get('384-wellnumberofreactions'); 
	}
	//var priceperrefassayUnit = assayrefobject.regions().findRecord('region', region).prices().findRecord('countrycode', currency).get('value');
	var pn = assayrefobject.get('partnumber');
	var priceperrefassayUnit = pricelist.findRecord('partnumber', pn).regions().findRecord('region', region + "-" + currency).get('price');
	
	var Units = Math.ceil(noofunits/refassayreaction);
	return Units * priceperrefassayUnit;
}

function findOptimumCopyNumberMicroMMXTubeRecord(mvolume) {
	var recordIndex = 0;
	var price = 0;
	var count = 0;
	var chem = getExperimentInfo('method') == 'Fast' ? "Fast" : "Universal";
	copymastermixModel.each(function(e) {
		
			var mnoofunits = Math.ceil(mvolume / e.get('volume'));
			var partNumber = e.get('partnumber');
			var mprice = mnoofunits
					* pricelist.findRecord('partnumber', partNumber).regions()
							.findRecord('region', region + "-" + currency).get(
									'price');
			if (price == 0) {
				price = mprice;
				recordIndex = count;
			}
			if (mprice < price) {
				price = mprice;
				recordIndex = count;
			}
		
		count++;
	});
	return copymastermixModel.getAt(recordIndex);
}

function addCopyNumCustomPlus() {
	
	//var title = "Assays in Tubes";
	var title = "Single Tube Assays - Custom Plus";
	var format = "";
	var noofreactions = getExperimentInfo('noofreplicates')* getExperimentInfo('noofsamples') * getExperimentInfo('nooftargets');
	var noofreactionspertarget = getExperimentInfo('noofreplicates')* getExperimentInfo('noofsamples');
	//var formatObj = findApproximateCopyNumberPre(noofreactionspertarget);
	var isOtherFormat = getExperimentInfo('isOtherFormat');
	var spno = 7;
	if( isOtherFormat === "YES" ){
		spno = getExperimentInfo('otherFmPano');
		var selOtherForVal = getExperimentInfo('selOtherFormatValue');
		var formatObj = findAppTapRecForOtherFormat(copyModel, 'concatenate', selOtherForVal);
	}else{
		updateExperimentInfo("currFmPno", spno);
		var formatObj = findOptimumCopyNumberTubeRecord(noofreactionspertarget,'Custom Plus assays');
	}
	format = formatObj.get("concatenate");
	
	format = format.replace(/_/gi,' ');
	format = format.replace(/Gene Expression/gi, 'Gene Expression Assays, ');
	format = format.replace(/miRNA/gi, 'MicroRNA Assays, ');
	format = format.replace(/small/gi, 'Small, ');
	format = format.replace(/Medium/gi, 'Medium, ');
	format = format.replace(/Large/gi, 'Large, ');
	format = format.replace("TaqMan","TaqMan®");
	//format = "TaqMan " + format;
	var refassayObj = Ext.get('referenceassay').dom;
    var assaypartoption = refassayObj.options[refassayObj.selectedIndex].value;
	var tubenoofreactions = formatObj.get('numberofreactions');
	
	var noofunits = getExperimentInfo('nooftargets');
	var wellNum = 96;
	
	var assaypartnumber = findOptimumCopyNumberRefAssay(noofreactions,assaypartoption,'Human');
	var assayrefobject = copyrefassayModel.findRecord('partnumber',assaypartnumber);
	
	if (getExperimentInfo('equipment') == '96-well') {
		tubenoofunits = Math.ceil(noofreactionspertarget/ formatObj.get('96-wellnumberofreactions'));
		var refassayreaction = assayrefobject.get('96-wellnumberofreactions'); 
	} else if (getExperimentInfo('equipment') == '384-well') {
		wellNum = 384;
		tubenoofunits = Math.ceil(noofreactionspertarget
				/ formatObj.get('384-wellnumberofreactions'));
		var refassayreaction = assayrefobject.get('384-wellnumberofreactions'); 
	} else {
		wellNum = 384;
		var refassayreaction = assayrefobject.get('384-wellnumberofreactions');
		tubenoofunits = Math.ceil(noofreactionspertarget / tubenoofreactions);
		//alert("no " + noofunits);
	}
	
    var noofunits_new = getExperimentInfo('nooftargets') * tubenoofunits;
	
	refassayunits = Math.ceil(noofreactions / refassayreaction);
	//var priceperrefassayUnit = assayrefobject.regions().findRecord('region', region).prices().findRecord('countrycode', currency).get('value');
	var pn = assayrefobject.get('partnumber');
	var priceperrefassayUnit = pricelist.findRecord('partnumber', pn)
			.regions().findRecord('region', region + "-" + currency).get(
					'price');
	
	var refassayname = assayrefobject.get('concatenate');

	var refassayquantity = refassayunits;
	
	
	
	var mvolume = 0;
	if (getExperimentInfo('equipment') == '96-well') {
		mvolume = masterMixRequirements.wellplate96
				* getExperimentInfo('nooftargets')
				* getExperimentInfo('noofreplicates')
				* getExperimentInfo('noofsamples') / 1000;
	} else if (getExperimentInfo('equipment') == '384-well') {
		mvolume = masterMixRequirements.wellplate384
				* getExperimentInfo('nooftargets')
				* getExperimentInfo('noofreplicates')
				* getExperimentInfo('noofsamples') / 1000;
	} else {
		mvolume = masterMixRequirements.tubes
				* getExperimentInfo('nooftargets')
				* getExperimentInfo('noofreplicates')
				* getExperimentInfo('noofsamples') / 1000;
	}
	
	
	var isOtherMMFormat = getExperimentInfo('isOtherMMFormat');
	if( isOtherMMFormat === "YES" ){
		spno = getExperimentInfo('otherFmPano');
		var selOtherForVal = getExperimentInfo('selOtherFormatMMValue');
		var selOtherForPd = getExperimentInfo('selOtherFormatMMProd');
		var mastermixObj = findAppTapRecForOtherMMFormat(cnvMasterMix, 'productname', selOtherForPd);
		var mastermix = mastermixObj.get('productname');
		var mnoofunits = (Math.ceil((mvolume * 1000) / mastermixObj.get('volume')));
		var masterMixPartNumber = mastermixObj.get('partnumber');
		var masterMixCostPerUnit = pricelist.findRecord('partnumber',masterMixPartNumber).regions().findRecord('region',region + "-" + currency).get('price');
		var masterperc = (Ext.get('masterperc').dom.value).split('%')[0];
		var totalMasterMixCost = masterMixCostPerUnit * mnoofunits * (1 - (masterperc / 100));
		var masterMixCostPerReaction = totalMasterMixCost / (getExperimentInfo('nooftargets') * 
										getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var mmixCostPerSample = totalMasterMixCost	/ getExperimentInfo('noofsamples');
		var masterMixCostPerReaction1 = 0;
		var masterMixCostPerReaction2 = 0;
		var masterMixCostPerReaction3 = 0;
		var mmixCostPerSample1 = 0;
		var mmixCostPerSample2 = 0;
		var mmixCostPerSample3 = 0;
		var totalMasterMixCost1 = 0;
		var totalMasterMixCost2 = 0;
		var totalMasterMixCost3 = 0;
	} else{
		
		//var mastermixObj = findOptimumCopyNumberMicroMMXTubeRecord(mvolume);
		
		// Master Mix Combination starts here
		totalQty = [];
		allCombination = [];
		var totQty = Math.ceil( (mvolume * 1000) / 1000  );
		var toGetCombinationVal = pbRatio(0, totQty, (mvolume * 1000), CopyMasterMix);
		var selMM = toGetOptimumPrice(toGetCombinationVal, cnvMasterMix);
		var mastermixObj = selMM;
		
		var mastermix = mastermixObj['Product Name1'];
		var mastermix1 = mastermixObj['Product Name2'];
		var mastermix2 = mastermixObj['Product Name3'];
		var mastermix3 = mastermixObj['Product Name4'];

		var mnoofunits = mastermixObj['qty1'];
		var mnoofunits1 = mastermixObj['qty2'];
		if(mnoofunits1 != undefined){
			mnoofunits1 = mnoofunits1;
		} else {
			mnoofunits1 = 0;
		}
		var mnoofunits2 = mastermixObj['qty3'];
		if(mnoofunits2 != undefined){
			mnoofunits2 = mnoofunits2;
		} else {
			mnoofunits2 = 0;
		}
		var mnoofunits3 = mastermixObj['qty4'];
		if(mnoofunits3 != undefined){
			mnoofunits3 = mnoofunits3;
		} else {
			mnoofunits3 = 0;
		}
		
		var masterMixPartNumber = mastermixObj["Part Number1"];
		var masterMixPartNumber1 = mastermixObj["Part Number2"];
		if(masterMixPartNumber1 != undefined){
			masterMixPartNumber1 = masterMixPartNumber1;
		} else {
			masterMixPartNumber1 = 0;
		}
		var masterMixPartNumber2 = mastermixObj["Part Number3"];
		if(masterMixPartNumber2 != undefined){
			masterMixPartNumber2 = masterMixPartNumber2;
		} else {
			masterMixPartNumber2 = 0;
		}
		var masterMixPartNumber3 = mastermixObj["Part Number4"];
		if(masterMixPartNumber3 != undefined){
			masterMixPartNumber3 = masterMixPartNumber3;
		} else {
			masterMixPartNumber3 = 0;
		}
		
		
		var masterMixCostPerUnit = pricelist.findRecord('partnumber', masterMixPartNumber).regions().findRecord('region', region + "-" + currency).get('price');
		
		if(masterMixPartNumber1 != 0){
			var masterMixCostPerUnit1 = pricelist.findRecord('partnumber', masterMixPartNumber1).regions().findRecord('region', region + "-" + currency).get('price');
		} else {
			var masterMixCostPerUnit1 = 0;
		}
		if(masterMixPartNumber2 != 0){
			var masterMixCostPerUnit2 = pricelist.findRecord('partnumber', masterMixPartNumber2).regions().findRecord('region', region + "-" + currency).get('price');
		} else {
			var masterMixCostPerUnit2 = 0;
		}
		if(masterMixPartNumber3 != 0){
			var masterMixCostPerUnit3 = pricelist.findRecord('partnumber', masterMixPartNumber3).regions().findRecord('region', region + "-" + currency).get('price');
		} else {
			var masterMixCostPerUnit3 = 0;
		}
		
		var masterperc = (Ext.get('masterperc').dom.value).split('%')[0];
		var totalMasterMixCost = masterMixCostPerUnit * mnoofunits * (1 - (masterperc / 100));
		var totalMasterMixCost1 = masterMixCostPerUnit1 * mnoofunits1 * (1 - (masterperc / 100));
		var totalMasterMixCost2 = masterMixCostPerUnit2 * mnoofunits2 * (1 - (masterperc / 100));
		var totalMasterMixCost3 = masterMixCostPerUnit3 * mnoofunits3 * (1 - (masterperc / 100));
		
		var masterMixCostPerReaction = (totalMasterMixCost) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var masterMixCostPerReaction1 = (totalMasterMixCost1) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var masterMixCostPerReaction2 = (totalMasterMixCost2) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var masterMixCostPerReaction3 = (totalMasterMixCost3) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		
		var mmixCostPerSample = totalMasterMixCost / getExperimentInfo('noofsamples');
		var mmixCostPerSample1 = totalMasterMixCost1 / getExperimentInfo('noofsamples');
		var mmixCostPerSample2 = totalMasterMixCost2 / getExperimentInfo('noofsamples');
		var mmixCostPerSample3 = totalMasterMixCost3 / getExperimentInfo('noofsamples');
		
		// Master Mix Combination ends here	
	}	
	var partNumber = formatObj.get('partnumber');
	
    var assayCostPerUnit = pricelist.findRecord('partnumber', partNumber)
			.regions().findRecord('region', region + "-" + currency).get(
					'price');
					
					
	newTotalCost = assayCostPerUnit * noofunits * tubenoofunits;
	totalNewCostPerReaction = newTotalCost/noofreactions;
	totalNewCostPerSample = newTotalCost/getExperimentInfo('noofsamples');
	
	var volumeDiscount = 0;
	var costWithVolDisc = noofunits * assayCostPerUnit* (1 - (volumeDiscount / 100));
	var assayperc = (Ext.get('assayperc').dom.value).split('%')[0];
	var totalAssayCost = costWithVolDisc * (1 - (assayperc / 100));
	var totalrefcost = refassayquantity * priceperrefassayUnit * (1 - (assayperc / 100));
		
	var numPlates = Math.ceil(getExperimentInfo('nooftargets')
			* getExperimentInfo('noofreplicates')
			* getExperimentInfo('noofsamples')/wellNum);

	var hours = Math.ceil(65/60 * 1.2 * numPlates);

//	var hours = Math.ceil((60 / 60 / wellNum) * getExperimentInfo('nooftargets')
	//		* getExperimentInfo('noofreplicates')
	//		* getExperimentInfo('noofsamples'));
	var totalCost = totalAssayCost + totalMasterMixCost + totalMasterMixCost1 + totalMasterMixCost2 +totalrefcost;

	var assayCostPerReaction = totalAssayCost
			/ (getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
	
	var optimizationCostPerReaction = 0;
	var totalCostPerReaction = assayCostPerReaction + masterMixCostPerReaction + masterMixCostPerReaction1 + masterMixCostPerReaction2	+ optimizationCostPerReaction;
	var productUrl = producturls.findRecord('partNumber', partNumber).get('productURL');
	

	var assayCostPerSample = totalAssayCost / getExperimentInfo('noofsamples');
	var refCostPerSample = totalrefcost/getExperimentInfo('noofsamples')
	var refassayperreaction = totalrefcost/(getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
	var totalCostPerSample = assayCostPerSample + mmixCostPerSample + mmixCostPerSample1 + mmixCostPerSample2 + refCostPerSample;
	totalNewCostPerReaction = totalCost/noofreactions;
	var totalCostPreDisc = costWithVolDisc
			+ (masterMixCostPerUnit * mnoofunits);
	var totalDiscount = 100 - (totalCost * 100 / totalCostPreDisc);
    
	refassayname = refassayname.replace("TaqMan","TaqMan®");
	
	
	
	outputList.add({
		pno : spno,
		title : title,
		partnumber : partNumber,
		format : format.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		noofunits : noofunits_new,
		noofreactions : noofreactions,
		mastermix : mastermix.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		mastermix1 : mastermix1,//.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		mastermix2 : mastermix2,//.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		mastermix3 : mastermix3,//.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		mnoofunits : mnoofunits,
		mnoofunits1 : mnoofunits1,
		mnoofunits2 : mnoofunits2,
		mnoofunits3 : mnoofunits3,
		totalcost : roundNumber(totalCost,2),
		//totalcost : roundNumber(newTotalCost,2),
		volumediscount : volumeDiscount,
		mvolumediscount : masterperc,
		assayscost : costWithVolDisc,
		assayscostperunit : assayCostPerUnit,
		assayscostwithvoldisc : totalAssayCost,
		mastermixvol : roundNumber(mvolume, 2),
		mastermixcostperunit : masterMixCostPerUnit,
		mastermixcostperunit1 : roundNumber(masterMixCostPerUnit1, 2),
		mastermixcostperunit2 : roundNumber(masterMixCostPerUnit2, 2),
		mastermixcostperunit3 : roundNumber(masterMixCostPerUnit3, 2),
		mastermixdisc : masterperc,
		mastermixcostwithdisc : roundNumber(totalMasterMixCost, 2),
		mastermixcostwithdisc1: roundNumber(totalMasterMixCost1, 2),
		mastermixcostwithdisc2: roundNumber(totalMasterMixCost2, 2),
		mastermixcostwithdisc3: roundNumber(totalMasterMixCost3, 2),
		mastermixcostpredisc : roundNumber((masterMixCostPerUnit * mnoofunits),2),
		mastermixcostpredisc1 : roundNumber((masterMixCostPerUnit1 * mnoofunits1), 2),
		mastermixcostpredisc2 : roundNumber((masterMixCostPerUnit2 * mnoofunits2), 2),
		mastermixcostpredisc3 : roundNumber((masterMixCostPerUnit3 * mnoofunits3), 2),
		mastermixcost : roundNumber(masterMixCostPerUnit * mnoofunits, 2),
		mastermixcost1 : roundNumber(masterMixCostPerUnit1 * mnoofunits1, 2),
		mastermixcost2 : roundNumber(masterMixCostPerUnit2 * mnoofunits2, 2),
		mastermixcost3 : roundNumber(masterMixCostPerUnit3 * mnoofunits3, 2),
		mastermixpartnumber : masterMixPartNumber,
		mastermixpartnumber1 : masterMixPartNumber1,
		mastermixpartnumber2 : masterMixPartNumber2,
		mastermixpartnumber3 : masterMixPartNumber3,
		mmxcostpersample : roundNumber(mmixCostPerSample, 2),
		mmxcostpersample1 : roundNumber(mmixCostPerSample1,2),
		mmxcostpersample2 : roundNumber(mmixCostPerSample2,2),
		mmxcostpersample3 : roundNumber(mmixCostPerSample3,2),
		assaycostpersample : roundNumber(assayCostPerSample, 2),
		totalcostpersample : totalCostPerSample,
		totalcostpredisc : roundNumber(totalCostPreDisc, 2),
		totaldiscount : roundNumber(totalDiscount, 2),
		noofhours : hours,
		assaycostperreaction : assayCostPerReaction,
		mastermixcostperreaction : masterMixCostPerReaction,
		mastermixcostperreaction1 : roundNumber(masterMixCostPerReaction1, 2),
		mastermixcostperreaction2 : roundNumber(masterMixCostPerReaction2, 2),
		mastermixcostperreaction3 : roundNumber(masterMixCostPerReaction3, 2),
		optimizationcostperreaction : roundNumber(optimizationCostPerReaction,2),
		totalcostperreaction : totalNewCostPerReaction,
		totalcostpersample : totalCostPerSample,
		producturl : productUrl,
		refassayname : refassayname,
		refassaypartnumber : assaypartnumber,
		refassayqty : refassayquantity,
		refassaycost : totalrefcost,
		refassaypercost : priceperrefassayUnit,
		refassayperreaction : refassayperreaction,
		refassaycostpersample : roundNumber(refCostPerSample, 2),
		reqnoofunits : noofunits_new,
		fnName:'addCopyNumCustomPlus',
		type : 'tube'
	});

}


function addCopyNumCustom() {
	
	//var title = "Assays in Tubes";
	var title = "Single Tube Assays - Custom";
	var format = "";
	var noofreactions = getExperimentInfo('noofreplicates')* getExperimentInfo('noofsamples') * getExperimentInfo('nooftargets');
	var noofreactionspertarget = getExperimentInfo('noofreplicates')* getExperimentInfo('noofsamples');
	//var formatObj = findApproximateCopyNumberPre(noofreactionspertarget);
	var isOtherFormat = getExperimentInfo('isOtherFormat');
	var spno = 8;
	if( isOtherFormat === "YES" ){
		spno = getExperimentInfo('otherFmPano');
		var selOtherForVal = getExperimentInfo('selOtherFormatValue');
		var formatObj = findAppTapRecForOtherFormat(copyModel, 'concatenate', selOtherForVal);
	}else{
		updateExperimentInfo("currFmPno", spno);
		var formatObj = findOptimumCopyNumberTubeRecord(noofreactionspertarget,'Custom assays');
	}
	format = formatObj.get("concatenate");
	
	format = format.replace(/_/gi,' ');
	format = format.replace(/Gene Expression/gi, 'Gene Expression Assays, ');
	format = format.replace(/miRNA/gi, 'MicroRNA Assays, ');
	format = format.replace(/small/gi, 'Small, ');
	format = format.replace(/Medium/gi, 'Medium, ');
	format = format.replace(/Large/gi, 'Large, ');
	format = format.replace("TaqMan","TaqMan®");
	//format = "TaqMan " + format;
	var refassayObj = Ext.get('referenceassay').dom;
    var assaypartoption = refassayObj.options[refassayObj.selectedIndex].value;
	var tubenoofreactions = formatObj.get('numberofreactions');
	
	var noofunits = getExperimentInfo('nooftargets');
	var wellNum = 96;
	
	var assaypartnumber = findOptimumCopyNumberRefAssay(noofreactions,assaypartoption,'Human');
	var assayrefobject = copyrefassayModel.findRecord('partnumber',assaypartnumber);
	
	if (getExperimentInfo('equipment') == '96-well') {
		tubenoofunits = Math.ceil(noofreactionspertarget/ formatObj.get('96-wellnumberofreactions'));
		var refassayreaction = assayrefobject.get('96-wellnumberofreactions'); 
	} else if (getExperimentInfo('equipment') == '384-well') {
		wellNum = 384;
		tubenoofunits = Math.ceil(noofreactionspertarget
				/ formatObj.get('384-wellnumberofreactions'));
		var refassayreaction = assayrefobject.get('384-wellnumberofreactions'); 
	} else {
		wellNum = 384;
		var refassayreaction = assayrefobject.get('384-wellnumberofreactions');
		tubenoofunits = Math.ceil(noofreactionspertarget / tubenoofreactions);
		//alert("no " + noofunits);
	}
	
     var noofunits_new = tubenoofunits * noofunits;
	refassayunits = Math.ceil(noofreactions / refassayreaction);
	//var priceperrefassayUnit = assayrefobject.regions().findRecord('region', region).prices().findRecord('countrycode', currency).get('value');
	var priceperrefassayUnit = pricelist.findRecord('partnumber', assaypartnumber)
			.regions().findRecord('region',
					region + "-" + currency).get(
					'price');
					
	var refassayname = assayrefobject.get('concatenate');
	var refassayquantity = refassayunits;
	var totalrefcost = refassayquantity * priceperrefassayUnit;
	
	var mvolume = 0;
	if (getExperimentInfo('equipment') == '96-well') {
		mvolume = masterMixRequirements.wellplate96
				* getExperimentInfo('nooftargets')
				* getExperimentInfo('noofreplicates')
				* getExperimentInfo('noofsamples') / 1000;
	} else if (getExperimentInfo('equipment') == '384-well') {
		mvolume = masterMixRequirements.wellplate384
				* getExperimentInfo('nooftargets')
				* getExperimentInfo('noofreplicates')
				* getExperimentInfo('noofsamples') / 1000;
	} else {
		mvolume = masterMixRequirements.tubes
				* getExperimentInfo('nooftargets')
				* getExperimentInfo('noofreplicates')
				* getExperimentInfo('noofsamples') / 1000;
	}
	
		
	//var mastermixObj = findOptimumCopyNumberMicroMMXTubeRecord(mvolume);
	var isOtherMMFormat = getExperimentInfo('isOtherMMFormat');
	if( isOtherMMFormat === "YES" ){
		spno = getExperimentInfo('otherFmPano');
		var selOtherForVal = getExperimentInfo('selOtherFormatMMValue');
		var selOtherForPd = getExperimentInfo('selOtherFormatMMProd');
		var mastermixObj = findAppTapRecForOtherMMFormat(cnvMasterMix, 'productname', selOtherForPd);
		var mastermix = mastermixObj.get('productname');
		var mnoofunits = (Math.ceil((mvolume * 1000) / mastermixObj.get('volume')));
		var masterMixPartNumber = mastermixObj.get('partnumber');
		var masterMixCostPerUnit = pricelist.findRecord('partnumber',masterMixPartNumber).regions().findRecord('region',region + "-" + currency).get('price');
		var masterperc = (Ext.get('masterperc').dom.value).split('%')[0];
		var totalMasterMixCost = masterMixCostPerUnit * mnoofunits * (1 - (masterperc / 100));
		var masterMixCostPerReaction = totalMasterMixCost / (getExperimentInfo('nooftargets') * 
										getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var mmixCostPerSample = totalMasterMixCost	/ getExperimentInfo('noofsamples');
		var masterMixCostPerReaction1 = 0;
		var masterMixCostPerReaction2 = 0;
		var masterMixCostPerReaction3 = 0;
		var mmixCostPerSample1 = 0;
		var mmixCostPerSample2 = 0;
		var mmixCostPerSample3 = 0;
		var totalMasterMixCost1 = 0;
		var totalMasterMixCost2 = 0;
		var totalMasterMixCost3 = 0;
	} else{
		// Master Mix Combination starts here
		totalQty = [];
		allCombination = [];
		var totQty = Math.ceil((mvolume * 1000) / 1000  );
		var toGetCombinationVal = pbRatio(0, totQty, (mvolume * 1000), CopyMasterMix);
		var selMM = toGetOptimumPrice(toGetCombinationVal, cnvMasterMix);
		var mastermixObj = selMM;
		
		var mastermix = mastermixObj['Product Name1'];
		var mastermix1 = mastermixObj['Product Name2'];
		var mastermix2 = mastermixObj['Product Name3'];
		var mastermix3 = mastermixObj['Product Name4'];

		var mnoofunits = mastermixObj['qty1'];
		var mnoofunits1 = mastermixObj['qty2'];
		if(mnoofunits1 != undefined){
			mnoofunits1 = mnoofunits1;
		} else {
			mnoofunits1 = 0;
		}
		var mnoofunits2 = mastermixObj['qty3'];
		if(mnoofunits2 != undefined){
			mnoofunits2 = mnoofunits2;
		} else {
			mnoofunits2 = 0;
		}
		var mnoofunits3 = mastermixObj['qty4'];
		if(mnoofunits3 != undefined){
			mnoofunits3 = mnoofunits3;
		} else {
			mnoofunits3 = 0;
		}
		
		var masterMixPartNumber = mastermixObj["Part Number1"];
		var masterMixPartNumber1 = mastermixObj["Part Number2"];
		if(masterMixPartNumber1 != undefined){
			masterMixPartNumber1 = masterMixPartNumber1;
		} else {
			masterMixPartNumber1 = 0;
		}
		var masterMixPartNumber2 = mastermixObj["Part Number3"];
		if(masterMixPartNumber2 != undefined){
			masterMixPartNumber2 = masterMixPartNumber2;
		} else {
			masterMixPartNumber2 = 0;
		}
		var masterMixPartNumber3 = mastermixObj["Part Number4"];
		if(masterMixPartNumber3 != undefined){
			masterMixPartNumber3 = masterMixPartNumber3;
		} else {
			masterMixPartNumber3 = 0;
		}
		
		
		var masterMixCostPerUnit = pricelist.findRecord('partnumber', masterMixPartNumber).regions().findRecord('region', region + "-" + currency).get('price');
		
		if(masterMixPartNumber1 != 0){
			var masterMixCostPerUnit1 = pricelist.findRecord('partnumber', masterMixPartNumber1).regions().findRecord('region', region + "-" + currency).get('price');
		} else {
			var masterMixCostPerUnit1 = 0;
		}
		if(masterMixPartNumber2 != 0){
			var masterMixCostPerUnit2 = pricelist.findRecord('partnumber', masterMixPartNumber2).regions().findRecord('region', region + "-" + currency).get('price');
		} else {
			var masterMixCostPerUnit2 = 0;
		}
		if(masterMixPartNumber3 != 0){
			var masterMixCostPerUnit3 = pricelist.findRecord('partnumber', masterMixPartNumber3).regions().findRecord('region', region + "-" + currency).get('price');
		} else {
			var masterMixCostPerUnit3 = 0;
		}
		
		var masterperc = (Ext.get('masterperc').dom.value).split('%')[0];
		var totalMasterMixCost = masterMixCostPerUnit * mnoofunits * (1 - (masterperc / 100));
		var totalMasterMixCost1 = masterMixCostPerUnit1 * mnoofunits1 * (1 - (masterperc / 100));
		var totalMasterMixCost2 = masterMixCostPerUnit2 * mnoofunits2 * (1 - (masterperc / 100));
		var totalMasterMixCost3 = masterMixCostPerUnit3 * mnoofunits3 * (1 - (masterperc / 100));
		
		var masterMixCostPerReaction = (totalMasterMixCost) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var masterMixCostPerReaction1 = (totalMasterMixCost1) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var masterMixCostPerReaction2 = (totalMasterMixCost2) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var masterMixCostPerReaction3 = (totalMasterMixCost3) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		
		var mmixCostPerSample = totalMasterMixCost / getExperimentInfo('noofsamples');
		var mmixCostPerSample1 = totalMasterMixCost1 / getExperimentInfo('noofsamples');
		var mmixCostPerSample2 = totalMasterMixCost2 / getExperimentInfo('noofsamples');
		var mmixCostPerSample3 = totalMasterMixCost3 / getExperimentInfo('noofsamples');
		
		// Master Mix Combination ends here	
	}	
	
	var partNumber = formatObj.get('partnumber');
	
    var assayCostPerUnit = pricelist.findRecord('partnumber', partNumber)
			.regions().findRecord('region', region + "-" + currency).get(
					'price');
					
					
	newTotalCost = assayCostPerUnit * noofunits * tubenoofunits;
	totalNewCostPerReaction = newTotalCost/noofreactions;
	totalNewCostPerSample = newTotalCost/getExperimentInfo('noofsamples');
	
	
	var volumeDiscount = 0;
	var costWithVolDisc = noofunits * assayCostPerUnit* (1 - (volumeDiscount / 100));
	var assayperc = (Ext.get('assayperc').dom.value).split('%')[0];
	var totalAssayCost = costWithVolDisc * (1 - (assayperc / 100));
	var totalrefcost = refassayquantity * priceperrefassayUnit * (1 - (assayperc / 100));
	
	var numPlates = Math.ceil(getExperimentInfo('nooftargets')
			* getExperimentInfo('noofreplicates')
			* getExperimentInfo('noofsamples')/wellNum);
	
	var hours = Math.ceil(65/60 * 1.2 * numPlates);

//	var hours = Math.ceil((60 / 60 / wellNum) * getExperimentInfo('nooftargets')
//			* getExperimentInfo('noofreplicates')
//			* getExperimentInfo('noofsamples'));
	var totalCost = totalAssayCost + totalMasterMixCost + totalMasterMixCost1 + totalMasterMixCost2 +totalrefcost;

	var assayCostPerReaction = totalAssayCost
			/ (getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
	
	var optimizationCostPerReaction = 0;
	var totalCostPerReaction = assayCostPerReaction + masterMixCostPerReaction + masterMixCostPerReaction1 + masterMixCostPerReaction2	+ optimizationCostPerReaction;
	var productUrl = "";
	var productUrl = producturls.findRecord('partNumber', partNumber).get('productURL');
	
	var refassayperreaction = totalrefcost/(getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));

	var assayCostPerSample = totalAssayCost / getExperimentInfo('noofsamples');
	var refCostPerSample = totalrefcost/getExperimentInfo('noofsamples')
	var totalCostPerSample = assayCostPerSample + mmixCostPerSample + mmixCostPerSample1 + mmixCostPerSample2 +refCostPerSample;
	totalNewCostPerReaction = totalCost/noofreactions;
	var totalCostPreDisc = costWithVolDisc
			+ (masterMixCostPerUnit * mnoofunits);
	var totalDiscount = 100 - (totalCost * 100 / totalCostPreDisc);
    refassayname = refassayname.replace("TaqMan","TaqMan®");
	
	
	
	
	outputList.add({
		pno : spno,
		title : title,
		partnumber : partNumber,
		format : format.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		noofunits : noofunits_new,
		noofreactions : noofreactions,
		mastermix : mastermix.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		mastermix1 : mastermix1,//.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		mastermix2 : mastermix2,//.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		mastermix3 : mastermix3,//.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		mnoofunits : mnoofunits,
		mnoofunits1 : mnoofunits1,
		mnoofunits2 : mnoofunits2,
		mnoofunits3 : mnoofunits3,
		totalcost : roundNumber(totalCost, 2),
		//totalcost : roundNumber(newTotalCost,2),
		volumediscount : volumeDiscount,
		mvolumediscount : masterperc,
		assayscost : roundNumber(costWithVolDisc, 2),
		assayscostperunit : roundNumber(assayCostPerUnit, 2),
		assayscostwithvoldisc : roundNumber(totalAssayCost, 2),
		mastermixvol : roundNumber(mvolume, 2),
		mastermixcostperunit : masterMixCostPerUnit,
		mastermixcostperunit1 : roundNumber(masterMixCostPerUnit1, 2),
		mastermixcostperunit2 : roundNumber(masterMixCostPerUnit2, 2),
		mastermixcostperunit3 : roundNumber(masterMixCostPerUnit3, 2),
		mastermixdisc : masterperc,
		mastermixcostwithdisc : roundNumber(totalMasterMixCost, 2),
		mastermixcostwithdisc1: roundNumber(totalMasterMixCost1, 2),
		mastermixcostwithdisc2: roundNumber(totalMasterMixCost2, 2),
		mastermixcostwithdisc3: roundNumber(totalMasterMixCost3, 2),
		mastermixcostpredisc : roundNumber((masterMixCostPerUnit * mnoofunits),2),
		mastermixcostpredisc1 : roundNumber((masterMixCostPerUnit1 * mnoofunits1), 2),
		mastermixcostpredisc2 : roundNumber((masterMixCostPerUnit2 * mnoofunits2), 2),
		mastermixcostpredisc3 : roundNumber((masterMixCostPerUnit3 * mnoofunits3), 2),
		mastermixcost : roundNumber(masterMixCostPerUnit * mnoofunits, 2),
		mastermixcost1 : roundNumber(masterMixCostPerUnit1 * mnoofunits1, 2),
		mastermixcost2 : roundNumber(masterMixCostPerUnit2 * mnoofunits2, 2),
		mastermixcost3 : roundNumber(masterMixCostPerUnit3 * mnoofunits3, 2),
		mastermixpartnumber : masterMixPartNumber,
		mastermixpartnumber1 : masterMixPartNumber1,
		mastermixpartnumber2 : masterMixPartNumber2,
		mastermixpartnumber3 : masterMixPartNumber3,
		mmxcostpersample : roundNumber(mmixCostPerSample, 2),
		mmxcostpersample1 : roundNumber(mmixCostPerSample1,2),
		mmxcostpersample2 : roundNumber(mmixCostPerSample2,2),
		mmxcostpersample3 : roundNumber(mmixCostPerSample3,2),
		assaycostpersample : roundNumber(assayCostPerSample, 2),
		totalcostpersample : totalCostPerSample,
		totalcostpredisc : roundNumber(totalCostPreDisc, 2),
		totaldiscount : roundNumber(totalDiscount, 2),
		noofhours : hours,
		assaycostperreaction : assayCostPerReaction,
		mastermixcostperreaction : masterMixCostPerReaction,
		mastermixcostperreaction1 : roundNumber(masterMixCostPerReaction1, 2),
		mastermixcostperreaction2 : roundNumber(masterMixCostPerReaction2, 2),
		mastermixcostperreaction3 : roundNumber(masterMixCostPerReaction3, 2),
		optimizationcostperreaction : roundNumber(optimizationCostPerReaction,2),
		totalcostperreaction : totalNewCostPerReaction,
		totalcostpersample : totalCostPerSample,
		producturl : productUrl,
		refassayname : refassayname,
		refassaypartnumber : assaypartnumber,
		refassayqty : refassayquantity,
		refassaycost : totalrefcost,
		refassaypercost : priceperrefassayUnit,
		refassayperreaction:refassayperreaction,
		refassaycostpersample : roundNumber(refCostPerSample, 2),
		fnName:'addCopyNumCustom',
		type : 'tube'
	});

}
/*function addDigitalCopyNumCustom() {
	
	//var title = "Assays in Tubes";
	var title = "Single Tube Assays - Custom";
	var format = "";
	var noofreactions = getExperimentInfo('noofreplicates')* getExperimentInfo('noofsamples') * getExperimentInfo('nooftargets');
	var noofreactionspertarget = getExperimentInfo('noofreplicates')* getExperimentInfo('noofsamples');
	//var formatObj = findApproximateCopyNumberPre(noofreactionspertarget);
    var formatObj = findOptimumCopyNumberTubeRecord(noofreactionspertarget,'Custom assays')
	format = formatObj.get("concatenate");
	
	format = format.replace(/_/gi,' ');
	format = format.replace(/Gene Expression/gi, 'Gene Expression Assays, ');
	format = format.replace(/miRNA/gi, 'MicroRNA Assays, ');
	format = format.replace(/small/gi, 'Small, ');
	format = format.replace(/Medium/gi, 'Medium, ');
	format = format.replace(/Large/gi, 'Large, ');
	format = format.replace("TaqMan","TaqMan®");
	//format = "TaqMan " + format;*/
	
	/*var refassayObj = Ext.get('referenceassay').dom;
    var assaypartoption = refassayObj.options[refassayObj.selectedIndex].value;*/
	
/*	var digRefassayObj = Ext.get('digitalreferenceassay').dom;
	var assaypartoption = digRefassayObj.options[digRefassayObj.selectedIndex].value;
			
	var tubenoofreactions = formatObj.get('numberofreactions');
	
	var noofunits = getExperimentInfo('nooftargets');
	var wellNum = 96;
	
	var assaypartnumber = '4403328';//findOptimumCopyNumberRefAssay(noofreactions,assaypartoption,'Human');
	var assayrefobject = copyrefassayModel.findRecord('partnumber',assaypartnumber);
	
	if (getExperimentInfo('equipment') == '96-well') {
		tubenoofunits = Math.ceil(noofreactionspertarget/ formatObj.get('96-wellnumberofreactions'));
		var refassayreaction = assayrefobject.get('96-wellnumberofreactions'); 
	} else if (getExperimentInfo('equipment') == '384-well') {
		wellNum = 384;
		tubenoofunits = Math.ceil(noofreactionspertarget
				/ formatObj.get('384-wellnumberofreactions'));
		var refassayreaction = assayrefobject.get('384-wellnumberofreactions'); 
	} else {
		wellNum = 384;
		var refassayreaction = assayrefobject.get('384-wellnumberofreactions');
		tubenoofunits = Math.ceil(noofreactionspertarget / tubenoofreactions);
		//alert("no " + noofunits);
	}
	
     var noofunits_new = tubenoofunits * noofunits;
	refassayunits = Math.ceil(noofreactions / refassayreaction);
	//var priceperrefassayUnit = assayrefobject.regions().findRecord('region', region).prices().findRecord('countrycode', currency).get('value');
	var priceperrefassayUnit = pricelist.findRecord('partnumber', assaypartnumber)
			.regions().findRecord('region',
					region + "-" + currency).get(
					'price');
					
	var refassayname = assayrefobject.get('concatenate');
	var refassayquantity = refassayunits;
	var totalrefcost = refassayquantity * priceperrefassayUnit;
	
	var mvolume = 0;
	if (getExperimentInfo('equipment') == '96-well') {
		mvolume = masterMixRequirements.wellplate96
				* getExperimentInfo('nooftargets')
				* getExperimentInfo('noofreplicates')
				* getExperimentInfo('noofsamples') / 1000;
	} else if (getExperimentInfo('equipment') == '384-well') {
		mvolume = masterMixRequirements.wellplate384
				* getExperimentInfo('nooftargets')
				* getExperimentInfo('noofreplicates')
				* getExperimentInfo('noofsamples') / 1000;
	} else {
		mvolume = masterMixRequirements.tubes
				* getExperimentInfo('nooftargets')
				* getExperimentInfo('noofreplicates')
				* getExperimentInfo('noofsamples') / 1000;
	}
	
	
	
	
	var mastermixObj = findOptimumCopyNumberMicroMMXTubeRecord(mvolume);
	var mastermix = mastermixObj.get('productname');
	var mnoofunits = Math.ceil(mvolume / mastermixObj.get('volume'));
	var partNumber = formatObj.get('partnumber');
	
    var assayCostPerUnit = pricelist.findRecord('partnumber', partNumber)
			.regions().findRecord('region', region + "-" + currency).get(
					'price');
					
					
	newTotalCost = assayCostPerUnit * noofunits * tubenoofunits;
	totalNewCostPerReaction = newTotalCost/noofreactions;
	totalNewCostPerSample = newTotalCost/getExperimentInfo('noofsamples');
	
	
	
	
	
	var volumeDiscount = 0;
	var costWithVolDisc = noofunits * assayCostPerUnit* (1 - (volumeDiscount / 100));
	var assayperc = (Ext.get('assayperc').dom.value).split('%')[0];
	var totalAssayCost = costWithVolDisc * (1 - (assayperc / 100));
	var totalrefcost = refassayquantity * priceperrefassayUnit * (1 - (assayperc / 100));
	var masterMixPartNumber = mastermixObj.get('partnumber');
	var masterMixCostPerUnit = pricelist.findRecord('partnumber',
			masterMixPartNumber).regions().findRecord('region',
			region + "-" + currency).get('price');
	var masterperc = (Ext.get('masterperc').dom.value).split('%')[0];
	var totalMasterMixCost = masterMixCostPerUnit * mnoofunits
			* (1 - (masterperc / 100));

	var numPlates = Math.ceil(getExperimentInfo('nooftargets')
			* getExperimentInfo('noofreplicates')
			* getExperimentInfo('noofsamples')/wellNum);
	console.log("Number of plates: " + numPlates);
	var hours = Math.ceil(65/60 * 1.2 * numPlates);

//	var hours = Math.ceil((60 / 60 / wellNum) * getExperimentInfo('nooftargets')
//			* getExperimentInfo('noofreplicates')
//			* getExperimentInfo('noofsamples'));
	var totalCost = totalAssayCost + totalMasterMixCost+totalrefcost;

	var assayCostPerReaction = totalAssayCost
			/ (getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
	var masterMixCostPerReaction = totalMasterMixCost
			/ (getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
	var optimizationCostPerReaction = 0;
	var totalCostPerReaction = assayCostPerReaction + masterMixCostPerReaction
			+ optimizationCostPerReaction;
	var productUrl = "";
	var productUrl = producturls.findRecord('partNumber', partNumber).get('productURL');
	
	var refassayperreaction = totalrefcost/(getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));

	var mmixCostPerSample = totalMasterMixCost
			/ getExperimentInfo('noofsamples');
	var assayCostPerSample = totalAssayCost / getExperimentInfo('noofsamples');
	var refCostPerSample = totalrefcost/getExperimentInfo('noofsamples')
	var totalCostPerSample = assayCostPerSample + mmixCostPerSample+refCostPerSample;
	totalNewCostPerReaction = totalCost/noofreactions;
	var totalCostPreDisc = costWithVolDisc
			+ (masterMixCostPerUnit * mnoofunits);
	var totalDiscount = 100 - (totalCost * 100 / totalCostPreDisc);
    refassayname = refassayname.replace("TaqMan","TaqMan®");
	
	/*Chip calculation*/
	/* var digitalchips = 'QuantStudio<sup>&reg;</sup>&nbsp; 3D Digital PCR Chips';
	 var digitalchipspartnumber = '4440045';
	 var digitalchipsnoofunits = Math.ceil((getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'))/12);
	 var digitalchipspriceperunit = 200;
	 var totdigitalchipscost = digitalchipsnoofunits * digitalchipspriceperunit;
	 var digitalchipscostperreaction = totdigitalchipscost / (getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
	 var digitalchipspersample =  totdigitalchipscost / getExperimentInfo('noofsamples');
	 var digitalchipscostwithdisc = 0;
	
	
	outputList.add({
		pno : 8,
		title : title,
		partnumber : partNumber,
		format : format.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		noofunits : noofunits_new,
		noofreactions : noofreactions,
		mastermix : mastermix.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		mnoofunits : mnoofunits,
		totalcost : roundNumber(totalCost, 2),
		//totalcost : roundNumber(newTotalCost,2),
		volumediscount : volumeDiscount,
		mvolumediscount : masterperc,
		assayscost : roundNumber(costWithVolDisc, 2),
		assayscostperunit : roundNumber(assayCostPerUnit, 2),
		assayscostwithvoldisc : roundNumber(totalAssayCost, 2),
		mastermixvol : roundNumber(mvolume, 2),
		mastermixcostperunit : masterMixCostPerUnit,
		mastermixdisc : masterperc,
		mastermixcostwithdisc : roundNumber(totalMasterMixCost, 2),
		mastermixcostpredisc : roundNumber((masterMixCostPerUnit * mnoofunits),
				2),
		mastermixcost : roundNumber(masterMixCostPerUnit * mnoofunits, 2),
		mastermixpartnumber : masterMixPartNumber,
		mmxcostpersample : roundNumber(mmixCostPerSample, 2),
		assaycostpersample : roundNumber(assayCostPerSample, 2),
		totalcostpersample : totalCostPerSample,
		totalcostpredisc : roundNumber(totalCostPreDisc, 2),
		totaldiscount : roundNumber(totalDiscount, 2),
		noofhours : hours,
		assaycostperreaction : assayCostPerReaction,
		mastermixcostperreaction : masterMixCostPerReaction,
		optimizationcostperreaction : roundNumber(optimizationCostPerReaction,
				2),
		totalcostperreaction : totalNewCostPerReaction,
		totalcostpersample : totalCostPerSample,
		producturl : productUrl,
		refassayname : refassayname,
		refassaypartnumber : assaypartnumber,
		refassayqty : refassayquantity,
		refassaycost : totalrefcost,
		refassaypercost : priceperrefassayUnit,
		refassayperreaction:refassayperreaction,
		refassaycostpersample : roundNumber(refCostPerSample, 2),
		reqnoofunits : noofunits_new,
		type : 'tube',
		digitalchips: digitalchips,
		digitalchipspartnumber: digitalchipspartnumber,
		digitalchipsnoofunits: digitalchipsnoofunits,
		digitalchipspriceperunit: digitalchipspriceperunit,
		digitalchipscostperreaction: digitalchipscostperreaction,
		digitalchipspersample: digitalchipspersample,
		digitalchipscostwithdisc: totdigitalchipscost
	});

}*/