var p_monthlyunlim=36.50;
var p_monthlyfree=10.50;
var p_monthlysimpl=8.49;
var p_monthlyflexi=8.50;

var p_setupunlim=20.00;
var p_setupfree=20.00;
var p_setupsimpl=20.00;
var p_setupflexi=20.00;

var p_setupbbl=50.00;
var p_setupnewline=125.00;
var p_setupnewfax=20.00;
var p_setupaddnum=0.00;
var p_setupport=0.00;
var p_setuprec=0.00;
var p_setupbbs=50.00;
var p_setupbun=0.00;
var p_setupclass=0.00;

var p_monthlybbl=35.00;
var p_monthlyline=12.50;
var p_monthlyfax=5.00;
var p_monthlynum=3.00;
var p_monthlyport=0.00;
var p_monthlyrec=3.00;
var p_monthlybbs=22.00;
var p_monthlybun=5.00;
var p_monthlyclass=0.00;

var p_ip01=64.00;
var p_t20p=74.00;
var p_t22p=90.00;
var p_gxp2000=65.00;
var p_a580=82.50;
var p_bt201=65.00;
var p_spa941=92.00;
var p_snom300=92.00;
var p_snom360=166.00;

var pm_ip01=0.00;
var pm_t20p=0.00;
var pm_t22p=0.00;
var pm_gxp2000=0.00;
var pm_a580=0.00;
var pm_bt201=0.00;
var pm_spa941=0.00;
var pm_snom300=0.00;
var pm_snom360=0.00;

function test(){
alert("test");
}

///////////////////////////////////////////////////////////////////////////
// fill basket
function setbasket(dowhat){

///////////////////////////////////////////////////////////////////////////
//Declare Checkboxes empty

planunlim=0;

planfree=0;

plansimpl=0;

planflexi=0;

extrabb=0;

extraline=0;

extrafax=0;

extranum=0;

extraport=0;

extrarec=0;

extrabbs=0;

extrabun=0;

extraclass=0;

phoneip01=0;

phonet20p=0;

phonet22p=0;

phonegxp2000=0;

phonea580=0;

phonebt201=0;

phonespa941=0;

phonesnom300=0;

phonesnom360=0;



///////////////////////////////////////////////////////////////////////////
// read all the cookies



var ca = document.cookie.split(';');
          

var nameEQ =  "planunlim=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               planunlim=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
            }

var nameEQ =  "planfree=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               planfree=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
            }
var nameEQ =  "plansimpl=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               planfree=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
            }

var nameEQ =  "planflexi=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               planflexi=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
            }



         var nameEQ =  "extrabb=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               extrabb=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
           }

         var nameEQ =  "extraline=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               extraline=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
           }

   var nameEQ =  "extrafax=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               extrafax=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
           }
   var nameEQ =  "extranum=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               extranum=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
           }
   var nameEQ =  "extraport=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               extraport=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
           }
   var nameEQ =  "extrarec=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               extrarec=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
           }

         var nameEQ =  "extrabbs=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               extrabbs=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
           }

         var nameEQ =  "extrabun=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               extrabun=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
           }

         var nameEQ =  "extraclass=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               extraclass=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
           }


var nameEQ =  "phoneip01=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               phoneip01=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
           }

var nameEQ =  "phonet20p=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               phonet20p=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
           }

var nameEQ =  "phonet22p=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               phonet22p=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
           }

var nameEQ =  "phonegxp2000=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               phonegxp2000=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
           }

var nameEQ =  "phonea580=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               phonea580=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
           }

var nameEQ =  "phonebt201=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               phonebt201=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
           }

var nameEQ =  "phonespa941=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               phonespa941=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
           }

var nameEQ =  "phonesnom300=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               phonesnom300=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
           }


var nameEQ =  "phonesnom360=";
          for(var i=0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) 
             //return c.substring(nameEQ.length, c.length);
               phonesnom360=c.substring(nameEQ.length, c.length);
              //  alert(c.substring(nameEQ.length, c.length));
           }






