<!--

function MailAFriend(ThisPage){
	var EmailTo=''; 
	var subject='See a World Wide Panorama Submission';
	var body1='I wanted to share this World Wide Panorama entry with you.  Check it out at \n';
	var body2='  \n\n\r\r--\nThe World Wide Panorama is a collection of over five thousand QTVR images taken around the world on the same days. You can see the whole site at ';
	var WWPLink='http://worldwidepanorama.org/worldwidepanorama/wwp/index.html ';
	var body3='\n\n\rNote - you will need to have the free QuickTime plug-in installed on your computer.  Get it at ';
	var QTLink='http://www.apple.com/quicktime/download/ ';
	document.write('<a href="' + 'mailto:' + EmailTo + '?subject=' + escape(subject) + '&body=' + escape(body1) + ThisPage + escape(body2) + WWPLink + escape(body3) + QTLink + '">' + 'Email someone a link to this page' + '<\/a>');
	}

function FullScreen(theURL) { 
	var theWindowName = 'WWPfullscreen';
	window.open(theURL, theWindowName , 'resizable=yes, status=yes, scrollbars=auto');
	}

function HelpPop(theURL) {
	var theWindowName = 'wwp_helpwindow';
	window.open(theURL, theWindowName , 'height=500, width=390, top=0, left=0, resizable=yes, status=yes, scrollbars=yes');
	}

/*

MOVIE EMBEDDING FUNCTIONS

*/

function dyn_embed_pano ( basefile , height, width, kioskmode, scaletype, showctrlr, pan, tilt, zoom ) {

var bgcol = document.bgColor;

if ( showctrlr != 'true' && showctrlr != 'false' ) {
	showctrlr = 'true';
	}


document.write('<object classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" codebase=\"http:\/\/www.apple.com\/qtactivex\/qtplugin.cab\" height=\"' + height + '\" width=\"' + width + '\" ID=\"objpano' + basefile + '\">');
document.write('<param name=\"cache\" value=\"true\">');
document.write('<param name=\"src\" value=\"..\/qtvr\/normal\/' + basefile + '.mov\">');
document.write('<param name=\"autoplay\" value=\"true\">');
document.write('<param name=\"controller\" value=\"' + showctrlr + '\">');
document.write('<param name=\"volume\" value=\"30\">');
document.write('<param name=\"kioskmode\" value=\"' + kioskmode + '\">');
document.write('<param name=\"scale\" value=\"' + scaletype + '\">');
document.write('<param name=\"bgcolor\" value=\"' + bgcol + '\">');
if ( zoom ) {
	document.write('<param name=\"pan\" value=\"' + pan + '\">');
	document.write('<param name=\"tilt\" value=\"' + tilt + '\">');
	document.write('<param name=\"fov\" value=\"' + zoom + '\">');
	}
document.write('<embed EnableJavaScript=\"true\" ID=\"emid_objpano' + basefile + '\" name=\"objpano' + basefile + '\" height=\"' + height + '\" pluginspage=\"http:\/\/www.apple.com\/quicktime\/download\/\" src=\"..\/qtvr\/normal\/' + basefile + '.mov\" type=\"video\/quicktime\" width=\"' + width + '\" controller=\"' + showctrlr + '\" autoplay=\"true\" volume=\"30\" kioskmode=\"' + kioskmode + '\" scale=\"' + scaletype + '\" cache=\"true\" bgcolor=\"' + bgcol + '\">');
document.write('<\/object>');


}


function dyn_embed_fspano ( basefile , height, width, kioskmode, scaletype ) {

var bgcol = document.bgColor;

document.write('<object id=\"fspano\" classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" codebase=\"http:\/\/www.apple.com\/qtactivex\/qtplugin.cab\" height=\"' + height + '\" width=\"' + width + '\">');
document.write('<param name=\"cache\" value=\"true\">');
document.write('<param name=\"src\" value=\"..\/qtvr\/fullscreen\/' + basefile + '.mov\">');
document.write('<param name=\"autoplay\" value=\"true\">');
document.write('<param name=\"controller\" value=\"true\">');
document.write('<param name=\"volume\" value=\"30\">');
document.write('<param name=\"kioskmode\" value=\"' + kioskmode + '\">');
document.write('<param name=\"scale\" value=\"' + scaletype + '\">');
document.write('<param name=\"bgcolor\" value=\"' + bgcol + '\">');
document.write('<param name=\"moviename\" value=\"spincontrolled\">');
document.write('<embed name=\"fspanoembed\" height=\"' + height + '\" pluginspage=\"http:\/\/www.apple.com\/quicktime\/download\/\" src=\"..\/qtvr\/fullscreen\/' + basefile + '.mov\" type=\"video\/quicktime\" width=\"' + width + '\" controller=\"true\" autoplay=\"true\" volume=\"30\" kioskmode=\"' + kioskmode + '\" scale=\"' + scaletype + '\" cache=\"true\" name=\"spincontrolled\" bgcolor=\"' + bgcol + '\">');
document.write('<\/object>');

}

