/* [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','6216',jdecode('Home'),jdecode(''),'/6216.html','true',[],'',''],
	['PAGE','6301',jdecode('Home+Products'),jdecode(''),'/6301/index.html','true',[ 
		['PAGE','7901',jdecode('Patio+Furniture'),jdecode(''),'/6301/7901.html','true',[],'',''],
		['PAGE','22912',jdecode('Rain+Barrel'),jdecode(''),'/6301/22912.html','true',[],'',''],
		['PAGE','6322',jdecode('Storage+Products'),jdecode(''),'/6301/6322.html','true',[],'',''],
		['PAGE','23512',jdecode('Solar+Lights'),jdecode(''),'/6301/23512.html','true',[],'',''],
		['PAGE','23533',jdecode('Tiffany+Lamps'),jdecode(''),'/6301/23533.html','true',[],'',''],
		['PAGE','19212',jdecode('Wall+Decor'),jdecode(''),'/6301/19212.html','true',[],'','']
	],'',''],
	['PAGE','16612',jdecode('Firelogs+%26+Grates'),jdecode(''),'/16612.html','true',[],'',''],
	['PAGE','6364',jdecode('About+us'),jdecode(''),'/6364.html','true',[],'',''],
	['PAGE','18412',jdecode('Contact+Us'),jdecode(''),'/18412.html','true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Folder';
theSitetree.paletteFamily='A5C14F';
theSitetree.keyvisualId='11088';
theSitetree.keyvisualName='kv_11088.jpg';
theSitetree.fontsetId='31973';
theSitetree.graphicsetId='13809';
theSitetree.contentColor='54524D';
theSitetree.contentBGColor='A5C14F';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Folder',
				paletteFamily: 	'A5C14F',
				keyvisualId: 	'11088',
				keyvisualName: 	'kv_11088.jpg',
				fontsetId: 		'31973',
				graphicsetId: 	'13809',
				contentColor: 	'54524D',
				contentBGColor: 'A5C14F',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				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:  '6216',
internalId:  '',
customField: '20100405-155449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6301',
internalId:  '',
customField: '20100420-164651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6322',
internalId:  '',
customField: '20100421-144703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6364',
internalId:  '',
customField: '20100519-104919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23512',
internalId:  '',
customField: '20100421-145610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23533',
internalId:  '',
customField: '20100421-144614'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6216',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7901',
internalId:  '',
customField: '20100421-151631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16612',
internalId:  '',
customField: '20100603-101814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19212',
internalId:  '',
customField: '20100421-120247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22912',
internalId:  '',
customField: '20100421-144649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18412',
internalId:  '',
customField: '20100421-160901'
};
webappMappings['7008']=webappMappings['7008-16493']={
webappId:    '7008',
documentId:  '18412',
internalId:  '16493',
customField: 'language:en;country:US;'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I7CTVK';
var companyName   = 'JJ+International%2C+Inc.';
var htmlTitle	  = 'JJ+International%2C+Inc.';
var metaKeywords  = 'Green+Log%2C+firelogs%2C+furniture%2C+storage%2C+frames%2C+mirrors%2C+framed+art%2C+viaspace%2C+viaspace+green+energy%2C+vge%2C+vspc%2C+green+firelog%2C+green+fire+logs%2C+green%2C+lamps%2C+green+firelogs%2C+green+fire+log%2C+green+log%2C+renewable+fire+log%2C+renewable+firelog%2C+renewable%2C+green+energy%2C+renewable+energy';
var metaContents  = '';
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();
};
