// Week in photos Javascript SSP Callbacks
// See also the "actions" layer in the SSP component for corresponding event listeners
// steve.johnson@virginia.edu, 10/2/2007

window.name = "groundstour";

function flashPutHref(href) { location.href = href; } 
function flashPutTitle(title) { document.title = title; } 


// add multiple events after page loads (by Simon Willison)
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function sspToggleDisplayMode() {
	thisMovie("ssp").sspToggleDisplayMode();
}
		
/*
	Passes the ID of the album from the XML file
	we want SlideShowPro inside the SWF to load
*/
function sspLoadAlbum(album) {
	thisMovie("ssp").sspLoadAlbum(album);
}

function thisMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName]
	} else {
		return document[movieName]
	}
}

function writeArchives() {
	var so = new SWFObject("http://www.virginia.edu/uvatours/groundstour/flash/groundstour2009.swf", "ssp", "690", "550", "8");
	so.addParam("allowScriptAccess", "always");
	so.addParam("wmode", "transparent");
	so.write("groundstour");
}

function writeRotunda() {
	var wp = new SWFObject("http://www.virginia.edu/uvatours/groundstour/flash/groundstour2009.swf", "ssp", "690", "550", 8);
    wp.addVariable("xmlfile", "http://www.virginia.edu/ssp_director/images.php?gid=43");
	wp.addVariable("gallery", "Never");
    wp.write("groundstour");
	
	document.getElementById('galleryheader').style.background = 'url(/uvatours/groundstour/images/home/rotunda_header.png) center bottom no-repeat';
}

function writeAcademical() {
	var wp = new SWFObject("http://www.virginia.edu/uvatours/groundstour/flash/groundstour2009.swf", "ssp", "690", "550", 8);
    wp.addVariable("xmlfile", "http://www.virginia.edu/ssp_director/images.php?gid=42");
	wp.addVariable("gallery", "Never");
    wp.write("groundstour");
	
	document.getElementById('galleryheader').style.background = 'url(/uvatours/groundstour/images/home/village_header.png) center bottom no-repeat';

}

function writeChapel() {
	var wp = new SWFObject("http://www.virginia.edu/uvatours/groundstour/flash/groundstour2009.swf", "ssp", "690", "550", 8);
    wp.addVariable("xmlfile", "http://www.virginia.edu/ssp_director/images.php?gid=45");
	wp.addVariable("gallery", "Never");
    wp.write("groundstour");
	
	document.getElementById('galleryheader').style.background = 'url(/uvatours/groundstour/images/home/chapel_header.png) center bottom no-repeat';

}

function writeCorner() {
  var wp = new SWFObject("http://www.virginia.edu/uvatours/groundstour/flash/groundstour2009.swf", "ssp", "690", "550", 8);
  wp.addVariable("xmlfile", "http://www.virginia.edu/ssp_director/images.php?gid=46");
  wp.addVariable("gallery", "Never");
  wp.write("groundstour");
  
  document.getElementById('galleryheader').style.background = 'url(/uvatours/groundstour/images/home/corner_header.png) center bottom no-repeat';
}

function writeGardens() {
  var wp = new SWFObject("http://www.virginia.edu/uvatours/groundstour/flash/groundstour2009.swf", "ssp", "690", "550", 8);
  wp.addVariable("xmlfile", "http://www.virginia.edu/ssp_director/images.php?gid=55");
  wp.addVariable("gallery", "Never");
  wp.write("groundstour");

  document.getElementById('galleryheader').style.background = 'url(/uvatours/groundstour/images/home/gardens_header.png) center bottom no-repeat';
}

function writejpja() {
  var wp = new SWFObject("http://www.virginia.edu/uvatours/groundstour/flash/groundstour2009.swf", "ssp", "690", "550", 8);
  wp.addVariable("xmlfile", "http://www.virginia.edu/ssp_director/images.php?gid=47");
  wp.addVariable("gallery", "Never");
  wp.write("groundstour");
  
  document.getElementById('galleryheader').style.background = 'url(/uvatours/groundstour/images/home/jpja_header.png) center bottom no-repeat';

}

