var isProductionServer=false;

var isMindLeaders = true; // Set to false for CD/WEBI delivery
var trackScores=true; // for DynamicCD. Set to false to turn off cookie and txt file tracking of scores
var isDynamicCd=false; //  for DynamicCD.

var rootDir = "/dpec";
var rootDirSalsa = "/salsa";
var scriptsDirectory = rootDir + "/scripts/";
var scriptsDirectorySalsa = rootDirSalsa + "/scripts/";
var sharedDirectory = rootDir + "/shared/";
var coursesDirectory = rootDir + "/courses/";
var customCoursesDirectory = rootDir + "/customcourses/";
var salsaCoursesDirectory = rootDirSalsa + "/series/";
var siteCustomDirectory = rootDir + "/custom/sites/";

//************************** Video Server Setup ****************************
// Streaming server for inhouse production
var inhouseStreamingServer = "mms://trix/";
inhouseVideoCourses="";
// Use the following line to play video courses over a local network; otherwise, comment out.
// var localCoursePath="file://netname/subdirs/dpec/courses/";
var streamingServer = "mms://rm.mindleaders.com/";
var useStreamingServer=isMindLeaders;

// Comment out the following line if you move course videos to a streaming server.
if (!isMindLeaders && location.href.toLowerCase().indexOf("video.htm") == -1) useStreamingServer=false;
//*******************************************************************************

// Reset values for internal servers
if (location.host == 'rubino') isMindLeaders = false;
var inhouseHosts="rubino,courses.rubino.com,preview.mindleaders.com,underscore";
if (inhouseHosts.indexOf(location.host) > -1)
{
	customCoursesDirectory = rootDir + "/courses/";
	var courseReviewJs = sharedDirectory + "js/course_review.js";
	document.write("<SCRIPT Language=\"Javascript\" SRC=\"" + courseReviewJs + "\"></S" + "CRIPT>");
}

var mlomTech = "JAVA";

// set fullPath for use on www.mindleaders.com only
var fullPath="";
if (location.host=="www.mindleaders.com") fullPath="http://courses.mindleaders.com";

localizationCode="";
localizedSharedDirectory=sharedDirectory;
if (typeof(parent.coursewareHandler) != "undefined" && parent.coursewareHandler.localizationCode !="")
{
	localizedSharedDirectory= rootDir + "/shared_" + parent.coursewareHandler.localizationCode + "/";
}
else
{
	// For Accessible SA and Qeval: set localization code based on window opener
	if (self.name.indexOf("acc_question_window") != -1 || self.name.indexOf("qComments") !=-1) localizationCode=window.opener.localizationCode;
		else localizationCode=getParm("loc");
	if (localizationCode !="") localizedSharedDirectory= rootDir + "/shared_" + localizationCode + "/";
}
var resourseStringJs = fullPath + localizedSharedDirectory + "js/resource_strings.js";
document.write("<SCRIPT Language=\"Javascript\" SRC=\"" + resourseStringJs + "\"></S" + "CRIPT>");

// include special_cases.js
var specialCasesJs = fullPath + sharedDirectory + "js/special_cases.js";
document.write("<SCRIPT Language=\"Javascript\" SRC=\"" + specialCasesJs + "\"></S" + "CRIPT>");

function getCoursesDirectory(courseID)
{
	if (courseID != null && courseID.substr(0,2) == "c_")
		return customCoursesDirectory;
	else
		return coursesDirectory;
}

// This is needed here to get loc parm for popup pages, since site.js is loaded before mlclientpage
function getParm(parm)
{
	if (location.search=="") return "";
	var parmList = "&" + location.search.substring(1, location.search.length) + "&";
	var re = new RegExp("&" + parm + "=([^&]*)&","i");
	var foundArray = re.exec(parmList);
	if (foundArray == null) return "";
	return foundArray[1].toLowerCase();
}

// ************** Set BSV Host Streaming Server by Site ID ********************
function setStreamingServer()
{
	siteId=parent.getParm("siteid").toLowerCase();
	if (siteId=="" || typeof(bsvHostSites) == "undefined") return;
	for (i=1; i <= bsvHostSites.length; i++)
	{
		if (siteId==bsvHostSites[i]) streamingServer = bsvHostServers[i];
	}
}

var wasaTempMessage = "<font color='red'><b>In observance of the national Thanksgiving Holiday, Technical Support is closing at 5:30 PM (EST) on Wednesday, November 25, 2009. The company will be closed on Thursday and Friday, November 26 and 27, 2008 and resume normal business hours (8 AM - 8 PM EST) on Monday, November 30, 2009.</b><br><br><b>Effective March 17th, 2010, courseware minimum system requirements will move from the current Adobe Flash Player 8 to Adobe Flash Player 10.<br>Please update your player by going to http://get.adobe.com/flashplayer</b></font>";
// var wasaTempMessage = "";
