
//var sPath = window.location.pathname;
var sPath = '';
sPath =  window.location;

//alert(window.location);
//alert(sPath);
//sPage = sPath;
//var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
//alert(sPage);

//1		Home page 				50 seconds 
//2		MUST Page				5 mins
//3		Accreditation			5 mins
//4		Faculty					5 mins
//5		Student services		5 mins
//6		Alumni Services			5 mins
//2		FAQs					5 mins
//2		High School Diploma		5 mins
//2		GED						5 mins
//2		Tuition page 			5 mins
//7		Financial Aid			5 mins
//8		Credit Transfer 		5 mins
//2		Fee Payment Options 	5 mins
//9		Free consultancy		5 mins
//10	Apply Now 				2 mins


PagesArray = new Array(16);
PagesArray[0] = '';
PagesArray[1] = '/must/aboutus.asp';
PagesArray[2] = '/must/accreditation.asp';
PagesArray[3] = '/must/faculty.asp';
PagesArray[4] = '/must/student-service.asp';
PagesArray[5] = '/must/alumni.asp'; 
PagesArray[6] = '/must/faq.asp';
PagesArray[7] = '/must/diploma/';
PagesArray[8] = '/must/ged/';
PagesArray[9] = '/must/tuition/';
PagesArray[10] = '/must/tuition/financialSWFA.asp';
PagesArray[11] = '/must/tuition/creditTransfers.asp';
PagesArray[12] = '/must/tuition/fee-payment-option.asp' 
PagesArray[13] = '/must/consultancy.asp';
PagesArray[14] = '/preapplication';
PagesArray[15] = 'http://www.musthighschool.com';
//PagesArray[15] = 'http://webserver2:50064/';

ScriptSrcArray = new Array(16);
ScriptSrcArray[0] = '';
ScriptSrcArray[1] = 'http://server.iad.liveperson.net/hc/17343351/x.js?cmd=file&file=chatScript3&site=17343351&imageUrl=http://www.musthighschool.com/images/chat/chat2';
ScriptSrcArray[2] = 'http://server.iad.liveperson.net/hc/17343351/x.js?cmd=file&file=chatScript3&site=17343351&imageUrl=http://www.musthighschool.com/images/chat/chat3';
ScriptSrcArray[3] = 'http://server.iad.liveperson.net/hc/17343351/x.js?cmd=file&file=chatScript3&site=17343351&imageUrl=http://www.musthighschool.com/images/chat/chat4';
ScriptSrcArray[4] = 'http://server.iad.liveperson.net/hc/17343351/x.js?cmd=file&file=chatScript3&site=17343351&imageUrl=http://www.musthighschool.com/images/chat/chat5';
ScriptSrcArray[5] = 'http://server.iad.liveperson.net/hc/17343351/x.js?cmd=file&file=chatScript3&site=17343351&imageUrl=http://www.musthighschool.com/images/chat/chat6';
ScriptSrcArray[6] = 'http://server.iad.liveperson.net/hc/17343351/x.js?cmd=file&file=chatScript3&site=17343351&imageUrl=http://www.musthighschool.com/images/chat/chat2';
ScriptSrcArray[7] = 'http://server.iad.liveperson.net/hc/17343351/x.js?cmd=file&file=chatScript3&site=17343351&imageUrl=http://www.musthighschool.com/images/chat/chat2';
ScriptSrcArray[8] = 'http://server.iad.liveperson.net/hc/17343351/x.js?cmd=file&file=chatScript3&site=17343351&imageUrl=http://www.musthighschool.com/images/chat/chat2';
ScriptSrcArray[9] = 'http://server.iad.liveperson.net/hc/17343351/x.js?cmd=file&file=chatScript3&site=17343351&imageUrl=http://www.musthighschool.com/images/chat/chat2';
ScriptSrcArray[10] = 'http://server.iad.liveperson.net/hc/17343351/x.js?cmd=file&file=chatScript3&site=17343351&imageUrl=http://www.musthighschool.com/images/chat/chat7';
ScriptSrcArray[11] = 'http://server.iad.liveperson.net/hc/17343351/x.js?cmd=file&file=chatScript3&site=17343351&imageUrl=http://www.musthighschool.com/images/chat/chat8';
ScriptSrcArray[12] = 'http://server.iad.liveperson.net/hc/17343351/x.js?cmd=file&file=chatScript3&site=17343351&imageUrl=http://www.musthighschool.com/images/chat/chat2';
ScriptSrcArray[13] = 'http://server.iad.liveperson.net/hc/17343351/x.js?cmd=file&file=chatScript3&site=17343351&imageUrl=http://www.musthighschool.com/images/chat/chat9';
ScriptSrcArray[14] =  'http://server.iad.liveperson.net/hc/17343351/x.js?cmd=file&file=chatScript3&site=17343351&imageUrl=http://www.musthighschool.com/images/chat/chat10';
ScriptSrcArray[15] = 'http://server.iad.liveperson.net/hc/17343351/x.js?cmd=file&file=chatScript3&site=17343351&imageUrl=http://www.musthighschool.com/images/chat/chat1';



