function Currency(money)
{
 //convert an value into a string
 money =  parseFloat(money);
 money += 0.005;
 money +=  "";           
 var monLen = money.length;
 var digPos = money.indexOf(".");
 if(digPos == -1) {
     if (money <=0) {
         money ="0.00";
     } else {
         money += ".00";
     }
     return money;
 } else {
     if (digPos + 3 > monLen) {
         money += "0";
     } else if (digPos + 3 != monLen) {
         money = money.substring(0, digPos+3);
     } 
     return money;
 }     
}
function getuprice()
{

var total=0;
var arg=/ /g
var a;

a=0;
if (document.listform.pprice)
{total=document.listform.pprice.value;}
if (document.listform.cntopt)
{
 if(document.listform.cntopt.value>1)
 {

     for (a=0;a<document.listform.cntopt.value;a++)
     {


         total=total+parseFloat(cat[a][document.listform.D1[a].selectedIndex][2]);
//         document.links[a+4].href="showprod.asp?p="+cat[a][document.listform.D1[a].selectedIndex][0]+"&type="+window.document.listform.ptype.value;
     }
 }

 else if(document.listform.cntopt.value!=0)
 {

     total=total+parseFloat(cat[0][document.listform.D1.selectedIndex][2]);
//     document.links[0+4].href="showprod.asp?p="+cat[0][document.listform.D1.selectedIndex][0]+"&type="+window.document.listform.ptype.value;

 }
}
window.document.listform.uprice.value=Currency(total);
window.document.listform.subtotal.value=Currency(total*window.document.listform.qty.value);
b=true;

}




