<title>Your style sheet file</title>
<%
'*******************************************************
'Background to this randomizing script
'*******************************************************
'
'Date: 10 March 2003
'Company: Dynamic Web Solutions, Meath, Ireland
'E-Mail: scripts@dynamic.ie
'Web Site: http://www.dynamic.ie
'
'**************************************************************
'This function generates a random code based on the code length
'specified when calling the function. The random code is
'returned under the variable "randomcode".
'**************************************************************
FUNCTION GetRandomCode(randomcode,codelength,numberofcombinations)

codecharacters = 35

'Array of characters being used for the random code
codearray = Array("a","b","c","d","e","f","g","h","i","j","k","l", _
"m","n","o","p","q","r","s","t","u","v","w","x", _
"y","z","1","2","3","4","5","6","7","8","9")

FOR x = 1 TO codelength
RANDOMIZE

thiscode = (Int(((codecharacters - 1) * Rnd) + 1))

totalcode = totalcode & codearray(thiscode)

IF numberofcombinations = "" THEN numberofcombinations = 1
numberofcombinations = numberofcombinations * codecharacters

NEXT

randomcode = totalcode

END FUNCTION


CALL GetRandomCode(randomcode,9,numberofcombinations)


'Response.Write(randomcode)

%>
<%
' Counts number of items in the Form collection (not necessary)
'Response.Write "Number of items: " & Request.Form.Count & "<br><p>"

' Create instance of FileSystemObject
Set objFSO = Server.CreateObject( "Scripting.FileSystemObject" )

' Create the text file
Set myFile = objFSO.CreateTextFile(Server.MapPath(((randomcode)))&"_"&Month(now())&"_"&Day(now())&"_"&Year(now())&".css")

dim strCssfile
strCssfile = ((((randomcode)))&"_"&Month(now())&"_"&Day(now())&"_"&Year(now())&".css")
'(Server.MapPath("Whatever.css"))
' Write this line to the text file created above
'myFile.WriteLine "This text file was created on " & Date

' Write each Form key and value to the text file created above
'For x = 1 to Request.Form.Count

myFile.WriteLine "body {"& vbNewLine & " scrollbar-3dlight-color : " & Request.Form.Item("a1")&";"& ""
myFile.WriteLine " scrollbar-arrow-color : " & Request.Form.Item("a2")&";" & ""
myFile.WriteLine " scrollbar-base-color : " & Request.Form.Item("a3")&";"& ""
myFile.WriteLine " scrollbar-darkshadow-color :" & Request.Form.Item("a4")&";"& ""
myFile.WriteLine " scrollbar-face-color : " & Request.Form.Item("a5")&";"& ""
myFile.WriteLine " scrollbar-highlight-color : " & Request.Form.Item("a6")&";"& ""
myFile.WriteLine " scrollbar-shadow-color : " & Request.Form.Item("a7")&";"& ""
myFile.WriteLine " scrollbar-track-color : " & Request.Form.Item("a8")&";"& ""
myFile.WriteLine " font-family:Verdana; font-size:10pt; " & vbNewLine & " background-color:" & Request.Form.Item("a9")& vbNewLine &"}" & ""
myFile.WriteLine "a:active { text-decoration:underline; color: "& Request.Form.Item("a10")&"}"& ""
myFile.WriteLine "a:link { text-decoration:underline; color: " & Request.Form.Item("a11")&"}"& ""
myFile.WriteLine "a:visited { text-decoration:none; color: " & Request.Form.Item("a12")&"}"& ""
myFile.WriteLine "a:hover { text-decoration:underline; color: " & Request.Form.Item("a13")&"}"& ""
myFile.WriteLine ".tablemain { border:1px solid " & Request.Form.Item("a14")&";"& " color: " & Request.Form.Item("a15")&"; background-color: "& Request.Form.Item("a16")&" }"& ""
myFile.WriteLine ".tdtitle {background-color:" & Request.Form.Item("a17")& "; border:1px solid " & Request.Form.Item("a18b")& "; color:"& Request.Form.Item("a18")& "}" & ""
myFile.WriteLine ".tddata {background-color:" & Request.Form.Item("a19")&"; color:"& Request.Form.Item("a20")&"}"& ""
myFile.WriteLine ".tdpricehead {background-color:" & Request.Form.Item("a21")&"}"& vbNewLine
'Next

myFile.Close

' Display the text file created above
Set DisplayText = objFSO.OpenTextFile(Server.MapPath(((randomcode)))&"_"&Month(now())&"_"&Day(now())&"_"&Year(now())&".css")
While Not DisplayText.AtEndOfStream
Response.Write(DisplayText.ReadLine) & "<br>"
Wend
response.write "<b><font size=4>Your css file is" & "<a href=" & ((((randomcode)))&"_"&Month(now())&"_"&Day(now())&"_"&Year(now())&".css")&">"& " " & ((((randomcode)))&"_"&Month(now())&"_"&Day(now())&"_"&Year(now())&".css") & "</a></b></font>"
DisplayText.Close

' Close objects
Set DisplayText = Nothing
Set objFSO = Nothing
%>
<br>
Test your CSS file on a webpage now - <b><a href="test.asp?style=<%=strCssfile %>">click here.</a></b><br>
<%

Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder("C:\html\members\accountname\html\aspexamples\stylefun\")

Set fileCollection = folder.Files

For Each file in fileCollection
If file.name<>"index.html" And file.name<>"default.asp" And file.name<>"picker.js" And file.name <>"poststyle.asp" And file.name <>"test.asp" And file.name <>"styleform.asp" And file.name <>"picker.html" Then
ime = Split(file.name,".")
ekstenzija = Right(file.name,3)
%>
<tr onmouseover=DrS(this,'#99ccff') onmouseout=DrS(this,'transparent')>

<td valign="middle">
<p>&nbsp;<font face="Verdana" size="2">Here is a css files:<br><a style="color: #6200C4" href="test.asp?style=<%=file.name%>"><b><%=file.name%></b></a><br>&nbsp;



</td>
</tr><%

End If

Next
%>
</table><br></font></p>