function addOTAPI() {
	
	if(getExperimentInfo('nooftargets') > 224)
	{
		Ext.get('emessage').removeCls('hidden');
		updateContMessage()
		return;
	}
	Ext.get('emessage').addCls('hidden');
	var title = "TaqMan<sup>&reg;</sup>&nbsp;OpenArray<sup>&reg;</sup>&nbsp;Real-Time PCR Plates(Inventoried)";
	var isQuant = getExperimentInfo('openarrayinstrument') == "QuantStudio" ? true : false;
	var isNTCycler = getExperimentInfo('openarrayinstrument') == "NTCycler" ? true : false;
	var formatObj1 = isQuant ? findApproximateOpenQuantTapIRecord(getExperimentInfo('nooftargets'))
			: findApproximateOpenTapIRecord(getExperimentInfo('nooftargets'));
	var formatObj = findApproximateOpenTapIRecord(getExperimentInfo('nooftargets'));
	var formats = formatObj1.get('concatenate');
	var format = formats.replace("QuantStudio TM","QuantStudio™");
	var partNo = formatObj1.get('partnumber');
	var noofgenes = formatObj.get('formatno');
	var reqnoofunits = getExperimentInfo('noofsamples')	* (Math.ceil(getExperimentInfo('noofsubarrays')/3)) / formatObj.get('effectivesamplesperunit');
	var noofunits = reqnoofunits < formatObj.get('min') ? formatObj.get('min')	: Math.ceil(reqnoofunits);
	/*if(getExperimentInfo('nooftargets') <= 18){
		if(getExperimentInfo('noofsubarrays') == 1 || getExperimentInfo('noofsubarrays') == 2 || getExperimentInfo('noofsubarrays') == 3){
			var noofunits = 1;
		}
		if(getExperimentInfo('noofsubarrays') == 4 || getExperimentInfo('noofsubarrays') == 5 || getExperimentInfo('noofsubarrays') == 6){
			var noofunits = 2;
		}
		if(getExperimentInfo('noofsubarrays') == 7 || getExperimentInfo('noofsubarrays') == 8 || getExperimentInfo('noofsubarrays') == 9){
			var noofunits = 3;
		}
	} else {
		var noofunits = reqnoofunits < formatObj.get('min') ? formatObj.get('min')	: Math.ceil(reqnoofunits);
	}*/
	
	var min = formatObj.get('min');
	var isMin = (min == 1 ? 1 : (Math.ceil(reqnoofunits) < min ? 0 : 1));

	var noofreactions = noofgenes * getExperimentInfo('noofsamples') * getExperimentInfo('noofreplicates');
	// var mvolume = reqnoofunits * 150;
	// var masterMixRec = findOptimumOpenArrayGeneMicroMMXRecord(mvolume);
	var mmxObj = accessories.findRecord('partnumber', "4462159");
	var mmxObj1 = accessories.findRecord('partnumber', "4462164");
	var mastermix = "";
	mastermix = mmxObj.get('product');
	var mastermix1 = mmxObj1.get('product');
	var mmxPartNumber = mmxObj.get('partnumber');
	var mmxPartNumber1 = mmxObj1.get('partnumber');
	var masterperc = (Ext.get('masterperc').dom.value).split('%')[0];
	var accessperc = (Ext.get('accessoriesperc').dom.value).split('%')[0];
	var volumeDiscount = 0;

	//var mnoofunits = Math.ceil((formatObj.get('mmxperunit') * reqnoofunits * 10) % 3.34);
    //var mnoofunits1 = Math.floor((formatObj.get('mmxperunit') * reqnoofunits * 10) / 3.4);
    //var mvolume = Math.ceil((157 * noofunits * 10)/1000) ; 
    var mvolume = (150 * noofunits * 10)/1000 ; // Lini asked to change the value 157 to 150 on 04-06-2014
	
	if(mvolume >= 3)
	{
		if(mvolume <=5)
		{
			var mnoofunits = 0;
			var mnoofunits1 = 1;		
		}else{
			var remvol = (mvolume % 5);
			var mnoofunits = Math.ceil((remvol / 1.5));
			var mnoofunits1 = Math.floor((mvolume / 5));
		

		}

	}else
	{
		var mnoofunits = Math.ceil((mvolume / 1.5));
		var mnoofunits1 = 0;
	}

    

	var masterMixCostPerUnit = pricelist.findRecord('partnumber', mmxPartNumber).regions().findRecord('region', region + "-" + currency).get('price');
	var masterMixCostPerUnit1 = pricelist.findRecord('partnumber',
			mmxPartNumber1).regions().findRecord('region',
			region + "-" + currency).get('price');

	var totalMasterMixCost = masterMixCostPerUnit * mnoofunits
			* (1 - (masterperc / 100));
	var totalMasterMixCost1 = masterMixCostPerUnit1 * mnoofunits1
			* (1 - (masterperc / 100));
	var masterMixCostPerReaction = (totalMasterMixCost)
			/ (getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
	var masterMixCostPerReaction1 = (totalMasterMixCost1)
			/ (getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));

	var mmixCostPerSample = totalMasterMixCost
			/ getExperimentInfo('noofsamples');
	var mmixCostPerSample1 = totalMasterMixCost1
			/ getExperimentInfo('noofsamples');

	var discObj = tsstable.findRecord('product', Ext.util.Format.trim(formatObj
			.get('concatenate')));
	var discUnits = noofunits > 84 ? 84 : noofunits;

	//volumeDiscount = discObj.discounts().findRecord('volume', discUnits, 0, false, false, true).get('value');

	if(partNo == 4456262 || partNo == 4456272 || partNo == 4471119 || partNo == 4471124){
		var volumeDiscount = GeneExpressionFormat18VolDiscount(noofunits,'');
	} else if(partNo == 4456266 || partNo == 4456276 || partNo == 4471120 || partNo == 4471125){
		var volumeDiscount = GeneExpressionFormat18VolDiscount(noofunits,'');
	} else if(partNo == 4456258 || partNo == 4471121){
		var volumeDiscount = GeneExpressionFormat112CustVolDiscount(noofunits,'');
	} else if(partNo == 4456268 || partNo == 4471126){
		var volumeDiscount = GeneExpressionFormat112InventVolDiscount(noofunits,'');
	} else if(partNo == 4456260 || partNo == 4471122){
		var volumeDiscount = GeneExpressionFormat168CustVolDiscount(noofunits,'');
	} else if(partNo == 4456270 || partNo == 4471127){
		var volumeDiscount = GeneExpressionFormat112InventVolDiscount(noofunits,'');
	} else if(partNo == 4456264 || partNo == 4471123){
		var volumeDiscount = GeneExpressionFormat224CustVolDiscount(noofunits,'');
	} else if(partNo == 4456274 || partNo == 4471128){
		var volumeDiscount = GeneExpressionFormat168CustVolDiscount(noofunits,'');
	}
	
	var pricePerUnit = (pricelist.findRecord('partnumber',partNo).regions().findRecord('region', region + "-" + currency).get('price'));

	var price = (pricelist.findRecord('partnumber',partNo).regions().findRecord('region', region + "-" + currency).get('price'))
			* noofunits;

	var openarrayperc = parseFloat((Ext.get('openarrayperc').dom.value)
			.split('%')[0]);
	var assaysCostWithVolDisc = price
			- (((volumeDiscount + openarrayperc) / 100) * price);

	var openArray384Obj = accessories.findRecord('product',
			'OpenArray® 384-well Sample Plates');
	var acc1PartNumber = openArray384Obj.get('partnumber');

	var openArray384WellSamplePlatesUnits = Math.ceil(formatObj
			.get('sampleplates')
			* reqnoofunits) < openArray384Obj.get('min') ? openArray384Obj
			.get('min') : Math.ceil(formatObj.get('sampleplates')
			* reqnoofunits);
	var openArray384WellSamplePlatesCost = pricelist.findRecord('partnumber',
			acc1PartNumber).regions().findRecord('region',
			region + "-" + currency).get('price')
			* openArray384WellSamplePlatesUnits ;

	var opeArrayAccuObj = accessories.findRecord('product',
			'OpenArray® AccuFill® System Tips');
	var acc2PartNumber = opeArrayAccuObj.get('partnumber');

	var openArrayAccuFillSystemTipsUnits = Math.ceil((formatObj
			.get('tipsperunit') * reqnoofunits) % 10) < opeArrayAccuObj
			.get('min') ? opeArrayAccuObj.get('min') : Math.ceil((formatObj
			.get('tipsperunit') * reqnoofunits) % 10);

	var openArrayAccuFillSystemTipsCost = pricelist.findRecord('partnumber',
			acc2PartNumber).regions().findRecord('region',
			region + "-" + currency).get('price')
			* openArrayAccuFillSystemTipsUnits ;

	var openArrayAccu10Obj = accessories.findRecord('product',
			'OpenArray® AccuFill® System Tips, 10 pack');
	var acc3PartNumber = openArrayAccu10Obj.get('partnumber');

	var openArrayAccuFillSystemTips10PackUnits = Math.ceil(Math
			.floor((formatObj.get('tipsperunit') * reqnoofunits) / 10)) < openArrayAccu10Obj
			.get('min') ? openArrayAccu10Obj.get('min') : Math.ceil(Math
			.floor((formatObj.get('tipsperunit') * reqnoofunits) / 10));
	var openArrayAccuFillSystemTips10PackCost = pricelist.findRecord(
			'partnumber', acc3PartNumber).regions().findRecord('region',
			region + "-" + currency).get('price')
			* openArrayAccuFillSystemTips10PackUnits ;

	// var masterMixUnits = Math.ceil(mvolume / masterMixRec.volume);
	//
	// var masterMixCostPerUnit = pricelist
	// .findRecord('partnumber', mmxPartNumber).regions().findRecord(
	// 'region', region + "-" + currency).get('price');
	//
	// var masterMixCostPerReaction = mvolume * masterMixCostPerUnit
	// / noofreactions;
	//
	// var masterMixCost = masterMixCostPerUnit * masterMixUnits;
	//
	// var masterMixCostWithDisc = masterMixCostPerUnit * masterMixUnits
	// * (1 - (masterperc / 100));
	var openArray384WellSamplePlatesCostWithDisc = openArray384WellSamplePlatesCost * (1 - (accessperc / 100));
	var openArrayAccuFillSystemTips10CostWithDisc = openArrayAccuFillSystemTips10PackCost * (1 - (accessperc / 100));
	var openArrayAccuFillSystemTipsCostWithDisc	  = openArrayAccuFillSystemTipsCost * (1 - (accessperc / 100));	
	var accessoriescost = openArrayAccuFillSystemTipsCostWithDisc + openArrayAccuFillSystemTips10CostWithDisc
			+ openArray384WellSamplePlatesCostWithDisc;

			
	var totalAccessoriescost = accessoriescost;

	var accessoriesCostPerReaction = totalAccessoriescost / noofreactions;

	var assayCostPerReaction = assaysCostWithVolDisc / noofreactions;

	var masterMixCost = masterMixCostPerUnit * mnoofunits;
	var masterMixCost1 = masterMixCostPerUnit1 * mnoofunits1;

	var masterMixCostWithDisc = masterMixCostPerUnit * mnoofunits
			* (1 - (masterperc / 100));
	var masterMixCostWithDisc1 = masterMixCostPerUnit1 * mnoofunits1
			* (1 - (masterperc / 100));

	var totalCostPerReaction = masterMixCostPerReaction + assayCostPerReaction
			+ accessoriesCostPerReaction;

	var totalCostPreDisc = accessoriescost + masterMixCost + price;

	// var openarraycost = formatObj.

	var totalCost = totalAccessoriescost + masterMixCostWithDisc + masterMixCostWithDisc1
			+ assaysCostWithVolDisc;

	var totalDiscount = 100 - (totalCost * 100 / totalCostPreDisc);

	var assayCostPerSample = assaysCostWithVolDisc
			/ getExperimentInfo('noofsamples');
	var acc1CostPerSample = openArray384WellSamplePlatesCost
			/ getExperimentInfo('noofsamples');
	var acc2CostPerSample = openArrayAccuFillSystemTipsCost
			/ getExperimentInfo('noofsamples');
	var acc3CostPerSample = openArrayAccuFillSystemTips10PackCost
			/ getExperimentInfo('noofsamples');
	var accessoriesCostPerSample = acc1CostPerSample + acc2CostPerSample
			+ acc3CostPerSample;
	// var mmixCostPerSample = masterMixCost / getExperimentInfo('noofsamples');

	var totalCostPerSample = assayCostPerSample + acc1CostPerSample
			+ acc2CostPerSample + acc3CostPerSample + mmixCostPerSample;
	var totalCostPerSample  = 	totalCost/getExperimentInfo('noofsamples');
	var totalCostPerReaction = totalCost/noofreactions;
	var partNumber = formatObj.get('partnumber');
	var productUrl = producturls.findRecord('partNumber', partNumber).get(
			'productURL');

	var noOfHours = 0;
	var oType = getExperimentInfo('openarrayinstrument') == "QuantStudio" ? "GEandMirnaQS"
			: "GEandMirnaNT";
	var tRec = openarrayruntimes.findRecord('type', oType);
	noOfHours = Math.ceil(Math.ceil((reqnoofunits * 10)
			/ tRec.get('noofplatesperrun'))
			* tRec.get('totalmin') / 60);
	var imageType = "";
	if(isNTCycler){
		imageType = "openarray-ntcycler-fixed";
	}
	outputList.add({
				pno : 11,
				title : title,
				partnumber : partNo,
				format : format.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
				noofunits : noofunits,
				noofreactions : noofreactions,
				mastermix : mastermix
						.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
				mastermix1 : mastermix1.replace(/�/gi,
						'<sup>&reg;</sup>&nbsp;'),
				mnoofunits : mnoofunits,
				mnoofunits1 : mnoofunits1,
				totalcost : roundNumber(totalCost, 2),
				volumediscount : volumeDiscount,
				mvolumediscount : 0,
				mastermixdisc : masterperc,
				accessoriesdisc : accessperc,
				assayscost : roundNumber(price, 2),
				assayscostperunit : roundNumber(pricePerUnit, 2),
				assayscostwithvoldisc : roundNumber(assaysCostWithVolDisc, 2),
				mastermixvol : 0,
				mastermixcostperunit : masterMixCostPerUnit,
				mastermixcostperunit1 : masterMixCostPerUnit1,
				mastermixcostwithvoldisc : masterMixCost,
				mastermixcostwithvoldisc1 : masterMixCost1,
				mastermixcostwithdisc : roundNumber(masterMixCostWithDisc, 2),
				mastermixcostwithdisc1 : roundNumber(masterMixCostWithDisc1, 2),
				mastermixcost : masterMixCost,
				mastermixcost1 : masterMixCost1,
				noofhours : noOfHours,
				assaycostperreaction : roundNumber(assayCostPerReaction, 2),
				mastermixcostperreaction : roundNumber(
						masterMixCostPerReaction, 2),
				mastermixcostperreaction1 : roundNumber(
						masterMixCostPerReaction1, 2),
				accessoriescostperreaction : roundNumber(
						accessoriesCostPerReaction, 2),
				optimizationcostperreaction : 0,
				totalcostperreaction : roundNumber(totalCostPerReaction, 2),
				producturl : '',
				openarray384wellsampleplatescost : openArray384WellSamplePlatesCost,
				openarrayaccufillsystemtipscost : openArrayAccuFillSystemTipsCost,
				openarrayaccufillsystemtips10packcost : openArrayAccuFillSystemTips10PackCost,
				openarray384wellsampleplatesunits : openArray384WellSamplePlatesUnits,
				openarrayaccufillsystemtipsunits : openArrayAccuFillSystemTipsUnits,
				openarrayaccufillsystemtips10packunits : openArrayAccuFillSystemTips10PackUnits,
				totalcostpersample : roundNumber(totalCostPerSample, 2),
				accessoriescost : roundNumber(accessoriescost, 2),
				accessoriescostwithdisc : roundNumber(totalAccessoriescost, 2),
				assaycostpersample : roundNumber(assayCostPerSample, 2),
				accessoriescostpersample : roundNumber(
						accessoriesCostPerSample, 2),
				mmxcostpersample : roundNumber(mmixCostPerSample, 2),
				mmxcostpersample1 : roundNumber(mmixCostPerSample1, 2),
				totalcostpredisc : roundNumber(totalCostPreDisc, 2),
				totaldiscount : roundNumber(totalDiscount, 2),
				accessory1partnumber : acc1PartNumber,
				accessory2partnumber : acc2PartNumber,
				accessory3partnumber : acc3PartNumber,
				mastermixpartnumber : mmxPartNumber,
				mastermixpartnumber1 : mmxPartNumber1,
				producturl : productUrl,
				reqnoofunits : reqnoofunits,
				type : 'openarray-custom',
				min : min,
				ismin : isMin,
				imageType:imageType,
				fnName:'addOTAPI'
			});

}

