/////////////////////////////////////////////////////////////////////////////////////////////////////////
// CookieObject.js
//   Usage: Contains functions for geting, setting, the users cookie folder for information 
//          pertaining to their video player settings.
/////////////////////////////////////////////////////////////////////////////////////////////////////////

//Cookie object constructor
function cookieObject() {
	//methods
	this.setCookie = setCookie; // pass name and value of cookie
	this.getCookie = getCookie; // pass name of cookie you  want the value to 
}

	// function returns the value of the named cookie
	// pass this function the name of the cookie you want the value to
function getCookie(name){
	var c = document.cookie;
		if (c.indexOf(name)==-1) {
			 return null;
		} else {
			var start = c.indexOf(name)+name.length+1;
			for (var end = start; end < c.length; end++) if (c.charAt(end)==";") break;
		    return unescape(c.substring(start,end));
	}
}		   

	//calls to this function require a name, value pair for each cookie to be stored
	//the exp. date is hard coded to be 2 years from now.
function setCookie(name, value) {
	var exp = new Date();
	var twoYears = exp.getTime() + (730 * 24 * 60 * 60 * 1000);
	exp.setTime(twoYears);
	document.cookie = name + "=" + escape(value) + "; expires=" + exp.toGMTString() + "; path=/;";
}
