/*
 * -----------------------------------------------------------------
 * Copyright (c) 2009 Fluid, Inc. All Right Reserved.
 * This software is the proprietary information of Fluid, Inc.
 * Use is subject to strict licensing terms.
 * -----------------------------------------------------------------
 *
 * CVS Information:
 * $Author: mmoscovich $
 * $Date: 
 * $Revision: 1.3 $
 *
 */

// Contains the Fluid Configure info temporally
var infoAboutFluidConfigure = "";

//New Window to show when opening a new url 
var newWindow;

// Start the process to show an alert within Fluid Configure about information
function showInfoAboutFluidConfigure(info) {
	infoAboutFluidConfigure = info;
	self.setTimeout("executeShowInfoAboutFluidConfigure()", 10);
}

// Show an alert within Fluid Configure about information
function executeShowInfoAboutFluidConfigure() {
	alert(infoAboutFluidConfigure);
}

//Open a new browser window with a "Please wait" message. Used when opening a URL on certain browsers (Firefox, IE)
function openNewWindow(waitUrl, waitTitle, waitText, waitCss) {
	var url = waitUrl + "?title=" + waitTitle + "&text=" + waitText;
	if(waitCss != null) {
		url = url + "&css=" + waitCss;
	}
	//Open the new window
	newWindow = window.open(url, '_blank','');
}

//Sets the URL of the new window when the process that uses it is over
function setNewWindowURL(url) {
	var result = false;
	if(newWindow != null && !newWindow.closed) 
	{
		newWindow.location = url;
		newWindow.focus();
		result = true;
	}
	newWindow = null;
	return result;	
}

//Closes the new window in case of an error
function closeNewWindow() {
	if(newWindow != null)
	{
		if(!newWindow.closed) {
			newWindow.close();
		}
		newWindow = null;
	}
}