//	THIS IS THE REPOSITORY FOR ALL UNIVERSAL SCRIPT.
//  DO NOT PUT PAGE-SPECIFIC SCRIPT IN THIS FILE.


// inline script goes below this line.



// functions below this line
// ------------------------------------------------------------------------------------------------------------------------------------------------------------
	
	
// pop is the same as the old 'win' function except now it is readable.
function pop(popUrl, popWindowName, popWidth, popHeight, popAddressBar, popMenuBar, popScroll, popResize, popToolBar)
{
	/* 
	If you don't specify some parameters, the function assumes it's ZERO
	
	Parameter values: "1" = ON
								"0" = OFF
	
	popURL					=	STRING: The relative path and address of the link
	popWindowName	 =	STRING: The name of the new window, so we can re-use it if need be
	popWidth				=	INTEGER: The width in pixels, of the new window: Remember, width needs to be 20 pixels wider if Scroolbars are enabled.
	popHeight				=	INTEGER: The height in pixels of the new window: Remember, if a horizontal scrollbar is present, then ass 20 pixels in height
	popAddressBar		=	INTEGER: The Address Bar of the browser: where you enter and read a URL of a page
	popMenuBar			=	INTEGER: The "File", "Edit", "View", "Favourites", "Tools", and "Help" buttons.
	popScroll				=	INTEGER: Whether Scroll Bars appear on the page
	popResize				=	INTEGER: Whether the new window can be resized. If the new window links to content, make sure this is set to "1"
	popToolBar				=	INTEGER: The standard Menu Buttons: Back, Forwards, Stop, Reload etc
	
	Please consider carefully how to implement this function.
	It is better to leave the user too many options, than not enough. 
	Resizeability is a key feature of windows, and should not be disabled lightly!
	
	When using some of the options above, make sure you get the size of the window (popWidth & popHeight) correct,
	Because these variables refer to the CONTENT width and height- NOT the measurements of the outside of the window.
	
	You must NOT allow background images to repeat in the new window, unless it is a tiling background image. 
	This because browsers opening the new window in a new Tab do not have the dimensions or properties you specify.
	
	ALWAYS CHECK RESULTS IN FIREFOX OR OTHER TAB-CAPABLE BROWSER
	*/

	//This next two lines figure out the middle of the screen, so it appears correctly on every screen
	popFromLeft = (window.screen.width/2) - ((popWidth/2) + (popWidth/58));
	popFromTop = (window.screen.height/2) - (popHeight/2 + (popHeight/14));
	
	// Assemble the .open parameters from the figures passed to the function
	params  = "width=" + popWidth + ",";
	params += "height=" + popHeight + ",";
	params += "toolbar=" + popToolBar+",";
	params += "location="+popAddressBar+",";
	params += "directories=0,";
	params += "status=1,";
	params += "menubar=" + popMenuBar + ",";
	params += "scrollbars=" + popScroll + ",";
	params += "resizable=" + popResize + ",";
	params += "left=" + popFromLeft + ",";
	params += "top=" + popFromTop + "";
	
	// Open the new window using all the parameters we just assembled.
	newWindow = window.open(popUrl, popWindowName, params);
}

function Win(url,winname,w2,h2,p1,p2,p3,p4,p5){
	w1 = (window.screen.width/2) - ((w2/2) + (w2/58));
	h1 = (window.screen.height/2) - (h2/2 + (h2/14));
	params  = "width="+w2+",";
	params += "height="+h2+",";
	params += "toolbar="+p5+",";
	params += "location="+p1+",";
	params += "directories=0,";
	params += "status=1,";
	params += "menubar="+p2+",";
	params += "scrollbars="+p3+",";
	params += "resizable="+p4+",";
	params += "left="+w1+",";
	params += "top="+h1+"";
	newWindow = window.open(url,winname,params,w2,h2,p1,p2,p3,p4,p5); 
}