window.onload = funonload; var fontS =10; var interval =10; function funonload() { var slabovid = ReadSpec('special'); addButton(slabovid); checkSpec(slabovid); if (slabovid== 'y') buttons_control(); } function checkSpec(spec) { setButton(spec); if (spec == 'y') { addStyleSheet('/bank/eye/vi.txt'); } } function ReadSpec(name) { var matches = document.cookie.match(new RegExp( "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)" )); return matches ? decodeURIComponent(matches[1]) : undefined; } function SetCookieSpec(name,value) { document.cookie = name + "=" + value; } function addButton() { var button = document.createElement('input'); var parentElem = document.body; var s = ReadSpec('special'); button.type = 'button'; button.id = 'spec'; button.value = ''; button.setAttribute("onclick","Spec()"); button.setAttribute("style","position:fixed; z-index:9999; top:0%; left:3%; margin: 5px; font-size:20px; font-weight:bold; background: #fff;"); parentElem.insertBefore(button, parentElem.firstChild); setButton(s); } function addStyleSheet(url) { // Создаём элемент LINK/STYLE и добавляем в документ var style; // // if (typeof url == 'undefined') // { // style = document.createElement('style'); // } // else // { style = document.createElement('link'); style.rel = 'stylesheet'; style.type = 'text/css'; style.href = url; // style.id = 'speccss'; // } document.getElementsByTagName('head')[0].appendChild(style); // Находим новый стиль в коллекции styleSheets style = document.styleSheets[document.styleSheets.length - 1]; // Делаем объект совместимыми с W3C DOM2 (для IE) return StyleSheet_makeCompatible(style); } function delStyleSheet() { style=document.getElementsByTagName('head')[0].lastChild;//document.styleSheets[document.styleSheets.length - 1] document.getElementsByTagName('head')[0].removeChild(style);// } function Spec() { var spec = ReadSpec('special'); //alert (spec); if (spec == 'y') { delStyleSheet(); SetCookieSpec('special','n'); setButton('n'); location.reload(); } else { addStyleSheet('/bank/eye/vi.txt'); SetCookieSpec('special','y'); setButton('y'); buttons_control(); } } //кнопки управления function buttons_control(){ var button = document.createElement('input'); var parentElem = document.body; button.type = 'button'; button.id = 'zvuk'; button.value = ' ? '; button.setAttribute("onclick","myInfo()"); button.setAttribute("style","position:fixed; z-index:9999; top:35px;left:30%; font-size: 20px; font-weight: bold;"); parentElem.insertBefore(button, parentElem.lastChild); button = document.createElement('div'); parentElem = document.body; button.innerHTML = 'Звук'; button.setAttribute("style","position:fixed; z-index:9999; top:10px;left:30%; font-size: 16px; font-weight: bold;"); parentElem.insertBefore(button, parentElem.lastChild); button = document.createElement('input'); parentElem = document.body; button.type = 'button'; button.id = 'minus'; button.value = ' а- '; button.setAttribute("onclick","fontSize(this)"); button.setAttribute("style","position:fixed; z-index:9999; top:35px;left:35%; font-size: 20px; font-weight: bold;"); parentElem.insertBefore(button, parentElem.lastChild); button = document.createElement('div'); parentElem = document.body; button.innerHTML = 'Шрифт'; button.setAttribute("style","position:fixed; z-index:9999; top:10px;left:36%; font-size: 16px; font-weight: bold;"); parentElem.insertBefore(button, parentElem.lastChild); button = document.createElement('input'); parentElem = document.body; button.type = 'button'; button.id = 'plus'; button.value = ' А+ '; button.setAttribute("onclick","fontSize(this)"); button.setAttribute("style","position:fixed; z-index:9999; top:35px;left:38%; font-size: 20px; font-weight: bold;"); parentElem.insertBefore(button, parentElem.lastChild); button = document.createElement('input'); parentElem = document.body; button.type = 'button'; button.id = 'intervalMinus'; button.value = ' И - '; button.setAttribute("onclick","intervalSize(this)"); button.setAttribute("style","position:fixed; z-index:9999; top:35px;left:47%; font-size: 20px; font-weight: bold;"); parentElem.insertBefore(button, parentElem.lastChild); button = document.createElement('div'); parentElem = document.body; button.innerHTML = 'Интервал'; button.setAttribute("style","position:fixed; z-index:9999; top:10px;left:48%; font-size: 16px; font-weight: bold;"); parentElem.insertBefore(button, parentElem.lastChild); button = document.createElement('input'); parentElem = document.body; button.type = 'button'; button.id = 'intervalPlus'; button.value = ' И + '; button.setAttribute("onclick","intervalSize(this)"); button.setAttribute("style","position:fixed; z-index:9999; top:35px;left:52%; font-size: 20px; font-weight: bold;"); parentElem.insertBefore(button, parentElem.lastChild); button = document.createElement('div'); parentElem = document.body; button.innerHTML = 'Цветовая схема'; button.setAttribute("style","position:fixed; z-index:9999; top:10px;left:62%; font-size: 16px; font-weight: bold;"); parentElem.insertBefore(button, parentElem.lastChild); button = document.createElement('input'); parentElem = document.body; button.type = 'button'; button.id = 'blackONwhite'; button.value = ' Ч/Б '; button.setAttribute("onclick","setColorShem(this)"); button.setAttribute("style","position:fixed; z-index:9999; top:35px;left:60%; font-size: 20px; font-weight: bold; color:#000!important; background: #FFF!important; "); parentElem.insertBefore(button, parentElem.lastChild); button = document.createElement('input'); parentElem = document.body; button.type = 'button'; button.id = 'whiteONblack'; button.value = ' Б/Ч '; button.setAttribute("onclick","setColorShem(this)"); button.setAttribute("style","position:fixed; z-index:9999; top:35px;left:65%; font-size: 20px; font-weight: bold; color:#FFF!important; background: #000!important; "); parentElem.insertBefore(button, parentElem.lastChild); button = document.createElement('input'); parentElem = document.body; button.type = 'button'; button.id = 'yellowONblue'; button.value = ' Ж/С '; button.setAttribute("onclick","setColorShem(this)"); button.setAttribute("style","position:fixed; z-index:9999; top:35px; left:70%; font-size: 20px; font-weight: bold; color:#FFFF00!important; background: #0000FF!important; "); parentElem.insertBefore(button, parentElem.lastChild); button = document.createElement('input'); parentElem = document.body; button.type = 'button'; button.id = 'imgOff'; button.value = ' Выкл '; button.setAttribute("onclick","imgNone()"); button.setAttribute("style","position:fixed; z-index:9999; top:35px;left:77%; font-size: 20px; font-weight: bold;"); parentElem.insertBefore(button, parentElem.lastChild); button = document.createElement('div'); parentElem = document.body; button.innerHTML = 'Изображения'; button.setAttribute("style","position:fixed; z-index:9999; top:10px;left:78%; font-size: 16px; font-weight: bold;"); parentElem.insertBefore(button, parentElem.lastChild); button = document.createElement('input'); parentElem = document.body; button.type = 'button'; button.id = 'imgBlack'; button.value = ' Ч/Б '; button.setAttribute("onclick","blackImg()"); button.setAttribute("style","position:fixed; z-index:9999; top:35px;left:83%; font-size: 20px; font-weight: bold;"); parentElem.insertBefore(button, parentElem.lastChild); } //звук function myInfo() { var aud = new Audio('/bank/eye/info.mp3'); aud.play(); } //черно-белые изображения var blackFilter=true; function blackImg(){ var btn = document.getElementById("imgBlack"); if(blackFilter) btn.value=" Цвет "; else btn.value=" Ч/Б "; var allimg = document.getElementsByTagName("img"); for(var i=0; i60)interval=60; else interval+=10; else if(interval<=15) interval=15; else interval-=10; for(var i=0; i40) fontS = 40; else fontS+=10; else if(fontS<=15) fontS=15; else fontS-=10; for(var i=0; i