//rstpopup() opens a new child window without menubar
function rstpopup(link) {
	var windowTitle = (arguments[1] != 'undefined' && arguments[1] != null) ? arguments[1] : '';
	if (windowTitle != '') {
		link += '&pageTitle=' + windowTitle;
	}
	var newWindow = window.open(link,"","resizable=0,scrollbars=yes,menubar=no,status=no,toolbar=no,width=625,height=460");
}//End of rstpopup()

function openPopUpWindow(link) {
	var windowWidth = (arguments[1] != 'undefined' && arguments[1] != null) ? arguments[1] : '';
	var newWindow = window.open(link,"","scrollbars=yes,status=no,width=" + windowWidth + ",toolbar=yes,status=yes");
}

function popMovie(width, height, movie) {
	var closeWindowText = (arguments[3] != 'undefined' && arguments[3] != null) ? arguments[3] : 'close window';
	var target = (arguments[4] != 'undefined' && arguments[4] != null) ? arguments[4] : null;
	var content = '';
	content += '<div style=\"text-align:center\">';
	content += getFlashMovie(movie, width, height, '', '#FFFFFF');
	content += '<p>[ <a href=\"javascript:window.close();\">' + closeWindowText + '</a> ]</p>';
	content += '</div>';
	popALittlePopup(width+30, height+120, content, target);
}

function popALittlePopup(width, height, content) {
	var target = (arguments[3] != 'undefined' && arguments[3] != null) ? arguments[3] : 'helpWindow';
	helpWindow=window.open('/helpfile.html',target,'width=' + width + ',height=' + height + ',location=no,toolbar=no,status=no,scrollbars=no,resizable=yes,menubar=no,directories=no,');
	helpWindow.document.location='about:blank';
	helpWindow.document.write(content);
	helpWindow.document.close();
	// If opening into a popup that's already open, the popup will not size to the width and height given if we don't force it to
	helpWindow.resizeTo(width, height);
	helpWindow.focus();
}

function popPage(width, height, link) {
	var target = (arguments[3] != 'undefined' && arguments[3] != null) ? arguments[3] : '';
	var newWindow = window.open(link,target,"width=" + width + ",height=" + height + ",location=no,toolbar=no,status=no,scrollbars=no,resizable=yes,menubar=no,directories=no");
	
	// If opening into a popup that's already open, the popup will not size to the width and height given if we don't force it to
	// Have to add the 12 to width and the 38 to height to get the overall window to match the dimensions given
	newWindow.resizeTo(width + 12, height + 38);
}

function popPageWithLocation(width, height, link) {
	var target = (arguments[3] != 'undefined' && arguments[3] != null) ? arguments[3] : '';
	var newWindow = window.open(link,target,"width=" + width + ",height=" + height + ",location=yes,toolbar=no,status=yes,scrollbars=no,resizable=no,menubar=no,directories=no");
	
	// If opening into a popup that's already open, the popup will not size to the width and height given if we don't force it to
	// Have to add the 12 to width and the 38 to height to get the overall window to match the dimensions given
	newWindow.resizeTo(width + 12, height + 38);
}

function popPageWithScroll(width, height, link) {
	var target = (arguments[3] != 'undefined' && arguments[3] != null) ? arguments[3] : '';
	var newWindow = window.open(link,target,"width=" + width + ",height=" + height + ",location=no,toolbar=no,status=no,scrollbars=yes,resizable=yes,menubar=no,directories=no");
	
	// If opening into a popup that's already open, the popup will not size to the width and height given if we don't force it to
	// Have to add the 12 to width and the 38 to height to get the overall window to match the dimensions given
	newWindow.resizeTo(width + 12, height + 38);
}

function launchThirdPartyTracker(url) {
	var link = "/interrupt.html?component=3rdPartyTracker&hidewrapper=true&destination=" + url;
	var width = (arguments[1] != 'undefined' && arguments[1] != null) ? arguments[1] : '500';
	var height = (arguments[2] != 'undefined' && arguments[2] != null) ? arguments[2] : '700';
	var target = (arguments[3] != 'undefined' && arguments[3] != null) ? arguments[3] : 'toolsScroll';
	
	var newWindow = window.open(link,target,"width=" + width + ",height=" + height + ",location=no,toolbar=no,status=no,scrollbars=yes,resizable=yes,menubar=no,directories=no");
	
	// If opening into a popup that's already open, the popup will not size to the width and height given if we don't force it to
	// Have to add the 12 to width and the 38 to height to get the overall window to match the dimensions given
	newWindow.resizeTo(width + 12, height + 38);
}

function launchLeavingSiteNotification(url) {
	var link = "/interrupt.html?component=LeavingSite&hidewrapper=true&destination=" + url;	
	var newWindow = window.open(link,"thirdPartySite");
}

//***********************************************************************
//* FIT 37402 bfuller 06/17/10
//*
//* Redirect the parent window to the link and close the pop up window
//***********************************************************************
function parentRedirectClose(link){

	opener.location.href=link;
	self.close();
}