function pricing(){
  this.price = 299;
  this.attorneyFee = 2080;
  
  this.setPrice = function( iPrice ){ this.price = iPrice; }
  this.getPrice = function(){ return this.price; }
  this.getPricingTableContent = function(){
    return this.getPrice()
  }
  this.setPricingTableContent = function(){
    var oContentArea = document.getElementById( "priceContent" );
    if ( oContentArea ){
      oContentArea.innerHTML = this.getPricingTableContent();
    }
  }
  this.writePricingtableContent = function(){
    document.write( this.getPricingTableContent() );
  }
  this.getSavings = function(){ return this.attorneyFee - this.getPrice(); }
  this.formatSavings = function( iIn ){
    var sTmp = String( iIn );
    var mDecs = sTmp.match( /[\.]{1}[0-9]{1,2}$/gi )
    var sDecs = mDecs? String( mDecs ): ".00";
    var sNum = "";
    for ( var i = sTmp.length; i >= 0; i-- ){
      sNum = ( ( i%3 == 1 && i < sTmp.length )? ",": "" ) + sTmp.charAt( i ) + sNum;
    }
    sNum += sDecs;
    return sNum;
  }
  this.getYouSaveContent = function(){
    var sSavings = this.formatSavings( this.getSavings() );
    return sSavings;
  }
  this.setYouSaveContent = function(){
    var oOut = document.getElementById( "oYouSave" );
    oOut.innerHTML = this.getYouSaveContent();
  }
  this.writeYouSaveContent = function(){
    document.write( this.getYouSaveContent() );
  }
  this.getAttorneyFeeContent = function(){
    return this.formatSavings( this.attorneyFee );
  }
  this.setAttorneyFeeContent = function(){
    var oOut = document.getElementById( "oAttorneyFee" );
    oOut.innerHTML = this.getAttorneyFeeContent();
  }
  this.writeAttorneyFeeContent = function(){
    document.write( this.getAttorneyFeeContent() );
  }
}
var oPricing = new pricing();
