<Script language = JavaScript>
<! --
Function setcookie (name, value ){
VaR argv = setcookie. arguments;
VaR argc = setcookie. Arguments. length;
VaR expires = (2 <argc )? Argv [2]: NULL;
VaR Path = (3 <argc )? Argv [3]: NULL;
VaR domain = (4 <argc )? Argv [4]: NULL;
VaR secure = (5 <argc )? Argv [5]: false;
Document. Cookie = Name + "=" + escape (value) + (expires = NULL )? "" :( "; Expires =" + expires. togmtstring () + (Path = NULL )? "" :( "; Path =" + path) + (domain = NULL )? "" :( "; Domain =" + domain) + (secure = true )? "; Secure ":"");
}
Function getcookie (name ){
VaR search = Name + "= ";
VaR returnvalue = "";
If (document. Cookie. length> 0 ){
Offset = Document. Cookie. indexof (Search );
If (offset! =-1 ){
Offset + = search. length;
End = Document. Cookie. indexof (";", offset );
If (END =-1)
End = Document. Cookie. length;
Returnvalue = Unescape (document. Cookie. substring (offset, end ));
}
}
Return returnvalue;
}
VaR thisskin;
Thisskin = getcookie ("nowskin ");
If (thisskin! = "")
Skin. href = thisskin;
Else
Skin. href = "css.css ";
Function changecss (URL ){
If (URL! = ""){
Skin. href = URL;
VaR expdate = new date ();
Expdate. settime (expdate. gettime () + (24*60*60*1000*30 ));
// Expdate = NULL;
// Set the cookie time to one year ..
Setcookie ("nowskin", URL, expdate, "/", null, false );
}
}
// -->
</SCRIPT>
<P> select the drop-down menu below to test the skin replacement effect. </P>
<A href = # onclick = "changecss('css.css ')"> css.css </a>
<A href = # onclick = "changecss('css1.css ')"> css1.css </a>
<A href = # onclick = "changecss('css2.css ')"> css2.css </a>
<A href = # onclick = "changecss('css3.css ')"> css3.css </a>
<Br>
<Select onchange = "changecss (this. Value)">
<Option> select a style sheet file </option>
<Script language = "JavaScript">
VaR CSSS = new array ();
CSSS [0] = "css.css ";
CSSS [1] = "css1.css ";
CSSS [2] = "css2.css ";
CSSS [3] = "css3.css ";
VaR I;
For (I = 0; I <4; I ++)
If (thisskin = CSSS [I])
Document. write ("<option value = \" "+ CSSS [I] +" \ "selected>" + CSSS [I] + "style sheet file </option> ");
Else
Document. Write ("<option value = \" "+ CSSS [I] +" \ ">" + CSSS [I] + "style sheet file </option> ");
</SCRIPT>
</SELECT>