/* [nodename, id, name, navigationtext, href, isnavigation, childs[], templatename] */

if (typeof(decodeURIComponent) == 'undefined') {
  decodeURIComponent = function(s) {
    return unescape(s);
  }
}

function jdecode(s) {
    s = s.replace(/\+/g, "%20")
    return decodeURIComponent(s);
}

var POS_NODENAME=0;
var POS_ID=1;
var POS_NAME=2;
var POS_NAVIGATIONTEXT=3;
var POS_HREF=4;
var POS_ISNAVIGATION=5;
var POS_CHILDS=6;
var POS_TEMPLATENAME=7;
var POS_TARGET=8;
var theSitetree=[ 
	['PAGE','4901',jdecode('Home'),jdecode(''),'/4901.html','true',[],'',''],
	['PAGE','4994',jdecode('About+Us'),jdecode(''),'/4994/index.html','true',[ 
		['PAGE','11164',jdecode('MPS+Accreditation'),jdecode(''),'/4994/11164.html','true',[],'','']
	],'',''],
	['PAGE','4952',jdecode('ISPS%2FMTSA+Training'),jdecode(''),'/4952/index.html','true',[ 
		['PAGE','10922',jdecode('Course+Descriptions'),jdecode(''),'/4952/10922.html','true',[],'','']
	],'',''],
	['PAGE','4973',jdecode('Services'),jdecode(''),'/4973/index.html','true',[ 
		['PAGE','57501',jdecode('Assessments%2FPlans'),jdecode(''),'/4973/57501.html','true',[],'',''],
		['PAGE','57801',jdecode('Plan+Audits%2FReviews'),jdecode(''),'/4973/57801.html','true',[],'',''],
		['PAGE','58001',jdecode('Drills+and+Exercises'),jdecode(''),'/4973/58001.html','true',[],'',''],
		['PAGE','58201',jdecode('Plan+Maintenance'),jdecode(''),'/4973/58201.html','true',[],'',''],
		['PAGE','59001',jdecode('Offshore+Programs'),jdecode(''),'/4973/59001.html','true',[],'','']
	],'',''],
	['PAGE','78401',jdecode('Clients'),jdecode(''),'/78401.html','true',[],'',''],
	['PAGE','78422',jdecode('Case+Studies'),jdecode(''),'/78422.html','true',[],'',''],
	['PAGE','5057',jdecode('Contact+Us'),jdecode(''),'/5057.html','true',[],'',''],
	['ITEM','85901',jdecode('Blog'),jdecode(''),'http://www.mpsblog.org','true',[],'','_blank'],
	['PAGE','74901',jdecode('Registration+Page'),jdecode(''),'/74901.html','true',[],'',''],
	['PAGE','75801',jdecode('Terms+and+Conditions'),jdecode(''),'/75801.html','false',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Disco';
theSitetree.paletteFamily='000066';
theSitetree.keyvisualId='1873';
theSitetree.keyvisualName='business.jpg';
theSitetree.fontsetId='307';
theSitetree.graphicsetId='363';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000066';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Disco',
				paletteFamily: 	'000066',
				keyvisualId: 	'1873',
				keyvisualName: 	'business.jpg',
				fontsetId: 		'307',
				graphicsetId: 	'363',
				contentColor: 	'FFFFFF',
				contentBGColor: '000066',
				a_color: 		'000066',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-13879']={
webappId:    '7008',
documentId:  '5057',
internalId:  '13879',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20100825-163307'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4952',
internalId:  '',
customField: '20100421-111722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4973',
internalId:  '',
customField: '20100107-094053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4994',
internalId:  '',
customField: '20100311-130755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78401',
internalId:  '',
customField: '20100512-164849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5057',
internalId:  '',
customField: '20100108-091424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58201',
internalId:  '',
customField: '20100104-132402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10922',
internalId:  '',
customField: '20100107-094020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58001',
internalId:  '',
customField: '20100201-134501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57501',
internalId:  '',
customField: '20100104-132021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57801',
internalId:  '',
customField: '20100107-094508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11164',
internalId:  '',
customField: '20100107-094745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59001',
internalId:  '',
customField: '20100107-094548'
};
webappMappings['7008']=webappMappings['7008-14657']={
webappId:    '7008',
documentId:  '74901',
internalId:  '14657',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74901',
internalId:  '',
customField: '20100203-143653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75801',
internalId:  '',
customField: '20100203-093216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78422',
internalId:  '',
customField: '20100204-160030'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I7CMTK';
var companyName   = 'Maritime+Protective+Services%2C+Inc.';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
theSitetree.getById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		if (ar[i][POS_ID] == id){
			return ar[i];
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getParentById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		for (var j = 0; j < ar[i][POS_CHILDS].length; j++) {
			if (ar[i][POS_CHILDS][j][POS_ID] == id) {
				// child found
				return ar[i];
			}
			var result=this.getParentById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getName = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAME];
	}
	return null;
};

theSitetree.getNavigationText = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAVIGATIONTEXT];
	}
	return null;
};

theSitetree.getHREF = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_HREF];
	}
	return null;
};

theSitetree.getIsNavigation = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_ISNAVIGATION];
	}
	return null;
};

theSitetree.getTemplateName = function(id, lastTemplateName, ar) {
	if (typeof(lastTemplateName) == 'undefined'){
		lastTemplateName = this.topTemplateName;
	}
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		var actTemplateName = ar[i][POS_TEMPLATENAME];
		if (actTemplateName == ''){
			actTemplateName = lastTemplateName;
		}
		if (ar[i][POS_ID] == id) {
			return actTemplateName;
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getTemplateName(id, actTemplateName, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getByXx = function(lookup, xx, ar) {
    if (typeof(ar) == 'undefined'){
    	ar = this;
    }
    for (var i=0; i < ar.length; i++) {
        if (ar[i][xx] == lookup){
        	return ar[i];
        }
        if (ar[i][POS_CHILDS].length > 0) {
        	var result=this.getByXx(lookup, xx, ar[i][POS_CHILDS]);
            if (result != null){
                return result;
               }
        }
    }
    return null;
};

function gotoPage(lookup) {
	if(__path_prefix__ == "/servlet/CMServeRES" && typeof (changePage) == 'function'){
		changePage(lookup);
		return;
	}
	var page = theSitetree.getHREF(lookup);
	if (!page) {
		var testFor = [ POS_NAME, POS_NAVIGATIONTEXT ];
		for (var i=0 ; i < testFor.length ; i++) {
			var p = theSitetree.getByXx(lookup, testFor[i]);
			if (p != null) {
				page = p[POS_HREF];
				break;
			}
		}
	}
	document.location.href = (new URL(__path_prefix__ + page, true, true)).toString();
};
