// HEADER
function prependHeader()
{
	var myBody = document.body;
	var addedElement = document.createElement('iframe');
	addedElement.src = "http://br.pepsimundo.com/toolkit/header/";
	addedElement.frameBorder = "0";
	addedElement.width="100%";
	addedElement.scrolling="no";
	addedElement.marginwidth="0";
	addedElement.marginheight="0";
	addedElement.height="63px";
	myBody.insertBefore(addedElement, myBody.firstChild);
}

// FOOTER
function appendFooter()
{
	var myBody2 = document.body;
	var addedElement = document.createElement('iframe');
	addedElement.src = "http://br.pepsimundo.com/toolkit/footer/";
	addedElement.frameBorder = "0";
	addedElement.width="100%";
	addedElement.height="41px";
	addedElement.scrolling="no";
	addedElement.marginwidth="0";
	addedElement.marginheight="0";
	myBody2.insertBefore(addedElement, myBody2.nextSibling);
}

//ONLOAD FUNCTION
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

//CALL EVENTS
addLoadEvent(prependHeader);
addLoadEvent(appendFooter);
