function updatePrice(frm,obj)
{
	// ----------for multi option any operation
	p = document.getElementById("baseprice").value;
	//var p = p1.toFixed(2);
	document.getElementById("disp_price").innerHTML = p;
	//document.getElementById("disp_price2").innerHTML = p;
	actual_price = p.substr(p.indexOf("$")+1, p.length);

	var price = parseFloat(actual_price);
	var pricevalAr = new Array();
	var direction = "add";
	
	for(i=0; i<frm.elements.length; i++)
	{
		//e = frm.elements[i];
		//if (e.type == "radio")
		//{
			//if(e.checked)
			//{
				priceval = frm.elements[i].value;
				if(priceval.indexOf("(+$") > -1) {
					pricevalAr = priceval.split("(+$");
					direction = "add";
				} else if(priceval.indexOf("(+") > -1) {
					pricevalAr = priceval.split("(+");
					direction = "add";
				} else if(priceval.indexOf("(-") > -1) {
					pricevalAr = priceval.split("(-");
					direction = "sub";
				}else if(priceval.indexOf("(-$") > -1) {
					pricevalAr = priceval.split("(-$");
					direction = "sub";
				}else {pricevalAr = "";}
				
				if(pricevalAr.length > 1)
				{
					priceval = pricevalAr[1].split(")");
					priceval = parseFloat(priceval[0]);
				}
				else
				{	priceval = 0;}
				
				
					

				if(direction == "add")
					price = price + priceval
				else if(direction == "sub")
					price = price - priceval
			//}
	//	}

	}//for ends

	//if(optRealtimeDis != ''){
		//price = price - parseFloat(optRealtimeDis)
	//}


	//alert (optRealtimeDis);
	var upPrice = price.toFixed(2);

	//document.getElementById("disp_price").innerHTML = "$" + upPrice + " " + "Each";
	document.getElementById("disp_price").innerHTML = formatMoney(upPrice,"$",",","."); + " " + "each";
	
	//document.getElementById("disp_price2").innerHTML = "$" + toDollarsAndCents(price);
}

function isThousands(position) {
if (Math.floor(position/3)*3==position) return true;
return false;
};

function formatMoney (theNumber,theCurrency,theThousands,theDecimal) {
var theDecimalDigits =
Math.round((theNumber*100)-(Math.floor(theNumber)*100));
theDecimalDigits= ""+ (theDecimalDigits + "0").substring(0,2);
theNumber = ""+Math.floor(theNumber);
var theOutput = theCurrency;
for (x=0; x<theNumber.length; x++) {
theOutput += theNumber.substring(x,x+1);
if (isThousands(theNumber.length-x-1) && (theNumber.length-x-1
!=0)) {
theOutput += theThousands;
};
};
theOutput += theDecimal + theDecimalDigits;
return theOutput;
};

