

$(document).ready(function() {

	$('.popup').fancybox({
		overlayOpacity	: 0.8,
		overlayColor	: '#191517',
		padding			: 0,
		titleShow		: false
	});

	//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
	
	//documents
    $("#documents").fancybox({
		'width'				: 380,
		'height'			: 291,
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	
	//media page
	$(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',theme:'light_square',slideshow:2000, autoplay_slideshow: false});
	
	$(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'fast',theme:'light_square', slideshow:10000});
	//Home Fader
	$('#features').jshowoff({ 
		controls: false,
		links: true,
		hoverPause: false,
		changeSpeed: 1200,
		speed: 6000
	});
	//privacy policy
    $("#PrivacyPolicy").fancybox({
		'width'				: 675,
		'height'			: 600,
        'autoScale'     	: false,
        'transitionIn'		: 'elastic',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	$("#newsLetter").fancybox({
			'width'				: 420,
			'height'			: 274,
	        'autoScale'     	: false,
	        'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'				: 'iframe'
		});
		
	$("#jquery_jplayer_1").jPlayer({
	ready: function () {
		$(this).jPlayer("setMedia", {
			mp3: "/images/Memo.mp3"
		}).jPlayer("stop");
	},
	ended: function (event) {
		$(this).jPlayer("stop");
	},
	swfPath: "/js",
	solution: "flash, html",
	supplied: "mp3"
	});

});
