freebrush_accessibility_create_plugin_div(); function freebrush_accessibility_create_plugin_div() { //load css var freebrush_accessibility_plugin_css = document.createElement("link"); freebrush_accessibility_plugin_css.rel = "stylesheet"; freebrush_accessibility_plugin_css.type = "text/css"; freebrush_accessibility_plugin_css.href = "https://ac.freebrush.net/freebrush_accessibility/css?s=stranacoilbab546a&lang=ru&PluginPosition=bottom_left&BgColor=000000&BgRgbaColor=rgba(0,0,0,0.9)&IconsColor=white&TextColor=ffffff&d="+Date.now(); document.getElementsByTagName("head")[0].appendChild(freebrush_accessibility_plugin_css); //create plugin div var freebrush_accessibility_plugin_div = document.createElement("div"); //set the css class + id freebrush_accessibility_plugin_div.className = ""; //freebrush_accessibility_plugin_div.className = "freebrush_accessibility_plugin_css"; freebrush_accessibility_plugin_div.id = "freebrush_accessibility_plugin_css_global"; //get the content var freebrush_accessibility_plugin_div_content = "
"; freebrush_accessibility_plugin_div.innerHTML = freebrush_accessibility_plugin_div_content; document.body.appendChild(freebrush_accessibility_plugin_div); freebrush_accessibility_plugin_add_onclick_events(); freebrush_accessibility_plugin_check_cookies(); } //load accessibily CSS / js files function freebrush_accessibility_plugin_load_JS(filename,id) { var freebrush_accessibility_plugin_js = document.createElement("script"); freebrush_accessibility_plugin_js.id = id; freebrush_accessibility_plugin_js.src = "https://ac.freebrush.net"+filename+"&"+Date.now(); document.getElementsByTagName("head")[0].appendChild(freebrush_accessibility_plugin_js); } function freebrush_accessibility_plugin_load_CSS(filename,id) { var freebrush_accessibility_plugin_css = document.createElement("link"); freebrush_accessibility_plugin_css.rel = "stylesheet"; freebrush_accessibility_plugin_css.type = "text/css"; freebrush_accessibility_plugin_css.media = "screen"; freebrush_accessibility_plugin_css.id = id; freebrush_accessibility_plugin_css.href = "https://ac.freebrush.net"+filename+"&"+Date.now(); document.getElementsByTagName("head")[0].appendChild(freebrush_accessibility_plugin_css); } function freebrush_accessibility_plugin_unload_CSS(filename,filetype) { var targetelement=(filetype=="js")? "script" : (filetype=="css")? "link" : "none" //determine element type to create nodelist from var targetattr=(filetype=="js")? "src" : (filetype=="css")? "href" : "none" //determine corresponding attribute to test for var allsuspects=document.getElementsByTagName(targetelement) for (var i=allsuspects.length; i>=0; i--){ //search backwards within nodelist for matching elements to remove if (allsuspects[i] && allsuspects[i].getAttribute(targetattr)!=null && allsuspects[i].getAttribute(targetattr).indexOf(filename)!=-1) allsuspects[i].parentNode.removeChild(allsuspects[i]) //remove element by calling parentNode.removeChild() } } //set/check cookie ================================ function freebrush_accessibility_plugin_set_cookie(cname, cvalue) { var exdays = 7; var d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); var expires = "expires="+d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function freebrush_accessibility_plugin_get_cookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } function freebrush_accessibility_plugin_check_cookie(cname) { var cookie = freebrush_accessibility_plugin_get_cookie(cname); if (cookie != "") { return cookie; } else { return ""; } } function freebrush_accessibility_plugin_delete_cookie(cname) { document.cookie = cname + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/'; } function freebrush_accessibility_plugin_keyboard_cancel(e) { if(e.keyCode === 13){ freebrush_accessibility_plugin_cancel(); } return false; } function freebrush_accessibility_plugin_cancel() { //freebrush_accessibility_icon_action_unload_sound(); freebrush_accessibility_icon_action_unload_gray(); freebrush_accessibility_icon_action_unload_contrast(); freebrush_accessibility_icon_action_unload_black(); freebrush_accessibility_icon_action_unload_white(); freebrush_accessibility_icon_action_unload_font(); freebrush_accessibility_icon_action_unload_anime(); freebrush_accessibility_icon_action_unload_keyboard(); freebrush_accessibility_icon_action_unload_font_sizes_all(); } //add ocnclick/onkeypress events function freebrush_accessibility_plugin_add_onclick_events() { //access button document.getElementById("freebrush_accessibility_plugin_icon_link").onclick = function () { freebrush_accessibility_plugin_open_menu(); return false; }; document.getElementById("freebrush_accessibility_plugin_icon_link").onkeypress = function () { freebrush_accessibility_plugin_open_menu_handler(event); return false; }; //cancel button document.getElementById("freebrush_accessibility_plugin_cancel_button").onclick = function () { freebrush_accessibility_plugin_cancel(); return false; }; document.getElementById("freebrush_accessibility_plugin_cancel_button").onkeypress = function () { freebrush_accessibility_plugin_keyboard_cancel(event); return false; }; //font sizes document.getElementById("freebrush_accessibility_font_button_a24").onclick = function () { freebrush_accessibility_icon_action_load_font_sizes("24"); return false; }; document.getElementById("freebrush_accessibility_font_button_a24").onkeypress = function () { freebrush_accessibility_icon_action_load_keypress_font_sizes(event,"24"); return false; }; document.getElementById("freebrush_accessibility_font_button_a20").onclick = function () { freebrush_accessibility_icon_action_load_font_sizes("20"); return false; }; document.getElementById("freebrush_accessibility_font_button_a20").onkeypress = function () { freebrush_accessibility_icon_action_load_keypress_font_sizes(event,"20"); return false; }; document.getElementById("freebrush_accessibility_font_button_a16").onclick = function () { freebrush_accessibility_icon_action_load_font_sizes("16"); return false; }; document.getElementById("freebrush_accessibility_font_button_a16").onkeypress = function () { freebrush_accessibility_icon_action_load_keypress_font_sizes(event,"16"); return false; }; document.getElementById("freebrush_accessibility_font_button_acancel").onclick = function () { freebrush_accessibility_icon_action_unload_font_sizes_all(); return false; }; document.getElementById("freebrush_accessibility_font_button_acancel").onkeypress = function () { freebrush_accessibility_icon_action_unload_keypress_font_sizes_all(event); return false; }; //filters document.getElementById("freebrush_accessibility_icon_action_gray").onclick = function () { freebrush_accessibility_icon_action_load_gray(); return false; }; document.getElementById("freebrush_accessibility_icon_action_gray").onkeypress = function () { freebrush_accessibility_icon_action_load_keypress_gray(event); return false; }; document.getElementById("freebrush_accessibility_icon_action_contrast").onclick = function () { freebrush_accessibility_icon_action_load_contrast(); return false; }; document.getElementById("freebrush_accessibility_icon_action_contrast").onkeypress = function () { freebrush_accessibility_icon_action_load_keypress_contrast(event); return false; }; document.getElementById("freebrush_accessibility_icon_action_black").onclick = function () { freebrush_accessibility_icon_action_load_black(); return false; }; document.getElementById("freebrush_accessibility_icon_action_black").onkeypress = function () { freebrush_accessibility_icon_action_load_keypress_black(event); return false; }; document.getElementById("freebrush_accessibility_icon_action_white").onclick = function () { freebrush_accessibility_icon_action_load_white(); return false; }; document.getElementById("freebrush_accessibility_icon_action_white").onkeypress = function () { freebrush_accessibility_icon_action_load_keypress_white(event); return false; }; document.getElementById("freebrush_accessibility_icon_action_font").onclick = function () { freebrush_accessibility_icon_action_load_font(); return false; }; document.getElementById("freebrush_accessibility_icon_action_font").onkeypress = function () { freebrush_accessibility_icon_action_load_keypress_font(event); return false; }; document.getElementById("freebrush_accessibility_icon_action_anime").onclick = function () { freebrush_accessibility_icon_action_load_anime(); return false; }; document.getElementById("freebrush_accessibility_icon_action_anime").onkeypress = function () { freebrush_accessibility_icon_action_load_keypress_anime(event); return false; }; document.getElementById("freebrush_accessibility_icon_action_keyboard").onclick = function () { freebrush_accessibility_icon_action_load_keyboard(); return false; }; document.getElementById("freebrush_accessibility_icon_action_keyboard").onkeypress = function () { freebrush_accessibility_icon_action_load_keypress_keyboard(event); return false; }; } //=========================== function freebrush_accessibility_plugin_check_cookies() { var filter_cookie = freebrush_accessibility_plugin_check_cookie("freebrush_accessibility_plugin_filter"); if (filter_cookie !== "") { if (filter_cookie == "gray") { freebrush_accessibility_icon_action_load_gray(); } if (filter_cookie == "contrast") { freebrush_accessibility_icon_action_load_contrast(); } if (filter_cookie == "black") { freebrush_accessibility_icon_action_load_black(); } if (filter_cookie == "white") { freebrush_accessibility_icon_action_load_white(); } } var keyboard_cookie = freebrush_accessibility_plugin_check_cookie("freebrush_accessibility_plugin_keyboard"); if (keyboard_cookie !== "") { if (keyboard_cookie == "1") { freebrush_accessibility_icon_action_load_keyboard(); } } var anime_cookie = freebrush_accessibility_plugin_check_cookie("freebrush_accessibility_plugin_anime"); if (anime_cookie !== "") { if (anime_cookie == "1") { freebrush_accessibility_icon_action_load_anime(); } } //{SOUND} var font_sizes_cookie = freebrush_accessibility_plugin_check_cookie("freebrush_accessibility_plugin_font_sizes"); if (font_sizes_cookie !== "") { freebrush_accessibility_icon_action_load_font_sizes(font_sizes_cookie); } } //=========================== //Open/Close menu functions function freebrush_accessibility_plugin_open_menu() { document.getElementById("freebrush_accessibility_plugin_menu").className = ""; document.getElementById("freebrush_accessibility_plugin_menu").className = "freebrush_accessibility_plugin_menu_css freebrush_accessibility_plugin_css_color"; document.getElementById("freebrush_accessibility_plugin_icon_link").onclick = function () { freebrush_accessibility_plugin_close_menu(); return false; }; } function freebrush_accessibility_plugin_open_menu_handler(e) { if(e.keyCode === 13){ freebrush_accessibility_plugin_open_menu(); } return false; } function freebrush_accessibility_plugin_close_menu() { document.getElementById("freebrush_accessibility_plugin_menu").className = ""; document.getElementById("freebrush_accessibility_plugin_menu").className = "freebrush_accessibility_hide_content"; document.getElementById("freebrush_accessibility_plugin_icon_link").onclick = function () { freebrush_accessibility_plugin_open_menu(); return false; }; } function freebrush_accessibility_plugin_close_menu_handler(e) { if(e.keyCode === 13){ freebrush_accessibility_plugin_close_menu(); } return false; } //===================================================== function freebrush_accessibility_icon_action_load_keypress_gray(e) { if(e.keyCode === 13){ freebrush_accessibility_icon_action_load_gray(); } return false; } function freebrush_accessibility_icon_action_load_gray() { var css_file = "/freebrush_accessibility/css/gray/?s=stranacoilbab546a"; freebrush_accessibility_plugin_load_CSS(css_file,"freebrush_accessibility_css_file_gray"); document.getElementById("freebrush_accessibility_icon_action_img_gray").src = "https://ac.freebrush.net/freebrush_accessibility/images/cancel.png?"+Date.now(); document.getElementById("freebrush_accessibility_icon_action_div_gray").className = ""; document.getElementById("freebrush_accessibility_icon_action_div_gray").className = "freebrush_accessibility_icon_topic_selected"; document.getElementById("freebrush_accessibility_icon_action_gray").onclick = function () { freebrush_accessibility_icon_action_unload_gray(); return false; }; document.getElementById("freebrush_accessibility_icon_action_gray").onkeypress = function () { freebrush_accessibility_icon_action_unload_keypress_gray(event); return false; }; //unload other accessibility filters freebrush_accessibility_icon_action_unload_contrast(); freebrush_accessibility_icon_action_unload_black(); freebrush_accessibility_icon_action_unload_white(); //close then accessibility menu //setTimeout( function(){ // freebrush_accessibility_plugin_close_menu(); //}, 2000); //set cookie freebrush_accessibility_plugin_set_cookie("freebrush_accessibility_plugin_filter", "gray"); } function freebrush_accessibility_icon_action_unload_keypress_gray(e) { if(e.keyCode === 13){ freebrush_accessibility_icon_action_unload_gray(); } return false; } function freebrush_accessibility_icon_action_unload_gray() { var css_file = "/freebrush_accessibility/css/gray/?s=stranacoilbab546a"; freebrush_accessibility_plugin_unload_CSS(css_file,"css"); document.getElementById("freebrush_accessibility_icon_action_img_gray").src = "https://ac.freebrush.net/freebrush_accessibility/images/gray.png?"+Date.now(); document.getElementById("freebrush_accessibility_icon_action_div_gray").className = ""; document.getElementById("freebrush_accessibility_icon_action_div_gray").className = "freebrush_accessibility_icon_topic"; document.getElementById("freebrush_accessibility_icon_action_gray").onclick = function () { freebrush_accessibility_icon_action_load_gray(); return false; }; document.getElementById("freebrush_accessibility_icon_action_gray").onkeypress = function () { freebrush_accessibility_icon_action_load_keypress_gray(event); return false; }; //delete cookie freebrush_accessibility_plugin_delete_cookie("freebrush_accessibility_plugin_filter"); } function freebrush_accessibility_icon_action_load_keypress_contrast(e) { if(e.keyCode === 13){ freebrush_accessibility_icon_action_load_contrast(); } return false; } function freebrush_accessibility_icon_action_load_contrast() { var css_file = "/freebrush_accessibility/css/contrast/?s=stranacoilbab546a"; freebrush_accessibility_plugin_load_CSS(css_file,"freebrush_accessibility_css_file_contrast"); document.getElementById("freebrush_accessibility_icon_action_img_contrast").src = "https://ac.freebrush.net/freebrush_accessibility/images/cancel.png?"+Date.now(); document.getElementById("freebrush_accessibility_icon_action_div_contrast").className = ""; document.getElementById("freebrush_accessibility_icon_action_div_contrast").className = "freebrush_accessibility_icon_topic_selected"; document.getElementById("freebrush_accessibility_icon_action_contrast").onclick = function () { freebrush_accessibility_icon_action_unload_contrast(); return false; }; document.getElementById("freebrush_accessibility_icon_action_contrast").onkeypress = function () { freebrush_accessibility_icon_action_unload_keypress_contrast(event); return false; }; //unload other accessibility filters freebrush_accessibility_icon_action_unload_gray(); freebrush_accessibility_icon_action_unload_black(); freebrush_accessibility_icon_action_unload_white(); //close then accessibility menu //setTimeout( function(){ // freebrush_accessibility_plugin_close_menu(); //}, 2000); //set cookie freebrush_accessibility_plugin_set_cookie("freebrush_accessibility_plugin_filter", "contrast"); } function freebrush_accessibility_icon_action_unload_keypress_contrast(e) { if(e.keyCode === 13){ freebrush_accessibility_icon_action_unload_contrast(); } return false; } function freebrush_accessibility_icon_action_unload_contrast() { var css_file = "/freebrush_accessibility/css/contrast/?s=stranacoilbab546a"; freebrush_accessibility_plugin_unload_CSS(css_file,"css"); document.getElementById("freebrush_accessibility_icon_action_img_contrast").src = "https://ac.freebrush.net/freebrush_accessibility/images/contrast.png?"+Date.now(); document.getElementById("freebrush_accessibility_icon_action_div_contrast").className = ""; document.getElementById("freebrush_accessibility_icon_action_div_contrast").className = "freebrush_accessibility_icon_topic"; document.getElementById("freebrush_accessibility_icon_action_contrast").onclick = function () { freebrush_accessibility_icon_action_load_contrast(); return false; }; document.getElementById("freebrush_accessibility_icon_action_contrast").onkeypress = function () { freebrush_accessibility_icon_action_load_keypress_contrast(event); return false; }; //delete cookie freebrush_accessibility_plugin_delete_cookie("freebrush_accessibility_plugin_filter"); } function freebrush_accessibility_icon_action_load_keypress_black(e) { if(e.keyCode === 13){ freebrush_accessibility_icon_action_load_black(); } return false; } function freebrush_accessibility_icon_action_load_black() { var css_file = "/freebrush_accessibility/css/black/?s=stranacoilbab546a"; freebrush_accessibility_plugin_load_CSS(css_file,"freebrush_accessibility_css_file_black"); document.getElementById("freebrush_accessibility_icon_action_img_black").src = "https://ac.freebrush.net/freebrush_accessibility/images/cancel.png?"+Date.now(); document.getElementById("freebrush_accessibility_icon_action_div_black").className = ""; document.getElementById("freebrush_accessibility_icon_action_div_black").className = "freebrush_accessibility_icon_topic_selected"; document.getElementById("freebrush_accessibility_icon_action_black").onclick = function () { freebrush_accessibility_icon_action_unload_black(); return false; }; document.getElementById("freebrush_accessibility_icon_action_black").onkeypress = function () { freebrush_accessibility_icon_action_unload_keypress_black(event); return false; }; //unload other accessibility filters freebrush_accessibility_icon_action_unload_gray(); freebrush_accessibility_icon_action_unload_contrast(); freebrush_accessibility_icon_action_unload_white(); //close then accessibility menu //setTimeout( function(){ // freebrush_accessibility_plugin_close_menu(); //}, 2000); //set cookie freebrush_accessibility_plugin_set_cookie("freebrush_accessibility_plugin_filter", "black"); } function freebrush_accessibility_icon_action_unload_keypress_black(e) { if(e.keyCode === 13){ freebrush_accessibility_icon_action_unload_black(); } return false; } function freebrush_accessibility_icon_action_unload_black() { var css_file = "/freebrush_accessibility/css/black/?s=stranacoilbab546a"; freebrush_accessibility_plugin_unload_CSS(css_file,"css"); document.getElementById("freebrush_accessibility_icon_action_img_black").src = "https://ac.freebrush.net/freebrush_accessibility/images/black.png?"+Date.now(); document.getElementById("freebrush_accessibility_icon_action_div_black").className = ""; document.getElementById("freebrush_accessibility_icon_action_div_black").className = "freebrush_accessibility_icon_topic"; document.getElementById("freebrush_accessibility_icon_action_black").onclick = function () { freebrush_accessibility_icon_action_load_black(); return false; }; document.getElementById("freebrush_accessibility_icon_action_black").onkeypress = function () { freebrush_accessibility_icon_action_load_keypress_black(event); return false; }; //delete cookie freebrush_accessibility_plugin_delete_cookie("freebrush_accessibility_plugin_filter"); } function freebrush_accessibility_icon_action_load_keypress_white(e) { if(e.keyCode === 13){ freebrush_accessibility_icon_action_load_white(); } return false; } function freebrush_accessibility_icon_action_load_white() { var css_file = "/freebrush_accessibility/css/white/?s=stranacoilbab546a"; freebrush_accessibility_plugin_load_CSS(css_file,"freebrush_accessibility_css_file_white"); document.getElementById("freebrush_accessibility_icon_action_img_white").src = "https://ac.freebrush.net/freebrush_accessibility/images/cancel.png?"+Date.now(); document.getElementById("freebrush_accessibility_icon_action_div_white").className = ""; document.getElementById("freebrush_accessibility_icon_action_div_white").className = "freebrush_accessibility_icon_topic_selected"; document.getElementById("freebrush_accessibility_icon_action_white").onclick = function () { freebrush_accessibility_icon_action_unload_white(); return false; }; document.getElementById("freebrush_accessibility_icon_action_white").onkeypress = function () { freebrush_accessibility_icon_action_unload_keypress_white(event); return false; }; //unload other accessibility filters freebrush_accessibility_icon_action_unload_gray(); freebrush_accessibility_icon_action_unload_contrast(); freebrush_accessibility_icon_action_unload_black(); //close then accessibility menu //setTimeout( function(){ // freebrush_accessibility_plugin_close_menu(); //}, 2000); //set cookie freebrush_accessibility_plugin_set_cookie("freebrush_accessibility_plugin_filter", "white"); } function freebrush_accessibility_icon_action_unload_keypress_white(e) { if(e.keyCode === 13){ freebrush_accessibility_icon_action_unload_white(); } return false; } function freebrush_accessibility_icon_action_unload_white() { var css_file = "/freebrush_accessibility/css/white/?s=stranacoilbab546a"; freebrush_accessibility_plugin_unload_CSS(css_file,"css"); document.getElementById("freebrush_accessibility_icon_action_img_white").src = "https://ac.freebrush.net/freebrush_accessibility/images/white.png?"+Date.now(); document.getElementById("freebrush_accessibility_icon_action_div_white").className = ""; document.getElementById("freebrush_accessibility_icon_action_div_white").className = "freebrush_accessibility_icon_topic"; document.getElementById("freebrush_accessibility_icon_action_white").onclick = function () { freebrush_accessibility_icon_action_load_white(); return false; }; document.getElementById("freebrush_accessibility_icon_action_white").onkeypress = function () { freebrush_accessibility_icon_action_load_keypress_white(event); return false; }; //delete cookie freebrush_accessibility_plugin_delete_cookie("freebrush_accessibility_plugin_filter"); } function freebrush_accessibility_icon_action_load_keypress_font(e) { if(e.keyCode === 13){ freebrush_accessibility_icon_action_load_font(); } return false; } function freebrush_accessibility_icon_action_load_font() { var css_file = "/freebrush_accessibility/css/font/?s=stranacoilbab546a"; freebrush_accessibility_plugin_load_CSS(css_file,"freebrush_accessibility_css_file_font"); document.getElementById("freebrush_accessibility_icon_action_img_font").src = "https://ac.freebrush.net/freebrush_accessibility/images/cancel.png?"+Date.now(); document.getElementById("freebrush_accessibility_icon_action_div_font").className = ""; document.getElementById("freebrush_accessibility_icon_action_div_font").className = "freebrush_accessibility_icon_topic_selected"; document.getElementById("freebrush_accessibility_icon_action_font").onclick = function () { freebrush_accessibility_icon_action_unload_font(); return false; }; document.getElementById("freebrush_accessibility_icon_action_font").onkeypress = function () { freebrush_accessibility_icon_action_unload_keypress_font(event); return false; }; //close then accessibility menu //setTimeout( function(){ // freebrush_accessibility_plugin_close_menu(); //}, 2000); //set cookie freebrush_accessibility_plugin_set_cookie("freebrush_accessibility_plugin_font", "1"); } function freebrush_accessibility_icon_action_unload_keypress_font(e) { if(e.keyCode === 13){ freebrush_accessibility_icon_action_unload_font(); } return false; } function freebrush_accessibility_icon_action_unload_font() { var css_file = "/freebrush_accessibility/css/font/?s=stranacoilbab546a"; freebrush_accessibility_plugin_unload_CSS(css_file,"css"); document.getElementById("freebrush_accessibility_icon_action_img_font").src = "https://ac.freebrush.net/freebrush_accessibility/images/font.png?"+Date.now(); document.getElementById("freebrush_accessibility_icon_action_div_font").className = ""; document.getElementById("freebrush_accessibility_icon_action_div_font").className = "freebrush_accessibility_icon_topic"; document.getElementById("freebrush_accessibility_icon_action_font").onclick = function () { freebrush_accessibility_icon_action_load_font(); return false; }; document.getElementById("freebrush_accessibility_icon_action_font").onkeypress = function () { freebrush_accessibility_icon_action_load_keypress_font(event); return false; }; //delete cookie freebrush_accessibility_plugin_delete_cookie("freebrush_accessibility_plugin_font"); } function freebrush_accessibility_icon_action_load_keypress_anime(e) { if(e.keyCode === 13){ freebrush_accessibility_icon_action_load_anime(); } return false; } function freebrush_accessibility_icon_action_load_anime() { var css_file = "/freebrush_accessibility/css/anime/?s=stranacoilbab546a"; freebrush_accessibility_plugin_load_CSS(css_file,"freebrush_accessibility_css_file_anime"); document.getElementById("freebrush_accessibility_icon_action_img_anime").src = "https://ac.freebrush.net/freebrush_accessibility/images/cancel.png?"+Date.now(); document.getElementById("freebrush_accessibility_icon_action_div_anime").className = ""; document.getElementById("freebrush_accessibility_icon_action_div_anime").className = "freebrush_accessibility_icon_topic_selected"; document.getElementById("freebrush_accessibility_icon_action_anime").onclick = function () { freebrush_accessibility_icon_action_unload_anime(); return false; }; document.getElementById("freebrush_accessibility_icon_action_anime").onkeypress = function () { freebrush_accessibility_icon_action_unload_keypress_anime(event); return false; }; //some code=================== var id = window.setTimeout(function() {}, 0); while (id--) { window.clearTimeout(id); // will do nothing if no timeout with id is present } //============================ //close then accessibility menu //setTimeout( function(){ // freebrush_accessibility_plugin_close_menu(); //}, 2000); //set cookie freebrush_accessibility_plugin_set_cookie("freebrush_accessibility_plugin_anime", "1"); } function freebrush_accessibility_icon_action_unload_keypress_anime(e) { if(e.keyCode === 13){ freebrush_accessibility_icon_action_unload_anime(); } return false; } function freebrush_accessibility_icon_action_unload_anime() { var css_file = "/freebrush_accessibility/css/anime/?s=stranacoilbab546a"; freebrush_accessibility_plugin_unload_CSS(css_file,"css"); document.getElementById("freebrush_accessibility_icon_action_img_anime").src = "https://ac.freebrush.net/freebrush_accessibility/images/anime.png?"+Date.now(); document.getElementById("freebrush_accessibility_icon_action_div_anime").className = ""; document.getElementById("freebrush_accessibility_icon_action_div_anime").className = "freebrush_accessibility_icon_topic"; document.getElementById("freebrush_accessibility_icon_action_anime").onclick = function () { freebrush_accessibility_icon_action_load_anime(); return false; }; document.getElementById("freebrush_accessibility_icon_action_anime").onkeypress = function () { freebrush_accessibility_icon_action_load_keypress_anime(event); return false; }; //window.location.reload(); //delete cookie freebrush_accessibility_plugin_delete_cookie("freebrush_accessibility_plugin_anime"); } function freebrush_accessibility_icon_action_load_keypress_keyboard(e) { if(e.keyCode === 13){ freebrush_accessibility_icon_action_load_keyboard(); } return false; } function freebrush_accessibility_icon_action_load_keyboard() { //tabinedex & focus to the first a element var y = document.getElementsByTagName("a"); var i; for (i = 0; i < y.length; i++) { y[i].removeAttribute('tabindex'); } for (i = 0; i < y.length; i++) { y[i].setAttribute("tabindex", i+1); } document.getElementsByTagName("a")[0].setAttribute("id", "freebrush_accessibility_first_link"); document.getElementById("freebrush_accessibility_first_link").focus(); var css_file = "/freebrush_accessibility/css/keyboard/?s=stranacoilbab546a"; freebrush_accessibility_plugin_load_CSS(css_file,"freebrush_accessibility_css_file_keyboard"); document.getElementById("freebrush_accessibility_icon_action_img_keyboard").src = "https://ac.freebrush.net/freebrush_accessibility/images/cancel.png?"+Date.now(); document.getElementById("freebrush_accessibility_icon_action_div_keyboard").className = ""; document.getElementById("freebrush_accessibility_icon_action_div_keyboard").className = "freebrush_accessibility_icon_topic_selected"; document.getElementById("freebrush_accessibility_icon_action_keyboard").onclick = function () { freebrush_accessibility_icon_action_unload_keyboard(); return false; }; document.getElementById("freebrush_accessibility_icon_action_keyboard").onkeypress = function () { freebrush_accessibility_icon_action_unload_keypress_keyboard(event); return false; }; //close then accessibility menu //setTimeout( function(){ // freebrush_accessibility_plugin_close_menu(); //}, 2000); //set cookie freebrush_accessibility_plugin_set_cookie("freebrush_accessibility_plugin_keyboard", "1"); } function freebrush_accessibility_icon_action_unload_keypress_keyboard(e) { if(e.keyCode === 13){ freebrush_accessibility_icon_action_unload_keyboard(); } return false; } function freebrush_accessibility_icon_action_unload_keyboard() { var css_file = "/freebrush_accessibility/css/keyboard/?s=stranacoilbab546a"; freebrush_accessibility_plugin_unload_CSS(css_file,"css"); document.getElementById("freebrush_accessibility_icon_action_img_keyboard").src = "https://ac.freebrush.net/freebrush_accessibility/images/keyboard.png?"+Date.now(); document.getElementById("freebrush_accessibility_icon_action_div_keyboard").className = ""; document.getElementById("freebrush_accessibility_icon_action_div_keyboard").className = "freebrush_accessibility_icon_topic"; document.getElementById("freebrush_accessibility_icon_action_keyboard").onclick = function () { freebrush_accessibility_icon_action_load_keyboard(); return false; }; document.getElementById("freebrush_accessibility_icon_action_keyboard").onkeypress = function () { freebrush_accessibility_icon_action_load_keypress_keyboard(event); return false; }; //delete cookie freebrush_accessibility_plugin_delete_cookie("freebrush_accessibility_plugin_keyboard"); } function freebrush_accessibility_global_html_markups() { //change the doctype to HTML5 var newDoctype = document.implementation.createDocumentType('html','',''); document.doctype.parentNode.replaceChild(newDoctype,document.doctype); //the lang attribute document.getElementsByTagName('html')[0].setAttribute('lang','ru'); //function global varibales var i; var y; var tmp; //scan