document.observe("dom:loaded", function() {
	if ($('tabs')) attachEventToTabs();
	if ($('ssp')) loadFlash('ssp');
});

function attachEventToTabs() {
	$('tabs').getElementsBySelector('li').each(function(li){
		s = li.firstDescendant();
		s.observe('click',function(e) {
			Event.stop(e);
			var tag = this;
			new Ajax.Request(tag.href, {
				    onSuccess: function(transport){
						$('tabsContent').update(transport.responseText);
						$('tabsContent').innerHTML;
						$$('#tabs ul li.sel').each(function(s) { s.removeClassName('sel'); });
						tag.up(0).addClassName('sel');
						},
				    onFailure: function(){ 
						alert('There was a problem getting the information you requested.  If the problem persists, please contact us.');
						}
				});
		});
	});
}

function loadFlash(elmnt) {
	var so = new SWFObject("/flash/ssp.swf", "ssp", "627", "352", "8");
	so.addParam("wmode", "transparent");
	so.write(elmnt);

}
