// Use two $ elements to avoid conflict with jquery.
Function $ (s ){
Return document. getelementbyid (s );
}
Function setblue (){
// Write cookie first
// Writecookie ("iscssstyle", "CSS/crm_blue.css", 365, true );
// Set a new CSS file
$ ("Maincss"). href = "CSS/crm_blue.css ";
// Retrieve the main frame page and reset the CSS file
// Var childobj = maid parent.doc ument. getelementbyid ("managermain"). contentWindow;
// Childobj.doc ument. getelementbyid ("maincss"). href = "CSS/crm_blue.css ";
}
Function setgreen (){
// Write cookie first
// Writecookie ("iscss style", "CSS/crm.css", 365, true );
// Set a new CSS file
$ ('Maincss '). href = "CSS/crm.css ";
// Retrieve the main frame page and reset the CSS file
// Var childobj = maid parent.doc ument. getelementbyid ("managermain"). contentWindow;
// Childobj.doc ument. getelementbyid ("maincss"). href = "CSS/crm.css ";
}
Function setgray (){
// Write cookie first
// Writecookie ("iscssstyle", "CSS/crm_gray.css", 365, true );
// Set a new CSS file
$ ('Maincss '). href = "CSS/crm_gray.css ";
// Retrieve the main frame page and reset the CSS file
// Var childobj = maid parent.doc ument. getelementbyid ("managermain"). contentWindow;
// Childobj.doc ument. 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 ";
// Set the CSS file
$ ('Maincss '). href = title;
}
Function getactivestylesheet (){
// Var I,;
// 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,;
// 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 * 24x60*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 (). 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 );
//}
});