function viewWithFrame(magasin, url, referer) {
	location.href = ("/frames/viewWithFrame.php?magasin=" + magasin + "&url="
			+ url + "&referer=" + referer);
	return false;
}

function arrayUnset(array, valueOrIndex) {
	array.splice(array.indexOf(valueOrIndex), 1);
}

/**
* Returns the value of the selected radio button in the radio group, null if
* none are selected, and false if the button group doesn't exist
*
* @param {radio Object} or {radio id} el
* OR
* @param {form Object} or {form id} el
* @param {radio group name} radioGroup
*/
function $RF(el, radioGroup) {
    if($(el).type && $(el).type.toLowerCase() == 'radio') {
        var radioGroup = $(el).name;
        var el = $(el).form;
    } else if ($(el).tagName.toLowerCase() != 'form') {
        return false;
    }

    var checked = $(el).getInputs('radio', radioGroup).find(
        function(re) {return re.checked;}
    );
    return (checked) ? $F(checked) : null;
}

function displayErrorsFormInModalbox(idForm){
	errors = $$('form#' + idForm + ' span.error');
        if(errors.length < 1){
            return;
        }
        txtMsg = new Array;
	errors.each(function(s){
            txtMsg.push('- ' + Element.extend(s).innerHTML);
        });
	Modalbox.show('<h3><img src="/admin/images/attention.gif" alt=""/> Votre formulaire n\'a pas pu être validé !</h3><br/><p>'+txtMsg.join('<br/>')+'</p>',{title:'Attention...'});
}