window.addEvent('domready',function(){
    if( $('InputCountry') ){
        /*/////////////////////////////////////////////////////////////////////////////////////////////
        // Dynamic Country / Province Toggling
        /*/////////////////////////////////////////////////////////////////////////////////////////////
        $('InputCountry').addEvent('change',function(){
            var pars = $('InputCountry').name+'='+$('InputCountry').options[$('InputCountry').selectedIndex].value;
            if ($('InputCountry').options[$('InputCountry').selectedIndex].value != ""){
                new Ajax( '/ajax/select_province.php', {
                    method: 'post',
                    postBody: pars,
                    update: $('InputProvinceDiv')
                } ).request();
            }
        });
    }

    if( $('Country') ){
        /*/////////////////////////////////////////////////////////////////////////////////////////////
        // Dynamic Country / Province Toggling
        /*/////////////////////////////////////////////////////////////////////////////////////////////
        $('Country').addEvent('change',function(){
            var pars = $('Country').name+'='+$('Country').options[$('Country').selectedIndex].value;
            if ($('Country').options[$('Country').selectedIndex].value != ""){
                new Ajax( '/ajax/select_province.php', {
                    method: 'post',
                    postBody: pars,
                    update: $('InputProvinceDiv')
                } ).request();
            }
        });
    }

    if( $('ShippingCounry') ){
        /*/////////////////////////////////////////////////////////////////////////////////////////////
        // Dynamic Country / Province Toggling
        /*/////////////////////////////////////////////////////////////////////////////////////////////
        $('ShippingCounry').addEvent('change',function(){
            var pars = 'country_code='+$('ShippingCounry').options[$('ShippingCounry').selectedIndex].value+'&field_id=InputShippingProvince';
            if ($('ShippingCounry').options[$('ShippingCounry').selectedIndex].value != ""){
                new Ajax( '/ajax/select_province.php', {
                    method: 'post',
                    postBody: pars,
                    update: $('InputShippingProvinceDiv')
                } ).request();
            }
        });
    }

    if ( $('prices1') && $('OnlinceExtraPrice') ){
        $$('div#OnlinePrices .RadioButtons input').each(function(chx){
            chx.getParent().addEvent('click',function(){
                if ( chx.value == 2 && chx.checked){
                    $('OnlinceExtraPrice').setStyle('display','block');
                }else{
                    $('OnlinceExtraPrice').setStyle('display','none');
                }
            })
        });
        if ( !$('prices1').checked ) { $('OnlinceExtraPrice').setStyle('display','none'); }
    }

});