
function loaded() {
    var agt = navigator.userAgent.toLowerCase();
    var pos = agt.indexOf('msie');

    if (pos != -1) { // Fix positioning in IE6
        var ie6 = parseInt(agt.substring(pos + 5)); 
        if (ie6 <= 6) {
            var con = document.getElementById("content");
            var cen_con = document.getElementById("centre_content");
            var right = document.createElement("div");
            var centre = document.createElement("div");
            
            right.style.position = "absolute";
            right.style.top = "0px";
            right.style.right = "0px";
            right.style.width = "50%";
            right.style.height = cen_con.offsetHeight + "px";            
            right.style.backgroundImage = "url('images/right_bg.png')";
            
            centre.style.position = "absolute";
            centre.style.top = "0px";
            centre.style.left = "0px";
            centre.style.width = "100%";
            centre.style.height = cen_con.offsetHeight + "px";          
            centre.style.backgroundPosition = "center";
            centre.style.backgroundRepeat = "repeat-y";
            centre.style.backgroundImage = "url('images/content_bg.png')";            
            
            con.insertBefore(centre, con.firstChild);
            con.insertBefore(right, con.firstChild);            
        }
    }
}

// Attach to window onload event
if (document.getElementById) {
    if (window.addEventListener){
        window.addEventListener("load", function() { loaded(); }, false);
    }
    else if (window.attachEvent){
        window.attachEvent("onload", function() { loaded(); });
    }
}
