Take element with two $ is to not conflict with jquery
function $$ (s) {
return document.getElementById (s);
}
function Setblue () {
Write Cookies First
Writecookie ("Iscssstyle", "Css/crm_blue.css", 365, true);
Set up a new CSS file
$$ ("Maincss"). href = "Css/crm_blue.css";
Take the main frames page and reset the CSS file
var childobj = window.parent.document.getElementById ("Managermain"). Contentwindow;
Childobj.document.getElementById ("Maincss"). href = "Css/crm_blue.css";
}
function Setgreen () {
Write Cookies First
Writecookie ("Iscssstyle", "Css/crm.css", 365, true);
Set up a new CSS file
$$ (' Maincss '). href = "Css/crm.css";
Take the main frames page and reset the CSS file
var childobj = window.parent.document.getElementById ("Managermain"). Contentwindow;
Childobj.document.getElementById ("Maincss"). href = "Css/crm.css";
}
function Setgray () {
Write Cookies First
Writecookie ("Iscssstyle", "Css/crm_gray.css", 365, true);
Set up a new CSS file
$$ (' Maincss '). href = "Css/crm_gray.css";
Take the main frames page and reset the CSS file
var childobj = window.parent.document.getElementById ("Managermain"). Contentwindow;
Childobj.document.getElementById ("Maincss"). href = "Css/crm_gray.css";
}
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;
// }
// }
$$ ("Maincss"). attr ("href", "css/crm_blue.css");
$$ (' Maincss '). href = "Css/crm_blue.css";
To set a file for CSS
$$ (' Maincss '). href = title;
}
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;
var cssfile = $$ (' maincss '). href;
alert (cssfile);
return cssfile;
}
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;
var cssfile = $$ (' maincss '). href;
alert (cssfile);
return cssfile;
}
function Createcookie (name, value, days) {
if (days) {
var date = new Date ();
Date.settime (Date.gettime () + (days * 24 * 60 * 60 * 1000));
var expires = "; Expires= "+ date.togmtstring ();
}
Else
expires = "";
Document.cookie = name + "=" + value + Expires + "; path=/";
}
function Writecookie (name, value, hours, ESCP) {
var expire = "";
if (hours!= null) {
expire = new Date (new Date ()). GetTime () + hours * 3600000);
expire = "; Expires= "+ expire.togmtstring ();
}
if (ESCP = = "True") {
Document.cookie = name + "=" + value + expire;
} else {
Document.cookie = name + "=" + Escape (value) + expire;
}
}
function Readcookie (name) {
var Nameeq = name + "=";
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, c.length);
if (C.indexof (nameeq) = = 0)
Return c.substring (Nameeq.length, c.length);
}
return null;
}
$ (document). Ready (function () {
var title = Readcookie ("Iscssstyle");
var title = "Css/crm_blue.css";
if (title!= null && title!= "undefined") {
Setactivestylesheet (title);
//}
});