<krpano version="1.0.8" showerrors="true" logkey="false" onstart="initialize();">
	<include url="skin/defaultskin-map.xml" />
	<include url="skin/defaultskin.xml" />
	<include url="ecard.xml" devices="flash" />
	<include url="analytics.xml" devices="flash" />
	
	<data name="delicios_share_title"
		  content="London's National Gallery Virtual Tour"/>
	<data name="facebook_share_title"
		  content="London's National Gallery Virtual Tour"/>
	<data name="facebook_share_text"
		  content="London's National Gallery Virtual Tour"/>
	<data name="facebook_share_image"
		  content="http://www.vrwebdesign.co.uk/ng-design/images/logo.gif"/>
	<data name="tweeter_share_text"
		  content="London's National Gallery Virtual Tour"/>
	
	<action name="initialize">
		set(custom_fov, 40);
	</action>
	
	<!-- Plugins -->
	<plugin name="swfaddress"
			url="plugins/sa.swf"
			alturl="plugins/sa.js"
			keep="true"  
			preload="true"
			
			randomroot="false"
			parsepaths="true"
			titlePrefix=""
			titlePostfix=""
			
			mode="auto"
			onurlchange="activatepano(%PANOID);"
			onparamschange="paramschangeaction();"
			oninvalidaddress=""
			>
			<pano name="central-hall" 
     xmlurl="%SWFPATH%/central-hall.xml"
     pageurl="/central-hall/"
     pagetitle="Central Hall - Northern Italy 1500-1580"
     />
	 
	 		<pano name="central-hall-a" 
     xmlurl="%SWFPATH%/central-hall-A.xml"
     pageurl="/central-hall-a/"
     pagetitle="Central Hall - Northern Italy 1500-1580"
     />
	 <pano name="room-9" 
     xmlurl="%SWFPATH%/room-9.xml"
     pageurl="/room-9/"
     pagetitle="Room 9 - Venice 1530-1600"
     />
	 	<pano name="room-9-A" 
     xmlurl="%SWFPATH%/room-9-A.xml"
     pageurl="/room-9-A/"
     pagetitle="Room 9 - Venice 1530-1600"
     />
	 	 	<pano name="room-9-B" 
     xmlurl="%SWFPATH%/room-9-B.xml"
     pageurl="/room-9-B/"
     pagetitle="Room 9 - Venice 1530-1600"
     />
	 		<pano name="room-16" 
     xmlurl="%SWFPATH%/room-16.xml"
     pageurl="/room-16/"
     pagetitle="Room 16 - Early Rembrandt and Dutch Landscapes"
     />
	 
	 		<pano name="room-23-A" 
     xmlurl="%SWFPATH%/room-23-A.xml"
     pageurl="/room-23-A/"
     pagetitle="Room 23 - Rembrandt and Dutch Painting 1640-1660"
     />
	 
	 		<pano name="room-23-B" 
     xmlurl="%SWFPATH%/room-23-B.xml"
     pageurl="/room-23-B/"
     pagetitle="Room 23 - Rembrandt and Dutch Painting 1640-1660"
     />
	 
	 
	 		<pano name="room-24-A" 
     xmlurl="%SWFPATH%/room-24-A.xml"
     pageurl="/room-24-A/"
     pagetitle="Room 24 - Rembrandt and Dutch Caravaggists"
     />
	 
	 		<pano name="room-24-B" 
     xmlurl="%SWFPATH%/room-24-B.xml"
     pageurl="/room-24-B/"
     pagetitle="Room 24 - Rembrandt and Dutch Caravaggists"
     />
	 
	 		<pano name="room-27" 
     xmlurl="%SWFPATH%/room-27.xml"
     pageurl="/room-27/"
     pagetitle="Room 27 - Dutch Scenes of Everyday Life"
     />
	 
	 		<pano name="room-30" 
     xmlurl="%SWFPATH%/room-30.xml"
     pageurl="/room-30/"
     pagetitle="Room 30 - Spain"
     />
	 
	 
	 	 		<pano name="room-30-A" 
     xmlurl="%SWFPATH%/room-30-A.xml"
     pageurl="/room-30-A/"
     pagetitle="Room 30- Spain"
     />

	 
	 
	 		<pano name="room-30-B" 
     xmlurl="%SWFPATH%/room-30-B.xml"
     pageurl="/room-30-B/"
     pagetitle="Room 30 - Spain"
     />
	 
	 		<pano name="room-32" 
     xmlurl="%SWFPATH%/room-32.xml"
     pageurl="/room-32/"
     pagetitle="Room 32 - Italy"
     />
	 
	 		<pano name="room-32-A" 
     xmlurl="%SWFPATH%/room-32-A.xml"
     pageurl="/room-32-A/"
     pagetitle="Room 32 - Italy"
     />
	 
	 		<pano name="room-32-B" 
     xmlurl="%SWFPATH%/room-32-B.xml"
     pageurl="/room-32-B/"
     pagetitle="Room 32 - Italy"
     />

	 
	 		<pano name="room-34" 
     xmlurl="%SWFPATH%/room-34.xml"
     pageurl="/room-34/"
     pagetitle="Room 34 - Great Britain 1750-1850"
     />
	 
	 		<pano name="room-34-A" 
     xmlurl="%SWFPATH%/room-34-A.xml"
     pageurl="/room-34-A/"
     pagetitle="Room 34 - Great Britain 1750-1850"
     />
	 
	 		<pano name="room-34-B" 
     xmlurl="%SWFPATH%/room-34-B.xml"
     pageurl="/room-34-B/"
     pagetitle="Room 34 - Great Britain 1750-1850"
     />
	
	<pano name="room-36" 
     xmlurl="%SWFPATH%/room-36.xml"
     pageurl="/room-36/"
     pagetitle="Room 36 - British Portraits 1750-1800"
     />

	
	<pano name="room-43" 
     xmlurl="%SWFPATH%/room-43.xml"
     pageurl="/room-43/"
     pagetitle="Room 43 - Manet, Monet and the Impressionists"
     />
	 
	 
	  	<pano name="room-45" 
     xmlurl="%SWFPATH%/room-45.xml"
     pageurl="/room-45/"
     pagetitle="Room 45 - Van Gogh and Cozanne"
     />

	 
	 	<pano name="room-56" 
     xmlurl="%SWFPATH%/room-56.xml"
     pageurl="/room-56/"
     pagetitle="Room 56 - The Netherlands 1400-1450"
     />
	 
	 <pano name="room-57" 
     xmlurl="%SWFPATH%/room-57.xml"
     pageurl="/room-57/"
     pagetitle="Room 57 - Florence 1450-1500"
     />
	 
 	<pano name="room-60" 
     xmlurl="%SWFPATH%/room-60.xml"
     pageurl="/room-60/"
     pagetitle="Room 60 - Siena and Perugia 1450-1500"
     />
			
	 
	 <pano name="room-65" 
     xmlurl="%SWFPATH%/room-65.xml"
     pageurl="/room-65/"
     pagetitle="Room 65 - Southern Germany and Austria"
     />
	 
	 <pano name="room-66" 
     xmlurl="%SWFPATH%/room-66.xml"
     pageurl="/room-66/"
     pagetitle="Room 66 - Piero della Francesca"
     />
	 

	 
	 <pano name="stairs" 
     xmlurl="%SWFPATH%/stairs.xml"
     pageurl="/stairs/"
     pagetitle="Stairs - Main Vestibule"
     />
	</plugin>
	
	<plugin name="bitly" 
			url="plugins/bitly.swf"
			alturl="plugins/bitly.js"
			keep="true"
			preload="true"
			
			apikey="R_e342ee01a880b21a0ba836f16d4c82e3"
			login="tommo77funk"
			onerror="showlog(); trace(The URL cannot be shortened);"
			/>
			
	<action name="activatepano">
		loadpano(%SWFPATH%/%1,null,MERGE,BLEND(1));
		wait(BLEND);
	</action>
	
	<action name="paramschangeaction">
		ifnot (plugin[swfaddress].hasparams === false, parseparams(); plugin[swfaddress].removeparams(););
	</action>
	
	<action name="parseparams">
		if (plugin[swfaddress].param_ath !== null, copy(p_ath, plugin[swfaddress].param_ath), copy(p_ath, 0));
		if (plugin[swfaddress].param_atv !== null, copy(p_atv, plugin[swfaddress].param_atv), copy(p_atv, 0));
		if (plugin[swfaddress].param_fov !== null, copy(p_fov, plugin[swfaddress].param_fov), copy(p_fov, 90));
		lookto(get(p_ath), get(p_atv), get(p_fov));
	</action>
	
	<!-- <action name="getlinktothisview">
		set(data[viewurl].content, null);
		txtadd(data[viewurl].content, get(plugin[swfaddress].baseurl), '#', get(plugin[swfaddress].path), '?ath=', get(view.hlookat), '&amp;atv=', get(view.vlookat), '&amp;fov=', get(view.fov));
	</action> -->
	
	<action name="getlinktothisview"> 
	  set(data[viewurl].content, null);
	  txtadd(data[viewurl].content, 'http://www.nationalgallery.org.uk/visiting/virtualtour/', '#', get(plugin[swfaddress].path), '?ath=', get(view.hlookat), '&amp;atv=', get(view.vlookat), '&amp;fov=', get(view.fov));
	  plugin[swfaddress].setparams(ath=view.hlookat,atv=view.vlookat,fov=view.fov);
	</action> 
	
	<action name="prepareurl">
		getlinktothisview();
		plugin[bitly].shorten(data[viewurl].content, true);
	</action>
	
	<!-- Share on delicious -->
	<action name="share_delicious">
		set(plugin[bitly].onsuccess, share_url_on_delicious(%URL););
		prepareurl();
	</action>
	
	<action name="share_url_on_delicious">
		set(data[link].content, null);
		txtadd(data[link].content, 'http://delicious.com/save?url=', %1, '&amp;title=', get(data[ecard_delicios_share_title].content));
		if (ishtml5, plugin[bitly].replaceapersands(get(data[link].content), data[link].content));
		if (ishtml5, openurl(get(data[link].content),_self), js(opensharewindow(get(data[link].content))));
	</action>
	
	<!-- Share on Facebook actions -->
	<action name="share_on_facebook">
		set(plugin[bitly].onsuccess, share_url_on_facebook(%URL););
		prepareurl();
	</action>
	
	<action name="share_url_on_facebook">
		set(data[link].content, null);
		txtadd(data[link].content, 'http://www.facebook.com/sharer.php?s=100&amp;p[title]=', get(data[facebook_share_title].content), '&amp;p[url]=', %1, '&amp;p[images][0]=', get(data[facebook_share_image].content), '&amp;p[summary]=', get(data[facebook_share_text].content));
		if (ishtml5, plugin[bitly].replaceapersands(get(data[link].content), data[link].content));
		if (ishtml5, openurl(get(data[link].content),_self), js(opensharewindow(get(data[link].content))));
	</action>
	
	<!-- Share on Twitter actions -->
	<action name="share_on_twitter">
		set(plugin[bitly].onsuccess, share_url_on_twitter(%URL););
		prepareurl();
	</action>
	
	<action name="share_url_on_twitter">
		set(data[link].content, null);
		txtadd(data[link].content, 'http://twitter.com/share?text=', get(data[tweeter_share_text].content), '&amp;url=', %1);
		if (ishtml5, plugin[bitly].replaceapersands(get(data[link].content), data[link].content));
		if (ishtml5, openurl(get(data[link].content),_self), js(opensharewindow(get(data[link].content))));
	</action>
	
	<contextmenu>
		<item caption="FULLSCREEN" />
		<item name="view_normal" caption="Normal View" onclick="action(enable_normal);" separator="true" enabled="false" />
		<item name="view_fisheye" caption="Fisheye View" onclick="action(enable_fisheye);" />
		<item name="view_architectural" caption="Architectural View" onclick="action(enable_architectural);" />
		<item name="view_stereographic" caption="Stereographic View" onclick="action(enable_stereographic);" />
		<item name="view_little_planet" caption="Little Planet View" onclick="action(enable_little_planet);" />
                
		<item caption="KRPANO" separator="true" />
	</contextmenu>
	
	
	<!-- actions for view changing (adapted from http://krpano.com/examples/littleplanets) -->
	<action name="enable_view">
		set(contextmenu.item[view_normal].enabled,true);
		set(contextmenu.item[view_fisheye].enabled,true);
		set(contextmenu.item[view_architectural].enabled,true);
		set(contextmenu.item[view_stereographic].enabled,true);
		set(contextmenu.item[view_little_planet].enabled,true);
		set(contextmenu.item[%1].enabled,false);
	</action>
	<action name="enable_normal">
		action(enable_view,view_normal);
		tween(view.fovmax,       120.0, distance(179, 0.25), easeoutquad);
		tween(view.architectural,  0.0, distance(1.0, 0.25), easeoutquad);
		tween(view.fisheye,        0.0, distance(1.0, 0.25), easeoutquad, set(view.stereographic,false); );
	</action>
	<action name="enable_fisheye">
		action(enable_view,view_fisheye);
		tween(view.architectural, 0.0, distance(1.0, 0.25), easeoutquad);
		tween(view.fisheye,       0.0 ,distance(1.0, 0.20), easeoutquad,
		set(view.stereographic,false);
		set(view.fovmax,179);
		tween(view.fisheye, 0.35, distance(1.0, 1.25));
		);
	</action>
	<action name="enable_architectural">
		action(enable_view,view_architectural);
		tween(view.fovmax,       100.0, distance(179, 0.25), easeoutquad);
		tween(view.architectural,  1.0, distance(1.0, 0.25), easeoutquad);
		tween(view.fisheye,        0.0, distance(1.0, 0.25), easeoutquad, set(view.stereographic,false); );
	</action>
	<action name="enable_stereographic">
		action(enable_view,view_stereographic);
		tween(view.architectural, 0.0, distance(1.0, 0.25), easeoutquad);
		tween(view.fisheye,       0.0 ,distance(1.0, 0.10), easeoutquad,
		set(view.stereographic,true);
		tween(view.fisheye, 1.0, distance(1.0, 1.25));
		tween(view.fovmax,  150, distance(179, 1.25));
		);
	</action>
	<action name="enable_little_planet">
		action(enable_view,view_little_planet);
		tween(view.architectural, 0.0, distance(1.0, 0.25), easeoutquad);
		tween(view.fisheye,       0.0 ,distance(1.0, 0.10), easeoutquad,
		set(view.stereographic,true);
		tween(view.fisheye, 1.0, distance(1.0, 0.75));
		tween(view.fov,     130, distance(179, 0.75), easeoutquad, set(view.fovmax,150););
		tween(view.vlookat,  90, distance(179, 0.75), easeoutquad);
		);
	</action>
	
</krpano>