//----------------------------------------------------------------------.
//Open a pop up window.													|
//----------------------------------------------------------------------|
//Parameters;															|
//URL - The location of the document to open in the popup				|
//W - The width of the window - default 100								|
//H - The Height of the window - default 100							|
//Name - The name of the popup window - default "PopUpWindow"			|
//SC - yes/no weather to display scrollbars.							|
//RS - yes/no weather to allow resizing of the window.					|
//TO - yes/no weather to display toolbars.								|
//LO - yes/no weather to display location bar.							|
//CH - yes/no weather to copy the history over to the new window.		|
//DI - yes/no weather to display extra buttons (what's cool, personal	|
//												buttons, etc...).		|
//SB - yes/no weather to display the status bar.						|
//MB - yes/no weather to display the menu bar.							|
//----------------------------------------------------------------------'
function openPopUp(url, w, h, name, sc, rs, to, lo, ch, di, sb, mb)
{
	var newWindow = 0;
	//Width must be defined, so if "w" is not defined set it to 100, the minimum value.
	var w = (w == undefined) ? 100 : w;
	//Height must be defined, so if "h" is not defined set it to 100, the minimum value.
	var h = (h == undefined) ? 100 : h;
	//Name must be defined, so if "name" is not defined set it to "PopUpWindow".
	var name = (name == undefined) ? name = "PopUpWindow" : name = name;

	var attributeString = 'width=' + w + ',height=' + h;
	//These attributes are optional, if they aren't passed as a parameter...
	attributeString += (sc != undefined) ? ',scrollbars=' + sc : '';
	attributeString += (rs != undefined) ? ',resizable=' + rs: '';
	attributeString += (to != undefined) ? ',toolbar=' + to : '';
	attributeString += (lo != undefined) ? ',location=' + lo : '';
	attributeString += (ch != undefined) ? ',copyhistory=' + ch : '';
	attributeString += (di != undefined) ? ',directories=' + di : '';
	attributeString += (sb != undefined) ? ',status=' + sb : '';
	attributeString += (mb != undefined) ? ',menubar=' + mb : '';

	//Centre the pop-up window
	var winleft = (screen.width - w) / 2;
	var wintop = (screen.height - h) / 2;
	attributeString +=  ',left=' + winleft + ',top=' + wintop;
	//Open the pop-up window using the name and url supplied in the parameters.
	//The attributeString "styles" the window.
	newWindow = window.open(url,name,attributeString);
	//Focus the newly created 
	newWindow.focus();
}
	