/**
*
*/
function change_factsheet_rfibutton(html)
{
	replace_rfibutton_image('.rfibutton',html);
}
function change_featured_rfibutton(html)
{
	replace_rfibutton_image('.rfibutton',html);
}
function replace_rfibutton_image(classname,content)
{
	var anchors = $$(classname);
	for(var i=0;i<anchors.length;i++)
	{	
		anchors[i].innerHTML = content;
	}
}

function change_rfi_submit_button(src)
{
	$('submitbutton').src = src;
}

function change_header_bg_image(path)
{
	$('header').style.backgroundImage = 'url(' + path + ')';
}
function change_header_bg_color(color)
{
	$('header').style.backgroundColor = color;
}
/**
*
*/
function rfi_hide_moreinfo_link()
{
	$('moreinfo_link').hide();
}
/**
*
*/
function rfi_nolink_logo()
{
	$('logo_link_wrapper').hide();
	$('logo_nolink_wrapper').show();
}

function spa_rfi_logo_nolink()
{
	$('schoolLogo').hide();
	$('schoolLogoNoLink').show();
}

function enable_pu(path)
{
	var puShownCookieName = "puShown";
	var shown = readCookie(puShownCookieName);
	Event.observe(document, 'click', function(event) 
	{
		if(shown)
			return;
			
		var pu;
		
		try
		{
			pu = window.open(path,'optInPU','height=340,width=465');
		}
		catch(e)
		{
			//something failed in attempting to open the window
			//this can also be if they have the window open from a different domain
			//don't bother trying again this page
			shown = true;
			return;	
		}
		
		pu.blur();
		window.focus();
		
		if(pu)
		{
			
			createCookie(puShownCookieName,"true");
			shown = true;
		}
	});
}