function dyn_embed_fspano2 ( basefile , heightdiff, width, kioskmode, scaletype ) {

var nuheight=100;

if (window.innerHeight) { // IE check

	nuheight = window.innerHeight - heightdiff;
		
	} 

else {
	
	nuheight = document.body.offsetHeight-heightdiff; // educated guesstimate for IE
	
	}

nuheight = nuheight.toString(10) + "Px";

document.write('<object id=\"fspano\" classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" codebase=\"http:\/\/www.apple.com\/qtactivex\/qtplugin.cab\" height=\"' + nuheight + '\" width=\"' + width + '\">');
document.write('<param name=\"cache\" value=\"true\">');
document.write('<param name=\"src\" value=\"..\/qtvr\/fullscreen\/' + basefile + '.mov\">');
document.write('<param name=\"autoplay\" value=\"true\">');
document.write('<param name=\"controller\" value=\"true\">');
document.write('<param name=\"volume\" value=\"30\">');
document.write('<param name=\"kioskmode\" value=\"' + kioskmode + '\">');
document.write('<param name=\"scale\" value=\"' + scaletype + '\">');
document.write('<param name=\"bgcolor\" value=\"#000000\">');
document.write('<param name=\"moviename\" value=\"spincontrolled\">');
document.write('<embed id=\"fspanoembed\" height=\"' + nuheight + '\" pluginspage=\"http:\/\/www.apple.com\/quicktime\/download\/\" src=\"..\/qtvr\/fullscreen\/' + basefile + '.mov\" type=\"video\/quicktime\" width=\"' + width + '\" controller=\"true\" autoplay=\"true\" volume=\"30\" kioskmode=\"' + kioskmode + '\" scale=\"' + scaletype + '\" cache=\"true\" name=\"spincontrolled\" bgcolor=\"#000000\">');
document.write('<\/object>');

}

function fspanoresize(heightdiff) {
	if(document.getElementById) {
		var nuheight=100;
		if (window.innerHeight) { // IE check
			nuheight = window.innerHeight - heightdiff;
			} 
		else {
			nuheight = document.body.offsetHeight-heightdiff; // educated guesstimate for IE
			}

	if(nuheight < 200) { nuheight = 200; }

		nuheight = nuheight.toString(10) + "Px";
		if(document.getElementById('fspano')) {		
			var thePano = document.getElementById('fspano');
			thePano.style.height = nuheight;
			}
		if(document.getElementById('fspanoembed')) {		
			var thePano = document.getElementById('fspanoembed');
			thePano.style.height = nuheight;
			}
		}
	}


function dyn_embed_sound ( basefile , start, loop ) {

var height = 16;
var width = 400;
var kioskmode = "false";
var scaletype = "tofit";

document.write('<object classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" codebase=\"http:\/\/www.apple.com\/qtactivex\/qtplugin.cab\" height=\"' + height + '\" width=\"' + width + '\">');
document.write('<param name=\"cache\" value=\"true\">');
document.write('<param name=\"src\" value=\"..\/qtvr\/audio\/' + basefile + '.mov\">');
document.write('<param name=\"autoplay\" value=\"' + start + '\">');
document.write('<param name=\"controller\" value=\"true\">');
document.write('<param name=\"volume\" value=\"30\">');
document.write('<param name=\"kioskmode\" value=\"' + kioskmode + '\">');
document.write('<param name=\"scale\" value=\"' + scaletype + '\">');
document.write('<param name=\"bgcolor\" value=\"#FFFFFF\">');
document.write('<param name=\"loop\" value=\"' + loop + '\">');
document.write('<embed height=\"' + height + '\" pluginspage=\"http:\/\/www.apple.com\/quicktime\/download\/\" src=\"..\/qtvr\/audio\/' + basefile + '.mov\" type=\"video\/quicktime\" width=\"' + width + '\" controller=\"true\" autoplay=\"' + start + '\" volume=\"30\" kioskmode=\"' + kioskmode + '\" scale=\"' + scaletype + '\" cache=\"true\" bgcolor=\"#FFFFFF\" loop=\"' + loop + '\">');
document.write('<\/object>');

}

