function addAdvanced() {
	//var title = "Assays in Tubes(Custom)";
	var title = "Single Tube Assays - Advanced";
	var format = "";
	var noofreactions = getExperimentInfo('noofreplicates')
			* getExperimentInfo('noofsamples');
	var isMirna = getExperimentInfo('type') == "Gene Expression" ? false : true;
	var isOtherFormat = getExperimentInfo('isOtherFormat');
	var spno = 303;
	if( isOtherFormat === "YES" ){
		spno = getExperimentInfo('otherFmPano');
		var selOtherForVal = getExperimentInfo('selOtherFormatValue');
		var formatObj = findAppTapRecForOtherFormat(tubesModel, 'concatenate', selOtherForVal);
	}else{
		updateExperimentInfo("currFmPno", spno);
		if(!isMirna){
			var formatObj = findOptimumGeneMicroExpTubeRecord(noofreactions, "Custom");
		} else{
			var formatObj = findOptimumMiRNAExpTubeRecord(noofreactions, "Advanced", getExperimentInfo('noofsamples'));
		}
	}
	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 &#174; " + format;
	format = "TaqMan® " + format;
	
	var tubenoofreactions = formatObj.get('numberofreactions');
	var noofunits = 0;
	
	var factor = (isMirna && (formatObj.get('concatenate').indexOf('Extra') != -1 || formatObj
			.get('concatenate').indexOf('small') != -1)) ? 3 : 1;
	/**Added on 01-10-2014**/
	if(isMirna){
	var mnoofunitsnRT = 0;
	var mnoofunitsRT = 0;
	var nNoofSamples = getExperimentInfo('noofsamples');
	if (getExperimentInfo('equipment') == '96-well') {
		mnoofunitsnRT = Math.ceil(noofreactions  / formatObj.get('96-wellnumberofreactions'));
		mnoofunitsRT = Math.ceil( (nNoofSamples * (isMirna ? factor : 1)) / formatObj.get('96-wellnumberofreactions'));
	} else if (getExperimentInfo('equipment') == '384-well') {
		mnoofunitsnRT = Math.ceil(noofreactions  / formatObj.get('384-wellnumberofreactions'));
		mnoofunitsRT = Math.ceil( (nNoofSamples * (isMirna ? factor : 1)) / formatObj.get('384-wellnumberofreactions'));
	} else {
		mnoofunitsnRT = Math.ceil(noofreactions  / formatObj.get('numberofreactions'));
		mnoofunitsRT = Math.ceil( (nNoofSamples * (isMirna ? factor : 1)) / formatObj.get('384-wellnumberofreactions'));
	}
		if(mnoofunitsRT > mnoofunitsnRT){
		noofreactions = nNoofSamples;
			//factor = 1;
		}else{
			factor = 1;
		}
	}
	/**Ended on 01-10-2014**/
	
	if (getExperimentInfo('equipment') == '96-well') {
		noofunits = Math.ceil(noofreactions * factor
				/ formatObj.get('96-wellnumberofreactions'))
				* getExperimentInfo('nooftargets');
	} else if (getExperimentInfo('equipment') == '384-well') {
		noofunits = Math.ceil(noofreactions * factor
				/ formatObj.get('384-wellnumberofreactions'))
				* getExperimentInfo('nooftargets');
	} else {
		noofunits = Math.ceil(noofreactions / tubenoofreactions)
				* getExperimentInfo('nooftargets');
	}
	
	var noofreactions = getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples');
	var mvolume = 0;
	var wellNum = 96;
	if (getExperimentInfo('equipment') == '96-well') {
		mvolume = masterMixRequirements.wellplate96
				* getExperimentInfo('nooftargets')
				* getExperimentInfo('noofreplicates')
				* getExperimentInfo('noofsamples') / 1000;
	} else if (getExperimentInfo('equipment') == '384-well') {
		wellNum = 384;
		mvolume = masterMixRequirements.wellplate384
				* getExperimentInfo('nooftargets')
				* getExperimentInfo('noofreplicates')
				* getExperimentInfo('noofsamples') / 1000;
	} else {
		wellNum = 384;
		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(masterMixModel, 'product', selOtherForPd);
		var mastermix = mastermixObj.get('product');
		var mnoofunits = (Math.ceil(mvolume / 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), geneExpressionMasterMix);
		var selMM = toGetOptimumPrice(toGetCombinationVal, tubesMasterMix);
		
		//var mastermixObj = findOptimumGeneMicroMMXTubeRecord(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', 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');
	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 masterperc = (Ext.get('masterperc').dom.value).split('%')[0];
	
	var totalreactions = noofreactions * getExperimentInfo('nooftargets');
	// 20% additional time added over plates for manual handling and mixing
	var stdRunTime = 75 * 1.2;
	var fastRunTime = 40 * 1.3;
	
	var numPlates = Math.ceil(totalreactions/wellNum);
	//console.log("Number of plates: " + numPlates);

	if (getExperimentInfo('method') == 'Fast'){		
		var hours = Math.ceil(fastRunTime/60 * numPlates);}
	else{
		var hours = Math.ceil(stdRunTime/60 * numPlates);
	}

	/*miRNA cDNA Synthesis Kit*/
	var cDNAKit = 'TaqMan™ Advanced miRNA cDNA Synthesis Kit';
	var cDNAKitQty =  Math.ceil(getExperimentInfo('noofsamples')/50); // a kit contains 50 reactions. so if user specifies 10 samples, 1 kit is enough.
	var cDNAKitPartNo = 'A28007';
	var cDNAKitCost = Number(pricelist.findRecord('partnumber', cDNAKitPartNo).regions().findRecord('region', region + "-" + currency).get('price'));
	var cDNAtotalKitCost = cDNAKitQty * cDNAKitCost * (1 - (volumeDiscount / 100));
	var cDNAkitCostPerRxn = cDNAtotalKitCost / (getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
	var cDNACostWithVolDisc = cDNAKitQty * cDNAKitCost	* (1 - (volumeDiscount / 100));
	/*miRNA cDNA Synthesis Kit*/


	var totalCost = totalAssayCost + totalMasterMixCost + totalMasterMixCost1 + totalMasterMixCost2 + cDNAtotalKitCost;

	var assayCostPerReaction = totalAssayCost
			/ (getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
	
	var optimizationCostPerReaction = 0;
	var totalCostPerReaction = assayCostPerReaction + masterMixCostPerReaction + masterMixCostPerReaction1 + masterMixCostPerReaction2+ optimizationCostPerReaction + cDNAkitCostPerRxn;

	var productUrl = "";
	if (getExperimentInfo('type') == "Gene Expression") {
		productUrl = "http://www.invitrogen.com/site/us/en/home/Products-and-Services/Applications/PCR/real-time-pcr/real-time-pcr-assays/taqman-gene-expression/custom-taqman-gene-expression-assays.html";
	} else {
		productUrl = "https://www.thermofisher.com/us/en/home/life-science/pcr/real-time-pcr/real-time-pcr-assays/mirna-ncrna-taqman-assays/taqman-advanced-mirna-assays.html";
	}

	
	var assayCostPerSample = totalAssayCost / getExperimentInfo('noofsamples');
	var totalCostPerSample = assayCostPerSample + mmixCostPerSample + mmixCostPerSample1 + mmixCostPerSample2 + cDNAkitCostPerRxn;

	var totalCostPreDisc = costWithVolDisc
			+ (masterMixCostPerUnit * mnoofunits);
	var totalDiscount = 100 - (totalCost * 100 / totalCostPreDisc);

	outputList.add({
		pno : spno,
		title : title,
		partnumber : partNumber,
		//format : format.replace(/&#174;/gi, '<sup>&reg;</sup>&nbsp;'),
		format : format.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		noofunits : noofunits,
		noofreactions : noofreactions * getExperimentInfo('nooftargets'),
		mastermix : mastermix.replace(/&#174;/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;'),
		mastermixpartnumber : masterMixPartNumber,
		mastermixpartnumber1 : masterMixPartNumber1,
		mastermixpartnumber2 : masterMixPartNumber2,
		mastermixpartnumber3 : masterMixPartNumber3,
		mnoofunits : mnoofunits,
		mnoofunits1 : mnoofunits1,
		mnoofunits2 : mnoofunits2,
		mnoofunits3 : mnoofunits3,
		totalcost : roundNumber(totalCost, 2),
		volumediscount : volumeDiscount,
		mvolumediscount : masterperc,
		assayscost : roundNumber(costWithVolDisc, 2),
		assayscostperunit : roundNumber(assayCostPerUnit, 2),
		assayscostwithvoldisc : roundNumber(totalAssayCost, 2),
		mastermixvol : roundNumber(mvolume, 2),
		mastermixcostperunit : roundNumber(masterMixCostPerUnit, 2),
		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 : roundNumber(totalCostPerSample, 2),
		totalcostpredisc : roundNumber(totalCostPreDisc, 2),
		totaldiscount : roundNumber(totalDiscount, 2),
		noofhours : hours,
		assaycostperreaction : roundNumber(assayCostPerReaction, 2),
		mastermixcostperreaction : roundNumber(masterMixCostPerReaction, 2),
		mastermixcostperreaction1 : roundNumber(masterMixCostPerReaction1, 2),
		mastermixcostperreaction2 : roundNumber(masterMixCostPerReaction2, 2),
		mastermixcostperreaction3 : roundNumber(masterMixCostPerReaction3, 2),
		optimizationcostperreaction : roundNumber(optimizationCostPerReaction,2),
		totalcostperreaction : roundNumber(totalCostPerReaction, 2),
		totalcostpersample : roundNumber(totalCostPerSample, 2),
		producturl : productUrl,
		reqnoofunits : noofunits,
		cDNAKit: cDNAKit,
		cDNAKitQty: cDNAKitQty,
		cDNAKitPartNo: cDNAKitPartNo,
		cDNAKitCost: cDNAKitCost,
		cDNAtotalKitCost: cDNAtotalKitCost,
		cDNAkitCostPerRxn: cDNAkitCostPerRxn,
		cDNACostWithVolDisc: cDNACostWithVolDisc,
		fnName:'addAdvanced',
		type : 'tube'
	});

}

