function setCookie(name, value){
	//alert("set cookie:" + name+"="+escape(value)); 
	document.cookie = name+"="+escape(value);
}

function getCookie(name) { 
	// use: getCookie("name")
	var bikky = document.cookie;
    var index = bikky.indexOf(name + "=");
    if (index == -1) return "No cookie found";
    index = bikky.indexOf("=", index) + 1; // first character
    var endstr = bikky.indexOf(";", index);
    if (endstr == -1) endstr = bikky.length; // last character
   	// alert("get cookie:" + unescape(bikky.substring(index, endstr)));
    return unescape(bikky.substring(index, endstr));
}

var wl = document.info.wl.value;
var prrfnbr = document.info.prrfnbr.value;
var aucnum = document.info.aucnum.value;
var prsdesc = document.info.prsdesc.value;
var title = document.info.prsdesc.value;

if (title.length >= 50){
prsdesc = title.substring (0, 45) + "..."
}

var NextBid = document.info.NextBid.value;
var bidnum = document.info.bidnum.value;
var yearend = document.info.yearend.value;
var monthend = document.info.monthend.value;
var dayend = document.info.dayend.value;
var hourend = document.info.hourend.value;
var minuteend = document.info.minuteend.value;
var formatTime = document.info.formatTime.value;
var timezone = document.info.timezone.value;
var curbid = document.info.curbid.value;
var autype = document.info.autype.value;
var thumbnail = document.info.prthmb.value;

var itemlayout = wl +"|"+ prrfnbr +"|"+ aucnum +"|"+ prsdesc +"|"+ title +"|"+ autype +"|"+ thumbnail +"|"+ curbid +"|"+ bidnum;
//alert(itemlayout);
var same = "Y"

for (var i=1; i<5; i++){
	itemnumval = getCookieNoWrite("itemnum" + i);
	if (itemnumval == aucnum){
		var same = "Y"
		break;
	}
	else{
	var same = "N"
	}
}

if(same == "N"){
Count();
showCount = getCookieNoWrite("Count");
name = "item" + showCount;
numname = "itemnum" + showCount;
setCookie( numname, aucnum);
setCookie( name, itemlayout);

}

