src.dualinventive.com/mtinfo/dist/webroot/rc-4.05/html/javascript/styleswitcher.js

1 line
832 B
JavaScript

function setActiveStyleSheet(title) {
var i,a;
for(i=0; (i < document.getElementsByTagName("link").length); i++) {
try {
a = document.getElementsByTagName("link")[i];
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
a.disabled = true;
if(a.getAttribute("title") == title) a.disabled = false;
}
}
catch(ex) {
// Silent exception
}
}
}
function getActiveStyleSheet() {
var i,a;
for(i=0; (i < document.getElementsByTagName("link").length); i++) {
try {
a = document.getElementsByTagName("link")[i];
if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) {
return a.getAttribute("title");
}
}
catch(ex) {
// Silent exception
}
}
}