cookie_name = "favColor"; // Set a global variable called, "cookie_name" and set it to the string "favColor."
var YourColor; // Set a global variable named "YourColor"
function setCookie(){ // Start the function called, "setCookie."
YourColor=document.cookieForm.cookieBox.value; // Set the variable "YourColor" to the value of the cookieBox.
document.cookie=cookie_name+"="+YourColor+"; expires=Monday, 04-Apr-2004 05:00:00 GMT"; // Set the cookie. The name of the cookie is equal to the variable, "cookie_name," the value of it is the value of the variable, "YourColor," and the cookie expires on Monday, the fourth of April in the year 2004 at 5:00 GMT.