<!doctype HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title>js traverse all link style on the page and add CSS code </title>
<script language= "Web Effects" type= "Text/javascript" >
function Getallsheets () {
if (!window.scriptengine && navigator.__ice_version) {
return document.stylesheets;
}
if (document.getelementsbytagname) {
var lt = document.getelementsbytagname (' link '), st = document.getElementsByTagName (' style ');
else if (document.stylesheets && document.all) {
var lt = document.all.tags (' link '), st = document.all.tags (' style ');
} else {
return [];
}
for (var x = 0, os = []; lt[x]; x + +) {
var rel = Lt[x].rel? Lt[x].rel:lt[x].getattribute? Lt[x].getattribute (' rel '): ';
if (typeof (rel) = = ' String ' && rel.tolowercase (). indexof (' style ') + 1) {
Os[os.length] = lt[x];
}
}
for (var x = 0; st[x]; x + +) {
Os[os.length] = st[x];
}
return OS;
}
function Changestyle () {
for (var x = 0, ss = Getallsheets (); ss[x]; x + +) {
for (var y = 0; y < arguments.length; y++) {
if (Ss[x].title = = Arguments[y]) {
if (ss[x].disabled = = False) {
Ss[x].disabled = true;
} else {
ss[x].disabled = false;
}
}
}
}
}
for (var x = 0, ss = Getallsheets (); ss[x]; x + +) {
if (Ss[x].title = = ' print ') {
Ss[x].disabled = true;
}
}
</script>
<body>
</body>