var Cookie = function() {}; Cookie.set = function (c_name, value, exdays, path, domain) { var exdate = new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value = escape(value) + ((exdays==null) ? "" : "; expires=" + exdate.toUTCString()) + (path == null ? '; path=/' : '; path=' + path); document.cookie = c_name + "=" + c_value; }; Cookie.get = function (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); } return null; }; $().ready(function() { if($(window).width() < 1024) { return; } if(Cookie.get('chat06282') == 'true') { return; } var modalTimeout = 10; // 7 секунд var modal = $('
'); var overlay = $('
'); var controls = $('
'); var banner = $('
'); modal.css({ textAlign: 'center', display: 'none', position: 'fixed', zIndex: 11000, left: (-1 * $(window).width()) + 'px', bottom: 0, width: '100%', height: '150px' }); controls.css({ background: '#fff', width: '20px', height: '20px', position: 'absolute', right: 0, bottom: '150px', margin: '0px 10px -30px 0px', zIndex: 11003, whiteSpace: 'nowrap', cursor: 'pointer', lineHeight: '18px' }); controls.append('
x
') controls.find('#close').click(function() { Cookie.set('chat06282', true, 7); modal.animate({left: $(window).width() + 'px'}, 300, function() { $(this).hide(); }); }); banner.css({ width: '100%', height: '150px', display: 'block', position: 'absolute', left: 0, bottom: 0, }); banner.html(''); //isie11 /* if(navigator.userAgent.match(/rv:/) && parseInt(navigator.userAgent.split('rv:')[1].split(')')[0]) <= 11 && navigator.appName == 'Netscape') { return; } */ modal .append(controls) .append(banner); $(document.body).prepend(modal); setTimeout(function() { modal.show().animate({left: '0px'}, 300); }, modalTimeout); modal.click(function() { Cookie.set('chat06282', true); modal.animate({left: $(window).width() + 'px'}, 300, function() { $(this).hide(); }); }); });