/*
	 This function will launch a new browser window or pop-up window for any links 
	 contained within the XHTML that have titles that match the title variable.
*/
function launchWindow(title, name, width, height, scrollbars, resizable, left, top) {
	if (!document.getElementsByTagName) 
		return false;
	var links = document.getElementsByTagName("a");
	if (links.length < 1) 
		return false;
	for (var i = 0; i < links.length; i++) {
		var linkTitle = links[i].getAttribute("title");
		if (linkTitle == title && width != null) {			// Launches "pop-up" style windows.
			links[i].onclick = function() {
				var newPopUp = window.open(this.getAttribute("href"), name, "'width=" + width + ",height=" + height + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",left=" + left + ",top=" + top + "'");
				return false;
			}
		}
		else if (linkTitle == title && width == null) {	// Launches normal browser windows.
			links[i].onclick = function() {
				var newWindow = window.open(this.getAttribute("href"), name);
				return false;
			}
		}
	}
}
/*
	Set the title of the links that you want to launch new browser windows for (and 
	the names of their windows) in launchWindow() below, and call lWArgs into 
	loadFuncs() in the header of the XHTML page(s).
*/
function lWArgs() {
	// Use the following function call to launch normal browser windows.
	//launchWindow("Apply Now. Link opens a new browser window.", "applyNow");
	launchWindow("Privacy and Security. Link opens a new browser window.", "privacySecurity");
	//launchWindow("Important disclosure information about terms and conditions; including rates. Link opens a new browser window.", "terms");
	// Use the following function call to launch "pop-up" style windows.
	launchWindow("Equal Housing Lender. Link opens a new pop-up window.", "newwin", 640, 371, "yes", "yes", 35, 161);
	launchWindow("Google Maps Terms and Conditions. Link opens a new browser window.", "TermsConditions");
	//launchWindow("Rate Information. Link opens a new pop-up window.", "newwin", 640, 371, "yes", "yes", 35, 161);
}