
var curProd = 1;
var timeoutID = 0;
function rotateProduct()
{		
	if (curProd == 1)
	{
		divLayer = 'product1';
		fadeLayer = 'product2';
		curProd = 2;
	}
	else
	{
		divLayer = 'product2';
		fadeLayer = 'product1';
		curProd = 1;
	}
	$(fadeLayer).style.display = 'none';
	new Effect.Appear(divLayer);
	var params = 'a=rotate';
	var myAjax = new Ajax.Updater(fadeLayer, 'http://www.savvycircle.com/web/home/view/product.php',
		{parameters: params, asynchronous: true});
	timeoutID = setTimeout("rotateProduct()",5000);
}

function showFirst()
{
	var params = 'a=rotate';
	var myAjax = new Ajax.Updater('product1', 'http://www.savvycircle.com/web/home/view/product.php',
		{parameters: params, asynchronous: true});
}

function restartTimeout()
{
	timeoutID = setTimeout("rotateProduct()",5000);
}
function showMarketing()
{
	var showMarketing = getCookie('sc_marketing');
	if (showMarketing != '0')
	{	
		marketingPO = new Popover();
		marketingPO.setTitle('Introducing Savvy Circle');
		var marketingMessage = 'Ever wish you could get notified as soon as your favorite products go on sale? We do!'
		marketingMessage += 'Reel-Style is excited to introduce Savvy Circle. Just click <a href="http://www.savvycircle.com">here</a> to find out how you can join the Savvy Circle.';
		marketingPO.setMessage(marketingMessage);
		marketingPO.addButton('Maybe Later','hidePopover(\'popoverBox\');',{isClose:false});
		marketingPO.showPopover();
		setCookie('sc_marketing', 0);	
	}
}
