/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],''],
	['PAGE','5601',jdecode('About+us'),jdecode(''),'/5601/index.html','true',[ 
		['PAGE','5622',jdecode('The+team'),jdecode(''),'/5601/5622.html','true',[],''],
		['PAGE','128201',jdecode('Mission+Statement'),jdecode(''),'/5601/128201.html','true',[],'']
	],''],
	['PAGE','5643',jdecode('Products'),jdecode(''),'/5643/index.html','true',[ 
		['PAGE','5664',jdecode('First+Product'),jdecode(''),'/5643/5664.html','true',[],''],
		['PAGE','5685',jdecode('Second+Product'),jdecode(''),'/5643/5685.html','true',[],''],
		['PAGE','5706',jdecode('Third+Product'),jdecode(''),'/5643/5706.html','true',[],''],
		['PAGE','125801',jdecode('New+Product'),jdecode(''),'/5643/125801.html','true',[],'']
	],''],
	['PAGE','5727',jdecode('Roomscaping+Designs'),jdecode(''),'/5727/index.html','true',[ 
		['PAGE','14501',jdecode('Interior+Furnishings'),jdecode(''),'/5727/14501.html','true',[],''],
		['PAGE','14522',jdecode('Custom+Kitchens'),jdecode(''),'/5727/14522.html','true',[],''],
		['PAGE','30301',jdecode('Custom+Built+Furniture'),jdecode(''),'/5727/30301.html','true',[],''],
		['PAGE','30322',jdecode('Woods+and+Finishes'),jdecode(''),'/5727/30322.html','true',[],'']
	],''],
	['PAGE','5748',jdecode('Recent+Projects'),jdecode(''),'/5748/index.html','true',[ 
		['PAGE','107701',jdecode('New+Design+Ideas'),jdecode(''),'/5748/107701.html','true',[],''],
		['PAGE','180326',jdecode('Additions'),jdecode(''),'/5748/180326.html','true',[],''],
		['PAGE','184795',jdecode('Alterations+%26+Construction'),jdecode(''),'/5748/184795.html','true',[],'']
	],''],
	['PAGE','89001',jdecode('Featured+Projects'),jdecode(''),'/89001/index.html','true',[ 
		['PAGE','184012',jdecode('Renovated+Baths'),jdecode(''),'/89001/184012.html','true',[],'']
	],''],
	['PAGE','21101',jdecode('Design+Portfolio'),jdecode(''),'/21101.html','true',[],''],
	['PAGE','5769',jdecode('Contact'),jdecode(''),'/5769/index.html','true',[ 
		['PAGE','5790',jdecode('Addresses'),jdecode(''),'/5769/5790.html','true',[],'']
	],''],
	['PAGE','14543',jdecode('Services'),jdecode(''),'/14543/index.html','true',[ 
		['PAGE','71101',jdecode('How+we+work'),jdecode(''),'/14543/71101.html','true',[],'']
	],''],
	['PAGE','14564',jdecode('References'),jdecode(''),'/14564/index.html','true',[ 
		['PAGE','87401',jdecode('Referral+List'),jdecode(''),'/14564/87401.html','true',[],'']
	],''],
	['PAGE','30364',jdecode('News'),jdecode(''),'/30364.html','true',[],''],
	['PAGE','41406',jdecode('Guestbook'),jdecode(''),'/41406/index.html','true',[ 
		['PAGE','41401',jdecode('Read+Guestbook'),jdecode(''),'/41406/41401.html','false',[],'']
	],'']];
var siteelementCount=30;
theSitetree.topTemplateName='Kreis';
theSitetree.paletteFamily='D24C59';
theSitetree.keyvisualId='603';
theSitetree.keyvisualName='planen.jpg';
theSitetree.fontsetId='125';
theSitetree.graphicsetId='143';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var theTemplate={
				name: 			'Kreis',
				paletteFamily: 	'D24C59',
				keyvisualId: 	'603',
				keyvisualName: 	'planen.jpg',
				fontsetId: 		'125',
				graphicsetId: 	'143',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'D24C59',
				b_color: 		'F877A1',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20081116-081030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20091226-081458'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-41406AHW050INXS83']={
webappId:    '1002',
documentId:  '41406',
internalId:  '41406AHW050INXS83',
customField: 'icq=false'
};
webappMappings['1501']=webappMappings['1501-7035']={
webappId:    '1501',
documentId:  '401',
internalId:  '7035',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-b11ce808c59b2e6f50d1891f807e1c43']={
webappId:    '7060',
documentId:  '21101',
internalId:  'b11ce808c59b2e6f50d1891f807e1c43',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5622',
internalId:  '',
customField: '20091226-081705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128201',
internalId:  '',
customField: '20091029-204056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5643',
internalId:  '',
customField: '20070329-082245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5664',
internalId:  '',
customField: '20091226-083456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5685',
internalId:  '',
customField: '20091226-083703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5706',
internalId:  '',
customField: '20091226-083754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125801',
internalId:  '',
customField: '20080509-202055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5727',
internalId:  '',
customField: '20091214-160108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14501',
internalId:  '',
customField: '20091226-124233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14522',
internalId:  '',
customField: '20091227-205554'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30301',
internalId:  '',
customField: '20091226-132546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30322',
internalId:  '',
customField: '20091226-132900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5748',
internalId:  '',
customField: '20100113-213510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107701',
internalId:  '',
customField: '20091226-134225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '180326',
internalId:  '',
customField: '20091227-211933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '184795',
internalId:  '',
customField: '20091226-141901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89001',
internalId:  '',
customField: '20080717-070456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '184012',
internalId:  '',
customField: '20090524-085318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21101',
internalId:  '',
customField: '20070412-081918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5769',
internalId:  '',
customField: '20080614-084006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5790',
internalId:  '',
customField: '20091029-204245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14543',
internalId:  '',
customField: '20091029-204426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71101',
internalId:  '',
customField: '20091029-204909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14564',
internalId:  '',
customField: '20091222-185347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87401',
internalId:  '',
customField: '20070716-234240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30364',
internalId:  '',
customField: '20100105-133228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41406',
internalId:  '',
customField: '20070403-202043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41401',
internalId:  '',
customField: '20070403-202043'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INXS83';
var companyName   = 'InnerSpaces+Building+%26+Design+llc';
var htmlTitle	  = 'http%3A%2F%2Fwww%2Cmyinnerspaces.com';
var metaKeywords  = 'imperia+kitchens%2C+custom+cabinets%2C+built-ins%2C+bathroom%2C+cwp+cabinetry%2C+custom+wood+products%2C+theaters%2C+media%2C+countertops%2C+flooring%2C+corian%2C+granite%2C+design%2C+floor+plans%2C+roomscaping%2C+innerspaces%2C';
var metaContents  = 'roomscapes%2Cinnerspaces%2Ccustom+kitchens%2C+luxury+baths%2C+Built-ins%2C+media+rooms%2C+home+theater%2C+furniture%2C+bath+vanities%2C+kitchen+design%2C+custom+cabinetry%2C+created+by+Cheshire+Cabinet%2C+designer+kitchens%2C+kitchen+designer+watertown+ct%2C';
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();
};
