// JavaScript Document

function popupFILES(url){open(url,"newwindow","scrollbars=yes,toolbar=no,directories=no,menubar=yes,resizable=yes,status=yes,width=550,height=500");

}

function popupQUIZ(url){open(url,"newwindow","scrollbars=yes,toolbar=no,directories=no,menubar=yes,resizable=yes,status=yes,width=800,height=550");

}

//provides a filestamp for each page called in

function filestamp() {

	homePage=new String("index.shtml");

	changeDate = new Date(document.lastModified);

	document.write("<b>Last Updated:</b> ",formatDate(changeDate));

}



function formatDate(theDate) {

	today = new Date();

	oneDay = 24*60*60*1000;

	UTCDiff = today.getTimezoneOffset()*60*1000;

	msToday = today.getMilliseconds() + today.getSeconds()*1000 +

		today.getMinutes()*60*1000 + today.getHours()*60*60*1000 - UTCDiff;


	if (theDate >= (today - msToday)) {

		dateformatted = "Today";

	} else if (theDate >= today - msToday - oneDay) {

		dateformatted = "Yesterday";

	} else {

		thisyear = theDate.getYear();

		while (thisyear >= 100) {

			thisyear -= 100;

		}

		if (thisyear < 10) {

			thisyear = "0" + thisyear;

		}

	

		thismonth = theDate.getMonth();

		thismonth++;

		thisday = theDate.getDate();

		dateformatted=thismonth + "/" + thisday + "/" + thisyear;

	}


	return dateformatted;

}

function submitform()
{
  document.petsmartform.submit();
}
/* hack */

	function getLinkDisplay(url)
	{
		for (i=0; i<document.links.length; i++)
		{
			if(document.links[i] == url)
			{
				if(document.all)
					return (document.links[i].innerText).replace("'","\\'");
				else
					return (document.links[i].text).replace("'","\\'");
				break;
			}
		}	
	}
	function setStatus(obj)
	{
		setWindowStatus(getLinkDisplay(obj.href));
	}	
	function setWindowStatus(str)
	{
		setTimeout("window.status='" + str + "'", 0);
	}	
	function clearStatus()
	{
		window.status = '';
	}
	