// ***** WARNING THIS JAVASCRIPT IS SITE SPECIFIC 

// Message.js
var strBaseUrl = "mitchell1.com";
var strHomeUrl = "http://www." + strBaseUrl;
var strSupportURL = GetSupportURL();
var strUrlSearch = strSupportURL + "/ondemand5/search.htm";
var strHelpUrl = strSupportURL + "/ondemand5";
var strGraphicsHelpUrl = strSupportURL + "/ondemand5/figures.asp";
var strPartsVoiceHelp = strSupportURL + "/ondemand5/partsvoice.htm";
var strLegalUrl = strHomeUrl + "/legalNotice.asp"
var strPrivacyUrl = strHomeUrl + "/privacy.asp"
var strLogoImg = '<IMG id="idHomeImg" height="35" width="150" src="/mric/common/images/logo_white.jpg" border="0"/>';
var strHelpHref = '<area shape="circle" coords="12,12,12" href="http://www.mitchellsupport.com/ondemand5/login.htm" target="wndHelp">';

var gMRICCopyright = "&copy; " + new Date().getFullYear() + " Mitchell Repair Information Co., LLC.";

var strFooterLinkCompany = '<a CLASS="clsFooterLink" href="http://www.mitchell1.com" target="wndMitchell">Mitchell1.com</a>';
var strWelcome = "<span class='clsWelcome'>Welcome to OnDemand5.com</span>";
var strLogoClearImg = '<img border="0" alt="Mitchell1" src="/mric/common/images/mriclogo_clear.gif" width="170">';
var strWelcomeImg = '<img alt="welcome to ondemand5.com" border="0" src="/mric/common/images/welcome.jpg" width="268" height="19">';
var strLogoTitle = 'Go to Mitchell 1 Home page';
var strODWebNumber = "888-724-6742";
var strAccessPurchaseNumber = strODWebNumber + " x6313";
var strModulePurchaseNumber = strODWebNumber;
var strRootDir = "mric";
var strUpdatingTo = "Updating to OnDemand 1.3 ...";
var strLoadingHomePage = "<DIV class='clsLoginLabel' align='center' style='width:100%; POSITION:absolute; TOP:40%'>OnDemand5 loading...</DIV>";
var strTechEmail = "mailto:techsupport@mitchell1.com";
var strProdEmail = "mailto:productsupport@mitchell1.com";

var strCompanyName = "Mitchell 1";
var strPlainProductName = "OnDemand5.com";
var strHtmlProductName = "<font color='gray'>OnDemand<\/font><font color='goldenrod'>5<\/font><font color='gray'>.com<\/font>";
var strProductName = "<span class='clsODNameText'>OnDemand<span class='clsODVerText'>5</span>.com</span>";
var strLogOutQuestion = "Your session has been detected in another window. Do you want to logout the other window?\n\nPlease click 'OK' to logout the other window or 'Cancel' to continue using your current session in the other window.";

// general technical support
var strProdSupport = "If this problem persists, please contact Product Support at " + strODWebNumber + " or via e-mail by clicking <A HREF='" + strProdEmail + "'>here</A>.&nbsp;&nbsp;Thank You!";

//--------------------------------------------------------------------------------+
// strTechSupport contains both phone & e-mail contact info & strTechSupportAlert |
// contains only phone contact info as it is meant for alert dialog boxes rather  |
// than HTML presentation. Both need to be updated when an update is made to one. |
//--------------------------------------------------------------------------------+
var strTechSupport = "If this problem persists, please contact Technical Support at " + strODWebNumber + " or via e-mail by clicking <A HREF='" + strTechEmail + "'>here</A>.&nbsp;&nbsp;Thank You!";
var strTechSupportAlert = "If this problem persists, please contact Technical Support at " + strODWebNumber + ".  Thank You!";
var strUnknownError = "Unable to continue due to an unknown error, please try again.&nbsp&nbsp;" + strTechSupport;
var strInvalidSession = "You do not have a valid session.  Please login and try again.";
var strLoaderError = "<span class='clsErrorMsg'>Your request could not be completed.&nbsp;&nbsp;" + strTechSupport + "</span>";

var	nSetupMenuOffset	= 262;
var	nTSBPrintMenuOffset = 310;
var	nRepPrintMenuOffset = 310;

function GetSupportURL()
{
    var supportUrlCookieName = "ODWEBSupportUrl";
    var suppUrl = "www.mitchell1support.com";
    
    if (readCookie(supportUrlCookieName) == null)    
    {
        var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	    var url = "/mric/server/GlobalConfig.aspx";
	    var httpMethod = "GET";
	    xmlHttp.Open(httpMethod, url, false);
	    xmlHttp.Send();
    
    	var globalConfig = xmlHttp.ResponseXML;

    	if (globalConfig.documentElement)
    	{
	        suppUrl = globalConfig.documentElement.getAttribute("Help");
	    }
	    createCookie(supportUrlCookieName,suppUrl,1);
    }
    else
    {
        suppUrl = readCookie(supportUrlCookieName);
    }
    
    return suppUrl;

        
}

function createCookie(name,value,days) 
{
	if (days) 
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) 
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) 
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) 
{
	createCookie(name,"",-1);
}

// ***** WARNING THIS JAVASCRIPT IS SITE SPECIFIC 