<!--

function initArray() {

this.length = initArray.arguments.length;
  for (var i = 0; i < this.length; i++) {
  this[i] = initArray.arguments[i];
  }
}

var CookieKart;
var name = "";
var address1 = "";
var address2 = "";
var city = "";
var stateIdx = "";
var state = "";
var zipcode = "";
var countryIdx = "";
var country = "";
var daytime_phone = "";
var evening_phone = "";
var call_time = "";
var email = "";
var ship_name = "";
var ship_address1 = "";
var ship_address2 = "";
var ship_city = "";
var ship_stateIdx = "";
var ship_state = "";
var ship_zipcode = "";
var ship_countryIdx = "";
var ship_country = "";
var ship_daytime_phone = "";
var ship_evening_phone = "";
var ship_call_time = "";
var ship_email = "";

unitQty = new initArray (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);

unitQtyMax = 100;

function loadCookieKart() {
	var now = new Date();
	fixDate(now);
	now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
	var CookieKart = getCookie("CookieKart");
	if (!CookieKart) {
		name = "";
		address1 = "";
		address2 = "";
		city = ""; 
		stateIdx = 0;
		state = ""; 
	    	zipcode = "";
		countryIdx = 0;
		country = "";
		daytime_phone = "";
		evening_phone = "";
		email = "";
		ship_name = "";
		ship_address1 = "";
		ship_address2 = "";
		ship_city = ""; 
		ship_stateIdx = 0;
		ship_state = ""; 
	    	ship_zipcode = "";
		ship_countryIdx = 0;
		ship_country = "";
		ship_daytime_phone = "";
		ship_evening_phone = "";
		ship_email = ""; 	 
		clearQty();
	} else {
	 	b = CookieKart.split('|');
		name = b[0];
		address1 = b[1];
		address2 = b[2];
		city = b[3]; 
		stateIdx = b[4];
		state = b[5]; 
	    	zipcode = b[6];
		countryIdx = b[7];
		country = b[8];
		daytime_phone = b[9];
		evening_phone = b[10];
		call_time = b[11]
		email = b[12]; 
		ship_name = b[13];
		ship_address1 = b[14];
		ship_address2 = b[15];
		ship_city = b[16]; 
		ship_stateIdx = b[17];
		ship_state = b[18];
	    	ship_zipcode = b[19];
		ship_countryIdx = b[20];
		ship_country = b[21];
		ship_daytime_phone = b[22];
		ship_evening_phone = b[23];
		ship_call_time = b[24]
		ship_email = b[25]; 
		loadQty(26);
	}
}

function saveCookieKart() {
  	var now = new Date();
  	fixDate(now);
  	now.setTime(now.getTime() + 1 * 48 * 60 * 60 * 1000);
	workQty = "";
	stringQty();
	CookieKart = (name + "|" +
	              address1 + "|" +
	              address2 + "|" +
	              city + "|" + 
	              stateIdx + "|" + 
	              state + "|" +
	              zipcode + "|" +
		      countryIdx + "|" +
		      country + "|" +
	              daytime_phone + "|" +
	              evening_phone + "|" +
	              call_time + "|" +
	              email + "|" +
		      ship_name + "|" +
	              ship_address1 + "|" +
	              ship_address2 + "|" +
	              ship_city + "|" + 
	              ship_stateIdx + "|" + 
	              ship_state + "|" +
	              ship_zipcode + "|" +
		      ship_countryIdx + "|" +
		      ship_country + "|" +
	              ship_daytime_phone + "|" +
	              ship_evening_phone + "|" +
	              ship_call_time + "|" +
	              ship_email + "|" +  
		      workQty);
  	setCookie("CookieKart", CookieKart, now);

}

function deleteCookieKart() {

	name = "";
	address1 = "";
	address2 = "";
	city = ""; 
	stateIdx = 0; 
	state = "";
	zipcode = "";
	countryIdx = 0;
	country = "";
	daytime_phone = "";
	evening_phone = "";
	call_time = "";
	email = "";
	ship_name = "";
	ship_address1 = "";
	ship_address2 = "";
	ship_city = ""; 
	ship_stateIdx = 0; 
	ship_state = "";
	ship_zipcode = "";
	ship_countryIdx = 0;
	ship_country = "";
	ship_daytime_phone = "";
	ship_evening_phone = "";
	ship_call_time = "";
	ship_email = "";  
	clearQty();
	deleteCookie("CookieKart");
}

function clearQty() {

	for (var i = 0; i < unitQtyMax; i++) {
		unitQty[i] = 0;
	}
}

function loadQty(j) {
	
	for (var i = 0; i < unitQtyMax; i++) {
		unitQty[i] = b[j];
		j++;
	}
}

function stringQty() {

	for (var i = 0; i < unitQtyMax; i++) {
		workQty = (workQty + unitQty[i] + "|");
	}
}

//-->

