jQuery(function($){
	$('form').initializeForm();
	$('.validate').formValidate(); 
	//$('.vcalendar').eventPreview();
	$('.post').postPreview();
	$('.post').iconPreview();
	$('.package').packagePreview();
	$('.ajax-calendar').ajaxCalendar();
	$('.share-link').initializeSharing();
	$('.follow-link').initializeFollowing();
	if (typeof jQuery.prototype.msnMap != 'undefined') {	   
		$('#map').msnMap({simpleMap:true});
	}
});

$(function() {

	$("#photo-gallery").each(function(){
		$(this).flash(
			{src:"flash/photo-gallery.swf",
			 width:555,
			 height:395,
			 wmode:"transparent",
			 allowFullScreen:"true",
			 quality:"high"},
			 {version:"8"});
	});


	//social media sharing
	$('.package-wrapper').each( function() {
		var x = $(this);
		$('.share-link', x).click(function() {
			$('.share-panel', x).show();
			//$(this).parents('.entry').find('.share-panel').css('display','inline');
			return false;
		});
		$('.share-close', x).click(function(){
			$('.share-panel', x).hide();
			//$(this).parents('.entry').find('.share-panel').slideUp('fast');
			return false;
		});
	});

	/* IE6 hack for secondary nav */
	if(BROWSER=='msie6'){
		$("ul#nav li").hover(function(){
			$("ul",this).show();
		}, function(){
			$("ul",this).hide();
		});
	}
	

});


// Function to add/remove "over" class for drop down nav - remove if not needed
$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover( 
			function() { $(this).addClass(c);  },
			function() { $(this).removeClass(c); }
		);
	});
	
	

};   