$(document).ready(function() { var currFFZoom = parseFloat(US_readCookie('ffzoom')); var currIEZoom = parseFloat(US_readCookie('iezoom')); var currContrast = ""+US_readCookie('currcontrast')+""; var currReadMode = $("body").hasClass("rsactive"); if(!currFFZoom) currFFZoom = 1; if(!currIEZoom) currIEZoom = 100; var checkSetReadmode = function() { if(!currReadMode) { US_createCookie('readmode',1,30); currReadMode = 1; $("body").addClass("rsactive"); $(".readmode-on").each(function() { $(this).hide().remove(); }); addthersbtn(); } else { $("body").removeClass("rsactive"); US_createCookie('readmode',0,30); currReadMode = 0; $(".readmode-on").each(function() { $(this).hide().remove(); }); if(typeof ReadSpeaker != "undefined") { ReadSpeaker.q(function() { if (rspkr.ui.getActivePlayer()) { rspkr.ui.getActivePlayer().close(); } }); $("#rsxp").html(" "); } } } var addthersbtn = function() { $(".addrsbtn").each(function(i,v) { //console.log($(this).attr("id")); if($(this).attr("id")) { var readidclass = $(this).attr("id"); } else { var newreadid = stdrsreadid+i; $(this).attr("id", newreadid); var readidclass = newreadid; } $(this).before('
'); }); if($("body").hasClass("home")) { var i = 0; var readidclass = "hpreadtext"; $("body").prepend(''); } } if(!currReadMode) { $("body").removeClass("rsactive"); US_createCookie('readmode',0,30); currReadMode = 0; $(".readmode-on").each(function() { $(this).hide().remove(); }); if(typeof ReadSpeaker != "undefined") { ReadSpeaker.q(function() { if (rspkr.ui.getActivePlayer()) { rspkr.ui.getActivePlayer().close(); } }); $("#rsxp").html(" "); } } else { US_createCookie('readmode',1,30); $("body").addClass("rsactive"); currReadMode = 1; addthersbtn(); } $("#readmodetoggle").on("click", checkSetReadmode); $("body").on("click", "a.vtb2cbtn", function(e) { e.preventDefault(); readpage($(this).attr("href"), rsxp); return false; }); //console.log(currFFZoom); $(".zoom-three").on("click", function(){ // larger var step; //only firefox sux in this case if ($.browser.mozilla){ step = 0.05; currFFZoom += step; $('html').css('-moz-transform','scale(' + currFFZoom + ')');$('html').width($(window).width() / currFFZoom); $('html').css('transform-origin','0 0'); US_createCookie('ffzoom',currFFZoom,30); } else { step = 5; currIEZoom += step; $('body').css('zoom', ' ' + currIEZoom + '%'); US_createCookie('iezoom',currIEZoom,30); } }); $(".zoom-one").on("click", function(){ // smaller var step; //only firefox sux in this case if ($.browser.mozilla){ step = 0.05; currFFZoom -= step; $('html').css('-moz-transform','scale(' + currFFZoom +')');$('html').width($(window).width() / currFFZoom); $('html').css('transform-origin','0 0'); US_createCookie('ffzoom',currFFZoom,30); } else { step = 5; currIEZoom -= step; $('body').css('zoom', ' ' + currIEZoom + '%'); US_createCookie('iezoom',currIEZoom,30); } }); $(".zoom-two").on("click", function(){ // zero 0 currFFZoom = 1; currIEZoom = 100; //only firefox sux in this case if ($.browser.mozilla){ $('html').css('-moz-transform','scale(1)');$('html').width($(window).width() / currFFZoom); $('html').css('transform-origin','0 0'); US_createCookie('ffzoom',currFFZoom,30); } else { $('body').css('zoom', '100%'); US_createCookie('iezoom',currIEZoom,30); } }); if ($.browser.mozilla){ $('html').css('-moz-transform','scale(' + currFFZoom + ')');$('html').width($(window).width() / currFFZoom); $('html').css('transform-origin','0 0'); } else { $('body').css('zoom', ' ' + currIEZoom + '%'); } if(currContrast.length) { $("body").removeClass("white black standard").addClass(currContrast); } $(".contrast-one").on("click", function() { currContrast = "standard"; $("body").removeClass("white black").addClass(currContrast); US_createCookie('currcontrast',currContrast,30); }); $(".contrast-two").on("click", function() { currContrast = "white"; $("body").removeClass("white black standard").addClass(currContrast); US_createCookie('currcontrast',currContrast,30); }); $(".contrast-three").on("click", function() { currContrast = "black"; $("body").removeClass("white black standard").addClass(currContrast); US_createCookie('currcontrast',currContrast,30); }); $("#contacttoggle div.ctitem").on("click", function() { $("#contacttoggle div.ctitem").removeClass("active"); $(this).addClass("active"); }); });