/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','5601',jdecode('About+Us'),jdecode(''),'/5601.html','true',[],'',''],
	['PAGE','7185',jdecode('ILD+for+the+BEDROOM'),jdecode(''),'/7185.html','true',[],'',''],
	['PAGE','7101',jdecode('ILD+for+the+OFFICE'),jdecode(''),'/7101.html','true',[],'',''],
	['PAGE','7143',jdecode('ILD+for+a+Healthy+Home'),jdecode(''),'/7143.html','true',[],'',''],
	['PAGE','103901',jdecode('The+Clutter+Counselor'),jdecode(''),'/103901.html','true',[],'',''],
	['PAGE','105701',jdecode('Tips+and+tricks'),jdecode(''),'/105701.html','true',[],'',''],
	['PAGE','3385',jdecode('Contact'),jdecode(''),'/3385.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Bound';
theSitetree.paletteFamily='4D5022';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10834';
theSitetree.graphicsetId='11292';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='787F42';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Bound',
				paletteFamily: 	'4D5022',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10834',
				graphicsetId: 	'11292',
				contentColor: 	'FFFFFF',
				contentBGColor: '787F42',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-3293130']={
webappId:    '1501',
documentId:  '401',
internalId:  '3293130',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20110802-091122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105701',
internalId:  '',
customField: '20110802-091724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20110701-153730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7101',
internalId:  '',
customField: '20110616-122754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103901',
internalId:  '',
customField: '20110802-091248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7143',
internalId:  '',
customField: '20110430-130017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7185',
internalId:  '',
customField: '20110701-153847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3385',
internalId:  '',
customField: '20100418-102635'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN211R';
var companyName   = 'Bante+Design+LLC';
var htmlTitle	  = 'Bante+Design+LLC';
var metaKeywords  = 'feng+shui%2C+bedroom+design%2C+home+office+design%2C+design+for+abundance%2C+design+for+romance%2C+teen+workshops%2C+books%2C+consulting%2C+interior+design%2C+keynote%2C+seminars%2C+business+workshops%2C+integrative+lifestyle+design%2C+deanna+radaj%2C+bante+design%2C+3e+products%2C+eco-friendly+cleaners%2C+feng+shui+chocolates%2C+natural+home+design%2C++healthcare+design%2C+consultations%2C+healthy+home%2C+blogtalk+radio%2C+feng+shui+fabulous%2C+casaverde%2C+design2share%2C+harmony2share%2C+casaguru%2C+the+latte+lounge%2C+women+making+a+difference%2C+integrative+lifestyle+design%2C+teenagers%2C+nuseries%2C+pets%2C+companion+animal+design%2C+eden+place+productions%2C+feng+shui+fabulous%2C+casaverde';
var metaContents  = 'Bante+Design+LLC+is+an+Integrative+Lifestyle+Design+company.++We+specialize+in+creating+healthy+%26+supportive+BEDROOMS+%26+OFFICES-the+2+most+important+rooms+we+live+%26+work+in.++We+offer+consulting+services+by+video%2C+phone+and+email%21++';
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();
};

