All pastes #44795 Raw Edit

Untitled

public text v1 · immutable
#44795 ·published 2006-03-07 18:45 UTC
rendered paste body
<script language="javascript">


fmtMoney = function( n, c, d, t ) {
	var m = ( c = Math.abs( c ) + 1 ? c : 2, d = d || ",", t = t || "", /(\d+)(?:(\.\d+)|)/.exec( n + "" ) ), x = m[1].length % 3;
	return ( x ? m[1].substr( 0, x ) + t : "" ) + m[1].substr( x ).replace( /(\d{3})(?=\d)/g, "$1" + t ) + ( c ? d + ( +m[2] ).toFixed( c ).substr( 2 ) : "" );
};

function updateamount_BLV()
{

	selectobj = document.forms['videoorder'].Select_BLV;
	var quantity = selectobj.options[selectobj.selectedIndex].value;
    var amount = quantity * 20;


	document.forms['videoorder'].Text_Amount_BLV.value =
fmtMoney( amount, 2, '.', '' );

}

function updateamount_LD()
{

	selectobj = document.forms['videoorder'].Select_LD;
	var quantity = selectobj.options[selectobj.selectedIndex].value;
    var amount = quantity * 20;
	document.forms['videoorder'].Text_Amount_LD.value = fmtMoney( amount, 2, '.', '' );

}

function updateamount_PD()
{

	selectobj = document.forms['videoorder'].Select_PD;
	var quantity = selectobj.options[selectobj.selectedIndex].value;
    var amount = quantity * 20;
	document.forms['videoorder'].Text_Amount_PD.value = fmtMoney( amount, 2, '.', '' );

}

function updateamount_CD()
{

	selectobj = document.forms['videoorder'].Select_CD;
	var quantity = selectobj.options[selectobj.selectedIndex].value;
    var amount = quantity * 30;


	document.forms['videoorder'].Text_Amount_CD.value =
fmtMoney( amount, 2, '.', '' );

}

function updateamount_HB()
{

	selectobj = document.forms['videoorder'].Select_HB;
	var quantity = selectobj.options[selectobj.selectedIndex].value;
    var amount = quantity * 1;


	document.forms['videoorder'].Text_Amount_HB.value =
fmtMoney( amount, 2, '.', '' );

}
function updateamount_HB2()
{

	selectobj = document.forms['videoorder'].Select_HB2;
	var quantity = selectobj.options[selectobj.selectedIndex].value;
    var amount = quantity * 1;


	document.forms['videoorder'].Text_Amount_HB2.value =
fmtMoney( amount, 2, '.', '' );

}
function updateamount_HB3()
{

	selectobj = document.forms['videoorder'].Select_HB3;
	var quantity = selectobj.options[selectobj.selectedIndex].value;
    var amount = quantity * 1;


	document.forms['videoorder'].Text_Amount_HB3.value =
fmtMoney( amount, 2, '.', '' );

}
function updateamount_HB4()
{

	selectobj = document.forms['videoorder'].Select_HB4;
	var quantity = selectobj.options[selectobj.selectedIndex].value;
    var amount = quantity * 1;


	document.forms['videoorder'].Text_Amount_HB4.value =
fmtMoney( amount, 2, '.', '' );

}
function updateamount_HB5()
{

	selectobj = document.forms['videoorder'].Select_HB5;
	var quantity = selectobj.options[selectobj.selectedIndex].value;
    var amount = quantity * 1;


	document.forms['videoorder'].Text_Amount_HB5.value =
fmtMoney( amount, 2, '.', '' );

}
function grandtotal()
{

	//add all the previous functions together and put into the grand total box as the result value.
}

</script>