
/*
	Special Olympics of Missouri
	Custom Javascript Functions
*/

BBI = {};

BBI.Core = 
{
	BBNC:
	{
		_version: 1.1,
		_updated: '04/17/2008 10:07:07 AM',

		isV5: !!window.Sys,
		isV4: !!(window.BBProcMsg && !window.Sys),
		isEditView: !!window.location.href.match('edit='),
		hasPRM: !this.isV5
	}
};

BBI.SOMO =
{
	siteInit: function()
	{
		$('ul.mainNav li').hover(function(){$(this).addClass('hover')},function(){$(this).removeClass('hover')});
		if ($('textarea[id$=_txtFundRaiserWaiver]').length > 0) {
			$('textarea[id$=_txtFundRaiserWaiver]').addClass('FundraiserWaiver');
		}
	},
	
	somoAreas:
	{
		'Northeast':		'/page.aspx?pid=260',
		'Northwest':		'/page.aspx?pid=262',
		'Southeast':		'/page.aspx?pid=261',
		'Southwest':		'/page.aspx?pid=264',
		'KC Metro':			'/page.aspx?pid=259',
		'Central':			'/page.aspx?pid=258',
		'SSD':				'/page.aspx?pid=263',
		'St. Louis Metro':	'/page.aspx?pid=250'
	},
	
	bbinit_bindAreaSelector: function()
	{
		if (BBI.Core.BBNC.isEditView)
			document.write('<h2>Custom Javascript: Areas Dropdown</h2>');
			
		else
			Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(BBI.SOMO.bindAreaSelector);
	},
	
	bindAreaSelector: function()
	{
		$('#somoAreaButton').bind('click',BBI.SOMO.redirectToArea);
	},
	
	redirectToArea: function()
	{
		if ($('#somoAreas').val() != 'Select a County')
			window.location = BBI.SOMO.somoAreas[$('#somoAreas').val()];
	},
	
	EventRegistrationRelabel: function()
	{
		if (BBI.Core.BBNC.isEditView) {
			$('#JS-EventRegistrationRelabel').append('Custom JavaScript: Event Registration Relabel');
		} else {
			$('span[id$=_lblBilling]').text('Participant Information');
		}	
	}
	
}



Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(BBI.SOMO.siteInit);