
$(document).ready(function () {
	$("a.bookmark").click(function (e) {
		e.preventDefault(); // this will prevent the anchor tag from going the user off to the link
		var bookmarkUrl = this.href;
		var bookmarkTitle = this.title;

		if (window.sidebar) { // For Mozilla Firefox Bookmark
			window.sidebar.addPanel(bookmarkTitle, bookmarkUrl, "");
		} else if (window.external || document.all) { // For IE Favorite
			window.external.AddFavorite(bookmarkUrl, bookmarkTitle);
		} else if (window.opera) { // For Opera Browsers
			$("a.bookmark").attr("href", bookmarkUrl);
			$("a.bookmark").attr("title", bookmarkTitle);
			$("a.bookmark").attr("rel", "sidebar");
		} else { // for other browsers which does not support
			alert('Your browser does not support this bookmark action');
			return false;
		}
	});

	$("a.map").fancybox({
		'autoDimensions': false,
		'width': 420,
		'height': 420,
		'transitionIn': 'none',
		'transitionOut': 'none',
		'hideOnContentClick': false,
		'type': 'iframe'
	});

	$("a.video").fancybox({
		'type': 'iframe'
	});

	$("a.youtubeembed").each(function () {
		$(this).replaceWith("<div style='width:420px;margin:0 auto;'><iframe width='420' height='315' src='http://www.youtube.com/embed/" + $(this).attr("href").substring($(this).attr("href").lastIndexOf("/") + 1) + "' frameborder='0' allowfullscreen></iframe></div>");
	});
});
