/* Tulane Virtual Tour Javascript by White Whale Web Services *//* Requires jQuery and SWFObject.js*/var have_loaded=0; // number of images which have loaded$(document).ready(function() {	// attach popup window event to tour map links	$('a[href=tourmap.php]').click(function() {		window.open('tourmap.php','tourmap','menubar=no,resizable=yes,scrollbars=yes,width=620,height=738');		return false;// cancel the original click	})	// prep slideshow	if(stop.images.length) {		stop.slideshow = $('#photos').html('');		$.each(stop.images,function() { stop.slideshow.prepend('<img src="'+this+'" alt="Virtual Tour Photo" style="display:none;"/>'); });		stop.slideshow.find('img:last-child').show();		if(stop.images.length>1) {			stop.slideshow.find('img').load(function() {				have_loaded++;				if(stop.images.length==have_loaded) {					stop.slideshow.find('img').show();					stop.slideshow.before('<div id="controls_shadow"><div id="controls"><a id="tour_back">Previous Photo</a><a id="tour_pause">Play/Pause</a><a id="tour_forward">Next Photo</a>');// add slideshow controls					$('#tour_back').click(prevImage);					stop.pause = $('#tour_pause').click(toggleSlideshow);					$('#tour_forward').click(nextImage);					window.setTimeout(nextImage,3000); // start playing				}			});		}	}	if(stop.video) swfobject.embedSWF('/tour/mediaplayer/flashversionis.swf', 'detect', '1', '1', '6.0.0', '/tour/mediaplayer/expressInstall.swf'); // calls flashVersionIs(9,0,115,0); forcing an upgrade if version is less than 6	else $('#video').hide();});function flashVersionIs(majorVers,minorVers,majorRev,minorRev) { // The actual version as returned from flashversionis.swf (to avoid JS detection bugs); 9.0.98 is the minimum for h264 playback	var requireVersion='';	if(majorVers>9||(majorVers==9&&majorRev>=98)) requireVersion='0'; // they have 9.0.98+ anyway, so don't bother with the check	else requireVersion='9.0.98'; // if not, proceed as usual, forcing them to upgrade	// show Flash movie	swfobject.embedSWF('/tour/mediaplayer/mediaplayer.swf', 'flash', '340', '275', requireVersion, '/tour/mediaplayer/expressInstall.swf',		{file:'/tour/videos/'+stop.video+'.mov',image:'/tour/videos/'+stop.video+'_still.jpg',usefullscreen:'false',showdigits:'false',width:'340',height:'275'}, {}, {id:'mediaplayer'}	);}function prevImage() {	window.clearTimeout(stop.timer);	stop.slideshow.children().eq(0).hide().appendTo(stop.slideshow).fadeIn(750);	if(!stop.pause.hasClass('paused')) stop.timer = window.setTimeout(nextImage,4500);}function nextImage() {	window.clearTimeout(stop.timer);	stop.slideshow.children().eq(stop.images.length-1).fadeOut(750,function() { $(this).prependTo(stop.slideshow).show(); });	if(!stop.pause.hasClass('paused')) stop.timer = window.setTimeout(nextImage,3000);}function toggleSlideshow() {	if($(this).hasClass('paused')) stop.timer = window.setTimeout(nextImage,1000);	else window.clearTimeout(stop.timer);	$(this).toggleClass('paused');}