// Calculate the difference (Only whole numbers!!), if any, and return with a formatted number 
function distance(dist,offset) 
{
	var totDist
	var newDist=""
	var neg=""
	totDist=Math.floor(dist-offset)
	if(totDist<0)
	{
		neg="-"				// we'll add this back at the return statement
		totDist=totDist*-1		// Positive #'s are much easier!!
	}
	totDist=totDist + ""			// convert to string so length functions work
	for (var i=0; i<totDist.length; i++)	
	{
		pos = totDist.length-i-1
		if(totDist.length>3&&newDist!=""&&Math.floor((i/3))==(i/3))
		{
			newDist=totDist.substr(pos,1)+","+newDist
		}
		else
		{
			newDist=totDist.substr(pos,1)+newDist
		}
	}
	return neg+newDist
}

