/* #######################
 * #  Guardian.co.uk JS  #
 * #                     #
 * # By: David Lin       #
 * ####################### */

// When the page is ready let's do stuff
Event.observe(window, 'load', function() {
	// get the div#header to put the iframe
        var header = document.getElementById('header');
        var footer = document.getElementById('footer');

        // create the header iframe through the DOM
        var headerIframe = document.createElement('iframe');
        headerIframe.setAttribute('id', 'guardian-header-iframe');
        headerIframe.setAttribute('scrolling', 'no');
        headerIframe.setAttribute('frameBorder', '0');
        headerIframe.setAttribute('width', '100%');
        headerIframe.setAttribute('height', '130');
        headerIframe.setAttribute('name', 'top');
        headerIframe.setAttribute('src', 'https://image.guim.co.uk/Guardian/thirdparty/gdn/secureheader.html');

        // create the footer iframe through the DOM
        var footerIframe = document.createElement('iframe');
        footerIframe.setAttribute('id', 'guardian-footer-iframe');
        footerIframe.setAttribute('scrolling', 'no');
        footerIframe.setAttribute('frameBorder', '0');
        footerIframe.setAttribute('width', '100%');
        footerIframe.setAttribute('height', '100');
        footerIframe.setAttribute('name', 'footer');
        footerIframe.setAttribute('src', 'https://image.guim.co.uk/Guardian/thirdparty/gdn/securefooter.html');

        // add the iframe to the header div
        header.appendChild(headerIframe);
        
        // add the iframe to the footer div
        footer.appendChild(footerIframe);
});
