function initSpecialOrderPage(contextPath, hasValErrors) {
        jslog.debug('special order: domready');
        //Shop loader event on select.
        var provinceSelect = document.getElement('select[name=provincia.code]')
        if (provinceSelect) {
          provinceSelect.addEvent('change', function(e) {
            jslog.debug('special order: change provincia');
            e = new Event(e);
            AjaxSpinner.show();
            doAjaxRequest(new Ajax(contextPath + '/product/SpecialOrder.action', {
              method: 'post',
              data: document.getElement('form[name=specialOrderProvinceForm]'),
              update: document.getElementById('specialOrderContainer'),
              evalScripts: true,
              onComplete: function() {
                AjaxSpinner.hide();
              }
            }));
            e.stop();
          });
        }
}

function initSpecialOrderShopList(contextPath, hasValErrors) {
        var specialOrderButton = document.getElement('input[name=show-special-order-form]')
        if (specialOrderButton) {
          specialOrderButton.addEvent('click', function(e) {
            jslog.debug('special order: show form');
            e = new Event(e);
            AjaxSpinner.show();
            doAjaxRequest(new Ajax(contextPath + '/product/SpecialOrder.action', {
              method: 'post',
              data: document.getElement('form[name=specialOrderForm]'),
              update: document.getElementById('specialOrderContainer'),
              evalScripts: true,
              onComplete: function() {
                AjaxSpinner.hide();
                scrollToElement(document.getElementById('specialOrderContainer'));
              }
            }));
            e.stop();
          });
        }
}

function initSpecialOrderForm(contextPath, hasValErrors) {
        var specialOrderButton = document.getElement('input[name=submit-special-order]')
        if (specialOrderButton) {
          specialOrderButton.addEvent('click', function(e) {
            jslog.debug('special order: submit form');
            e = new Event(e);
            AjaxSpinner.show();
            doAjaxRequest(new Ajax(contextPath + '/product/SpecialOrder.action', {
              method: 'post',
              data: document.getElement('form[name=specialOrderForm]'),
              update: document.getElementById('specialOrderContainer'),
              evalScripts: true,
              onComplete: function() {
                AjaxSpinner.hide();
                scrollToElement(document.getElementById('specialOrderContainer'));
              }
            }));
            e.stop();
          });
        }
}