/*


DOWNLOAD INDICATORS


*/

var wwpdltimerID = null; // global
var wwpdlMovie = null; // global
var wwpdlindic = null; // global

function wwpdlsetup ( objName ) { 
	
	if (document.getElementById) { 
		wwpdlMovie = document.getElementById( objName ); 
		}
	
	try { blah = theMovie.GetMovieSize(); }
	
	catch (err) {
		wwpdlMovie = document.getElementsByName( objName )[0];
		}

	if (document.getElementById) { 
		wwpdlindic = document.getElementById('downloadindicator');
		}
			
	try {
		blah = wwpdlMovie.GetMovieSize(); // fail here or
		if(wwpdlMovie) { 
			wwpdlindic.style.visibility = 'visible';
			wwpdlreadFromQtvr(); 
			} // start update repeater
		}
	
	catch (err) {
		// try again until QT responds or user gets bored...
		wwpdltimerID = self.setTimeout("wwpdlsetup(\"" + objName + "\")", 500);
		}
	
	}

function wwpdlhide() {
	wwpdlindic.style.visibility = 'hidden';
	}

function wwpdlreadFromQtvr() {

	try {

	var msiz = wwpdlMovie.GetMovieSize();
	var mrdy = wwpdlMovie.GetMaxBytesLoaded();
	var delay = 10;

	window.status = "Movie loading - " + mrdy + " / " + msiz + " Bytes";

	if ( mrdy < msiz || msiz == 0 ) {
		wwpdltimerID = self.setTimeout("wwpdlreadFromQtvr()", 300);
		}
	else {
		window.status = "Movie loading complete.";
		for(i=0;i<=100;i=i+10) {
			delay = 100 + ( 10 * i );
			window.setTimeout("wwp_fader_obj(wwpdlindic," + (100 - i) + ")", delay );
			}
		window.setTimeout("wwpdlhide()", delay);
		}
	}
	
	catch(err) {
		window.status = "Movie progress indicator not available.";	
		}
	
	}


/*


MAP HANDLERS


*/

function myPopObject ( theUID , theEvent, thePhotographerName, thePanoramaTitle, theFileNameBase, hasAudio, thePopX, thePopY) {
	this.theUID = theUID;
	this.theEvent = theEvent;
	this.theEventShort = eval('eventname_' + theEvent);
	this.theName = thePhotographerName;
	this.theTitle = thePanoramaTitle;
	this.theBasename = theFileNameBase;
	this.hasAudio = hasAudio;
	this.thePopX = thePopX;
	this.thePopY = thePopY;


	// calculate some paths
	
	this.theZurl = '..\/..';
	this.thePrevimgpath = '..\/';
	if ( this.theEvent != thisEvent ) {
		this.theZurl += '\/..\/' + this.theEvent;
		this.thePrevimgpath += '..\/..\/' + this.theEvent + '\/map\/';
		}
	this.theZurl += '\/html\/' + this.theBasename + '.html';
	this.thePrevimgpath += 'smallthumbs\/'; 

	prewrite ( this );

	}

function prewrite ( theObj ) {

	document.write('<DIV ID="preview_' + theObj.theUID + '" onMouseOut="previewpop(\'preview_' + theObj.theUID + '\', \'-500px\', \'-500px\', \'abs\',\'\', \'\');">');
	document.write('<TABLE CELLSPACING="0" CELLPADDING="0">');
	document.write('<TR><TD class="mappop" WIDTH="150" BGCOLOR="#EEEEEE" align="center">');
	document.write(theObj.theEventShort + ': ' + theObj.theName + '<\/TD><\/TR>');
	document.write('<TR><TD align="center" WIDTH="150" BGCOLOR="#000000">');
	document.write('<A TARGET="panowindow" HREF="' + theObj.theZurl + '">');
	document.write('<IMG WIDTH="150" HEIGHT="80" ID="img_' + theObj.theUID + '" SRC="' + theObj.thePrevimgpath + 'thumbnail_placeholder.jpg" BORDER="1" alt="thumbnail"><\/A>');
	document.write('<\/TD><\/TR>');
	document.write('<TR><TD class="mappop" WIDTH="150" BGCOLOR="#EEEEEE" align="center">');
	document.write(theObj.theTitle);
	document.write('<\/TD><\/TR>');

	if ( theObj.hasAudio == 1 && 0) { // replace by embedded sign in smallthumb generator
	document.write('<div style="position:absolute;left:5px;top:65px;"><IMG SRC="..\/..\/graphics\/speakersign.gif" WIDTH="24" height="24" border="0" alt="audio"><\/div>'); }
	
	document.write('<\/TABLE><\/DIV>');

	if ( theTag = document.getElementById('area_' + theObj.theUID) ) {
		theTag.onmouseover = popin;
		theTag.onmouseout = popout;
		}
		
	}

