

$(document).ready(function() {


	//convert richtext popup full size images to fancybox images
	$(".intContentRight img").each(function(){
		if(!$(this).parent().is("a"))
			$(this).wrap("<a class='single_image' href='" + $(this).attr("src") + "'></a>");
	});
	//end convert richtext popup full size images to fancybox images
	
	//convert richtext popup thumb images to fancybox images
	$("#main_content_1 a").each(function(){
		var href = $(this).attr("href");
		if(href != undefined){
			var index = href.indexOf("viewImage");
			if(index > -1){
				href = href.replace("javascript:viewImage('", "");
				href = href.replace("')","");
				$(this).attr("href", href);
				$(this).addClass("single_image"); 
			}
		}
	});
	$("#getDirections").formfocus({
            focus : true,
            blur : true,
            keyup : true,
            label : false
        });
	$("a.single_image").fancybox();
	//end convert richtext popup images to fancybox images

	//Home Fader
	$('div.featureImg').jshowoff({ 
		controls: false,
		links: true,
		hoverPause: false,
		changeSpeed: 1200,
		speed: 6000
	});
	//Events Agenda View Page
	  	//ACCORDION
	$('.eventButton').click(function() {
		$('.eventButton').removeClass('on');
	 	$('.eventContent').slideUp('fast');
	 	$(".print").hide();
		if($(this).next().is(':hidden') == true) {
			$(this).addClass('on');
			$(this).next().slideDown('fast');
			$(this).children(".print").show();
			SetRSVP();
		 } 
	 });
	 
	 $('.print').click(function(e){
	    e.stopPropagation();
	    $(this).parent().slideDown();
	 });
	  
	$('.eventButton').mouseover(function() {
		$(this).addClass('eOver');
	}).mouseout(function() {
		$(this).removeClass('eOver');										
	});
	$('.eventContent').hide();
	
	$("#wrapper .eventButton:last").css('border-bottom', 'none');
	
	$('#featureDate').hover(function(){
		$("#featureDate ul").css('display','block');
		$("#featureDate li").addClass('listHover');
	},function(){
		$("#featureDate ul").css('display','none');
		$("#featureDate li").removeClass('listHover');
	});
	
	//print popup
	$(".printTrigger").fancybox({
		'width'				: 700,
		'height'			: 400,
        'autoScale'     	: false,
        'transitionIn'		: 'elastic',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});

	$('#fbLink').hover(
		function(){$('.social_media_fb').animate({width: '41px'},50)},
		function(){$('.social_media_fb').animate({width: '38px'},50)}
	);
	$('#twLink').hover(
		function(){$('.social_media_tw').animate({width: '41px'},50)},
		function(){$('.social_media_tw').animate({width: '38px'},50)}
	);
	$('#ytLink').hover(
		function(){$('.social_media_yt').animate({width: '41px'},50)},
		function(){$('.social_media_yt').animate({width: '38px'},50)}
	);

});
