/* [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','1446',jdecode('Home'),jdecode(''),'/1446.html','true',[],''],
	['PAGE','2101',jdecode('Foreclosure+'),jdecode(''),'/2101.html','true',[],''],
	['PAGE','2301',jdecode('Short+Sales'),jdecode(''),'/2301.html','true',[],''],
	['PAGE','2501',jdecode('Bankruptcy'),jdecode(''),'/2501.html','true',[],''],
	['PAGE','6401',jdecode('Business+Owners'),jdecode(''),'/6401.html','true',[],''],
	['PAGE','3301',jdecode('Debt+Counselors'),jdecode(''),'/3301.html','true',[],''],
	['PAGE','1509',jdecode('My+Blog'),jdecode(''),'/1509.html','true',[],''],
	['PAGE','1467',jdecode('Law+Firm+and+Legal+Fees'),jdecode(''),'/1467.html','true',[],''],
	['PAGE','3801',jdecode('Forgiven'),jdecode(''),'/3801.html','true',[],''],
	['PAGE','5601',jdecode('Resources'),jdecode(''),'/5601.html','true',[],''],
	['PAGE','10301',jdecode('Spanish+Resources'),jdecode(''),'/10301.html','true',[],''],
	['PAGE','7601',jdecode('Humor'),jdecode(''),'/7601.html','true',[],''],
	['PAGE','1541',jdecode('Contact'),jdecode(''),'/1541.html','true',[],''],
	['PAGE','2122',jdecode('Directions+to+the+Office'),jdecode(''),'/2122.html','true',[],'']];
var siteelementCount=14;
theSitetree.topTemplateName='Shindig';
theSitetree.paletteFamily='9A9F74';
theSitetree.keyvisualId='10397';
theSitetree.keyvisualName='kv_10397.jpg';
theSitetree.fontsetId='21228';
theSitetree.graphicsetId='13369';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='7A804B';
var theTemplate={
				name: 			'Shindig',
				paletteFamily: 	'9A9F74',
				keyvisualId: 	'10397',
				keyvisualName: 	'kv_10397.jpg',
				fontsetId: 		'21228',
				graphicsetId: 	'13369',
				contentColor: 	'FFFFFF',
				contentBGColor: '7A804B',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3301',
internalId:  '',
customField: '20091015-123542'
};
webappMappings['7050']=webappMappings['7050-1105']={
webappId:    '7050',
documentId:  '1509',
internalId:  '1105',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20100205-073741'
};
webappMappings['7008']=webappMappings['7008-3519']={
webappId:    '7008',
documentId:  '1541',
internalId:  '3519',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1446',
internalId:  '',
customField: '20100205-073438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1467',
internalId:  '',
customField: '20100205-074038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2501',
internalId:  '',
customField: '20091211-101257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1509',
internalId:  '',
customField: '20090602-084239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20091015-123731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1541',
internalId:  '',
customField: '20090602-145626'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '2122',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3801',
internalId:  '',
customField: '20090603-131351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2122',
internalId:  '',
customField: '20090915-101136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20091016-113147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20091014-094150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7601',
internalId:  '',
customField: '20091005-120216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20100205-073629'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INLOYV';
var companyName   = 'Forgiven+Debt+Lawyer';
var htmlTitle	  = 'Forgiven+Debt+Lawyer';
var metaKeywords  = '';
var metaContents  = 'bankruptcy+lawyer';
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();
};
