$(document).ready(function(){
	var gallery = $("#gallery");
	if (gallery.length > 0) {
		$(".previewTrigger", gallery).click(function(e){
			e.preventDefault();
		});
		$(".previewTrigger", gallery).hover(
			function(){
				var swfSrc = $(this).attr("href");
				/*
				$("body").append('<div id="activePreview"><div id="galleryPreviewFlashWrap"><object width="240" height="180"><param name="movie" value="' + swfSrc + '"><embed src="' + swfSrc + '" width="240" height="180"></embed></object></div></div>');
				*/
				$("body").append('<div id="activePreview"><div id="galleryPreviewFlashWrap"></div></div>');
				$(document).bind('mousemove',function(e){
					$("#activePreview").css("top",e.pageY - 10).css("left",e.pageX + 10)
				});
				FlashReplace.replace("galleryPreviewFlashWrap", swfSrc, "galleryPreviewMovieId", 240, 180);			
			},function(){
				$("#activePreview").remove();
			}
		);
	}
});



/***************
GOOGLE ANALYTICS
***************/

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-16991986-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