TimeInSecArr = new Array(16);
TimeInSecArr[0] = 0;
TimeInSecArr[1] = 300;
TimeInSecArr[2] = 300;
TimeInSecArr[3] = 300;
TimeInSecArr[4] = 300;
TimeInSecArr[5] = 300;
TimeInSecArr[6] = 300;
TimeInSecArr[7] = 300;
TimeInSecArr[8] = 300;
TimeInSecArr[9] = 300;
TimeInSecArr[10] = 300;
TimeInSecArr[11] = 300;
TimeInSecArr[12] = 300;
TimeInSecArr[13] = 300;
TimeInSecArr[14] = 120;
TimeInSecArr[15] = 50;



var PageIndex = 0;

//if(sPath.href.toLowerCase() == PagesArray[15].toLowerCase() || sPath.href.toLowerCase() == PagesArray[15].toLowerCase() + '/')
//{
//	//alert('Main Page');
//	PageIndex = 15;
//}
//else
//{
	for(var i=0;i<=14;i++)
	{
		//alert(PagesArray[i]);
		//alert(sPath);
		//var MatchResut = PagesArray[i].search(sPath);
		var Path = sPath.href.toLowerCase();
		var MatchResut = Path.indexOf(PagesArray[i].toLowerCase());// .search(PagesArray[i]);
	//alert(MatchResut);
		if(MatchResut != null && MatchResut > 0)
		{
			//alert(sPath);
			//alert(PagesArray[i]);
			//alert(ScriptSrcArray[i]);
			//alert(TimeInSecArr[i]);
		   PageIndex = i;
		   break 
		}
		else
		{
			PageIndex = -1;
		}
	}
//}

//alert(PageIndex);

var body = document.getElementsByTagName("body");
if(PageIndex != -1)
{
        if (typeof(lpCV) == "undefined") 
            lpCV = "";
        lpEngageSeconds = TimeInSecArr[PageIndex]; // seconds before invitation sent
    	lpNumber = "17343351"; // Account number
	    lpServerName = "server.iad.liveperson.net"; // Site server
        lpCV+="&SESSIONVAR!Call=LiveEngageInvite"; // LiveEngage type : Proactive Invitation Button

        var scriptTag_0 = document.createElement('script');
        scriptTag_0.src= 'https://server.iad.liveperson.net/hcp/html/liveengage1.js';
	    if (document.body.firstChild != null)
		    document.body.insertBefore(scriptTag_0, document.body.firstChild);
	    else
		    body.appendChild(scriptTag_0);

        var scriptTag = document.createElement('script');
        scriptTag.src= ScriptSrcArray[PageIndex];
	    if (document.body.firstChild != null)
		    document.body.insertBefore(scriptTag, document.body.firstChild);
	    else
		    body.appendChild(scriptTag);		
}
else
{		
		var browserName=navigator.appName; 
		
		
		var scriptTag = document.createElement('script');
        scriptTag.src= ScriptSrcArray[15];
	    if (document.body.firstChild != null)
		 if (browserName=="Microsoft Internet Explorer")
		 {
		document.body.insertBefore(scriptTag, document.body.firstChild);
		 }
		 else
		 {
			 body.appendChild(scriptTag);
		 }
	   
  		
       
	    else
		    body.appendChild(scriptTag);
	    //alert('No LivePerson');
}
