	var appWindow = null;
	var detailsWindow = null;
    var helpWindow = null;

function openApp(relativeAppPath) {
     window.open(relativeAppPath, "appWindow", "scrollbars=1,status=1,resizable=1,menubar=1,width=550,height=400");
     return false;
}

function openAppBig(relativeAppPath) {
     window.open(relativeAppPath, "appWindow", "scrollbars=1,status=1,resizable=1,menubar=1,width=550,height=650");
     return false;
}

function openAppWindow(relativePath) {
    if (appWindow != null && appWindow.closed == false) {
        appWindow = window.open("/application/empty.html", "ifxAppWindow", "resizable,scrollbars,status,width=5,height=5");
        appWindow.close();
    }
	appWindow = window.open(relativePath, "ifxAppWindow", "resizable,scrollbars,status");
	return false;
}

function openHelp(relativeHelpPath) {
    if (helpWindow != null && helpWindow.closed == false) {
	helpWindow = window.open("/application/empty.html", "helpWindow", "resizable,scrollbars,status,width=0,height=0");
	helpWindow.close();
    }
    window.open(relativeHelpPath, "helpWindow", "scrollbars=1,status=1,resizable=1,menubar=1,width=320,height=400");
    return false;
}

function openApp(relativeAppPath) {
    window.open(relativeAppPath, "appWindow", "scrollbars=1,status=1,resizable=1,menubar=1,width=550,height=400");
    return false;
}

function openApp2(relativeAppPath) {
    window.open(relativeAppPath, "appWindow2", "scrollbars,status,resizable,menubar,location,toolbar,width=550,height=400");
    return false;
}


function openNewWindow(relativePath) {
	detailsWindow = window.open("/application/empty.html", "ifxDetailsWindow", "resizable,scrollbars,status,width=0,height=0");
	detailsWindow.close();
	var screen_height = window.screen.availHeight - 50;
	var screen_width = window.screen.availWidth - 10;
	detailsWindow = window.open(relativePath, "ifxDetailsWindow", "resizable,scrollbars,status,width="+screen_width+",height="+screen_height+",screenX=0,screenY=0,top=0,left=0");
	return false;
}

function closeDetailsWindow() {
    if (detailsWindow != null) {
        if (! detailsWindow.closed) {
            detailsWindow.close();
        }
    } else {
        detailsWindow = window.open("", "ifxDetailsWindow", "resizable,scrollbars,status,width=100,height=100,screenX=-100,screenY=-100,top=0,left=0");
        detailsWindow.close();
    }
}

function closeHelpWindow() {
    if (helpWindow != null) {
        if (! helpWindow.closed) {
            helpWindow.close();
        }
    } else {
        helpWindow = window.open("", "helpWindow", "resizable,scrollbars,status,width=100,height=100,screenX=-100,screenY=-100,top=0,left=0");
        helpWindow.close();
    }
}


function printThis() {
    if (checkIt('mac')) {
        alert("To print: push OK, click in the \n window you want to print, and type command-p");
    } else {
        print();
    }
    return false;
}

function checkIt(string)
{
	var detect = navigator.userAgent.toLowerCase();
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

function forceDownload(location){
    if (navigator.appName == "Microsoft Internet Explorer")	{
        if (navigator.appVersion.indexOf( "MSIE 5.5" ) != -1) {
            window.showModalDialog("/application/downloadIFrame.html", location);
            return;
        } else if (navigator.appVersion.indexOf("MSIE 4.01") != -1) {
			location = location+"&downloadFix=true";
        }
    }
    window.location = location;
}

function openAttachmentWindow(path) {
	var screen_height = window.screen.availHeight - 50;
	var screen_width = window.screen.availWidth - 10;
    window.open(path, "attachmentWindow");
    return false;
}

function refreshNavBar(mail, forums, news, library, admin, search) {
	if (!top.navbar.document.getElementById("logout") && !top.navbar.document.logout) {
		setTimeout("refreshNavBar("+mail+","+forums+","+news+","+library+","+admin+","+search+");", 500);
	} else  {
		top.navbar.setNavigationIcons(mail, forums, news, library, admin, search)
	}
}

function refreshNavBarStatus(mail, mailStatus, forums, forumStatus, news, newsStatus, library, libraryStatus, admin, search, contact, fms) {
	if (!top.navbar.document.getElementById("logout") && !top.navbar.document.logout) {
		setTimeout("refreshNavBarStatus("+mail+","+mailStatus+","+forums+","+forumStatus+","+news+","+newsStatus+","+library+","+libraryStatus+","+admin+","+search+");", 500);
	} else  {
		top.navbar.setNavigationIconsStates(mail,mailStatus, forums,forumStatus, news,newsStatus, library,libraryStatus, admin, search, contact, fms)
	}
}
