<html>
<head>
<title>Virginia's Native Clothing</title>
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
//make cookie values global variables
var numjingledress = 0;
function readCookie(JingleDressOrdered)
{
cookie_array = document.cookie.split ("; ");
for (x=0; x < cookie_array.length; x++)
{
cookieParts_array = cookie_array[x].split("=");
if (cookieParts_array[0] == "JingleDressOrdered")
{
numjingledress = cookieParts_array[1];
return numjingledress;
}
}
return null;
}
function JingleOrdered(numjingledress)
{
document.write("<FORM NAME='clothing' ACTION='mailto:loretta.stone@sympatico.ca' METHOD='POST' enctype='text/plain' onsubmit='Calculate(this);'>");
document.bgColor = "#87CEEB";
document.write("<SCRIPT LANGUAGE='JAVASCRIPT'>");
document.write("function Calculate()");
document.write("{");
document.write("var cost = 0;");
document.write("alert('You are in the Calculate Function');");
document.write("for (var a=0; a < document.getElementById('jdage' + a).length; a++);");
document.write("{");
document.write("alert('value = ' + document.getElementById('jdage' + a).value);");
document.write("if (document.getElementById('jdage' + a).checked)");
document.write("{");
document.write("if (document.getElementById('jdage' + a).value == 'toddler')");
document.write("{");
document.write("cost = cost + 75.00;");
document.write("alert('The value of cost is: ' + cost)");
document.write("}");
document.write("else if (document.getElementById('jdage' + a).value == 'youth')");
document.write("{");
document.write("cost = cost + 165.00;");
document.write("alert('The value of cost is: ' + cost)");
document.write("}");
document.write("else if (document.getElementById('jdage' + a).value == 'adult')");
document.write("{");
document.write("cost = cost + 300.00;");
document.write("alert('The value of cost is: ' + cost)");
document.write("}");
document.write("}");
document.write("}");
document.write("}");
document.write("</SCRIPT>");
var colour = new Array("aqua", "beige", "black", "light blue", "medium blue", "dark blue", "navy", "dark goldenrod", "light green", "lime green", "medium green", "dark green", "light pink", "pink", "hot pink", "red", "burgundy", "maroon", "mauve", "medium purple", "dark purple", "light salmon", "dark salmon", "orange", "medium yellow", "dark yellow", "white", "fuschia");
var jdcolourValue = new Array("aqua", "beige", "black", "light_blue", "medium_blue", "dark_blue", "navy", "dark_goldenrod", "light_green", "lime_green", "medium_green", "dark_green", "light_pink", "pink", "hot_pink", "red", "burgundy", "maroon", "mauve", "medium_purple", "dark_purple", "light_salmon", "dark_salmon", "orange", "medium_yellow", "dark_yellow", "white", "fuschia");
var variable = new Array("main", "second", "third");
var j = 0;
var l = 0;
var m = 0;
var n = 0;
var o = 0;
var p = 0;
var q = 0;
var r = 0;
while (numjingledress > 0)
{
numjingledress--;
document.write("<H3><B>Jingle Dress</B></H3>");
for (var k = 0; k <= 2; k++)
{
var jdname = "jdname" + j;
var jdclothtype = "jdclothtype" + l;
var jdage;
var jdchest = "jdchest" + n;
var jdwaist = "jdwaist" + o;
var jdhips = "jdhips" + p;
var jdheight = "jdheight" + q;
document.write("Please choose the " + variable[k] + " colour of your jingle dress:");
document.write("<table border=1>");
for (var i = 0; i <= 27; i++)
{
document.write("<TR>");
document.write("<TD>");
document.write("<INPUT TYPE=\"RADIO\" NAME=" + jdname + "VALUE=" + jdcolourValue[i] + ">");
document.write(colour[i]);
document.write("</TD>");
i++;
document.write("<TD>");
document.write("<INPUT TYPE=\"RADIO\" NAME=" + jdname + "VALUE=" + jdcolourValue[i] + ">");
document.write(colour[i]);
document.write("</TD>");
i++;
document.write("<TD>");
document.write("<INPUT TYPE=\"RADIO\" NAME=" + jdname + "VALUE=" + jdcolourValue[i] + ">");
document.write(colour[i]);
document.write("</TD>");
i++;
document.write("<TD>");
document.write("<INPUT TYPE=\"RADIO\" NAME=" + jdname + "VALUE=" + jdcolourValue[i] + ">");
document.write(colour[i]);
document.write("</TD>");
document.write("</TR>");
}
document.write("</TABLE>");
document.write("<BR>");
document.write("Please choose the type of material:");
document.write("<TABLE border=1>");
document.write("<TR>");
document.write("<TD><INPUT TYPE=\"RADIO\" NAME=" + jdclothtype + " VALUE=\"broadcloth\">broadcloth</TD>");
document.write("<TD><INPUT TYPE=\"RADIO\" NAME=" + jdclothtype + " VALUE=\"satin\">satin</TD>");
document.write("<TD><INPUT TYPE=\"RADIO\" NAME=" + jdclothtype + " VALUE=\"sequins\">sequined accents</TD>");
document.write("<TD><INPUT TYPE=\"RADIO\" NAME=" + jdclothtype + " VALUE=\"cotpol\">cotton/polyester blend</TD>");
document.write("</TR>");
document.write("</TABLE>");
document.write("<BR><BR>");
j++;
l++;
}
document.write("Please enter the measurements of the individual this item is for in inches:");
document.write("<TABLE>");
document.write("<TR>");
document.write("<TD>Chest <INPUT NAME=" + jdchest + " TYPE=\"TEXT\" VALUE=\"\" SIZE=3></TD>");
document.write("<TD>Waist <INPUT NAME=" + jdwaist + " TYPE=\"TEXT\" VALUE=\"\" SIZE=3></TD>");
document.write("<TD>Hips <INPUT NAME=" + jdhips + " TYPE=\"TEXT\" VALUE=\"\" SIZE=3></TD>");
document.write("<TD>Height <INPUT NAME=" + jdheight + " TYPE=\"TEXT\" VALUE=\"\" SIZE=4></TD>");
document.write("</TR>");
document.write("</TABLE>");
document.write("<BR>");
document.write("Please indicate the age of the individual the dress is for:");
document.write("<table>"
+ "<TR>"
+ "<TD><INPUT NAME=jdage" + (m) + " ID=jdage" + (r++) + " TYPE=RADIO VALUE=toddler>Toddler</TD>"
+ "<TD><INPUT NAME=jdage" + (m) + " ID=jdage" + (r++) + " TYPE=RADIO VALUE=youth>Youth</TD>"
+ "<TD><INPUT NAME=jdage" + (m) + " ID=jdage" + (r++) + " TYPE=RADIO VALUE=adult>Adult</TD>"
+ "</TR>"
+ "</table>"
);
m++;
n++;
o++;
p++;
q++;
r++;
}
document.write("<center><INPUT TYPE=SUBMIT VALUE='Submit Order'></center>");
document.write("</FORM>");
}
//main function that calls functions to read the cookies and then display order form based on value of cookies
function Main()
{
readCookie();
JingleOrdered(numjingledress);
}
//-->
</SCRIPT>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#87CEEB" LINK="#FF00FF" VLINK="#EE82EE" ALINK="#FF0000" onLoad="Main();">
</html>