// JavaScript Document
function GerrorLoad(gbody, gtitle, gwidth, gheight, gtitle_height, gtitle_background_color, gbody_background_color, border_color)
{
	var screen_width = 783;
	
	var top_position = 100;
	var left_position;
	

	if (gtitle.length == 0)
	{
		var tmp_gtitle = "<strong>Error</strong>";
	}
	else
	{
		var tmp_gtitle = gtitle;	
	}


	if (gwidth.length == 0)
	{
		var tmp_gwidth = 200;
	}
	else
	{
		var tmp_gwidth = gwidth;	
	}
	

	if (gheight.length == 0)
	{
		var tmp_gheight = 180;
	}
	else
	{
		var tmp_gheight = gheight;	
	}


	if (gtitle_height.length == 0)
	{
		var tmp_gtitle_height = 18;
	}
	else
	{
		var tmp_gtitle_height = gtitle_height;	
	}


	if (border_color.length == 0)
	{
		var tmp_border_color = "#000000";
	}
	else
	{
		var tmp_border_color = border_color;	
	}


	if (gtitle_background_color.length == 0)
	{
		var tmp_gtitle_background_color = "#CCCCCC";
	}
	else
	{
		var tmp_gtitle_background_color = gtitle_background_color;	
	}


	if (gbody_background_color.length == 0)
	{
		var tmp_gbody_background_color = "#FFFFFF";
	}
	else
	{
		var tmp_gbody_background_color = gbody_background_color;	
	}





	if ((screen_width % 2) == 0)
	{
		var shalf = screen_width / 2;
	}
	else
	{
		var shalf = screen_width - 1;
		shalf = shalf / 2;
	}
	
	if ((gwidth % 2) == 0)
	{
		var ghalf = gwidth / 2;
	}
	else
	{
		var ghalf = gwidth - 1;
		ghalf = ghalf / 2;
	}
	
	left_position = shalf - ghalf;
	
	
	document.getElementById("gerror").style.width = tmp_gwidth;
	document.getElementById("gerror_blocker").style.width = tmp_gwidth;
	document.getElementById("gerror_table").style.width = tmp_gwidth;
	
	document.getElementById("gerror").style.height = tmp_gheight;
	document.getElementById("gerror_blocker").style.height = tmp_gheight;
	document.getElementById("gerror_table").style.height = tmp_gheight;
	
	document.getElementById("gerror_table").style.border = "1px " + tmp_border_color + " solid";
	
	document.getElementById("gerror_title").innerHTML = tmp_gtitle;
	document.getElementById("gerror_title").style.height = tmp_gtitle_height;
	document.getElementById("gerror_title_row").style.backgroundColor = tmp_gtitle_background_color;
	
	document.getElementById("gerror_body").style.backgroundColor = tmp_gbody_background_color;
	document.getElementById("gerror_body").innerHTML = gbody;
	
	document.getElementById("gerror").style.top = top_position;
	document.getElementById("gerror_blocker").style.top = top_position;
	
	document.getElementById("gerror").style.left = left_position;
	document.getElementById("gerror_blocker").style.left = left_position;
	
	GerrorDisplay();
}

function GerrorClear()
{
	document.getElementById("gerror").style.width = 0;
	document.getElementById("gerror_blocker").style.width = 0;
	document.getElementById("gerror_table").style.width = 0;
	
	document.getElementById("gerror").style.height = 0;
	document.getElementById("gerror_blocker").style.height = 0;
	document.getElementById("gerror_table").style.height = 0;
	
	document.getElementById("gerror_table").style.border = "";
	
	document.getElementById("gerror_title").innerHTML = "";
	document.getElementById("gerror_title").style.height = 0;
	document.getElementById("gerror_title").style.backgroundColor = "";
	
	document.getElementById("gerror_body").style.backgroundColor = "";
	document.getElementById("gerror_body").innerHTML = "";
	
	document.getElementById("gerror").style.top = 0;
	document.getElementById("gerror_blocker").style.top = 0;
	
	document.getElementById("gerror").style.left = 0;
	document.getElementById("gerror_blocker").style.left = 0;
	
	GerrorHide();
}

function GerrorDisplay()
{
	document.getElementById("gerror").style.display = "block";
	document.getElementById("gerror_blocker").style.display = "block";
}

function GerrorHide()
{
	document.getElementById("gerror").style.display = "none";
	document.getElementById("gerror_blocker").style.display = "none";
}

function OpenSite(asite) //function used by the menus
{
	window.open(asite, "PCI");
}



//used to correct a vertical bar on 3 column pages
/*function fix_3column_bar()
{
 	window.setTimeout("fix_vertical_bar()", 30);
}

//used to correct a vertical bar on 3 column pages
function fix_vertical_bar()
{
	var header_top = document.getElementById("content").offsetTop;
	
	var content_height = document.getElementById("page_content_bottom").offsetTop;
	if (document.getElementById("subcol3_bottom"))
	{
		var content_test = document.getElementById("subcol3_bottom").offsetTop;
		if (content_test > content_height)
		{
			content_height = content_test
		}
	}
	
	if (document.getElementById("xcol3_bottom"))
	{
		var content_test = document.getElementById("xcol3_bottom").offsetTop;
		if (content_test > content_height)
		{
			content_height = content_test
		}
	}
	
	
	var new_bar_height = Math.abs(content_height - header_top); 
	if (new_bar_height > 180)
	{
		document.getElementById("content").style.height = new_bar_height + "px";
	}
	else
	{
		document.getElementById("content").style.height = "180px";
	}
	
}*/