var tvget890_all; var tvget890_elem; var tvget890_track; var tvget890_thumb; var tvget890_height; var tvget890_cntHeight; var tvget890_trcHeight; var tvget890_mean = 50; var tvget890_current = 0; var tvget890_jump_pattern="http://beln.by/index/0-12/?tvget_channel_id=%CHANNEL_ID%"; function tvget_jump2schedule(channel_id) { document.getElementById('tvnow890_jump_link').href = tvget890_jump_pattern.replace(new RegExp("%CHANNEL_ID%", 'g'), channel_id); document.getElementById('tvnow890_jump_link').click(); return false; } var tvget890_doScroll = function (e) { var elem = document.getElementById('tvget890_scroll_area'); // cross-browser wheel delta e = window.event || e; var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail))); var scrolltop = elem.scrollTop; // scrollTop property takes positive values when you scroll down and our delta variable behaves otherwise, so the equation will be: elem.scrollTop = scrolltop - delta * tvget890_mean; // set top position for the scrollbar thumb tvget890_thumb.style.top = (elem.scrollTop/tvget890_cntHeight * tvget890_trcHeight) + 'px'; e.preventDefault(); }; function tvget890_init_scroll() { tvget890_all = document.getElementById('tvget890_now_block'); tvget890_elem = document.getElementById('tvget890_scroll_area'); tvget890_track = document.getElementById('tvget890_scrollbar_track'); tvget890_thumb = document.getElementById('tvget890_scrollbar_thumb'); tvget890_height = parseInt(tvget890_elem.offsetHeight, 10); tvget890_cntHeight = parseInt(tvget890_elem.children[0].clientHeight, 10); tvget890_trcHeight = parseInt(tvget890_track.offsetHeight, 10); tvget890_thumb.style.height = Math.round(tvget890_height/tvget890_cntHeight * tvget890_trcHeight) + 'px'; if (tvget890_elem.addEventListener) { tvget890_elem.addEventListener("mousewheel", tvget890_doScroll, false); tvget890_elem.addEventListener("DOMMouseScroll", tvget890_doScroll, false); } else { tvget890_elem.attachEvent("onmousewheel", tvget890_doScroll); } } function tvget_now_expand_desc(prid) { var el = document.getElementById(prid); if (el.style.display == 'none' || el.style.display == '') el.style.display = 'block'; else el.style.display = 'none'; } function tvget890_makeHttpRequest(url, callback_function, return_xml) { var http_request = false; if (window.XMLHttpRequest) { http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/html'); } } else if (window.ActiveXObject) { try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { alert("Unfortunatelly you browser doesn't support this feature."); return false; } http_request.onreadystatechange = function() { if (http_request.readyState == 4) { if (http_request.status == 200) { var regex = /([^<]*)<\/content>/gi; match = http_request.responseText.match(regex); var body = match[0].replace("", "").replace('<\/content>', ""); document.getElementById('tvget890_now_block_content').innerHTML = tvget_start_Base64.decode(body); tvget890_init_scroll(); } else { alert('There was a problem with the request.(Code: ' + http_request.status + ')'); } } }; http_request.open('GET', url, true); http_request.send(null); } function tvget890_loadedWait() { if (typeof(tvget890_loaded) === "function") { tvget890_loaded(); } else setTimeout(tvget890_loadedWait(), 100); } function tvget890_loadBanner(xml) { var html_content = xml.getElementsByTagName('content').item(0).firstChild.nodeValue; var reload_after = xml.getElementsByTagName('reload').item(0).firstChild.nodeValue; document.getElementById('tvget890_now_block_content').innerHTML = html_content; tvget890_loadedWait(); try { clearTimeout(to); } catch (e) {} } function tvget890_loaded() { tvget890_fleXenv.fleXcrollInit(); } function tvget890_nextAd() { var now = new Date(); var el = document.getElementById("tvget890_now_block"); el.innerHTML = "" + "" + "
" + "
    "+ "
    " + "" ; var url = '//tvget.ru/tvgate/nb/1.0/wkfgie65/tv_now.php?r=' + now.getTime(); tvget890_makeHttpRequest(url, 'tvget890_loadBanner', true); } var tvget_start_Base64 = { _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", encode: function(input) { var output = ""; var chr1, chr2, chr3, enc1, enc2, enc3, enc4; var i = 0; input = tvget_start_Base64._utf8_encode(input); while (i < input.length) { chr1 = input.charCodeAt(i++); chr2 = input.charCodeAt(i++); chr3 = input.charCodeAt(i++); enc1 = chr1 >> 2; enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); enc4 = chr3 & 63; if (isNaN(chr2)) { enc3 = enc4 = 64; } else if (isNaN(chr3)) { enc4 = 64; } output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); } return output; }, decode: function(input) { var output = ""; var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); while (i < input.length) { enc1 = this._keyStr.indexOf(input.charAt(i++)); enc2 = this._keyStr.indexOf(input.charAt(i++)); enc3 = this._keyStr.indexOf(input.charAt(i++)); enc4 = this._keyStr.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; output = output + String.fromCharCode(chr1); if (enc3 != 64) { output = output + String.fromCharCode(chr2); } if (enc4 != 64) { output = output + String.fromCharCode(chr3); } } output = tvget_start_Base64._utf8_decode(output); return output; }, _utf8_encode: function(string) { /* string = string.replace("/\r\n/g","\n"); */ var utftext = ""; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if ((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return utftext; }, _utf8_decode: function(utftext) { var string = ""; var i = 0; var c = c1 = c2 = 0; while (i < utftext.length) { c = utftext.charCodeAt(i); if (c < 128) { string += String.fromCharCode(c); i++; } else if ((c > 191) && (c < 224)) { c2 = utftext.charCodeAt(i + 1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2; } else { c2 = utftext.charCodeAt(i + 1); c3 = utftext.charCodeAt(i + 2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } } return string; } }; if (!false) { document.addEventListener('touchmove', function(e) { e.preventDefault(); }, false); } //window.onload = tvget890_nextAd; //tvget890_nextAd(); window.addEventListener("load",function(event) { tvget890_nextAd(); },false);