if (dowhat=="display")
{

////////////////////////////////////////////////////////////////////////
// put data into basket

//<div id=basket>
var totsetup=0;
var totmonth=0;


var html="";


html+="<table style='background-color: #4682B4;' border=1><tbody><tr><td><b>Jotter</b><td>Qty<td>Setup &#163<td>Monthly &#163</td></tr>";

if (planunlim>0)
{
html+="<tr><td>Unlimited Plan <td align=right>"+planunlim+"<td align=right>"+(planunlim*p_setupunlim).toFixed(2)+"<td  align=right>"+(planunlim*p_monthlyunlim).toFixed(2);  
totsetup+=planunlim*p_setupunlim;
totmonth+=planunlim*p_monthlyunlim;
}

if (planfree>0)
{
html+="<tr><td>Freedom Plan <td align=right>"+planfree+"<td align=right>"+(planfree*p_setupfree).toFixed(2)+"<td align=right>"+(planfree*p_monthlyfree).toFixed(2);  
totsetup+=planfree*p_setupfree;
totmonth+=planfree*p_monthlyfree;
}

if (plansimpl>0)
{
html+="<tr><td>Simple Plan <td align=right>"+plansimpl+"<td align=right>"+(plansimpl*p_setupsimpl).toFixed(2)+"<td align=right>"+(plansimpl*p_monthlysimpl).toFixed(2);  
totsetup+=plansimpl*p_setupsimpl;
totmonth+=plansimpl*p_monthlysimpl;
}

if (planflexi>0)
{
html+="<tr><td>Flexi Plan <td align=right>"+planflexi+"<td align=right>"+(planflexi*p_setupflexi).toFixed(2)+"<td align=right>"+(planflexi*p_monthlyflexi).toFixed(2);  
totsetup+=planflexi*p_setupflexi;
totmonth+=planflexi*p_monthlyflexi;
}

if (extrabb>0)
{
html+="<tr><td>QoS Broadband <td align=right>"+extrabb+"<td align=right>"+(extrabb*p_setupbbl).toFixed(2)+"<td align=right>"+(extrabb*p_monthlybbl).toFixed(2);  
totsetup+=extrabb*p_setupbbl;
totmonth+=extrabb*p_monthlybbl;
}

if (extraline>0)
{
html+="<tr><td>Extra Line <td align=right>"+extraline+"<td align=right>"+(extraline*p_setupnewline).toFixed(2)+"<td align=right>"+(extraline*p_monthlyline).toFixed(2);  
totsetup+=extraline*p_setupnewline;
totmonth+=extraline*p_monthlyline;
}

if (extrafax>0)
{
html+="<tr><td>Fax to Email <td align=right>"+extrafax+"<td align=right>"+(extrafax*p_setupnewfax).toFixed(2)+"<td align=right>"+(extrafax*p_monthlyfax).toFixed(2);  
totsetup+=extrafax*p_setupnewfax;
totmonth+=extrafax*p_monthlyfax;
}

if (extranum>0)
{
html+="<tr><td>Additional Number <td align=right>"+extranum+"<td align=right>"+(extranum*p_setupaddnum).toFixed(2)+"<td align=right>"+(extranum*p_monthlynum).toFixed(2);  
totsetup+=extranum*p_setupaddnum;
totmonth+=extranum*p_monthlynum;  
}

if (extraport>0)
{
html+="<tr><td>Number Port <td align=right>"+extraport+"<td align=right>"+(extraport*p_setupport).toFixed(2)+"<td align=right>"+(extraport*p_monthlyport).toFixed(2);  
totsetup+=extraport*p_setupport;
totmonth+=extraport*p_monthlyport;
}

if (extrarec>0)
{
html+="<tr><td>Call Recording <td align=right>"+extrarec+"<td align=right>"+(extrarec*p_setuprec).toFixed(2)+"<td align=right>"+(extrarec*p_monthlyrec).toFixed(2);  
totsetup+=extrarec*p_setuprec;
totmonth+=extrafax*p_monthlyrec; 
}

if (extrabbs>0)
{
html+="<tr><td>QoS Broadband Small<td align=right>"+extrabbs+"<td align=right>"+(extrabbs*p_setupbbs).toFixed(2)+"<td align=right>"+(extrabbs*p_monthlybbs).toFixed(2);  
totsetup+=extrabbs*p_setupbbs;
totmonth+=extrabbs*p_monthlybbs;
}

if (extrabun>0)
{
html+="<tr><td>1000 Minute Bundle<td align=right>"+extrabun+"<td align=right>"+(extrabun*p_setupbun).toFixed(2)+"<td align=right>"+(extrabun*p_monthlybun).toFixed(2);  
totsetup+=extrabun*p_setupbun;
totmonth+=extrabun*p_monthlybun;
}

if (extraclass>0)
{
html+="<tr><td>Class<td align=right>"+extraclass+"<td align=right>"+(extraclass*p_setupclass).toFixed(2)+"<td align=right>"+(extraclass*p_monthlyclass).toFixed(2);  
totsetup+=extraclass*p_setupclass;
totmonth+=extraclass*p_monthlyclass;
}

if (phoneip01>0)
{
html+="<tr><td>IP-01 Handset <td align=right>"+phoneip01+"<td align=right>"+(phoneip01*p_ip01).toFixed(2)+"<td align=right>"+(phoneip01*pm_ip01).toFixed(2);  
totsetup+=phoneip01*p_ip01;
totmonth+=phoneip01*pm_ip01;
}

if (phonet20p>0)
{
html+="<tr><td>Yealink T20P Handset <td align=right>"+phonet20p+"<td align=right>"+(phonet20p*p_t20p).toFixed(2)+"<td align=right>"+(phonet20p*pm_t20p).toFixed(2);  
totsetup+=phonet20p*p_t20p;
totmonth+=phonet20p*pm_t20p;
}

if (phonet22p>0)
{
html+="<tr><td>Yealink T22P Handset <td align=right>"+phonet22p+"<td align=right>"+(phonet22p*p_t22p).toFixed(2)+"<td align=right>"+(phonet22p*pm_t22p).toFixed(2);  
totsetup+=phonet22p*p_t22p;
totmonth+=phonet22p*pm_t22p;
}

if (phonegxp2000>0)
{
html+="<tr><td>Grandstream GXP2000 Handset<td align=right>"+phonegxp2000+"<td align=right>"+(phonegxp2000*p_gxp2000).toFixed(2)+"<td align=right>"+(phonegxp2000*pm_gxp2000).toFixed(2);  
totsetup+=phonegxp2000*p_gxp2000;
totmonth+=phonegxp2000*pm_gxp2000;
}

if (phonea580>0)
{
html+="<tr><td>Siemens A580 Handset<td align=right>"+phonea580+"<td align=right>"+(phonea580*p_a580).toFixed(2)+"<td align=right>"+(phonea580*pm_a580).toFixed(2);  
totsetup+=phonea580*p_a580;
totmonth+=phonea580*pm_a580;
}

if (phonebt201>0)
{
html+="<tr><td>Budge Tone 201 Handset<td align=right>"+phonebt201+"<td align=right>"+(phonebt201*p_bt201).toFixed(2)+"<td align=right>"+(phonebt201*pm_bt201).toFixed(2);  
totsetup+=phonebt201*p_bt201;
totmonth+=phonebt201*pm_bt201;
}

if (phonespa941>0)
{
html+="<tr><td>Linkseys SPA 941 Handset <td align=right>"+phonespa941+" <td align=right>"+(phonespa941*p_spa941).toFixed(2)+"<td align=right>"+(phonespa941*pm_spa941).toFixed(2);  
totsetup+=phonespa941*p_spa941;
totmonth+=phonespa941*pm_spa941;
}

if (phonesnom300>0)
{
html+="<tr><td>Snom 300 Handset<td align=right>"+phonesnom300+"<td align=right>"+(phonesnom300*p_snom300).toFixed(2)+"<td align=right>"+(phonesnom300*pm_snom300).toFixed(2);  
totsetup+=phonesnom300*p_snom300;
totmonth+=phonesnom300*pm_snom300;
}

if (phonesnom360>0)
{
html+="<tr><td>Snom 360 Handset<td align=right>"+phonesnom360+"<td align=right>"+(phonesnom360*p_snom360).toFixed(2)+"<td>"+(phonesnom360*pm_snom360).toFixed(2);  
totsetup+=phonesnom360*p_snom360;
totmonth+=phonesnom360*pm_snom360;
}


html+="<tr><td><b>Total</b><td><td align=right>"+(totsetup).toFixed(2)+"<td align=right>"+(totmonth).toFixed(2);

html+="<tr><td colspan=7><input type=button onclick='emptybasket(); location.reload()' value=Clear />";

document.getElementById("basket").innerHTML=html;
}

