microsite_active = true;

function activateMicrosite()
{
	microsite_active = true;
}

function deactivateMicrosite()
{
	microsite_active = false;
}

function toggleMicrosite()
{
	microsite_active = !microsite_active;
}

function MicrositeWithTimer()
{
	
	if (microsite_active == true)
	{
		
		clearTimeout(timer);
		timer = setTimeout('UpdateMicrosite(gFilmstrip.getSelectedItemId())', 700);
	}
}

function UpdateMicrosite(link_id, loading_element)
{	
	$('microsite_add_form').action = $('microsite_add_form').action + gFilmstrip.getSelectedItemId();
	new Ajax.Updater('update_area',
		'/shuffle/fetch_microsite/' + link_id, 
		{asynchronous:true, evalScripts:true, 	
		onComplete:function(request){Element.hide('loading');}, 
		onLoading:function(request){Element.show('loading');}}); 
	return false;
}

function selectUserMicrosite(microIframe, microSelect, linkid)
{
		try
		{
			setCookie(linkid, microSelect.options[microSelect.selectedIndex].text, new Date(2020, 12, 31));
			microIframe.src = microSelect.options[microSelect.selectedIndex].value;
			$('microsite_url').value = microSelect.options[microSelect.selectedIndex].value;	
		}
		catch(e)
		{
			return false;
		}
		
}
