function initForteMenu() {
	jQuery("ul li.yuimenubaritem:first-child").addClass('first-of-type');
	jQuery("ul li.yuimenubaritem:last-child").addClass('last-of-type');
	jQuery("ul li.yuimenubaritem:nth-child(even)").addClass('even');
	jQuery("ul li.yuimenubaritem:nth-child(odd)").addClass('odd');
	
	jQuery("ul li.yuimenuitem:first-child").addClass('first-of-type');
	jQuery("ul li.yuimenuitem:last-child").addClass('last-of-type');
	jQuery("ul li.yuimenuitem:nth-child(even)").addClass('even');
	jQuery("ul li.yuimenuitem:nth-child(odd)").addClass('odd');
	
	jQuery("ul.menuItemCt li:nth-child(even)").addClass('even');
	jQuery("ul.menuItemCt li:nth-child(odd)").addClass('odd');
	jQuery("ul.menuItemCt li:first-child").addClass('first');
	jQuery("ul.menuItemCt li:last-child").addClass('last');
	jQuery("li.menuItem-selected:first").addClass('menuItem-active').parents("li:first").addClass('menuItem-active').parents("li:first").addClass('menuItem-active');
	jQuery("ul.menuItemCt li.menuItem-active").find("a:first").addClass('menuItemLabel-active');	
}

function initForteTables() {
	jQuery("table tr:nth-child(even)").addClass('tr-even');
	jQuery("table tr:nth-child(odd)").addClass('tr-odd');
	jQuery("table tr:first-child").addClass('tr-first');
	jQuery("table tr:last-child").addClass('tr-last');
	jQuery("table td:nth-child(even)").addClass('td-even');
	jQuery("table td:nth-child(odd)").addClass('td-odd');
	jQuery("table td:first-child").addClass('td-first');
	jQuery("table td:last-child").addClass('td-last');
}

function initForteVideos() {
	jQuery("a.forteVideoPlayer").each(function(index) {
    	var objId = jQuery(this).attr('id');
		var objWidth = jQuery(this).width();
		var objHeight = jQuery(this).height();
		var iconLeft = parseInt((objWidth / 2) - (83 / 2));
		var iconTop = parseInt((objHeight / 2) - (83 / 2));
		jQuery(this).css('position','relative');
		jQuery(this).append('<img src="/common_scripts/images/play_large.png" border="0" style="position:absolute;top:' + iconTop + 'px;left:' + iconLeft + 'px;"/>')
	});
	jQuery("a.forteVideoPlayer").click(function(event) {
		event.preventDefault();
		var objId = jQuery(this).attr('id');
		var vidSt = jQuery(this).attr('href');
		flowplayer(objId, { src:'http://releases.flowplayer.org/swf/flowplayer-3.2.5.swf', wmode:'transparent' },{
			clip: { url:vidSt, autoPlay:false, autoBuffering: true, bufferLength: 5, scaling: 'scale' }
		}).ipad().play();
		return false;
	});
}

function onStateMainNavigation(MenuId) {
	jQuery("li#yui-item" + MenuId).addClass('yuimenubaritem-onstate').find("a:first").addClass('yuimenubaritemlabel-onstate');
}

jQuery(document).ready(function(){
	initForteMenu();
	initForteTables();
	initForteVideos();
});
