$(function() {
	//Documentation located in special.docs.js
	// Sifr
	$('body.home div#content h1').sifr(
		{ strSWF: '/flash/warnock-pro-regular.swf', strColor: '#372f16', strWmode: 'transparent', intPadding: [0, 0, 0, 0] },
		{ expressInstall: true }
	);
	$('div#content-wrapper h1').sifr(
		{ strSWF: '/flash/warnock-pro-bold.swf', strColor: '#4d4d4d', strWmode: 'transparent', intPadding: [0, 0, 0, 0] },
		{ expressInstall: true }
	);
	
	$('div#feature-wrapper h2').sifr(
		{ strSWF: '/flash/warnock-pro-regular.swf', strColor: '#372f16', strWmode: 'transparent', intPadding: [0, 0, 0, 0] },
		{ expressInstall: true }
	);
	
/*	$('div.property-name div.property-address').sifr(
		{ strSWF: '/flash/warnock-pro-regular.swf', strColor: '#372f16', strWmode: 'transparent', intPadding: [0, 0, 0, 0], strCase: 'upper' },
		{ expressInstall: true }
	);
	$('div.property-name div.property-locale').sifr(
		{ strSWF: '/flash/warnock-pro-regular.swf', strColor: '#372f16', strWmode: 'transparent', intPadding: [0, 0, 0, 0] },
		{ expressInstall: true }
	);
*/	

	
	$("div#flash-masthead").flash(
		{src:"flash/hompage-masthead.swf",
		 width:960,
		 height:407,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.xmlFile = "/flash/xml/homepage-masthead.xml";
				$(this).html($.fn.flash.transform(htmlOptions));
		});

	$("div#ssp-photo-gallery").flash(
		{src:"/flash/ssp-photo-gallery.swf",
		 width:673,
		 height:507,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.xmlFile = "/flash/xml/photo-gallery.xml";
				$(this).html($.fn.flash.transform(htmlOptions));
		});
	
	$("div#ssp-video-gallery").flash(
		{src:"/flash/ssp-video.swf",
		 width:673,
		 height:507,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.xmlFile = "/flash/xml/video-gallery.xml";
				$(this).html($.fn.flash.transform(htmlOptions));
		});
	
	$("a.video-gallery-load").click(function () { 
      $("#ssp-photo-gallery").hide();
      $("#ssp-video-gallery").show();
		return false;
	});

	$("a.photo-gallery-load").click(function () { 
      $("#ssp-photo-gallery").show();
      $("#ssp-video-gallery").hide();
		return false;
	});

	
	$('a.fancyimage').fancybox({overlayOpacity:0.8});
	$('#property-gallery').cycle({ 
		fx:     'fade', 
		speed:  'fast', 
		timeout: 0, 
		after: onAfterCaption,
		next:   '#next-property-image', 
		prev:   '#previous-property-image' 
	});
	$('#large-property-image').cycle({ 
		fx:     'fade', 
		speed:  'fast', 
		timeout: 0,
		next:   '#next-property-image', 
		prev:   '#previous-property-image' 
	 });

	$('div.agent').expand({openText: '<img src="/images/layout/more-details.gif" alt="More Details">', closeText: '<img src="/images/layout/close-details.gif" alt="Close Details">', longClass: '.agent-bio'});
	
	//tool tip on neighborhoods page:
	$("a.tooltip").tooltip({tip: '.tool-tip-view', effect: 'toggle', fadeOutSpeed: 0, position: "top center", offset: [18, 0] }); 

});

function onAfterCaption(curr,next,opts) {
	var caption = 'Property ' + (opts.currSlide + 1) + ' of ' + opts.slideCount;
	$('#property-caption').html(caption);
}