function writeLibrary() {
  var wp = new SWFObject("http://www.virginia.edu/uvatours/groundstour/flash/groundstour2009.swf", "ssp", "690", "550", 8);
  wp.addVariable("xmlfile", "http://www.virginia.edu/ssp_director/images.php?gid=44");
  wp.addVariable("gallery", "Never");
  wp.write("groundstour");
  
  document.getElementById('galleryheader').style.background = 'url(/uvatours/groundstour/images/home/library_header.png) center bottom no-repeat';
}

function writeNewcomb() {
  var wp = new SWFObject("http://www.virginia.edu/uvatours/groundstour/flash/groundstour2009.swf", "ssp", "690", "550", 8);
  wp.addVariable("xmlfile", "http://www.virginia.edu/ssp_director/images.php?gid=48");
  wp.addVariable("gallery", "Never");
  wp.write("groundstour");
  
  document.getElementById('galleryheader').style.background = 'url(/uvatours/groundstour/images/home/newcomb_header.png) center bottom no-repeat';

}

function writeScott() {
  var wp = new SWFObject("http://www.virginia.edu/uvatours/groundstour/flash/groundstour2009.swf", "ssp", "690", "550", 8);
  wp.addVariable("xmlfile", "http://www.virginia.edu/ssp_director/images.php?gid=49");
  wp.addVariable("gallery", "Never");
  wp.write("groundstour");
  
  document.getElementById('galleryheader').style.background = 'url(/uvatours/groundstour/images/home/scott_header.png) center bottom no-repeat';

}

function writeMuseum() {
  var wp = new SWFObject("http://www.virginia.edu/uvatours/groundstour/flash/groundstour2009.swf", "ssp", "690", "550", 8);
  wp.addVariable("xmlfile", "http://www.virginia.edu/ssp_director/images.php?gid=50");
  wp.addVariable("gallery", "Never");
  wp.write("groundstour");
  
  document.getElementById('galleryheader').style.background = 'url(/uvatours/groundstour/images/home/museum_header.png) center bottom no-repeat';

}

function writeFinals() {
  var wp = new SWFObject("http://www.virginia.edu/uvatours/groundstour/flash/groundstour2009.swf", "ssp", "690", "550", 8);
  wp.addVariable("xmlfile", "http://www.virginia.edu/ssp_director/images.php?gid=56");
  wp.addVariable("gallery", "Never");
  wp.write("groundstour");
  
  document.getElementById('galleryheader').style.background = 'url(/uvatours/groundstour/images/home/finals_header.png) center bottom no-repeat';
}

function writeAthletics() {
  var wp = new SWFObject("http://www.virginia.edu/uvatours/groundstour/flash/groundstour2009.swf", "ssp", "690", "550", 8);
  wp.addVariable("xmlfile", "http://www.virginia.edu/ssp_director/images.php?gid=51");
  wp.addVariable("gallery", "Never");
  wp.write("groundstour");
  
  document.getElementById('galleryheader').style.background = 'url(/uvatours/groundstour/images/home/athletics_header.png) center bottom no-repeat';
}

function writeResearch() {
  var wp = new SWFObject("http://www.virginia.edu/uvatours/groundstour/flash/groundstour2009.swf", "ssp", "690", "550", 8);
  wp.addVariable("xmlfile", "http://www.virginia.edu/ssp_director/images.php?gid=52");
  wp.addVariable("gallery", "Never");
  wp.write("groundstour");
  
  document.getElementById('galleryheader').style.background = 'url(/uvatours/groundstour/images/home/research_header.png) center bottom no-repeat';
}

function writeHealth() {
  var wp = new SWFObject("http://www.virginia.edu/uvatours/groundstour/flash/groundstour2009.swf", "ssp", "690", "550", 8);
  wp.addVariable("xmlfile", "http://www.virginia.edu/ssp_director/images.php?gid=53");
  wp.addVariable("gallery", "Never");
  wp.write("groundstour");
  
  document.getElementById('galleryheader').style.background = 'url(/uvatours/groundstour/images/home/health_header.png) center bottom no-repeat';
}

function writeSchools() {
  var wp = new SWFObject("http://www.virginia.edu/uvatours/groundstour/flash/groundstour2009.swf", "ssp", "690", "550", 8);
  wp.addVariable("xmlfile", "http://www.virginia.edu/ssp_director/images.php?gid=54");
  wp.addVariable("gallery", "Startup");
  wp.write("groundstour");
  
  document.getElementById('galleryheader').style.background = 'url(/uvatours/groundstour/images/home/schools_header.png) center bottom no-repeat';

}