function getProductAttributes(type, save_state, product_id, suffix) {


    switch(ACTIVE_PLATFORM) {

        case BEBO:
        case FACEBOOK: {

            var opposite_type = 'size';
            
            if(type == 'size') {
                opposite_type = 'color';
            }
                
            var type1 = document.getElementById(type + suffix);
            var type2 = document.getElementById(opposite_type + suffix);
            
            if(type == 'color') {
                type2.disabled = true;
            }
            
            var url = WEB_PATH + '/products/get-product-attributes/type/' + type + '/pid/' + product_id + '/suffix/' + suffix + '/aid/' + type1.getValue() + '/save/' + save_state;
        
            var ajax = new Ajax();
            ajax.responseType = Ajax.JSON;
    
            ajax.ondone = function(data) {

                var quantity = document.getElementById('quantity_container' + suffix);
                quantity.setTextValue(data.product_quantity);
    
                if(type == 'color') {

                    var size = document.getElementById('size_container' + suffix);
                    size.setInnerFBML(data.fbml_size_element);

                }
    
                return;
            };

            ajax.post(url, null);

            return;

        }

        default: {

            var opposite_type = 'size';
            
            if(type == 'size') {
                opposite_type = 'color';
            }
                
            var type1 = dojo.byId(type + suffix);
            var type2 = dojo.byId(opposite_type + suffix);
            
            if(type == 'color') {
                type2.disabled = true;
            }
            
            var url = '/products/get-product-attributes/type/' + type + '/pid/' + product_id + '/suffix/' + suffix + '/aid/' + type1.value + '/save/' + save_state;
        
            dojo.xhrGet({
                url: url,
                handleAs: 'json',
                load: function(data) {

                    var quantity = dojo.byId('quantity_container' + suffix);
                    quantity.innerHTML = data.product_quantity;
        
                    if(type == 'color') {
    
                        var size = document.getElementById('size_container' + suffix);
                        size.innerHTML = data.fbml_size_element;

                    }
        
                    return;
                }
            });


            return;

        }
        
    }

}