<!--

// Common_GlobalVigJS.js
// =====================
// The following file handles all the variations of opening windows handled by the NAB site.
// Created: 2/07/2001 (RdF)
//

// The following lines are for tracking multiple windows being opened.
var opnwinNameArray = new Array();
var opnwinIDArray = new Array();
var eleReference = null;
var opnwinIdx = 0;

function openWindow(url)
{
	var winWidth = 700;
	var winHeight = 500;
	var options = "width=" + winWidth + ",height=" + winHeight + ",";
	options += "resizable=yes,scrollbars=yes,status=yes,";
	options += "menubar=yes,toolbar=yes,location=no,directories=yes,channelmode=no";
	var newWin = window.open(url, 'newWin', options);

        // Line removed by KHoward because it causes an error with IE 4.72
	//newWin.focus();
}


function openExtWindow(genURL, extwinName)
{
	var generatedURL = genURL;
	var winName      = extwinName;
	var targetFound  = false;
	var idx          = opnwinIdx;
	var eleName      = null;
	var eleReff      = null;

	// Search the array to see if the target window already exits.
	
	for(var i=0; i < idx; i++)
	{
		eleName = opnwinNameArray[i]

		// if there is a match, exit the for loop, else set the temp varibles to blanks.

		if (eleName == winName)
		{
			eleReff = opnwinIDArray[i]
			targetFound = true;
			break;
		}
		else 
		{
			eleName = "";			
		}
	}
		
	// Check to see if the target is empty or closed. If so then a new window will be opened. If not 
	// then the window already is opened and the focus will be shifted to it.
			
	if (targetFound)
	{
		if ((eleReff == null) || (eleReff.closed))
		{
			opnwinIDArray[i] = window.open(generatedURL, winName, 'height=440,width=800,scrollbars=yes,resizable=yes,menubar=yes,toolbar=yes');
			self.opnwinIDArray[i].focus(); 
		}
		else
		{ 
			self.opnwinIDArray[i].focus();            
		}
	}
	else
	{ 
		// If the target window is new, add it to the open windows arrays.
		opnwinIDArray[opnwinIdx] = window.open(generatedURL, winName, 'height=440,width=800,scrollbars=yes,resizable=yes,menubar=yes,toolbar=yes')
		opnwinNameArray[opnwinIdx] = winName;
		opnwinIdx = ++idx;
	}
}

function openBareExtWindow(genURL, extwinName)
{
	var generatedURL = genURL;
	var winName      = extwinName;
	var targetFound  = false;
	var idx          = opnwinIdx;
	var eleName      = null;
	var eleReff      = null;

	// Search the array to see if the target window already exits.

	for(var i=0; i < idx; i++)
	{
		eleName = opnwinNameArray[i]

		// if there is a match, exit the for loop, else set the temp varibles to blanks.

		if (eleName == winName)
		{
			eleReff = opnwinIDArray[i]
			targetFound = true;
			break;
		}
		else 
		{
			eleName = "";			
		}
	}
		
	// Check to see if the target is empty or closed. If so then a new window will be opened. If not 
	// then the window already is opened and the focus will be shifted to it.
			
	if (targetFound) 
	{
		if ((eleReff == null) || (eleReff.closed))
		{
			opnwinIDArray[i] = window.open(generatedURL, winName, 'height=440,width=800,scrollbars=no,resizable=yes,menubar=no,toolbar=no');
			self.opnwinIDArray[i].focus(); 
		}
		else
		{ 
			self.opnwinIDArray[i].focus();            
		}
	}
	else
	{ 
		// If the target window is new, add it to the open windows arrays.

		opnwinIDArray[opnwinIdx] = window.open(generatedURL, winName, 'height=440,width=800,scrollbars=no,resizable=yes,menubar=no,toolbar=no')
		opnwinNameArray[opnwinIdx] = winName;
		opnwinIdx = ++idx;
	}
}
	
function openDownloadWindow(file)
{
    	myWin=open(file, "Preview","width=470,height=340,scrollbars=no,resizable=no,status=no,toolbar=no,menubar=no");
}

//-->
