/* **   Třídní stránky matematické třídy pana učitele Pařízka**   (http://tridni.jmx.cz)**   **   PREPINAC STYLU**   ******************************************************************************************************* **   FROM A LIST A PART: http://www.alistapart.com/articles/alternate/** ********************************************************************************************************   **   This program is free software; you can redistribute it and/or**   modify it under the terms of the GNU General Public License**   as published by the Free Software Foundation; either version 2**   of the License, or (at your option) any later version.** **   This program is distributed in the hope that it will be useful,**   but WITHOUT ANY WARRANTY; without even the implied warranty of**   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the**   GNU General Public License for more details.** **   You should have received a copy of the GNU General Public License**   along with this program; if not, write to the Free Software**   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.** */function setActiveStyleSheet(title) {  var i, a, main;  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {      a.disabled = true;      if(a.getAttribute("title") == title) a.disabled = false;    }  }}function getActiveStyleSheet() {  var i, a;  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");  }  return null;}function getPreferredStyleSheet() {  var i, a;  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {    if(a.getAttribute("rel").indexOf("style") != -1       && a.getAttribute("rel").indexOf("alt") == -1       && a.getAttribute("title")       ) return a.getAttribute("title");  }  return null;}window.onload = function(e) {  var cookie = readCookie("style");  var title = cookie ? cookie : getPreferredStyleSheet();  setActiveStyleSheet(title);}window.onunload = function(e) {  var title = getActiveStyleSheet();  createCookie("style", title, 365);}var cookie = readCookie("style");var title = cookie ? cookie : getPreferredStyleSheet();setActiveStyleSheet(title);