var popin_name = "";

function popin () {
	if (popin_name == this.id) { return true; } // dont re-pop visible item
	theObj = eval('mydata_' + this.id);
	previewpop('preview_' + theObj.theUID , theObj.thePopX , theObj.thePopY , 'abs', 'img_' + theObj.theUID, theObj.thePrevimgpath + theObj.theBasename + '.jpg');
	popin_name = this.id; // memorize item
	}

function popout () {
	theObj = eval('mydata_' + this.id);
	popin_name = ""; // clear name tag
	previewpop('preview_' + theObj.theUID , '-500px', '-500px', 'abs', '', '');
	}

function previewpop(theName,theX,theY,theMode,thePreviewImageName,thePreviewImagePath)
{
if(document.getElementById)
{
	if ( ego = document.getElementById(theName) )
	{

		if ( theMode == "abs") { ego.style.position = "absolute"; }
		else { ego.style.position = "relative"; }

		// play fun with alpha, if possible
		
		for(i=0;i<=100;i=i+10) {
			window.setTimeout("wwp_fader(\'" + theName + "\'," + i + ")", 50 + ( 2 * i ) );
			}

		wwp_fader(theName,1);

		// hop to it
		
		ego.style.top = theY;
		ego.style.left = theX;

	}

	if(thePreviewImageName != "") {

		if ( ego = document.getElementById(thePreviewImageName) )
		{
			if ( 0 < ego.src.indexOf('thumbnail_placeholder') ) {
				ego.src = thePreviewImagePath; }
		}

	}

}
}

function wwp_fader ( theName, theValue ) {

	var theobj = document.getElementById(theName).style;

	theobj.opacity = theValue / 100;
	theobj.MozOpacity = theValue / 100;
	theobj.KhtmlOpacity = theValue / 100;
	theobj.filter = "alpha(opacity=" + theValue + ")";

	}

function wwp_fader_obj ( myObj, theValue ) {

	var theobj = myObj.style;

	theobj.opacity = theValue / 100;
	theobj.MozOpacity = theValue / 100;
	theobj.KhtmlOpacity = theValue / 100;
	theobj.filter = "alpha(opacity=" + theValue + ")";

	}

function mapmover () {

if(document.getElementById)
{
	if ( ego = document.getElementById('mapdiv') )
	{

	// start with upper left, in case all else fails...

		var posX = 0;
		var posY = 0;

	// this one is MS-compatible
	
	if (document.body.offsetWidth)
	{
		posX = (document.body.offsetWidth - 640 ) / 2;
		posY = (document.body.offsetHeight - 500 ) / 2;
	}
	
	// this one is Mozilla-Style
	
	if (window.innerWidth)
	{
		posX = ( window.innerWidth - 640 ) / 2;
		posY = ( window.innerHeight - 500 ) / 2;
	}
	
	// so let's hope there's some usable value in it

		ego.style.left = posX;
		// ego.style.top = posY;

	}
}

}


/*


COOKIE HANDLERS


*/




/*
   name - name of the cookie
   value - value of the cookie
   [expires] - expiration date of the cookie
     (defaults to end of current session)
   [path] - path for which the cookie is valid
     (defaults to path of calling document)
   [domain] - domain for which the cookie is valid
     (defaults to domain of calling document)
   [secure] - Boolean value indicating if the cookie transmission requires
     a secure transmission
   * an argument defaults when it is assigned null as a placeholder
   * a null placeholder is not required for trailing omitted arguments
*/
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}


/*
  name - name of the desired cookie
  return string containing value of specified cookie or null
  if cookie does not exist
*/
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}


/*
   name - name of the cookie
   [path] - path of the cookie (must be same as path used to create cookie)
   [domain] - domain of the cookie (must be same as domain used to
     create cookie)
   path and domain default if assigned null or omitted if no explicit
     argument proceeds
*/
function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"
function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}

// -->