<!--
// Bottle Counter for Marglen Industries' Website
// Version 2
// Copyright Winston Astrachan 2011
// www.wiacore.com | marglen.us

self.setInterval("updateBottleCounter()", 160);

function updateBottleCounter()
{
	var multiplier = 0;
	var bottleCount = 0;
	var bottlesPerMilli = .083;
	var date = new Date();
	
	multiplier = (date.getMonth() * 2629743.83);
	multiplier = multiplier + (date.getDate() * 86400);
	multiplier = multiplier + (date.getHours() * 3600);
	multiplier = multiplier + (date.getMinutes() * 600);
	multiplier = (multiplier * 1000) + date.getMilliseconds();
	
	bottleCount = Math.round(multiplier * bottlesPerMilli);
	
	var outputString = null;
	if(bottleCount < 10)
	{
		outputString = "000000000" + bottleCount;
	}
	else if(bottleCount < 100)
	{
		outputString = "00000000" + bottleCount;
	}
	else if(bottleCount < 1000)
	{
		outputString = "0000000" + bottleCount;
	}
	else if(bottleCount < 10000)
	{
		outputString = "000000" + bottleCount;
	}
	else if(bottleCount < 100000)
	{
		outputString = "00000" + bottleCount;
	}
	else if(bottleCount < 1000000)
	{
		outputString = "0000" + bottleCount;
	}
	else if(bottleCount < 10000000)
	{
		outputString = "000" + bottleCount;
	}
	else if(bottleCount < 100000000)
	{
		outputString = "00" + bottleCount;
	}
	else if(bottleCount < 1000000000)
	{
		outputString = "0" + bottleCount;
	}
	else
	{
		outputString = bottleCount;
	}
	
	document.getElementById('bottleCounter').innerHTML=outputString;
	return true;
}
-->
