(function(){ //block miniheader creation if device = mobile if (navigator.userAgent.match(/(Android|webOS|iPhone|iPod|BlackBerry|Windows Phone)/i) && (window.screen.width < 768)) return; /* head */ var H = document.getElementsByTagName('head')[0]; /* Miniheader */ var MH = document.createElement('div'); /* main container */ MH.id = 'Leonardo_Navigation'; var positionCss = 'z-index:10003;position:fixed;top:0;left:0;'; var wrapperWidth= '996px'; MH.setAttribute('style','height:40px;' + positionCss + 'width:100%; font-family:Verdana !important; line-height:normal !important; background-color:#464546; background: -webkit-linear-gradient(#464546, #000000); background: -o-linear-gradient(#464546, #000000); background: -moz-linear-gradient(#464546, #000000); background: linear-gradient(#464546, #000000);'); /* Insert miniheader wrapper */ var W = document.createElement('div'); /* contenitore interno centrato */ W.id = 'Leonardo_Navigation-Wrapper'; W.setAttribute('style','height:40px; width:' + wrapperWidth + '; margin:0 auto; text-align:center'); /* Container logo and text */ var L = document.createElement('div'); /* contenitore logo Leonardo */ L.id = 'Leonardo_Navigation-logo'; L.setAttribute('style','height:40px;'); /* Logo link container */ var A_L = document.createElement('a'); A_L.href = 'http://news.leonardo.it'; A_L.title = 'Visita http://news.leonardo.it'; A_L.rel = 'nofollow'; /* Logo container */ var L_I = document.createElement('div'); L_I.id = 'Leonardo_Navigation-logo-img'; L_I.setAttribute('style','height:40px;'); /* Img logo */ var I = document.createElement('img'); I.src = 'https://cdn.triboomedia.it/images/miniheader/leo_news_bg.png'; I.alt = 'Leonardo.it'; I.setAttribute('style','max-height:40px; border:0; margin:0; margin-top:0'); /* Insert image to link tag */ A_L.appendChild(I); /* Insert link+image to logo container */ L_I.appendChild(A_L); W.appendChild(L); L.appendChild(L_I); /* Insert miniheader content */ MH.appendChild(W); /* Insert miniheader to body */ var delay = 200; setTimeout(function(){ var staticContainer = document.getElementById('tbm-miniheader-container'); /* body fixed top */ var MH_Container = document.getElementsByTagName('body')[0]; MH_Container.insertBefore(MH, MH_Container.childNodes[0]); var spacer = document.createElement("DIV"); spacer.id = 'Leonardo_Navigation_spacer'; spacer.setAttribute('style','width:100%;height:40px;clear:both;'); MH_Container.insertBefore(spacer, MH_Container.childNodes[0]); }, delay); })();