
// attach the resize function when the window is resized
window.onresize = reisze;
 
/**
* This function will init the mootools and call the resize function
*/


function reisze() {
    var backgroundWidth = jQuery("#background_section").width();
    
    var documentWidth = window.innerWidth ||
                        document.documentElement.clientWidth ||
                        document.body.clientWidth;
                        
    
    if (documentWidth <= 996)
    {
        iRemaining = 717;
        document.getElementById('background_section').style.left = iRemaining + 'px';
    }
    else
    {
        if (documentWidth <= 1009)
        {
            iRemaining = documentWidth - 996;
            iRemaining = 717 - iRemaining;
        
            document.getElementById('background_section').style.left = iRemaining + 'px';
        }
        else
        {
            iHalf = documentWidth / 2;
            iHalfDocument = 980 / 2;
            
            iRemaining = (iHalfDocument + iHalf) -300;
        
            document.getElementById('background_section').style.left = iRemaining + 'px';
            
        }
    }
    
    
    /*
    if (documentWidth > 980)
    {
        iRemaining = documentWidth - 263;
        document.getElementById('background_section').style.left = iRemaining + 'px';
    }
    else
    {
        iRemaining = 980 - documentWidth;
        iRemaining = 511 - iRemaining;
        iRemaining = documentWidth - iRemaining;
        
        document.getElementById('background_section').style.left = iRemaining + 'px';
    }
*/

/*
    var docWidth = window.innerWidth ||
        document.documentElement.clientWidth ||
        document.body.clientWidth;
        
    var docHeight = window.innerHeight ||
        document.documentElement.clientHeight ||
        document.body.clientHeight;
        
    if (docWidth <= 1028) {
        jQuery("#body").css({ 'backgroundImage': 'url(/media/img/background_rampe_half.jpg)' });
    }
    else {
        jQuery("#body").css({ 'backgroundImage': 'url(/media/img/background_rampe.jpg)' });
    }
    
    if (docWidth <= 1028) {
        minWidth = 470;
    }
    else {
        if (navigator.appVersion.indexOf('compatible; MSIE 7.0') != -1) {
            minWidth = (docWidth - (leftWidth + 128));
        }
        else {
            minWidth = (docWidth - (leftWidth + 124));
        }
        
        if (minWidth > 1028) {
            minWidth = 1028;
        }
    }
    
    if (navigator.appVersion.indexOf('compatible; MSIE 7.0') != -1) {
        if (document.location.href.indexOf('/fr/realisations.php') != -1 ||
            document.location.href.indexOf('/en/realisations.php') != -1) {
                document.getElementById('rightnavigation').style.marginRight = '0px';
                document.getElementById('leftnavigation').style.marginLeft = '0px';
                document.getElementById('theTitle').style.marginLeft = '-5px';
                document.getElementById('theTitle').style.width = jQuery("#theTitle").width() - 50 + 'px';

                for (a = 0; a <= 3; a++) {
                    document.getElementById('fleches_' + a).style.marginTop = '-35px';
                }
        }
    }

    jQuery("#navigation").css({ 'width': minWidth });
    jQuery('#divprincipale').css({ 'width': (minWidth - 20) });
    jQuery('#footer').css({ 'width': minWidth });
    */
}
