function updateSU (data)
{
    if (!("std" in data.price)) return;
    history.navigationMode = 'compatible';

    $("span.price-std-prod").replaceWith(data.price.std.su.prod);
    $("span.price-stdcmb-prod").replaceWith(data.price.stdcmb.su.prod);
    $("span.price-stdcmbs-prod").replaceWith(data.price.stdcmbs.su.prod);
    $("span.price-pro-prod").replaceWith(data.price.pro.su.prod);
    $("span.price-cmb-prod").replaceWith(data.price.procmb.su.prod);
    $("span.price-procmb-prod").replaceWith(data.price.procmb.su.prod);
    $("span.price-procmbs-prod").replaceWith(data.price.procmbs.su.prod);
    $("span.price-bzp-prod").replaceWith(data.price.bzp.su.prod);
    $("span.price-bzps-prod").replaceWith(data.price.bzps.su.prod);
    $("span.price-ec-prod").replaceWith(data.price.ec.su.prod);
    $("span.price-se-prod").replaceWith(data.price.se.su.prod);
    $("span.price-sus-prod").replaceWith(data.price.sus.su.prod);
    $("span.price-ro-prod").replaceWith(data.price.ro.su.prod);
    $("span.price-du-prod").replaceWith(data.price.du.su.prod);

    $("span.price-cd").replaceWith(data.price.pro.su.cd);
}

function updateMU (data)
{
    if (!("std" in data.price)) return;
    history.navigationMode = 'compatible';

    $("span.price-std-2").replaceWith(data.price.std['2'].prod);
    $("span.price-std-10").replaceWith(data.price.std['10'].prod);
    $("span.price-std-25").replaceWith(data.price.std['25'].prod);
    $("span.price-std-50").replaceWith(data.price.std['50'].prod);
    $("span.price-std-100").replaceWith(data.price.std['100'].prod);
    $("span.price-std-200").replaceWith(data.price.std['200'].prod);
    $("span.price-std-500").replaceWith(data.price.std['500'].prod);
    $("span.price-std-1000").replaceWith(data.price.std['1000'].prod);
    $("span.price-std-2000").replaceWith(data.price.std['2000'].prod);
    $("span.price-std-5000").replaceWith(data.price.std['5000'].prod);

    $("span.price-pro-2").replaceWith(data.price.pro['2'].prod);
    $("span.price-pro-10").replaceWith(data.price.pro['10'].prod);
    $("span.price-pro-25").replaceWith(data.price.pro['25'].prod);
    $("span.price-pro-50").replaceWith(data.price.pro['50'].prod);
    $("span.price-pro-100").replaceWith(data.price.pro['100'].prod);
    $("span.price-pro-200").replaceWith(data.price.pro['200'].prod);
    $("span.price-pro-500").replaceWith(data.price.pro['500'].prod);
    $("span.price-pro-1000").replaceWith(data.price.pro['1000'].prod);
    $("span.price-pro-2000").replaceWith(data.price.pro['2000'].prod);
    $("span.price-pro-5000").replaceWith(data.price.pro['5000'].prod);

    $("span.price-cmb-2").replaceWith(data.price.procmb['2'].prod);
    $("span.price-cmb-10").replaceWith(data.price.procmb['10'].prod);
    $("span.price-cmb-25").replaceWith(data.price.procmb['25'].prod);
    $("span.price-cmb-50").replaceWith(data.price.procmb['50'].prod);
    $("span.price-cmb-100").replaceWith(data.price.procmb['100'].prod);
    $("span.price-cmb-200").replaceWith(data.price.procmb['200'].prod);
    $("span.price-cmb-500").replaceWith(data.price.procmb['500'].prod);
    $("span.price-cmb-1000").replaceWith(data.price.procmb['1000'].prod);
    $("span.price-cmb-2000").replaceWith(data.price.procmb['2000'].prod);
    $("span.price-cmb-5000").replaceWith(data.price.procmb['5000'].prod);

    $("span.price-bzp-2").replaceWith(data.price.bzp['2'].prod);
    $("span.price-bzp-10").replaceWith(data.price.bzp['10'].prod);
    $("span.price-bzp-25").replaceWith(data.price.bzp['25'].prod);
    $("span.price-bzp-50").replaceWith(data.price.bzp['50'].prod);
    $("span.price-bzp-100").replaceWith(data.price.bzp['100'].prod);
    $("span.price-bzp-200").replaceWith(data.price.bzp['200'].prod);
    $("span.price-bzp-500").replaceWith(data.price.bzp['500'].prod);
    $("span.price-bzp-1000").replaceWith(data.price.bzp['1000'].prod);
    $("span.price-bzp-2000").replaceWith(data.price.bzp['2000'].prod);
    $("span.price-bzp-5000").replaceWith(data.price.bzp['5000'].prod);
		
    $("span.price-ec-2").replaceWith(data.price.ec['2'].prod);
    $("span.price-ec-10").replaceWith(data.price.ec['10'].prod);
    $("span.price-ec-25").replaceWith(data.price.ec['25'].prod);
    $("span.price-ec-50").replaceWith(data.price.ec['50'].prod);
    $("span.price-ec-100").replaceWith(data.price.ec['100'].prod);
    $("span.price-ec-200").replaceWith(data.price.ec['200'].prod);
    $("span.price-ec-500").replaceWith(data.price.ec['500'].prod);
    $("span.price-ec-1000").replaceWith(data.price.ec['1000'].prod);
    $("span.price-ec-2000").replaceWith(data.price.ec['2000'].prod);
    $("span.price-ec-5000").replaceWith(data.price.ec['5000'].prod);
		
    $("span.price-se-2").replaceWith(data.price.se['2'].prod);
    $("span.price-se-10").replaceWith(data.price.se['10'].prod);
    $("span.price-se-25").replaceWith(data.price.se['25'].prod);
    $("span.price-se-50").replaceWith(data.price.se['50'].prod);
    $("span.price-se-100").replaceWith(data.price.se['100'].prod);
    $("span.price-se-200").replaceWith(data.price.se['200'].prod);
    $("span.price-se-500").replaceWith(data.price.se['500'].prod);
    $("span.price-se-1000").replaceWith(data.price.se['1000'].prod);
    $("span.price-se-2000").replaceWith(data.price.se['2000'].prod);
    $("span.price-se-5000").replaceWith(data.price.se['5000'].prod);
}

function updateOrderLinks (data)
{
    if (!("std" in data.price)) return;
    history.navigationMode = 'compatible';

    var curr = data.currency.notation.match(/(No currency)/i);
    var qstr;
    if (curr) {
        // we only modify links in the content area, ignoring the header 
        // and footer.  For now.
        $('.content a[href*="order.cgi"],#content a[href*="order.cgi"]').each(function(i){
            var qstr = $(this).attr('href').match(/\?(\w+)/);
            $(this).attr('href', "/orderp.cgi?qstr="+qstr[1]+"-localized&curr="+curr[1]);
        });
    }
}


