/* [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','17801',jdecode('Home'),jdecode(''), jdecode('%2F17801.html'), 'true',[],'',''],
	['PAGE','19401',jdecode('Real+Estate+Finance'),jdecode(''), jdecode('%2F19401%2Findex.html'), 'true',[ 
		['PAGE','19464',jdecode('Agricultural'),jdecode(''), jdecode('%2F19401%2F19464.html'), 'true',[],'',''],
		['PAGE','19422',jdecode('Private+Money'),jdecode(''), jdecode('%2F19401%2F19422.html'), 'true',[],'',''],
		['PAGE','19485',jdecode('Conventional'),jdecode(''), jdecode('%2F19401%2F19485.html'), 'true',[],'',''],
		['PAGE','121822',jdecode('Low+Doc'),jdecode(''), jdecode('%2F19401%2F121822.html'), 'true',[],'',''],
		['PAGE','19443',jdecode('Church+Finance'),jdecode(''), jdecode('%2F19401%2F19443.html'), 'true',[],'',''],
		['PAGE','19527',jdecode('Apps'),jdecode(''), jdecode('%2F19401%2F19527.html'), 'true',[],'','']
	],'',''],
	['PAGE','19548',jdecode('Business+Finance'),jdecode(''), jdecode('%2F19548%2Findex.html'), 'true',[ 
		['PAGE','130222',jdecode('*NEW+Biz+Loan'),jdecode(''), jdecode('%2F19548%2F130222.html'), 'true',[],'',''],
		['PAGE','19569',jdecode('Biz+Cash+Advance'),jdecode(''), jdecode('%2F19548%2F19569.html'), 'true',[],'',''],
		['PAGE','19590',jdecode('New+Equipment'),jdecode(''), jdecode('%2F19548%2F19590.html'), 'true',[],'',''],
		['PAGE','127822',jdecode('Sale%2FLeaseback'),jdecode(''), jdecode('%2F19548%2F127822.html'), 'true',[],'',''],
		['PAGE','19611',jdecode('Factoring'),jdecode(''), jdecode('%2F19548%2F19611.html'), 'true',[],'',''],
		['PAGE','19632',jdecode('Contract%2FPO'),jdecode(''), jdecode('%2F19548%2F19632.html'), 'true',[],'',''],
		['PAGE','19653',jdecode('Apps'),jdecode(''), jdecode('%2F19548%2F19653.html'), 'true',[],'','']
	],'',''],
	['PAGE','18601',jdecode('More+About+Us'),jdecode(''), jdecode('%2F18601%2Findex.html'), 'true',[ 
		['PAGE','30601',jdecode('Programs+-+RE'),jdecode(''), jdecode('%2F18601%2F30601.html'), 'true',[],'',''],
		['PAGE','32501',jdecode('Programs+Biz'),jdecode(''), jdecode('%2F18601%2F32501.html'), 'true',[],'',''],
		['PAGE','30622',jdecode('Questions'),jdecode(''), jdecode('%2F18601%2F30622.html'), 'true',[],'',''],
		['PAGE','30901',jdecode('Privacy+Policy'),jdecode(''), jdecode('%2F18601%2F30901.html'), 'true',[],'',''],
		['PAGE','111112',jdecode('Articles+'),jdecode(''), jdecode('%2F18601%2F111112.html'), 'true',[],'','']
	],'',''],
	['PAGE','18622',jdecode('Contact+Info'),jdecode(''), jdecode('%2F18622%2Findex.html'), 'true',[ 
		['PAGE','30643',jdecode('Email+Form+'),jdecode(''), jdecode('%2F18622%2F30643.html'), 'true',[],'',''],
		['PAGE','30664',jdecode('Blog'),jdecode(''), jdecode('%2F18622%2F30664.html'), 'true',[],'',''],
		['PAGE','107654',jdecode('Social+Networking+'),jdecode(''), jdecode('%2F18622%2F107654.html'), 'true',[],'','']
	],'',''],
	['PAGE','19695',jdecode('Brokers+Corner'),jdecode(''), jdecode('%2F19695%2Findex.html'), 'true',[ 
		['PAGE','19716',jdecode('Registration'),jdecode(''), jdecode('%2F19695%2F19716.html'), 'true',[],'',''],
		['PAGE','19737',jdecode('Broker+Promo'),jdecode(''), jdecode('%2F19695%2F19737.html'), 'false',[],'',''],
		['PAGE','19758',jdecode('Program+Apps'),jdecode(''), jdecode('%2F19695%2F19758.html'), 'true',[],'',''],
		['PAGE','30685',jdecode('Brkr+Forum'),jdecode(''), jdecode('%2F19695%2F30685.html'), 'false',[],'','']
	],'',''],
	['PAGE','115012',jdecode('Success+Highlights'),jdecode(''), jdecode('%2F115012%2Findex.html'), 'true',[ 
		['PAGE','115033',jdecode('Funded+Highlights'),jdecode(''), jdecode('%2F115012%2F115033.html'), 'true',[],'',''],
		['PAGE','115054',jdecode('Archived+Highlights'),jdecode(''), jdecode('%2F115012%2F115054.html'), 'true',[],'',''],
		['PAGE','116312',jdecode('Program+Highlights'),jdecode(''), jdecode('%2F115012%2F116312.html'), 'true',[],'','']
	],'',''],
	['PAGE','96912',jdecode('Industry+Links'),jdecode(''), jdecode('%2F96912.html'), 'true',[],'',''],
	['PAGE','106412',jdecode('Investors'),jdecode(''), jdecode('%2F106412.html'), 'true',[],'','']];
var siteelementCount=37;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='990000';
theSitetree.keyvisualId='1262';
theSitetree.keyvisualName='seminar.jpg';
theSitetree.fontsetId='190';
theSitetree.graphicsetId='232';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hps_testtown',
  product: 'WSCSYSSSSLYTC24G'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Profile',
				paletteFamily: 	'990000',
				keyvisualId: 	'1262',
				keyvisualName: 	'seminar.jpg',
				fontsetId: 		'190',
				graphicsetId: 	'232',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'990000',
				b_color: 		'333333',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17801',
internalId:  '',
customField: '20110724-193810'
};
webappMappings['1501']=webappMappings['1501-9706201']={
webappId:    '1501',
documentId:  '17801',
internalId:  '9706201',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19401',
internalId:  '',
customField: '20120125-170904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18601',
internalId:  '',
customField: '20110606-182844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18622',
internalId:  '',
customField: '20111221-145931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19695',
internalId:  '',
customField: '20120126-102401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19548',
internalId:  '',
customField: '20120125-170050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19422',
internalId:  '',
customField: '20110724-181450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19443',
internalId:  '',
customField: '20120125-171425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19464',
internalId:  '',
customField: '20110724-180442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19485',
internalId:  '',
customField: '20110724-195740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30622',
internalId:  '',
customField: '20110724-192459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19527',
internalId:  '',
customField: '20120126-103305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19569',
internalId:  '',
customField: '20120117-163827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19590',
internalId:  '',
customField: '20111011-111111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19611',
internalId:  '',
customField: '20110724-172322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19632',
internalId:  '',
customField: '20111206-142244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19653',
internalId:  '',
customField: '20110724-165513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116312',
internalId:  '',
customField: '20111206-135852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19716',
internalId:  '',
customField: '20110310-131802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19737',
internalId:  '',
customField: '20110228-173910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19758',
internalId:  '',
customField: '20110310-131842'
};
webappMappings['7008']=webappMappings['7008-10897']={
webappId:    '7008',
documentId:  '30643',
internalId:  '10897',
customField: 'language:en;country:US;'
};
webappMappings['7050']=webappMappings['7050-3412']={
webappId:    '7050',
documentId:  '30664',
internalId:  '3412',
customField: 'language:en;country:US;'
};
webappMappings['1003']=webappMappings['1003-ahw050inzyhk12e6ab0ef1a']={
webappId:    '1003',
documentId:  '30685',
internalId:  'ahw050inzyhk12e6ab0ef1a',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30901',
internalId:  '',
customField: '20110625-231648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30601',
internalId:  '',
customField: '20110310-132510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30643',
internalId:  '',
customField: '20110228-001858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30664',
internalId:  '',
customField: '20110227-235249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30685',
internalId:  '',
customField: '20110228-173644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32501',
internalId:  '',
customField: '20110310-132535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106412',
internalId:  '',
customField: '20110611-172502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96912',
internalId:  '',
customField: '20110908-164115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107654',
internalId:  '',
customField: '20110317-150259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111112',
internalId:  '',
customField: '20110427-165635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115012',
internalId:  '',
customField: '20110825-113606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115033',
internalId:  '',
customField: '20120216-143350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115054',
internalId:  '',
customField: '20110923-094446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121822',
internalId:  '',
customField: '20120125-171944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '127822',
internalId:  '',
customField: '20111011-122144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '130222',
internalId:  '',
customField: '20120117-224230'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INZYHK';
var companyName   = 'Commercial+Real+Estate+-+Business+Finance';
var htmlTitle	  = 'Commercial+Real+Estate+%26+Business+Financing+%28A-D+Credit%29++*AG+Financing%2C+Cash+Advance+%26+Business+Loans+Available';
var metaKeywords  = 'Small+Business+Finance%2C+Small+Business+Loans%2C+Loans%2C+Private+Money%2C+Private+Hard+Money%2C+Cash+Advances%2C+Business+Loans%2C+Business+Financing%2C+Ag+Loans%2C+Agricultural+Financing%2C+Factoring%2C+Full+doc+loans%2C+Purchase+Order+Finance%2C+Contract+Finance%2C+Texas+Loans%2C+Texas+Financing%2C+Texas+Business+Financing%2C+SBA+Loans%2C+SBA+Financing%2C+Land+Finance%2C+Commercial+Finance%2C+Commercial+Real+Estate+Finance%2C+CREW%2C+Investment+Financing%2C+Private+Money+Investments%2C+Development+Financing%2C+Nationwide+Finance%2C+Investment+Professionals%2C+Equipment+Financing%2C+Full+Doc+Loans%2C+Low+Doc+Loans%2C+Stated+Loans%2C+Full+Doc+Financing%2C+Low+Doc+Financing%2C+Church+Loans%2C+Church+Financing%2C+Loans%2C+Financing%2C+Church+Construction+Loans';
var metaContents  = 'Commercial+Real+Estate+%26+Business+Financing.++Private+Money%2C+Agricultural+Land%2C+Full+Doc%2C+Low+Doc+%26+Church+Programs+%24100k+plus.++Merchant+Cash+Advances+%245km-%24800k%2C+Equipment+Financing%2C+Factoring%2C+Contract+%26+Purchase+Order+Financing.';
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();
};

