/* [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','7201',jdecode('Home'),jdecode(''),'/7201.html','true',[],'',''],
	['PAGE','7252',jdecode('PAINT'),jdecode(''),'/7252.html','true',[],'',''],
	['PAGE','7273',jdecode('WINDOWTREATS'),jdecode(''),'/7273.html','true',[],'',''],
	['PAGE','9601',jdecode('LIGHTING'),jdecode(''),'/9601.html','true',[],'',''],
	['PAGE','9622',jdecode('WALLPAPER'),jdecode(''),'/9622.html','true',[],'',''],
	['PAGE','7294',jdecode('SERVICES'),jdecode(''),'/7294.html','true',[],'',''],
	['PAGE','7336',jdecode('CONTACT+US'),jdecode(''),'/7336.html','true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Holz';
theSitetree.paletteFamily='C239A1';
theSitetree.keyvisualId='8815';
theSitetree.keyvisualName='KV_01.swf';
theSitetree.fontsetId='17181';
theSitetree.graphicsetId='12652';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='262626';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Holz',
				paletteFamily: 	'C239A1',
				keyvisualId: 	'8815',
				keyvisualName: 	'KV_01.swf',
				fontsetId: 		'17181',
				graphicsetId: 	'12652',
				contentColor: 	'FFFFFF',
				contentBGColor: '262626',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'C039A3',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7201',
internalId:  '',
customField: '20100910-134414'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '7201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7252',
internalId:  '',
customField: '20100909-154926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7273',
internalId:  '',
customField: '20100909-154926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7294',
internalId:  '',
customField: '20100909-154926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7336',
internalId:  '',
customField: '20100909-154926'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I71Q6Z';
var companyName   = 'HOME+TEAM+DECOR';
var htmlTitle	  = 'Home+Team+Decor';
var metaKeywords  = '%3Cmythic%3E+%3Chome%3E+%3Cdecor%3E+%3Cnon+toxic%3E+%3Cpaint%3E+%3Cpet%3E+%3Cbenjamin+moore%3E+%3Ccolor%3E+%3Cexpert%3E+%3Cbusiness%3E+%3Cdesign%3E+%3Chunter+douglas%3E+%3Cfaux+finish%3E+%3Csherri%3E+%3Cmike%3E+%3Cretail+store%3E+%3Cwallpaper%3E+%3Clighting%3E+%3Cceiling+fans%3E+%3Csikkens%3E+%3Cakzonobel%3E+%3Cinterior+design%3E+%3Cblinds%3E+%3Ccurtains%3E+%3Cdrapes%3E+%3Cseamstress%3E+%3Cwindowcoverings%3E+%3Cplover%3E+%3Ccentral+wisconsin%3E+%3Cstevens+point%3E+%3Cmosinee%3E+%3Cwausau%3E+%3Cmarshfield%3E+%3Cwaupaca%3E+%3Cprofessional%3E+%3Cexperts%3E+%3Cremodel%3E+%3Cbudget%3E+%3Ccraftmade%3E+%3Ccolor%3E+%3Cdecorating%3E+%3Cservice%3E+%3Cpainting%3E+%3Cwallpaper+hanger%3E+%3Cinstruction%3E+%3Cvision%3E+%3Ccustomer%3E+%3Csatisfaction%3E+%3Cin-home%3E+%3Cdesigner%3E';
var metaContents  = '%3Chome+team+decor%3E+%3Cmythic+paint%3E+%3Cnon+toxic+paint%3E+%3Clocally+owned%3E+%3Ccustomer+service%3E+%3Chome+design%3E+%3Cpaint%3E+%3Cbenjamin+moore%3E+%3Cpaint+%26+color%3E+%3Cwindowtreatments%3E+%3Chunter+douglas%3E+%3Ccustom+creations%3E+%3Cexpert+staff%3E+%3Csherri%3E+%3Cmike%3E+%3Con+a+budget%3E+%3Cdesign+resource%3E+%3Cakzo+nobel%3E+%3Csikkens%3E+%3Clog+home%3E+%3Ccentral+wisconsin%3E+%3Cstevens+point%3E+%3Cplover%3E+%3Cwausau%3E+%3Cmosinee%3E+%3Chandy+man%3E+%3Chandy+lady%3E+%3Ccontract+paint%3E+%3Cfaux+finishing%3E+%3Ccolor+expert%3E+%3Cremodel+experts%3E+%3Cstylish+solutions%3E+%3Cservice+products%3E+%3Cretail+store%3E+%3Cwork+on+budget%3E+%3Cexperience+staff%3E+%3Cblonder+wallpaper%3E+%3Cyork+wallpaper%3E+%3Ccraftmade+fans%3E+%3Cwoodbridge+lighting%3E+%3Clighting+expert%3E+%3Cdesign+expert%3E+%3Chome+experts%3E';
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();
};

