/* [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','5301',jdecode('Home'),jdecode(''),'/5301.html','true',[],''],
	['PAGE','5352',jdecode('The+Benefits+of+Selling'),jdecode(''),'/5352/index.html','true',[ 
		['PAGE','5373',jdecode('Advantages'),jdecode(''),'/5352/5373.html','true',[],''],
		['PAGE','5394',jdecode('The+Power+of+Cash'),jdecode(''),'/5352/5394.html','true',[],'']
	],''],
	['PAGE','5415',jdecode('How+we+value+your+Note'),jdecode(''),'/5415/index.html','true',[ 
		['PAGE','5436',jdecode('Three+simple+factors'),jdecode(''),'/5415/5436.html','true',[],''],
		['PAGE','5457',jdecode('Time+Value+of+Money'),jdecode(''),'/5415/5457.html','true',[],'']
	],''],
	['PAGE','20901',jdecode('Client+Testimonials'),jdecode(''),'/20901.html','true',[],''],
	['PAGE','31253',jdecode('Trust+Deed+Investing'),jdecode(''),'/31253.html','true',[],''],
	['PAGE','5478',jdecode('About+us'),jdecode(''),'/5478.html','true',[],''],
	['PAGE','5499',jdecode('Contact'),jdecode(''),'/5499/index.html','true',[ 
		['PAGE','11001',jdecode('Contact+%28follow+up+page%29'),jdecode(''),'/5499/11001.html','false',[],''],
		['PAGE','5520',jdecode('Addresses'),jdecode(''),'/5499/5520.html','true',[],'']
	],''],
	['PAGE','31012',jdecode('Privacy'),jdecode(''),'/31012.html','true',[],'']];
var siteelementCount=14;
theSitetree.topTemplateName='Care';
theSitetree.paletteFamily='EE8240';
theSitetree.keyvisualId='212';
theSitetree.keyvisualName='gute_zaehne.jpg';
theSitetree.fontsetId='22';
theSitetree.graphicsetId='22';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Care',
				paletteFamily: 	'EE8240',
				keyvisualId: 	'212',
				keyvisualName: 	'gute_zaehne.jpg',
				fontsetId: 		'22',
				graphicsetId: 	'22',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'EE8240',
				b_color: 		'669966',
				c_color: 		'000000',
				d_color: 		'6A8493',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1001']=webappMappings['1001-ahw050inejxx75846ab464e20f4b']={
webappId:    '1001',
documentId:  '5499',
internalId:  'ahw050inejxx75846ab464e20f4b',
customField: ''
};
webappMappings['1001']=webappMappings['1001-ahw050inejxx75846ab464e20f4b']={
webappId:    '1001',
documentId:  '11001',
internalId:  'ahw050inejxx75846ab464e20f4b',
customField: 'followUp'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20080825-163107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31253',
internalId:  '',
customField: '20090422-164534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20901',
internalId:  '',
customField: '20090422-164608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5415',
internalId:  '',
customField: '20080331-182354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5352',
internalId:  '',
customField: '20080820-163310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5373',
internalId:  '',
customField: '20070129-155533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5394',
internalId:  '',
customField: '20070130-140215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5436',
internalId:  '',
customField: '20070129-152402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5457',
internalId:  '',
customField: '20070129-145659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5478',
internalId:  '',
customField: '20080820-163138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5499',
internalId:  '',
customField: '20070129-142553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11001',
internalId:  '',
customField: '20070129-142425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5520',
internalId:  '',
customField: '20070219-140723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31012',
internalId:  '',
customField: '20080812-202236'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INEJXX';
var companyName   = 'J.+Merrill+Funding';
var htmlTitle	  = 'notebeacon.com';
var metaKeywords  = 'note+buyer%2C+sell+a+note%2C++land+contract%2C++contract+for+deed%2C++mortgage+buyer%2C+notebeacon%2C+noteworld%2C+enoteworld%2C+cash+for+notes%2C+landcontract%2C+notebuyer%2C+trust+deed%2C+deed+of+trust%2C+mortgage+note%2C+cash+for+note%2C+note+broker%2C+boston+note%2C+contract+buyers%2C+noteworthy';
var metaContents  = 'cash+for+notes%2C+contracts+and+mortgages.++Reliable+note+buyer.++Jennifer+Sokso+left+Noteworld+and+South+Plains+Mortgage+and+founded+J.+Merrill+Funding+to+purchase+notes%2C+land+contracts+and+mortgages+nationwide.++Friendly+note+buyers+we+offer+the+best+prices+and+quick+cash.++commercial+notes%2C+residential+notes%2C+business+notes%2C+specializing+in+Arizona%2C+Washington%2C+Oregon%2C+Idaho%2C+Montana%2C+Texas';
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();
};
