var NAV_OFFSET_X = -25;
var NAV_OFFSET_Y = -65;
var CONTENT_OFFSET_X = 125;
var CONTENT_OFFSET_Y = -50;

var nav; 
var smallImgs = null;
var largeImgs = null;

function onLoad() 
{
	var pRect = getDocRect();
	nav = new CircleNav("dW", "iW", null, null, "dT");
	
	// Assign event handlers.
	document.onmousemove 	= nav.onMouseMove;
	document.onmousedown 	= nav.onMouseDown;
	document.onmouseup		= nav.onMouseUp;
	
	//nav.setDisplayParams(null, 300, new Point(0, 0), false, false, false, 1);
	nav.setDisplayParams(1.0 * Math.PI, 250, new Point(50, 100), true, true, true, 0.25)
	nav.setFade(null, true);
	nav.load(smallImgs, largeImgs, "progressCallback");
	
	onResize();
	
	myOnLoad();
}

function onResize()
{
	var wRect	= nav.getBoundRect();
	var pRect 	= getDocRect();
	var centerX	= wRect.dx / 2 + NAV_OFFSET_X;
	var centerY	= wRect.dy / 2 + NAV_OFFSET_Y;
	
	nav.setLocations(new Point(centerX, centerY), null, new Point(centerX + CONTENT_OFFSET_X, centerY + CONTENT_OFFSET_Y));
				  
	var navZero = nav.getZeroLoc();
}

function progressCallback(progress)
{
	var style = getItemStyle("loading");
	// Advance the progress bar.
	getItemStyle("loadBarF").width = progress * 100 + "%";
	// When beginning to load, set load bar as visible.
	if (progress == 0)
	{
		style.visibility = "visible";
	}
	// On done or error, dismiss loading bar and show other hidden elements.
	else if (progress == 1 || progress == -1)
	{
		style.visibility = "hidden";
	}
}

function myOnLoad() {}

