//==========================================================================
//                     Mobius e-Solutions
//==========================================================================
//
//  COPYRIGHT 2000-2002 (c) Mobius e-Solutions
//
//  This software is proprietary to and the copyright and all
//  other intellectual property rights in this software are owned
//  by Mobius e-Solutions.
//
//==========================================================================

// Opens help glossary for the supplied HelpId
var cnstWebRoot;

function helpG(helpid)
{
	// If we have no helpid supplied, then this is wrong
	if ( !(helpid) ) {
		alert("Sorry, this help function is not setup correctly, please contact techsupport@smartmole.com so we can fix this right away.");
		return false;
	}
	
	// Open the glossary window
	var windowStyle;
	// The width does not seem to be working
	windowStyle = 'location=no,titlebar=1;status=yes,toolbar=yes;menubar=no,scrollbars=yes,resizable=yes,width=600,height=400'
	
	// If helpid is 0, then we are going to show the glossary main page
	if ( helpid == -1 ) 
	{
		// Look at a specific glossary item
		raiseWindow('http://www.smartmole.com/help/root/glossarylist.asp','glossaryWindow',windowStyle);
	}
	else
	{
		// Look at a specific glossary item
		raiseWindow('http://www.smartmole.com/help/root/glossaryview.asp?helpid=' + helpid,'glossaryWindow',windowStyle);
	}
}

//
// RaiseWindow
// Forces the window to be raised and made visable.
//
function raiseWindow(iURL,iTargetName,iWindowStyle)
{  
    var w = null;
    if ( iWindowStyle == null ) {
		// Give us a default window style
		iWindowStyle = 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes'
    }
    
	// Open the window to get a handle
    w = window.open('',iTargetName,'');
    
    // Close the window
    if (w != null) {
        w.close();
    }
    
    // So we can re-open it to ensure focus is returned to it
    w = window.open(iURL,iTargetName,iWindowStyle);
}

//
// Load some new content into an existing window
//
function loadWindow(urlname, iTargetName, iWindowStyle)
{
    var w;
    w =  window.open(urlname,iTargetName,iWindowStyle);
    if (w != null) {
        return true;
    }
}

function closeWindow(iTargetName)
{
    var w;
    w = window.open('',iTargetName,'');
    if (w != null) {
        w.close();
        w = null;
    }
}

function setStatus(sStatus)
{
	window.status = sStatus;
	return true;
}

function setDefaultStatus(iStr)
{
	defaultStatus = iStr;
}

// Set default window status automatically if you include this file
setDefaultStatus("SmartMole.com");

// Set default time for checking layers visibilty
function getLayersTime() {
	return 3000;
}
