// common.js  Common Javascript


// The "FeaturesConst" constants define the characteristics of the window (like size and decorations) to be opened
// upon clicking a link.  They must must all be named ending in "FeaturesConst".  The first part of their name
// allows for the automatic selection of the right characteristics through the function openWin() below.
// As an example, marketWebWinFeaturesConst is set at 1200x700; the three other variables are set at 800x700.

var defaultWinFeaturesConst = "toolbar=yes,scrollbars=yes,resizable=yes,width=700,height=600"; // window for default case
var marketWebWinFeaturesConst = "toolbar=yes,scrollbars=yes,resizable=yes,width=1200,height=700"; // window for Marketing/Websites case
var techBusWinFeaturesConst = "toolbar=yes,scrollbars=yes,resizable=yes,width=800,height=700"; // window for Technica/Business case
var articlesWinFeaturesConst = "toolbar=yes,scrollbars=yes,resizable=yes,width=800,height=700"; // window for Articles case




// Open a new window and give it the focus (pop it to the front)
// In the html, just call openWin() with a first argument value that matches one of the above variable names,
// without the FeaturesConst, e.g, openWin("defaultWin", "myfilename.pdf"), for the openWin function to work.
// Because of quotes, this might look like this:
// <a href="#" onClick="return openWin(\'defaultWin\',\'myfilename.pdf\');">Click Here</a>
// If you use defaultWin for every link's call to openWin(), then they will all share that window.
// If you use unique names for every link's call to openWin(), then they will not share windows.
// In either case, repeated clicks of the same link will always reuse the same window it used before.

function openWin(what, fname){
	var wNewWin = window.open(fname, what, eval(what + "FeaturesConst"));
	wNewWin.focus();
	return false;
}

