/* Shows target with given targetId */
function s2ShowTarget(targetId)
{
	if (document.getElementById(targetId))
	{
		s2PendingHide = false;
		document.getElementById(targetId).style.display = 'block';
	}
}	

/* Hides target with given targetId if we have a pending hide */
function s2HideTarget(targetId)
{
	if (document.getElementById(targetId))
	{
		s2PendingHide = true;
		setTimeout("if (s2PendingHide) { document.getElementById('" + targetId + "').style.display = 'none'; s2PendingHide = false; }", 1000);
	}
}

/* Init value for pending hide variable */
var s2PendingHide = false;

/* Register events if we have an help button and a container for the help text */
if (document.getElementById("s2CartFreeShippingHelpButton") && document.getElementById("s2CartFreeShippingHelp"))
{
	addEventHandler(document.getElementById("s2CartFreeShippingHelpButton"), "mouseover", function() { s2ShowTarget('s2CartFreeShippingHelp'); }); 
	addEventHandler(document.getElementById("s2CartFreeShippingHelpButton"), "mouseout", function() { s2HideTarget('s2CartFreeShippingHelp'); }); 
	addEventHandler(document.getElementById("s2CartFreeShippingHelp"), "mouseover", function() { s2ShowTarget('s2CartFreeShippingHelp'); }); 
	addEventHandler(document.getElementById("s2CartFreeShippingHelp"), "mouseout", function() { s2HideTarget('s2CartFreeShippingHelp'); }); 
}

