/* [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','4701',jdecode('Home+Page'),jdecode(''),'/4701.html','true',[],''],
	['PAGE','4752',jdecode('Attorney+Profile'),jdecode(''),'/4752.html','true',[],''],
	['PAGE','18323',jdecode('Real+Estate'),jdecode(''),'/18323.html','true',[],''],
	['PAGE','18523',jdecode('Bankruptcy'),jdecode(''),'/18523.html','true',[],''],
	['PAGE','18544',jdecode('Estate+Planning'),jdecode(''),'/18544.html','true',[],''],
	['PAGE','4857',jdecode('Contact+Us'),jdecode(''),'/4857.html','true',[],''],
	['PAGE','4878',jdecode('Location'),jdecode(''),'/4878.html','true',[],''],
	['PAGE','7912',jdecode('FAQ+Sellers'),jdecode(''),'/7912.html','true',[],''],
	['PAGE','7933',jdecode('FAQ+Buyers'),jdecode(''),'/7933.html','true',[],''],
	['PAGE','15012',jdecode('Blog'),jdecode(''),'/15012.html','true',[],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Livinginamerica';
theSitetree.paletteFamily='6971B1';
theSitetree.keyvisualId='6319';
theSitetree.keyvisualName='kv_6319.jpg';
theSitetree.fontsetId='11151';
theSitetree.graphicsetId='11956';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='D6DAF6';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Livinginamerica',
				paletteFamily: 	'6971B1',
				keyvisualId: 	'6319',
				keyvisualName: 	'kv_6319.jpg',
				fontsetId: 		'11151',
				graphicsetId: 	'11956',
				contentColor: 	'000000',
				contentBGColor: 'D6DAF6',
				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['7008']=webappMappings['7008-6345']={
webappId:    '7008',
documentId:  '4857',
internalId:  '6345',
customField: 'language:en;country:US;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '4878',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20090220-095339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7933',
internalId:  '',
customField: '20090201-163626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4857',
internalId:  '',
customField: '20090202-214001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4878',
internalId:  '',
customField: '20090220-100327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4752',
internalId:  '',
customField: '20090220-095429'
};
webappMappings['7050']=webappMappings['7050-3891']={
webappId:    '7050',
documentId:  '15012',
internalId:  '3891',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7912',
internalId:  '',
customField: '20090201-163547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15012',
internalId:  '',
customField: '20080726-221230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18323',
internalId:  '',
customField: '20090202-213104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18523',
internalId:  '',
customField: '20090220-100048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18544',
internalId:  '',
customField: '20090220-100230'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2F8P';
var companyName   = 'CYNTHIA+M.+BURKE';
var htmlTitle	  = 'New+York%2C+Long+Island%2C+real+estate+and+bankruptcy+lawyer';
var metaKeywords  = 'Long+Island%2C+New+York%2C+real+estate+lawyer%2C+new+york+bankruptcy+lawyer%2C+new+york+real+estate+attorney%2C+new+york+bankruptcy+attorney%2C+ny+real+estate+lawyer%2C+ny+bankruptcy+lawyer%2C+new+york+real+estate+law%2C+bankruptcy+lawyer+in+new+york%2C+new+york+state+bankruptcy+law%2C+ny+real+estate+law%2C+bankruptcy+in+new+york%2C+nassau+county+real+estate+lawyer%2C+suffolk+county+real+estate+lawyer%2C+baldwin+real+estate+lawyer%2C+garden+city+real+estate+lawyer%2C+elmont+real+estate+lawyer%2C+long+island+real+estate+lawyer%2C+long+island+bankruptcy+lawyer%2C+queens+real+estate+attorney%2C+queens+real+estate+lawyer%2C+nassau+bankruptcy+attorney%2C+nassau+bankruptcy+lawyer%2C+suffolk+bankruptcy+attorney%2C+new+york+probate+lawyer%2C+new+york+probate+attorney';
var metaContents  = 'Cynthia+M.+Burke+is+a+New+York+real+estate%2C+bankruptcy%2C+estate+and+litigation+lawyer+practicing+in+Long+Island%2C+Nassau%2C+Suffolk%2C+Queens%2C+Brooklyn.++Attorney+who+handles+real+estate+closings+for+buyers+and+sellers%2C+and+Chapter+7+and+13+bankruptcies.';
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();
};
