function updateConcelho(DistritoId){
    var pars = 'DistritoId=' + DistritoId;

    var myAjax = new Ajax.Updater('element_ConcelhoId',
                                  '/utilizadores/actualizaConcelho/',
                                  {
                                      method: 'get',
                                      parameters: pars
                                  }
                                  );
}

function verificaDisponibilidade(produto, cor, tamanho){
	url = '/catalogo/verificaDisponibilidade' + produto + 'hexa/' + escape(cor) +'/tamanho/' + tamanho;
	//window.location = url;
	window.open(url, '', 'width=520, height=330, status=1, resizable=1, scrollbars=1 ')
}

<!-- alterValue(this, 'nome'); -->

function alterValue(component, val) {
    if (component.value == '') {
        component.value = val;
    } else if (component.value == val) {
        component.value = '';
    }
}

/**
 * Preenche uma combo box a partir de um array
*/
function fillSelectFromArray(selectCtrl, itemArray, goodPrompt, badPrompt, defaultItem) {
    var i, j;
    var prompt;

    if ((itemArray == '0') || (itemArray == -1) || (itemArray == null)) {
        selectCtrl.disabled = true;
    } else {
        selectCtrl.disabled = false;
    }

    // empty existing items
    for (i = selectCtrl.options.length; i >= 0; i--) {
        selectCtrl.options[i] = null;
    }
    prompt = (itemArray != null) ? goodPrompt : badPrompt;
    if (prompt == null) {
        j = 0;
    } else {
        selectCtrl.options[0] = new Option(prompt);
        j = 1;
    }
    if (itemArray != null) {
        // add new items
        for (i = 0; i < itemArray.length; i++) {
            selectCtrl.options[j] = new Option(itemArray[i][0]);
            if (itemArray[i][1] != null) {
                selectCtrl.options[j].value = itemArray[i][1];
            }
            j++;
        }
        // select first item (prompt) for sub list
        selectCtrl.options[0].selected = true;
    }
}






