// create expiration date for 30 daysvar thirtydays = new Date();var expDate = thirtydays.getTime() + (60 * 60 * 24 * 30 * 1000);thirtydays.setTime(expDate);// pop-up window functionself.window.name = "mainWin";function popWin(page)  {	window.open(page, "confWin", "width=300,height=200,status=no,resizable=no");}//get the value of the specified cookie (name)function readCookie(name) {    var start = document.cookie.indexOf(name+"=");    var len = start+name.length+1;    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;    if (start == -1) return null;    var end = document.cookie.indexOf(";",len);    if (end == -1) end = document.cookie.length;  //begin modification    var string_value = unescape(document.cookie.substring(len,end));	var numeric_value = parseInt(string_value);	return numeric_value; }// if cookie exists, append to it// if cookie does not exist, create itfunction addToCart(videoNum) {	var doExist = readCookie(videoNum); // read the cookie's value & if it exists	if(doExist == null) {		if(videoNum == "vid1") 			document.cookie = "vid1=1; expires=" + thirtydays.toGMTString();				if(videoNum == "vid2") 			document.cookie = "vid2=1; expires=" + thirtydays.toGMTString();				if(videoNum == "vid3") 			document.cookie = "vid3=1; expires=" + thirtydays.toGMTString();				if(videoNum == "vid4") 			document.cookie = "vid4=1; expires=" + thirtydays.toGMTString();	}	else {		var oneMore = doExist + 1;  // add one more to the quantity		if(videoNum == "vid1") 			document.cookie = "vid1=" + oneMore + "; expires=" + thirtydays.toGMTString();		if(videoNum == "vid2") 			document.cookie = "vid2=" + oneMore + "; expires=" + thirtydays.toGMTString();		if(videoNum == "vid3") 			document.cookie = "vid3=" + oneMore + "; expires=" + thirtydays.toGMTString();		if(videoNum == "vid4") 			document.cookie = "vid4=" + oneMore + "; expires=" + thirtydays.toGMTString();	}	// launch pop-up html window with confirmation screen, option to go to cart screen	popWin('item_add.html');}		