<!--
//Hide script from old browers
function getCookies()  {
/*
PURPOSE: Collect all the cookies from this server and put them together into one super object. The super object will have one property for each cookie and each of those properties will be another object housing the individual keys and values.
USAGE: highestLevelObject = getCookies();
*/
//check for existing cookies. If there are none, spit out a message.
if (document.cookie != "")  {
var allOfCookie = document.cookie;
var returnableObject = new Object();
var listOfCookies = allOfCookie.split("; ");
//Creates an object for each cookie
for (var i in listOfCookies)  {
var cookieName = listOfCookies[i].split("=")[0];
//Checks for special cookie cases this function can't handle
var checkResults = cookieName.search(/^consq/i);
if(checkResults>0)  {
continue;
}
var checkResults = cookieName.search(/^TABLE/);
if(checkResults>0)  {
continue;
}
var restOfCookie = listOfCookies[i].split("=")[1];
returnableObject[cookieName] = new Object();
var cookieArray = restOfCookie.split("|");
//Puts the keys and values into the lower level object
for (var j in cookieArray)  {
var cookieParts = cookieArray[j].split("^");
var cookieKey = cookieParts[0];
var cookieValue = cookieParts[1];
returnableObject[cookieName][cookieKey] = cookieValue;
}
}
return returnableObject;
}
else  {
return false;
}
}
function writeCookie(objName, obj)  {
/*
!!!!!!!!!!!!
DO NOT USE THESE NAMES FOR objName:
/^consq.(one or more)/
/^table.(one or more)/
!!!!!!!!!!!!
PURPOSE: Given an object with properties, this function will write them into a cookie
USAGE: writeCookie(nameOfCookie, Object)  Both fields can not contain following special characters
"|", "^", ";", or "="
The data type of "nameOfCookie" is a string. the data type of "Object" is an object.
The cookie will be named nameOfCookie. The property names and values will be written into the cookie. Only enumerated properties will be included. In other words the properties must be user defined and not implied. Avoid including methods. I have not tested what occurs when methods are present, but it is possible that methods of the object might screw this function up.
RESULTING COOKIE: nameOfCookie=prop1^value1|prop2^value2|prop3^value3
*/
//Sets the expiration date of the cookie to 1 year later.
var expireDate = new Date();
expireDate.setFullYear(expireDate.getFullYear()+1);
//The following if conditions checks to make sure the arguments are the correct type
if (typeof(obj) == "object")  {
if (typeof(objName) == "string")  {
//cookieString will be the string inputed into the cookie. Everything will be added onto this.
var cookieString = "";
//firstTime is to avoid a ^ in nameOfCookie=^...
var firstTime = 1;
cookieString += objName + "=";
for (var j in obj)  {
if (firstTime == 1)  {
cookieString += j + "^" + obj[j];
firstTime = 0;
}
else   {
cookieString += "|" + j + "^" + obj[j];
}
}
document.cookie = cookieString + ";expires="+expireDate.toGMTString();
}
else  {
//Remove comment to ensure the name of the cookie is a string. THIS WILL DISPLAY!
//      alert("The name of the cookie must be a string");
}
}
else  {
//Remove comment to ensure an object for the cookie data was passed. THIS WILL DISPLAY!
//    alert("You did not pass an object to this function. You must pass an object");
}
}
//End hiding script from old browsers -->