//alert(document.getElementById("basket").innerHTML);

}


//////////////////////////////////////////////
function createCookie(name, value, days)
{
if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}


///////////////////////////////////////////////////////////////////////////
// fill basket
function emptybasket(){

createCookie("planunlim",0,1);
createCookie("planfree",0,1);
createCookie("plansimpl",0,1);
createCookie("planflexi",0,1);
createCookie("extrabb",0,1);
createCookie("extraline",0,1);
createCookie("extrafax",0,1);
createCookie("extranum",0,1);
createCookie("extraport",0,1);
createCookie("extrarec",0,1);
createCookie("extrabbs",0,1);
createCookie("extrabun",0,1);
createCookie("extraclass",0,1);
createCookie("phoneip01",0,1);
createCookie("phonet20p",0,1);
createCookie("phonet22p",0,1);
createCookie("phonegxp2000",0,1);
createCookie("phonea580",0,1);
createCookie("phonebt201",0,1);
createCookie("phonespa941",0,1);
createCookie("phonesnom300",0,1);
createCookie("phonesnom360",0,1);


setbasket();


}

////////////////////////////////
//calculate instantly

function calculate(){
//alert("");

document.getElementById("subunlim").value=(document.getElementById("planunlim").value*p_monthlyunlim).toFixed(2);
document.getElementById("subfree").value=(document.getElementById("planfree").value*p_monthlyfree).toFixed(2);
document.getElementById("subsimpl").value=(document.getElementById("plansimpl").value*p_monthlysimpl).toFixed(2);
document.getElementById("subflexi").value=(document.getElementById("planflexi").value*p_monthlyflexi).toFixed(2);
document.getElementById("subbb").value=(document.getElementById("extrabb").value*p_monthlybbl).toFixed(2);
document.getElementById("subbbs").value=(document.getElementById("extrabbs").value*p_monthlybbs).toFixed(2);
document.getElementById("subnum").value=(document.getElementById("extranum").value*p_monthlynum).toFixed(2);
document.getElementById("subbun").value=(document.getElementById("extrabun").value*p_monthlybun).toFixed(2);
document.getElementById("subrec").value=(document.getElementById("extrarec").value*p_monthlyrec).toFixed(2);
document.getElementById("subclass").value=(document.getElementById("extraclass").value*p_monthlyclass).toFixed(2);
document.getElementById("subfax").value=(document.getElementById("extrafax").value*p_monthlyfax).toFixed(2);
document.getElementById("subport").value=(document.getElementById("extraport").value*p_monthlyport).toFixed(2);
document.getElementById("subline").value=(document.getElementById("extraline").value*p_monthlyline).toFixed(2);
document.getElementById("subip01").value=(document.getElementById("phoneip01").value*pm_ip01).toFixed(2);
document.getElementById("subt20p").value=(document.getElementById("phonet20p").value*pm_t20p).toFixed(2);
document.getElementById("subt22p").value=(document.getElementById("phonet22p").value*pm_t22p).toFixed(2);
document.getElementById("subgxp2000").value=(document.getElementById("phonegxp2000").value*pm_gxp2000).toFixed(2);
document.getElementById("suba580").value=(document.getElementById("phonea580").value*pm_a580).toFixed(2);
document.getElementById("subbt201").value=(document.getElementById("phonebt201").value*pm_bt201).toFixed(2);
document.getElementById("subspa941").value=(document.getElementById("phonespa941").value*pm_spa941).toFixed(2);
document.getElementById("subsnom300").value=(document.getElementById("phonesnom300").value*pm_snom300).toFixed(2);
document.getElementById("subsnom360").value=(document.getElementById("phonesnom360").value*pm_snom360).toFixed(2);


document.getElementById("subsuunlim").value=(document.getElementById("planunlim").value*p_setupunlim).toFixed(2);
document.getElementById("subsufree").value=(document.getElementById("planfree").value*p_setupfree).toFixed(2);
document.getElementById("subsusimpl").value=(document.getElementById("plansimpl").value*p_setupsimpl).toFixed(2);
document.getElementById("subsuflexi").value=(document.getElementById("planflexi").value*p_setupflexi).toFixed(2);
document.getElementById("subsubb").value=(document.getElementById("extrabb").value*p_setupbbl).toFixed(2);
document.getElementById("subsubbs").value=(document.getElementById("extrabbs").value*p_setupbbs).toFixed(2);
document.getElementById("subsunum").value=(document.getElementById("extranum").value*p_setupaddnum).toFixed(2);
document.getElementById("subsubun").value=(document.getElementById("extrabun").value*p_setupbun).toFixed(2);
document.getElementById("subsurec").value=(document.getElementById("extrarec").value*p_setuprec).toFixed(2);
document.getElementById("subsuclass").value=(document.getElementById("extraclass").value*p_setupclass).toFixed(2);
document.getElementById("subsufax").value=(document.getElementById("extrafax").value*p_setupnewfax).toFixed(2);
document.getElementById("subsuport").value=(document.getElementById("extraport").value*p_setupport).toFixed(2);
document.getElementById("subsuline").value=(document.getElementById("extraline").value*p_setupnewline).toFixed(2);
document.getElementById("subsuip01").value=(document.getElementById("phoneip01").value*p_ip01).toFixed(2);
document.getElementById("subsut20p").value=(document.getElementById("phonet20p").value*p_t20p).toFixed(2);
document.getElementById("subsut22p").value=(document.getElementById("phonet22p").value*p_t22p).toFixed(2);
document.getElementById("subsugxp2000").value=(document.getElementById("phonegxp2000").value*p_gxp2000).toFixed(2);
document.getElementById("subsua580").value=(document.getElementById("phonea580").value*p_a580).toFixed(2);
document.getElementById("subsubt201").value=(document.getElementById("phonebt201").value*p_bt201).toFixed(2);
document.getElementById("subsuspa941").value=(document.getElementById("phonespa941").value*p_spa941).toFixed(2);
document.getElementById("subsusnom300").value=(document.getElementById("phonesnom300").value*p_snom300).toFixed(2);
document.getElementById("subsusnom360").value=(document.getElementById("phonesnom360").value*p_snom360).toFixed(2);



//document.getElementById("totalsu").value=(document.getElementById().toFixed(2);

lntot=Number(document.getElementById("subunlim").value)+Number(document.getElementById("subfree").value)+Number(document.getElementById("subsimpl").value)+Number(document.getElementById("subflexi").value)+Number(document.getElementById("subbb").value)+Number(document.getElementById("subbbs").value)+Number(document.getElementById("subnum").value)+Number(document.getElementById("subbun").value)+Number(document.getElementById("subrec").value)+Number(document.getElementById("subclass").value)+Number(document.getElementById("subfax").value)+Number(document.getElementById("subport").value)+Number(document.getElementById("subline").value)+Number(document.getElementById("subip01").value)+Number(document.getElementById("subt20p").value)+Number(document.getElementById("subt22p").value)+Number(document.getElementById("subgxp2000").value)+Number(document.getElementById("suba580").value)+Number(document.getElementById("subbt201").value)+Number(document.getElementById("subsnom300").value)+Number(document.getElementById("subsnom360").value);

document.getElementById("totalm").value=lntot.toFixed(2);

lntotsu=Number(document.getElementById("subsuunlim").value)+Number(document.getElementById("subsufree").value)+Number(document.getElementById("subsusimpl").value)+Number(document.getElementById("subsuflexi").value)+Number(document.getElementById("subsubb").value)+Number(document.getElementById("subsubbs").value)+Number(document.getElementById("subsunum").value)+Number(document.getElementById("subsubun").value)+Number(document.getElementById("subsurec").value)+Number(document.getElementById("subsuclass").value)+Number(document.getElementById("subsufax").value)+Number(document.getElementById("subsuport").value)+Number(document.getElementById("subsuline").value)+Number(document.getElementById("subsuip01").value)+Number(document.getElementById("subsut20p").value)+Number(document.getElementById("subsut22p").value)+Number(document.getElementById("subsugxp2000").value)+Number(document.getElementById("subsua580").value)+Number(document.getElementById("subsubt201").value)+Number(document.getElementById("subsusnom300").value)+Number(document.getElementById("subsusnom360").value);

document.getElementById("totalsu").value=lntotsu.toFixed(2);


//document.getElementById("totalm").value=fred;

//alert(fred);


//}

//calculate();
}


function onEnterKeyCalc(formElement) {
var press;
if (window.event) {
   press = window.event.keyCode;
} else if (e) {
   press = e.which;
} else {
   return false;
}
if (press == 13) {
  document.getElementById(formElement).focus();
  document.getElementById(formElement).select();
    calculate();
  return false;
}
return false;
}

