// this script need to jquery any version // woah.bar pro v 2.0 h1 = { stub_showing : 0, add_css : function(css){ var style = document.createElement('style'); style.type = 'text/css'; // для IE if (style.styleSheet) { style.styleSheet.cssText = css; } else { // для Safari/Chrome if (style.innerText == '') { style.innerText = css; // для остальных } else { style.innerHTML = css; } } document.body.appendChild(style); }, cookie : function(k, v, e){ if(!navigator.cookieEnabled){ return -1; } if(typeof v != 'undefined'){ if(!e){ var expires = new Date(); expires.setTime(expires.getTime() + (1000 * 86400 * 365)); } document.cookie = k + "=" + escape(v) + "; expires=" + expires.toGMTString() + "; path=/"; return v; } else{ var cookie_name = k + "="; var cookie_length = document.cookie.length; var cookie_begin = 0; var value_begin = ""; while(cookie_begin < cookie_length){ value_begin = cookie_begin + cookie_name.length; if(document.cookie.substring(cookie_begin, value_begin) == cookie_name){ var value_end = document.cookie.indexOf (";", value_begin); if (value_end == -1){ value_end = cookie_length; } return unescape(document.cookie.substring(value_begin, value_end)); } cookie_begin = document.cookie.indexOf(" ", cookie_begin) + 1; if(cookie_begin == 0){ break; } } return null; } }, digit : function(e){ $(e).animate({"marginTop": "-20px"}, 70); $(e).animate({"marginTop": "5px"}, 150); $(e).animate({"marginTop": "-10px"}, 70); $(e).animate({"marginTop": "0px"}, 200); }, woahbar_show : function(){ if(!h1.stub_showing && h1.cookie('woahbar') == 2){ h1.woahbar_hide(); return; } if(h1.stub_showing){ $('.woahbar-stub').slideUp('fast', function(){ $('.woahbar').slideDown('fast'); h1.digit('.woahbar'); }); } else{ h1.digit('.woahbar'); } h1.cookie('woahbar', 1); return false; }, woahbar_hide : function(){ $('.woahbar').slideUp('fast', function(){ $('.woahbar-stub').slideDown('fast'); h1.digit('.woahbar-stub'); h1.stub_showing = 1; }); h1.cookie('woahbar', 2); return false; }, init : function(){ document.body.style.marginTop = '1.5em'; setTimeout(function(){ h1.woahbar_show(); }, 50); { // CSS h1.add_css('\ .woahbar{\ position: fixed;\ top: 0px;\ left: 0px;\ width: 100%;\ height: 19px;\ z-index: 103;\ padding: 5px 0 5px 0;\ text-align: center;\ font-size: 110%;\ color: #fff;\ background-color: #2069A3;\ box-shadow: 0px 0px 5px #888888;\ -moz-box-shadow: 0px 0px 5px #888888;\ -webkit-box-shadow: 0px 0px 5px #888888;\ border-bottom: 3px solid #fff;\ font-family: sans-serif;\ z-index:1000;\ }\ .woahbar-stub{\ position: fixed;\ top: 0px;\ left: 0px;\ width: 100%;\ height: 19px;\ z-index: 105;\ }\ .woahbar-link{\ color: white;\ text-decoration: none;\ padding: 2px 8px;\ font-weight: normal;\ background: rgb(255, 183, 0);\ font-family: Helvetica, Arial, sans-serif;\ border-radius: 4px;\ text-shadow: 0 -1px 0 rgb(192, 127, 30);\ border-top: 1px solid rgb(255, 213, 103);\ border-bottom: 1px solid rgb(216, 130, 0);\ }\ .woahbar-link:hover{\ color: white;\ text-decoration: none;\ padding: 2px 8px;\ font-weight: normal;\ background: rgb(255, 163, 0);\ font-family: Helvetica, Arial, sans-serif;\ border-radius: 4px;\ text-shadow: 0 -1px 0 rgb(192, 127, 30);\ border-top: 1px solid rgb(255, 185, 0);\ border-bottom: 1px solid rgb(216, 130, 0);\ }\ .close-notify{\ float: right;\ margin-right: 22px;\ color: #fff;\ width: 17px;\ height: 19px;\ text-decoration: none;\ background: none;\ cursor: pointer;\ }\ .show-notify\ {\ -moz-border-radius: 3px;\ -webkit-border-radius: 3px;\ border: 3px solid #fff;\ box-shadow: 0 0 5px rgba(0,0,0,0.35);\ -moz-box-shadow: 0 0 5px rgba(0,0,0,0.35);\ -webkit-box-shadow: 0 0 5px rgba(0,0,0,0.35);\ float: right;\ margin-right: 10px;\ color: #fff;\ width: 35px;\ height: 33px;\ text-decoration: none;\ background-color: #2069A3;\ cursor:pointer;\ }\ .woahbar_container a{\ outline: none;\ }\ #woahbar_content_id{\ float: left;\ width: 80%\ }\ '); } var woahbar_container = $('
', {class: 'woahbar_container'}); $(document.body).append(woahbar_container); var woahbar = $('
', {class: 'woahbar', id: 'woahbar_id', style: 'display: none;'}); $(woahbar_container).append(woahbar); var content = $('
', {id: 'woahbar_content_id'}); $(woahbar).append(content); var close_link = $('', {class: 'close-notify', hidefocus: 'true'}); $(close_link).click(function(){ h1.woahbar_hide(); }); $(close_link).html(''); $(woahbar).append(close_link); var stub = $('
', {class: 'woahbar-stub', style: 'display: none;'}); $(woahbar_container).append(stub); var open_link = $('', {class: 'show-notify', hidefocus: 'true'}); $(open_link).click(function(){ h1.woahbar_show(); }); $(open_link).html(''); $(stub).append(open_link); $('.woahbar').css('display', 'block'); } } $().ready(function(){ h1.init(); $('#woahbar_content_id').html('
'); });