function getPageName(){
var sPath = window.location.pathname;
//var sPage = sPath.substring(sPath.lastIndexOf('\\') + 1);
var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
return sPage;	
}

function update_orderform_totals( selectedpackage ) {
  
if ( selectedpackage == '1' ) {
 packageprice = 32.00;
}

if ( selectedpackage == '2' ) {
 packageprice = 54.00;
}

if ( selectedpackage == '3' ) {
 packageprice = 76.00;
}

var shipping = 11.00;
var gstrate = 0.05;    
    
var total = CurrencyFormatted((packageprice + shipping) * (gstrate + 1));
var gst = CurrencyFormatted((packageprice + shipping) * gstrate);    
var packageprice = CurrencyFormatted( packageprice );   
var shipping = CurrencyFormatted( shipping  );       
  
   
document.getElementById('chargeoverview').innerHTML = '<h2>$'+packageprice+' + $'+shipping+' <span class="pricesmall">S/H</span> + $'+gst+' <span class="pricesmall">('+gstrate*100+'% GST)</span> = <span style="color: red;">$'+total+'</span></h2>'; 
document.getElementById('bottomprice').innerHTML = '<h4><u>Please note</u> that this transaction (for $'+total+' canadian dollars)<br />will apear on your statement as "RealIOD Inc".</h4>'; 
document.orderform.amount.value = total;
document.orderform.gst.value = gst;
    
}




function CurrencyFormatted(amount)
{
    var i = parseFloat(amount);
    if(isNaN(i)) { i = 0.00; }
    var minus = '';
    if(i < 0) { minus = '-'; }
    i = Math.abs(i);
    i = parseInt((i + .005) * 100);
    i = i / 100;
    s = new String(i);
    if(s.indexOf('.') < 0) { s += '.00'; }
    if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
    s = minus + s;
    return s;
}






