function showCoupon(day,month,year,code,discount,desc,company,couptype) {
	expire = new Date(year,month - 1,day);
	today = new Date();
	if (today.valueOf() > expire.valueOf() + 86400 * 1000) { return 0; }
	total = "<li><p>";
	total = total + "<a href=\"" + company + "-Discount.php?discount=" + discount + "\" ";
	total = total + "target=\"_blank\" onClick=\"javascript: pageTracker._trackPageview('/outside/CJPets');javascript:copyCode('" + code + "');\">";
	total = total + "<strong>" + code + "</strong></a> - ";
	if (couptype) { total = total + "<strong>" + couptype + " coupon</strong> - "; }
	total = total + desc;
	before = "";
	after = "";
	if ((expire.valueOf() - today.valueOf()) < 5 * 86400 * 1000) {
	before = "<span class=\"expdiscount\">";
	after = "</span>";
	}
	if ((expire.valueOf() - today.valueOf()) < 0) {
		month = 13;	
		day = "today";
	}
	if ((expire.valueOf() - today.valueOf()) > 0 && (expire.valueOf() - today.valueOf()) < 86400 * 1000) {
		month = 13;	
		day = "tomorrow";
	}
	total = total + " " + before + "(expires " + monthName(month - 1) + " " + day + ")" + after + "</p></li>";
	document.write(total);
}
function showDiscount(day,month,year,discount,title,desc,company) {
	expire = new Date(year,month - 1,day);
	today = new Date();
	if (today.valueOf() > expire.valueOf() + 86400 * 1000) { return 0; }
	total = "<li><p>";
	total = total + "<a href=\"" + company + "-Discount.php?discount=" + discount + "\" ";
	total = total + "target=\"_blank\" onClick=\"javascript: pageTracker._trackPageview('/outside/CJPets');\">";
	total = total + "<strong>" + title + "</strong></a> - ";
	total = total + desc;
	before = "";
	after = "";
	if ((expire.valueOf() - today.valueOf()) < 5 * 86400 * 1000) {
		before = "<span class=\"expdiscount\">";
		after = "</span>";
	}
	if ((expire.valueOf() - today.valueOf()) < 0) {
		month = 13;	
		day = "today";
	}
	if ((expire.valueOf() - today.valueOf()) > 0 && (expire.valueOf() - today.valueOf()) < 86400 * 1000) {
		month = 13;	
		day = "tomorrow";
	}
	total = total + " " + before + "(expires " + monthName(month - 1) + " " + day + ")" + after + "</p></li>";
	document.write(total);
}

function monthName(monthnum) {
	var monthy;
	switch (monthnum) {
	case 12:
		return " ";
		break;
	case 0:
		monthy = "January";
		break;
	case 1:
		monthy = "February";
		break;
	case 2:
		monthy = "March";
		break;
	case 3:
		monthy = "April";
		break;
	case 4:
		monthy = "May";
		break;
	case 5:
		monthy = "June";
		break;
	case 6:
		monthy = "July";
		break;
	case 7:
		monthy = "August";
		break;
	case 8:
		monthy = "September";
		break;
	case 9:
		monthy = "October";
		break;
	case 10:
		monthy = "November";
		break;
	case 11:
		monthy = "December";
		break;
	}
	return monthy;
}

function showJBCoupon(day,month,year,code,desc,couptype) {
	expire = new Date(year,month - 1,day);
	today = new Date();
	if (today.valueOf() > expire.valueOf() + 86400 * 1000) { return 0; }
	total = "<li><p>";
	total = total + "<a href=\"JBPet-FoodDiscount.php\" ";
	total = total + "target=\"_blank\" onClick=\"javascript: pageTracker._trackPageview('/outside/CJPets');javascript:copyCode('" + code + "');\">";
	total = total + "<strong>" + code + "</strong></a> - ";
	if (couptype) { total = total + "<strong>" + couptype + " coupon</strong> - "; }
	total = total + desc;
	before = "";
	after = "";
	if ((expire.valueOf() - today.valueOf()) < 5 * 86400 * 1000) {
	before = "<span class=\"expdiscount\">";
	after = "</span>";
	}
	if ((expire.valueOf() - today.valueOf()) < 0) {
		month = 13;	
		day = "today";
	}
	if ((expire.valueOf() - today.valueOf()) > 0 && (expire.valueOf() - today.valueOf()) < 86400 * 1000) {
		month = 13;	
		day = "tomorrow";
	}
	total = total + " " + before + "(expires " + monthName(month - 1) + " " + day + ")" + after + "</p></li>";
	document.write(total);
}