// JScript source code





if (typeof clickCounter == 'undefined') {var clickCounter = 0;}
if (typeof lastClickSeconds == 'undefined') {var lastClickSeconds = 0;}
if (typeof showValue == 'undefined') {var showValue = 0;}
if (typeof lastControlID == 'undefined') {var lastControlID = "";}


var clickInterval = 1;


function SnapDateClick(event, thiscontrolID, OneText, TwoText, ThreeText, FourText)
{

var myDate = new Date();
var secs=myDate.getSeconds();

clickCounter++;
if (lastClickSeconds == 0)
	{
	lastClickSeconds = secs;
	}
if (lastControlID != thiscontrolID)
    {
    	clickCounter=1;
    	lastControlID = thiscontrolID;
    	showValue = 0;
    }
    

else if ((secs - lastClickSeconds) < clickInterval)   
	{
	
	if (clickCounter == 2 || (clickCounter=1 && showValue > 0))
		{
		clickCounter=0;
		lastClickSeconds = 0;
		showValue++;
		if (showValue > 4)
			{
			showValue = 1;
			}
		if (showValue == 1)
			{
			document.getElementById(thiscontrolID).value = OneText;
			}
		else if (showValue == 2)
			{
			document.getElementById(thiscontrolID).value = TwoText;
			}
		else if (showValue == 3)
			{
			document.getElementById(thiscontrolID).value = ThreeText;
			}
		else if (showValue ==4)
			{
			document.getElementById(thiscontrolID).value = FourText;
			}
	
		}
	}

else
	{
	lastClickSeconds = secs;
	clickCounter=1;
	}
	
}



