

/***************************************************
 popupWindow.js

 Date: 9/15/2006
 Purpose: JavaScript for popup windows
***************************************************/




// Global variables
var _worksheetRouterURL = "/worksheet/router.asp";
var _worksheetWidth = 690;
var _worksheetHeight = screen.height * .75;

var _tellafriendRouterURL = "/tell-a-friend/default.asp";
var _tellafriendWidth = 690;
var _tellafriendHeight = screen.height * .75;

var _feedbackRouterURL = "/feedback/default.asp";
var _feedbackWidth = 690;
var _feedbackHeight = screen.height * .75;

var _glossaryURL = "/worksheet/glossary.asp";
var _glossaryWidth = 350;
var _glossaryHeight = 400;

var _summaryWidth = 600;
var _summaryHeight = screen.height * .75;


/***************************************************
 openSummary()

 Date: 7/30/2007
 Purpose: Open the Summary window
***************************************************/

function openSummary( url ) {
	var name = "PrintSummaryOrNotes";
	var width = _summaryWidth;
	var height = _summaryHeight;
	var scrollbars = true;
	var resizeable = false;
	var location = false;
	var menubar = false;
	var status = false;
	var toolbar = false;
	winBRopen( url, name, width, height, scrollbars, resizeable, location, menubar, status, toolbar );	
}


/***************************************************
 openWorksheet()

 Date: 7/30/2007
 Purpose: Open the FundPath Worksheet window
***************************************************/

function openWorksheet() {
	var url = _worksheetRouterURL;
	var name = "Worksheet";
	var width = _worksheetWidth;
	var height = _worksheetHeight;
	var scrollbars = true;
	var resizeable = false;
	var location = false;
	var menubar = false;
	var status = false;
	var toolbar = false;
	winBRopen( url, name, width, height, scrollbars, resizeable, location, menubar, status, toolbar );
}



/***************************************************
 openTellAFriend()

 Date: 7/30/2007
 Purpose: Open the Tell-A-Friend window
***************************************************/

function openTellAFriend() {
	var url = _tellafriendRouterURL;
	var name = "TellAFriend";
	var width = _tellafriendWidth;
	var height = _tellafriendHeight;
	var scrollbars = true;
	var resizeable = false;
	var location = false;
	var menubar = false;
	var status = false;
	var toolbar = false;	
	winBRopen( url, name, width, height, scrollbars, resizeable, location, menubar, status, toolbar );
}



/***************************************************
 openFeedback()

 Date: 7/30/2007
 Purpose: Open the Feedback window
***************************************************/

function openFeedBack() {
	var url = _feedbackRouterURL;
	var name = "Feedback";
	var width = _feedbackWidth;
	var height = _feedbackHeight;
	var scrollbars = true;
	var resizeable = false;
	var location = false;
	var menubar = false;
	var status = false;
	var toolbar = false;	
	winBRopen( url, name, width, height, scrollbars, resizeable, location, menubar, status, toolbar );
}



/***************************************************
 openGlossary([anchorName])

 Date: 8/3/2007
 Purpose: Open the FundPath Worksheet glossary
***************************************************/

function openGlossary() {
	var anchorName = "";
	// Get anchor name if passed
	anchorName = ( arguments.length > 0 ) ? "#" + arguments[0] : "";
	// Open window
	var url = _glossaryURL + anchorName;
	var name = "Glossary";
	var width = _glossaryWidth;
	var height = _glossaryHeight;
	var scrollbars = true;
	var resizeable = false;
	var location = false;	
	var menubar = false;
	var status = false;
	var toolbar = false;	
	winBRopen( url, name, width, height, scrollbars, resizeable, location, menubar, status, toolbar );
}



/***************************************************
 winBRopen(theURL, Name, popW, popH, scroll, resize)

 Date: 9/22/2006
 Author: © 2004-2005 SixSide.com All Rights Reserved
 Purpose: Opens a popup window
***************************************************/

function winBRopen(theURL, Name, popW, popH, scroll, resize, location, menubar, status, toolbar) {
	// scroll and resize are really boolean vars, so accomodate 
	//for true|false instead of just yes|no or 1|0
	if( scroll.toLowerCase != 'yes' && scroll.toLowerCase != 'no' ) {
		if( scroll == true ) scroll = 'yes';
		if( scroll == false ) scroll = 'no';
	}
	if( resize.toLowerCase != 'yes' && resize.toLowerCase != 'no' ) {
		if( resize == true ) resize = 'yes';
		if( resize == false ) resize = 'no';
	}
	// Center window in screen
	var winleft = (screen.width - popW) / 2;
	var winUp = (screen.height - popH) / 2;
	// Set properties
	winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable='+resize+',location='+location+',menubar='+menubar+',status='+status+',toolbar='+toolbar+'';
	//alert( winProp );
	// Open window
	Win = window.open(theURL, Name, winProp);
	// Set focus to the window
	if( Win ) {
		Win.window.focus();
	}
}


