/* [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 theSitetree=[ 
	['PAGE','301',jdecode('Home'),jdecode(''),'/301.html','true',[],''],
	['PAGE','33206',jdecode('Mortgage+Relief+Programs'),jdecode(''),'/33206/index.html','true',[ 
		['PAGE','60415',jdecode('FAQs'),jdecode(''),'/33206/60415.html','true',[],'']
	],''],
	['PAGE','33401',jdecode('Debt+Portfolio+Services'),jdecode(''),'/33401.html','true',[],''],
	['PAGE','33101',jdecode('Collection+Services'),jdecode(''),'/33101/index.html','true',[ 
		['PAGE','33122',jdecode('Make+a+Payment'),jdecode(''),'/33101/33122.html','true',[],''],
		['PAGE','33164',jdecode('FAQs'),jdecode(''),'/33101/33164.html','true',[],'']
	],''],
	['PAGE','33248',jdecode('Contact+Us'),jdecode(''),'/33248/index.html','true',[ 
		['PAGE','33185',jdecode('Privacy+Policy+%26+Disclosure'),jdecode(''),'/33248/33185.html','true',[],'']
	],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Startup';
theSitetree.paletteFamily='000066';
theSitetree.keyvisualId='1333';
theSitetree.keyvisualName='agentur.jpg';
theSitetree.fontsetId='235';
theSitetree.graphicsetId='293';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Startup',
				paletteFamily: 	'000066',
				keyvisualId: 	'1333',
				keyvisualName: 	'agentur.jpg',
				fontsetId: 		'235',
				graphicsetId: 	'293',
				contentColor: 	'666666',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000066',
				b_color: 		'666666',
				c_color: 		'000000',
				d_color: 		'FF0000',
				e_color: 		'FF0000',
				f_color: 		'FF0000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20090426-151827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33185',
internalId:  '',
customField: '20090426-155348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33248',
internalId:  '',
customField: '20090620-171735'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33206',
internalId:  '',
customField: '20090426-160145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60415',
internalId:  '',
customField: '20090419-161620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33101',
internalId:  '',
customField: '20090620-170153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33122',
internalId:  '',
customField: '20090620-170405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33164',
internalId:  '',
customField: '20090424-190322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33401',
internalId:  '',
customField: '20090620-170130'
};
webappMappings['7008']=webappMappings['7008-6637']={
webappId:    '7008',
documentId:  '33248',
internalId:  '6637',
customField: 'language:en;country:US;'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INPQ8B';
var companyName   = 'Trilogy+Capital+Management';
var htmlTitle	  = 'Trilogy+Capital+Management%2C+LLC';
var metaKeywords  = 'Note+Modification%2C+Note+Mod%2C+Contact+ManagementLoss+Mitigation%2C+Obama+Plan%2C+Mortgage%2C+Mortgages%2C+Home+Retention%2C+Home+Saver%2C+Services%2C+Foreclosure%2C+Mitch+Bonilla%2C+Trilogy%2C+Capital%2C+Management%2C+Trilogy+Capital+Management%2C+TCM%2C+Collections%2C+Debt%2C+Financial+Services%2C+Countrywide%2C+Washington+Mutual%2C+Portfolio+Management%2C+Fannie+Mae%2C+Freddie+Mac%2C+WaMu%2C+Asset+Management';
var metaContents  = 'Trilogy+Capital+Management%2C+LLC+provides+asset+management+outsourcing+services+to+banking+and+financial+services+clients%2C+primarily+in+the+mortgage+and+consumer+loan+industries+with+a+focus+on+home+retention.';
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();
};
