var currentPopupWindow = 0

function showWindow( url )
{
	if( currentPopupWindow ) 
	{ 
		if( currentPopupWindow.closed == false  ) 
			currentPopupWindow.close(); 
	} 
	
	currentPopupWindow = window.open( url );
}

function showPage( root, id )
{
	var pageResource = findResource( id, vpbPageIndex );

	if( typeof pageResource == "undefined" )
		parent._html.location = root + "null.htm";
	else
		parent._html.location = root + pageResource.name;
}

function home( root )
{
	parent._html.location = root + vpbPageIndex[0].name;
}

function showSlide( root, id )
{
	var slideResource = findResource( id, vpbSlideIndex );

	if( typeof slideResource == "undefined" )
		parent._slide.location = root + "null.htm";
	else
		parent._slide.location = root + slideResource.name;
}

function findResource( id, resourceList )
{
	for( j = 0; j < resourceList.length; j++ )
	{
		if( resourceList[j].id == id )
			return resourceList[j];
	}
}

function createResource( id, name )
{
	var resource = new Object();

	resource.id = id;
	resource.name = name;

	return resource;
}