function findApproximateOpenTapIRecord(value) {
	var record = null;
	var name = "TaqMan® OpenArray® Real-Time PCR Plates, Inventoried Assays Format";
	var prevRecord = null;
	if (value < 18) {
		return openArray.findRecord('concatenate', name + '  18');
	} else if (value > 224) {
		return openArray.findRecord('concatenate', name + '  224');
	} else {
		openArray.each(function(e) {
			if (e.get('concatenate').indexOf(name) != -1
					&& e.get('formatno') == value) {
				record = e;
				return false;
			} else if (e.get('concatenate').indexOf(name) != -1
					&& e.get('formatno') > value) {
				if (prevRecord != null && prevRecord >= value)
					record = prevRecord;
				else
					record = e;
				return false;
			} else if (e.get('concatenate').indexOf(name) != -1) {
				prevRecord = e;
			}

		});
		return record;
	}
}

function findApproximateOpenQuantTapIRecord(value) {
	var record = null;
	var name = "TaqMan® OpenArray® RT PCR Inventoried Format";
	var prevRecord = null;
	if (value < 18) {
		return quantstudio.findRecord('concatenate', name
				+ ' 18 QuantStudio TM 12K Flex');
	} else if (value > 224) {
		return quantstudio.findRecord('concatenate', name
				+ ' 224 QuantStudio TM 12K Flex');
	} else {
		quantstudio.each(function(e) {
			if (e.get('concatenate').indexOf(name) != -1
					&& e.get('number of Assays or Plate') == value) {
				record = e;
				return false;
			} else if (e.get('concatenate').indexOf(name) != -1
					&& e.get('number of Assays or Plate') > value) {
				if (prevRecord != null && prevRecord >= value)
					record = prevRecord;
				else
					record = e;
				return false;
			} else if (e.get('concatenate').indexOf(name) != -1) {
				prevRecord = e;
			}

		});
		return record;
	}
}