function showSitemap( x_root_project)
{
	var		oWindow = null;
	var		iWidth = 300;
	var		iHeight = 600;

	oWindow = window.open( x_root_project+"popups/sitemap.php", "POPUP_SITEMAP", "dependent=yes,locationbar=no,menubar=no,scrollbars=yes,resizable=yes,status=no,screenX=0,screenY=0,height="+iHeight+",width="+iWidth); 
	if( top.window.opener)
		oWindow.opener = top.window.opener;

	oWindow.moveTo( 0, 0);
	oWindow.focus();
//	centerWindow( oWindow, iWidth, iHeight)
}

function showPictures( x_IDs, x_root_project, x_total, x_page, x_level, x_sub)
{
	var		oWindow = null;
	var		iWidth = 1020;
	var		iHeight = 900;

	oWindow = window.open( x_root_project+"popups/pictures.php?sub="+x_sub+"&page="+x_page+"&IDs="+x_IDs+"&total="+x_total+"&level="+x_level, "POPUP_PICTURES", "dependent=yes,locationbar=no,menubar=no,scrollbars=yes,resizable=yes,status=no,screenX=0,screenY=0,height="+iHeight+",width="+iWidth); 
	if( top.window.opener)
		oWindow.opener = top.window.opener;

//	centerWindow( oWindow, iWidth, iHeight)
	oWindow.focus();
}

function showSearchHelp( x_root)
{
	var		oWindow = null;
	var		iWidth = 500;
	var		iHeight = 300;

	oWindow = window.open( x_root+"template.popup.php?blur=1&target=searchhelp", "POPUP_SEARCHHELP", "dependent=yes,locationbar=no,menubar=no,scrollbars=no,resizable=yes,status=no,screenX=0,screenY=0,height="+iHeight+",width="+iWidth); 
	if( top.window.opener)
		oWindow.opener = top.window.opener;

	centerWindow( oWindow, iWidth, iHeight)
}

function showSpeciesSheetPrintview( x_url_var)
{
	var		oWindow = null;
	var		iWidth = 700;
	var		iHeight = 800;

	oWindow = window.open( "template.popup.php?blur=0&target=speciessheet.printview&"+x_url_var, "POPUP_SPECIESSHEETPRINTVIEW", "dependent=yes,locationbar=no,menubar=no,scrollbars=yes,resizable=yes,status=no,screenX=0,screenY=0,height="+iHeight+",width="+iWidth); 
	if( top.window.opener)
		oWindow.opener = top.window.opener;

	centerWindow( oWindow, iWidth, iHeight)
}

function showRedlistComment( x_redlistdataID, x_type, x_root)
{
	var		oWindow = null;
	var		iWidth = 400;
	var		iHeight = 200;

	oWindow = window.open( x_root+"template.popup.php?blur=1&target=redlistcomment&redlistdataID="+x_redlistdataID+"&type="+x_type, "POPUP_REDLISTCOMMENT", "dependent=yes,locationbar=no,menubar=no,scrollbars=no,resizable=yes,status=no,screenX=0,screenY=0,height="+iHeight+",width="+iWidth); 
	if( top.window.opener)
		oWindow.opener = top.window.opener;

	centerWindow( oWindow, iWidth, iHeight)
}

function showCitation( x_referenceID, x_root)
{
	var		oWindow = null;
	var		iWidth = 400;
	var		iHeight = 200;

	oWindow = window.open( x_root+"template.popup.php?blur=1&target=citation&referenceID="+x_referenceID, "POPUP_CITATION", "dependent=yes,locationbar=no,menubar=no,scrollbars=no,resizable=yes,status=no,screenX=0,screenY=0,height="+iHeight+",width="+iWidth); 
	if( top.window.opener)
		oWindow.opener = top.window.opener;

	centerWindow( oWindow, iWidth, iHeight)
}

function centerWindow( x_obj, x_width, x_height)
{
	var posX = (screen.availWidth - x_width) / 2;
	var posY = (screen.availHeight - x_height) / 2;

	x_obj.resizeTo( x_width, x_height);
	x_obj.moveTo( posX, posY);
	x_obj.focus();
}

function generateMap( x_speciesID, x_map, iWidth, iHeight, x_root, x_species_orgID)
{
	var		oWindow = null;

	oWindow = window.open( x_root+"template.popup.php?blur=1&target=maps&species_orgID="+x_species_orgID+"&speciesID="+x_speciesID+"&map="+x_map, "POPUP_MAP", "dependent=yes,locationbar=no,menubar=no,scrollbars=no,resizable=yes,status=no,screenX=0,screenY=0,height="+iHeight+",width="+iWidth); 
	if( top.window.opener)
		oWindow.opener = top.window.opener;

	centerWindow( oWindow, iWidth, iHeight)
}


