
/*--------------------------------------------------------------------------------------------------------------*/
function OpenWindow (win_href, win_title, win_width, win_height, win_center, with_scrollbars, win_resizable, with_bar)
{

	if (win_height > screen.availHeight - 50)
		win_height = screen.availHeight - 50;

	win_width = win_width - 0;
	if (with_scrollbars == 'true')
	{
		win_width += 20;
	}
	
	var win_flags = "width=" + win_width + ",height=" + win_height;
	win_flags += ",resizable=yes,dependent=yes";
	
	if (with_scrollbars == 'true')
	{
		win_flags += ",scrollbars=yes";
	}
	
	if (win_center)
	{
		var win_left = Math.ceil ((screen.availWidth - win_width) / 2);
		var win_top  = Math.ceil ((screen.availHeight - win_height) / 3);
		win_flags	+= ",left=" + win_left + ",top=" + win_top;
	}
	
	win_flags += ",resizable=" + ((win_resizable == "true") ? "yes" : "no");
	win_flags += ",location=" + ((with_bar == "true") ? "yes" : "no");
	win_flags += ",menubar=" + ((with_bar == "true") ? "yes" : "no");
	win_flags += ",toolbar=" + ((with_bar == "true") ? "yes" : "no");

//	alert (win_flags);
	 
	window.open (win_href, win_title, win_flags);
}


/*--------------------------------------------------------------------------------------------------------------*/
function FIND(item) 
{
	if( window.mmIsOpera ) return(document.getElementById(item));
	if (document.all) return(document.all[item]);
	if (document.getElementById) return(document.getElementById(item));
	return(false);
}


/*--------------------------------------------------------------------------------------------------------------*/

function ShowPara (para_name)
{
	var para = FIND (para_name);

	if (para)
	{
		if (para.style.visibility != "visible")
		{
			para.style.visibility = "visible";
			para.style.display = "block";
		}
		else
		{
			para.style.visibility = "hidden";
			para.style.display = "none";
		}
	}
}


/*--------------------------------------------------------------------------------------------------------------*/
function SwapMenuIcon(icon_image)
{
	var srcname = icon_image.src;
	var gif_pos = srcname.indexOf (".gif");
	var name_pos = srcname.indexOf ("_open");
	var newname = "";
	if (name_pos >= 0)
		newname = srcname.substr (0, name_pos) + "_close";
	else
	{
		name_pos = srcname.indexOf ("_close");
		newname = srcname.substr (0, name_pos) + "_open";
	}
	newname += ".gif";
	icon_image.src = newname;
}
