


function setRadio(label, container){
	var labels = document.getElementById(container).getElementsByTagName('label');
	for (i=0; i<labels.length; i++){
        if (labels[i].className.indexOf('radio-label') != -1){
		    labels[i].className = "radio-label";
		}
    }
    if (label.className.indexOf('radio-label') != -1){
	    label.className = "radio-label-checked";
    }
}
function setCheckbox(label){
    if (label.className.indexOf('checkbox-label-checked') != -1){
	    label.className = "checkbox-label";
    } else {
	    label.className = "checkbox-label-checked";
    }
}
/* autoHeight
-----------------------------------------------------------------------------*/
function autoHeight(){
    var divh = document.getElementById('footer').offsetHeight;
    var refDiv = (divh +"px");
    document.getElementById('wrap-footer').style.height = refDiv;
    document.getElementById('push').style.height = refDiv;
    document.getElementById('fwrap1').style.height = refDiv;
    document.getElementById('fwrap2').style.height = refDiv;
    document.getElementById('fwrap3').style.height = refDiv;
    document.getElementById('container').style.marginBottom = (0-divh)+"px";

    var minDivh = document.getElementById('container').offsetHeight;
    document.getElementById('mh1').style.height = minDivh+"px";
    document.getElementById('mh2').style.height = minDivh+"px";
    document.getElementById('mh3').style.height = minDivh+"px";
};
/* newWindow
-----------------------------------------------------------------------------*/
function newWindow(mypage, myname, w, h, scroll){
    var winl = (screen.width-w)/2;
    var wint = (screen.height-h)/2;
    var settings = 'height='+h+',';
    settings += 'width='+w+',';
    settings += 'top='+wint+',';
    settings += 'left='+winl+',';
    settings += 'scrollbars='+scroll+',';
    settings += 'resizable=no';
    win = window.open(mypage,myname,settings);
    if (parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
/* changeToMail
-----------------------------------------------------------------------------*/
var mails = new Array();
mails[0] = "es"+"pac"+"e."+"bel"+"le."+"et"+".zen"+"@"+"gma"+"il.c"+"om";
mails[1] = "";

function changeToMail(id,i,title){
    if (!title) title = "Envoyez-nous un e-mail";
    if (document.getElementById(id)) {
        document.getElementById(id).innerHTML = "<a href='" + "mai" + "lto:" + mails[i] + "' title='" + title + "'>" + mails[i] + "</a>";
    }
}
/* addLoadEvent
-----------------------------------------------------------------------------*/
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}
/* highlightTable
-----------------------------------------------------------------------------*/
function highlightTable(t, highlightRows, highlightColumns, selectable){
    $(t + ' tr:odd').addClass('odd');
    $(t + ' tr:even').addClass('even');
    if (highlightRows){
        $(t + ' tbody tr').mouseover(function(){
            $(this).addClass('over');
        }).mouseout(function(){
            $(this).removeClass('over');
        });
    }
    if (highlightColumns){
        $(t + ' td,' + t + ' th').mouseover(function(){
            var column = $(this).parent().children().index($(this)) + 1;
            $(t + ' tr :nth-child(' + column + ')').addClass('sel2');
        }).mouseout(function(){
            var column = $(this).parent().children().index($(this)) + 1;
            $(t + ' tr :nth-child(' + column + ')').removeClass('sel2');
        });
    }
    if (selectable){
        $(t + ' tbody tr').click(function(){
            $(t + ' tr').removeClass('sel');
            $(this).addClass('sel');
        });
    }
}
