function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else var expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

function eraseCookie(name) {
  createCookie(name,"",-1);
}

function popSplash() {
  if (readCookie('notoxSplash') == 1) {
    return;
  }

  var pageWidth = 0, pageHeigth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    pageWidth = window.innerWidth;
    pageHeigth = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    pageWidth = document.documentElement.clientWidth;
    pageHeigth = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    pageWidth = document.body.clientWidth;
    pageHeigth = document.body.clientHeight;
  }

  var flashDiv = document.createElement('div');
  flashDiv.id = 'flashcontent';
  flashDiv.style.height = pageHeigth;
  flashDiv.style.width = pageWidth;
  flashDiv.style.zIndex = 10000;
  flashDiv.style.position = 'absolute';
  flashDiv.style.top = 0;
  flashDiv.style.left = 0;

  var body = document.getElementsByTagName('body')[0];
  body.appendChild(flashDiv);

  var so = new SWFObject("flash/intro03.swf", "mundi", pageWidth, pageHeigth, "6", "#FFFFFF");
  so.write("flashcontent");

  createCookie('notoxSplash', '1');
}