var j = jQuery.noConflict();

j(document).ready(function(){
						   
		j('.slideshow').cycle({
			fx: 'fade' ,// choose your transition type, ex: fade, scrollUp, shuffle, etc...
			speed: 2000,
			timeout:6000
		});
		
		 j('.caption').cycle({
			 fx: 'scrollUp', 
			 speed: 1000,
			 timeout:6000
		});					   
						   
						   

	if(j("#medCouncilVids").length)
	{
		// setup player without "internal" playlists
		$f("medCouncilVids", "/includes/flash/flowplayer-3.2.7.swf", 
			{	
				clip: {
					baseUrl: 'http://www.medicalcouncil.ie/', 
					scaling: 'scale', 
					autoPlay: false, 
					autoBuffering: true
				}
			}
		// use playlist plugin. 
		).playlist(".mc_vid_playlist", 
			{
				playingClass: 'playing',
				pausedClass: 'paused',
				progressClass:'progress',
				loop:true
			}
		);
	}
	

	j(".primaryNav li, .home_quicklinks img, .header_logo").hover(
		function() { j(this).fadeTo("fast", 0.5); },
		function() { j(this).fadeTo("fast", 1.0); }
	);
	j(".banner_edit_icon, .documentComposite_edit_icon").hover(
		function() { j(this).toggleClass("hover"); },
		function() { j(this).toggleClass("hover"); }
	);
	

	 
	
	j(".datepicker").datepicker({ 
		showOn: 'both', 
		dateFormat: 'dd/mm/yy',
		buttonImage: 'includes/images/maincontent/ico_datepicker.gif', 
		buttonImageOnly: true
	});

	j(".cma_events_imgs a").lightBox();

	j(".mainWrapper").height() > j(".sidebarWrapper").height() ? j(".sidebarWrapper").height(j(".mainWrapper").height()) : null;
	j(".maincontent table").each(function(){
		if (j(this).width() > 650) {
			j(this).children("colgroup").remove();
			j(this).attr("width", "90%");
		} 
	});

	// =========================================== ASSIGN ZEBRA CLASSES TO EVERY SECOND ITEM 
	var i = 0;
	jQuery(".formRowWrapper, .maincontent .checkdetails tr").each( function(i){
		i % 2 == 0 ? jQuery(this).addClass("zebra_row_0") : jQuery(this).addClass("zebra_row_1");
		i++;
	});

	var so = new SWFObject("includes/flash/flash_1_002.swf", "flash_area", "950", "310", "8", "#ffffff");
	so.addParam("wmode", "transparent");
	if(document.getElementById("homepageFlash")) { so.write("homepageFlash"); }

	/* ------------------------------------------------ FONT SIZE TOGGLE ------------------------------------------------ */
	// If there's a cookie present for this site, assign the font size based on this value.
	if(j.cookie('fontSizeCookie'))
	{
		var getCookie = parseFloat(j.cookie('fontSizeCookie'));
		jQuery(".maincontentWrapper").css({ 'font-size' : getCookie+'em' });
	}
	
	// Increase the font size based on <current cookie size> + 0.25.
	jQuery("a.font_inc").click(function() 
	{
		if(j.cookie('fontSizeCookie'))
		{
			
			j.cookie('fontSizeCookie', parseFloat(j.cookie('fontSizeCookie'))+0.25, { path: '/' });
			jQuery(".maincontentWrapper").css({ 'font-size' : parseFloat(j.cookie('fontSizeCookie'))+'em' });
		}
		else // No Cookie Present? Set a Cookie based on initial step-up (0.25), then increase font size
		{
			j.cookie('fontSizeCookie', 1.25, { path: '/' });
			jQuery(".maincontentWrapper").css({ 'font-size' : parseFloat(j.cookie('fontSizeCookie'))+'em' });
		}
	});
	
	// Decrease the font size based on <current cookie size> - 0.25.
	jQuery("a.font_dec").click(function() 
	{
		if(j.cookie('fontSizeCookie'))
		{
			if(parseFloat(j.cookie('fontSizeCookie')) > 1.0)
			{
				j.cookie('fontSizeCookie', parseFloat(j.cookie('fontSizeCookie'))-0.25, { path: '/' });
				jQuery(".maincontentWrapper").css({ 'font-size' : parseFloat(j.cookie('fontSizeCookie'))+'em' });
			}
		}
	});
	
	/* ------------------------------------------------ FONT SIZE TOGGLE ------------------------------------------------ */


});




