/* [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','301',jdecode('Home'),jdecode(''),'/301.html','true',[],'',''],
	['PAGE','24601',jdecode('About+Us'),jdecode(''),'/24601.html','true',[],'',''],
	['PAGE','30601',jdecode('Staging+FAQs'),jdecode(''),'/30601.html','true',[],'',''],
	['PAGE','20443',jdecode('Services+and+Fees'),jdecode(''),'/20443.html','true',[],'',''],
	['PAGE','20485',jdecode('Contact+Us'),jdecode(''),'/20485.html','true',[],'',''],
	['PAGE','23101',jdecode('Portfolio'),jdecode(''),'/23101.html','true',[],'',''],
	['PAGE','25201',jdecode('Links'),jdecode(''),'/25201.html','true',[],'',''],
	['PAGE','41601',jdecode('Staging+Tips'),jdecode(''),'/41601.html','true',[],'',''],
	['PAGE','50501',jdecode('Testimonials'),jdecode(''),'/50501.html','true',[],'',''],
	['PAGE','52793',jdecode('Staging+Blog'),jdecode(''),'/52793.html','true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Medium';
theSitetree.paletteFamily='F5F5F5';
theSitetree.keyvisualId='2155';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='360';
theSitetree.graphicsetId='407';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F5F5F5';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Medium',
				paletteFamily: 	'F5F5F5',
				keyvisualId: 	'2155',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'360',
				graphicsetId: 	'407',
				contentColor: 	'000000',
				contentBGColor: 'F5F5F5',
				a_color: 		'F5F5F5',
				b_color: 		'8EBFC6',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30601',
internalId:  '',
customField: '20100421-145242'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20081216-123600'
};
webappMappings['7060']=webappMappings['7060-15fe1a6db6269b4bcd9601a5ed2d0984']={
webappId:    '7060',
documentId:  '23101',
internalId:  '15fe1a6db6269b4bcd9601a5ed2d0984',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20443',
internalId:  '',
customField: '20100423-081631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20485',
internalId:  '',
customField: '20080328-143645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23101',
internalId:  '',
customField: '20071019-101352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25201',
internalId:  '',
customField: '20100512-123456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41601',
internalId:  '',
customField: '20090415-123935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52793',
internalId:  '',
customField: '20080903-111920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24601',
internalId:  '',
customField: '20071018-140532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50501',
internalId:  '',
customField: '20100514-085355'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INEU4K';
var companyName   = 'Home+Staging+%26+Organizing';
var htmlTitle	  = 'Home+Staging+and+Organizing';
var metaKeywords  = 'home+and%2Fstaging+and+%2FPhiladelphia%2C+real+estate+and+%2Fstaging+and+%2FChester+County%2C+real+estate+and%2Fstaging+and%2FDelaware+County%2C+real+estate+and+%2Fstaging+and+%2FMontgomery+County%2C+home+and+%2Forganizer%2C+professional+and%2Fstager%2C+real+estate+and%2Fstaging+and%2FPhiladelphia%2C+home+and%2Fstaging+and+%2FPennsylvania%2C+redesign%2C+house+and%2Fstaging%2C+Main+Line+and+%2Fstaging%2C+staging+tips%2C+staging+FAQs%2C+Lehigh+Valley+and+%2Fstaging%2C+home+and%2Forganizing';
var metaContents  = 'Professional+stager+Linda+Sticklin%2C+provides+staging+consultation%2C+staging+to+prepare+vacant+or+occupied+home+for+sale%2C+furniture+and+accessory+rental+and+home+organizing+services.++Find+services%2C+fees+and+contact.';
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();
};
