//----------------------------------------------------------------------
curWin = new Array(); //array of opened windows objects

//Generic function that replaces window.open
//Checks if the window already exists
// if no -> creates it
// if yes -> shows the window
//______________________________________________________________________
//call : popWindow(URL, NAME, WIDTH, HEIGHT, LEFT, TOP, RESIZE, SCROLLS)
//覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧
// URL, NAME : string
// WIDTH, HEIGHT, LEFT, TOP : integer
// RESIZE, SCROLLS : "yes", "no"
//----------------------------------------------------------------------
function popWindow(w_url, w_name, w_width, w_height, w_left, w_top, w_resize, w_scroll)
{
	//assigns a handle
	popWin = window.open("", w_name, "width="+ w_width + ",height=" + w_height + ",left=" + w_left + ",top=" + w_top + ",resizable=" + w_resize + ",scrollbars=" + w_scroll);

	if (popWin != null) //if the creation was successfull
	{
		if (curWin[w_name] != popWin) //if the handle does not exist in the array
		{
			//popWin.rootWin = self;
			popWin.location = w_url; //refreshes the content
			curWin[w_name] = popWin; //insert the window in the curWin array as an object
		}
		else
		{
			popWin.focus(); //show it
		}
	}
}
//----------------------------------------------------------------------

function popDoc(url)
{
	popWindow(url, "Doc", 600, 600, 10, 10, "yes", "yes");
}

function popPrefs(language)
{
	popWindow(language + "_preferences_form.asp", "Preferences", 500, 250, 10, 10, "no", "no");
}
