// JavaScript Document
var showingElements = true;
var showingNotes = false;
var elements = [];
function init() 
{	
	elements['carousel'] 	= {	id:'carousel',	x: krpano().get("plugin[carousel].x"),	y:krpano().get("plugin[carousel].y") };	
	elements['logo'] 		= {	id:'logo',		x: krpano().get("plugin[logo].x"),		y:krpano().get("plugin[logo].y") };
}
function krpano() 
{
	return document.getElementById("krpanoSWFObject");
}
function setOrigin(hotspot)
{	
	krpano().call("tween(plugin["+hotspot+"].x,"+elements[hotspot].x+",distance(220,0.5),easeoutquad);");
	krpano().call("tween(plugin["+hotspot+"].y,"+elements[hotspot].y+",distance(220,0.5),easeoutquad);");
}
function setNewPosition(hotspot, x, y)
{	
	if(x!='')
	krpano().call("tween(plugin["+hotspot+"].x,"+x+",distance(220,0.5),easeoutquad);");
	
	if(y!='')
	krpano().call("tween(plugin["+hotspot+"].y,"+y+",distance(220,0.5),easeoutquad);");
}
function switchElements()
{
	if(showingElements)
	{
		setNewPosition('carousel','',-200);
		setNewPosition('logo',-200,'');
		showingElements = false;
	}else{
		
		setOrigin('carousel');
		setOrigin('logo');		
		showingElements = true;		
	}
}
function switchNotes()
{
	if(showingNotes)
	{
		krpano().call("action(hidenotes);");
		showingNotes = false;
		
	}else{
		krpano().call("action(shownotes);");
		showingNotes = true;
	}
}
