/* [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','1501',jdecode('Home'),jdecode(''),'/1501.html','true',[],'',''],
	['PAGE','2043',jdecode('Products'),jdecode(''),'/2043.html','true',[],'',''],
	['PAGE','12243',jdecode('InspireNet+%28TM%29'),jdecode(''),'/12243.html','false',[],'',''],
	['PAGE','2001',jdecode('What%26%23x27%3Bs+new'),jdecode(''),'/2001.html','true',[],'',''],
	['PAGE','2064',jdecode('How+to+find+us'),jdecode(''),'/2064.html','true',[],'',''],
	['PAGE','2085',jdecode('Hours+%2F+Info'),jdecode(''),'/2085.html','true',[],'',''],
	['PAGE','10215',jdecode('See+our+work'),jdecode(''),'/10215.html','true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Holz';
theSitetree.paletteFamily='FF7113';
theSitetree.keyvisualId='8817';
theSitetree.keyvisualName='KV_03.swf';
theSitetree.fontsetId='17181';
theSitetree.graphicsetId='12655';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Holz',
				paletteFamily: 	'FF7113',
				keyvisualId: 	'8817',
				keyvisualName: 	'KV_03.swf',
				fontsetId: 		'17181',
				graphicsetId: 	'12655',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'FF6600',
				d_color: 		'FFFFFF',
				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:  '1501',
internalId:  '',
customField: '20110331-045116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12243',
internalId:  '',
customField: '20100530-133904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20110802-112708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10215',
internalId:  '',
customField: '20100517-063248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2043',
internalId:  '',
customField: '20110409-110420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2064',
internalId:  '',
customField: '20100505-180002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2085',
internalId:  '',
customField: '20110331-044836'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INLRK1';
var companyName   = 'Floor+Coverings+Design+Studio';
var htmlTitle	  = 'Floor+Coverings+Design+Studio';
var metaKeywords  = 'carpet%2C+hardwood%2C+flooring%2C+laminate%2C+cork%2C+home+design%2C+home+improvement%2C+bamboo%2C+karndean%2C+plank+flooring%2C+warmup+floor+system%2C+tile%2C+Okemos%2C+inspired+flooring%2C+wool+carpet%2C+sisal%2C+Inspirnet%2C+Kraus+carpet%2C+Shaw+carpet%2C+Stainmaster%2C+Mohawk+carpet%2C+carpet+tiles%2C+FLOR%2C+Chelsea+Plank%2C+vinyl%2C+glass+tile%2C+slate%2C+stone%2C+marble%2C+American+Flooring%2C+Maloney+Carpet+One%2C+Flooring+America%2C+Congoleum%2C+Williams+Carpet%2C+Floor+Coverings+International%2C+Floor+Coverings+Design+Studio';
var metaContents  = 'Boutique+flooring+store+in+Okemos%2C+Michigan+--+everything+for+your+flooring+needs';
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();
};

