skin Replacement Technology
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>
</Head>
<Body>
<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>
</Body>
</Html>