﻿
var RatesService = Class.create({   
    initialize: function(ZoneId, ProductId, TierId, FormatId, SpanId) {   
        this.ZoneId = ZoneId;   
        this.ProductId = ProductId;   
        this.TierId = TierId;   
        this.FormatId = FormatId;
        this.SpanId = SpanId;
    },   
       
    GetRates: function() {  
        var spanId = this.SpanId;
        var zoneId = this.ZoneId;
        var productId = this.ProductId;
        var tierId = this.TierId;
        var formatId = this.FormatId;
        var spanId = this.SpanId;
        var _Request = new Ajax.Request('/RatesService/RatesService.asmx/GetRates',
        {
            method: 'post',
            postBody:'ZoneId=' + zoneId + '&ProductId=' + productId + '&TierId=' + tierId + '&FormatId=' + formatId,
            onSuccess: function(transport) { 
                rs_$(spanId).innerHTML = transport.responseText.unescapeHTML();   
            },
            onFailure: function() {
                rs_$(spanId).innerHTML = '';
            }
        });
    }
});

