// site specific javascript

$(function(){
	
	/* sometimes devs forget to put sn_hasTabs */
	$('.sn_tabbed').parent('.mod-body').parent('.mod').addClass('sn_hasTabs');
	
	// this list of modules adds specific color classes to modules. it's here instead of the css because this will be much easier to track
	//MODULE  "TYPE"
	$('#PUT_MODULE_ID_NAME_HERE').addClass('blah_module_class');
	
	// adds class mod-first to first .mod in any column
	$('.mod-col .mod:first').addClass('mod-first');
	$('#sn_col2 .mod:first').addClass('mod-first');
		// also add/remove mod-first to these specific sections/modules
		$('#other_training_modules').addClass('mod-first');
		$('#sn_employee').removeClass('mod-first');
	// adds class mod-col to to some odd IBM specific columns
	$('#promote_ibm_side_content').addClass('mod-col');
	
	// general site style repairs
	$('#sn_account').find('p').attr('style','');
	
	// adds radio/checkbox classes - mostly for ie6
	$(':radio').addClass('sn_radio_button');
	$(':checkbox').addClass('sn_checkbox_button');
	
	//CALLS THE BIND BEHAVIOR FUNCTION
	behavior_binder();
	
});

/*
Binds behaviors
** can be re-run whenever there are DOM changes
*/
function behavior_binder(){

// give checkbox/radio button sn_form_elementDiv a class
	$(':checkbox').each(function(){
		$(this).parent('.sn_form_elementDiv').addClass('sn_form_elementDiv_checkbox');
	});
	$(':radio').each(function(){
		$(this).parent('.sn_form_elementDiv').addClass('sn_form_elementDiv_radio');
	});

	
/* ADD FIRST/LAST TO LI
		adds a class 'first' to the first LI, and a 'last' to the last LI and 'first last' to a single LI
	*/
	$('ul').each(function(i){
		$(this).children('li:first').addClass('first');
		$(this).children('li:last').addClass('last');
	});
// END ADD FIRST/LAST TO LI

}