var LastIt = window.onload;
if(typeof(LastIt) !== 'function')
  window.onload = Preload;
else
  window.onload = function(){LastIt();ShowBanner();}
  
function ShowBanner(){
  console.log(getCookie("integ"));
  if(getCookie("integ") == 1){
    var el = document.createElement("div");
    el.id = "info_wrapper";
    changeOpacE(el, 70);
    document.body.appendChild(el);
    var info = document.createElement("a");
    info.href = "userinteg.html";
    info.id = "info_info";
    info.target = "_blank";
    info.onclick = function(){ HideBanner(true); };
    document.body.appendChild(info);
    var close = document.createElement("a");
    close.href = "#";
    close.id = "info_close";
    close.onclick = function(){ return HideBanner(false); };
    document.body.appendChild(close);
    setCookie("integ", "2", 30);
  }
}
function HideBanner(ret){
  for(var i=0; i<3; i++) document.body.removeChild(document.body.lastChild);
  return ret;
}


function setCookie(c_name,value,exdays){
  var exdate=new Date();
  exdate.setDate(exdate.getDate() + exdays);
  var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
  document.cookie=c_name + "=" + c_value;
}
function getCookie(c_name){
  var i,x,y,ARRcookies=document.cookie.split(";");
  for (i=0;i<ARRcookies.length;i++){
    x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
    y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
    x=x.replace(/^\s+|\s+$/g,"");
    if (x==c_name){
      return unescape(y);
    }
  }
}
