// Summary: Contains common functionality used by SalesChannel web sites
// Dependencies: common.js

// Local variables
var scs_rootWebPath = "/MDHOWSBS/";
var scs_absoluteRootWebPath = "localhost/MDHOWSBS/";
var scs_rootLinkWebPath = "/MDHOWSBS/";

// Summary: Sets web path to root of site following the server name in the Url.
// Client side scripts can use this value to format correct path whether the 
// site is running either under root domain name "/" or within a virtual directory
function scs_setRootWebPath (rootWebPath)
{
	scs_rootWebPath = rootWebPath;
}


// Summary: Gets web path to root of site
function scs_getRootWebPath ()
{
	return scs_rootWebPath;
}
// Summary: Sets web path to root of site following the server name in the Url.
// Client side scripts can use this value to format correct path whether the 
// site is running either under root domain name "/" or within a virtual directory
function scs_setRootLinkWebPath (rootWebPath)
{
	scs_rootLinkWebPath = rootWebPath;
}


// Summary: Gets web path to root of site
function scs_getRootLinkWebPath ()
{
	return scs_rootLinkWebPath;
}


// Summary: Sets full web path, including server name, to root of site
function scs_setFullRootWebPath (fullRootWebPath)
{
	scs_fullRootWebPath = fullRootWebPath;
}

// Summary: Gets full web path, including server name, to root of site
function scs_getFullRootWebPath ()
{
	return scs_fullRootWebPath;
}

// Summary: Gets web path to a file based on a site-root relative path
function scs_getWebPath (path)
{
	return cmn_combineWebPath(scs_getRootWebPath(), path);
}

// Summary: Gets full web path, including server name to a file within the
// site based on a site-root relative path
function scs_getFullWebPath (path)
{
	return cmn_combineWebPath("http://" + scs_getFullRootWebPath(), path);
}

// Summary: Gets absolute URL, including server name to a file within the
// site based on a site-root relative path
function scs_getFullWebPathSecure (path)
{
	return cmn_combineWebPath("https://" + scs_getFullRootWebPath(), path);
}


// Summary: Displays info in tooltip style
function scs_doToolTip(e, msg)
{
	if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
	if (Tooltip.ovTimer) clearTimeout(Tooltip.ovTimer);
	Tooltip.ovTimer = setTimeout("Tooltip.toggleOverlay(" + 1 + ")", 200);
	Tooltip.show(e, msg);
}

// Summary: Hides currently visible tooltip
function scs_hideToolTip (message)
{
	if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
	if (Tooltip.ovTimer) clearTimeout(Tooltip.ovTimer);
	Tooltip.ovTimer = setTimeout("Tooltip.toggleOverlay(" + 0 + ")", 200);
	Tooltip.hide();
}