/* [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','10501',jdecode('OUR+PRODUCTS'),jdecode(''),'/10501.html','true',[],''],
	['PAGE','27601',jdecode('Mantel+Packages'),jdecode(''),'/27601/index.html','true',[ 
		['PAGE','27622',jdecode('Arrowflame'),jdecode(''),'/27601/27622.html','true',[],''],
		['PAGE','27706',jdecode('Classic+Flame'),jdecode(''),'/27601/27706.html','true',[],''],
		['PAGE','27727',jdecode('Dimplex'),jdecode(''),'/27601/27727.html','true',[],''],
		['PAGE','36201',jdecode('Phoenix+Innovations'),jdecode(''),'/27601/36201.html','true',[],''],
		['PAGE','36222',jdecode('Premier+Fireplaces'),jdecode(''),'/27601/36222.html','true',[],'']
	],''],
	['PAGE','11585',jdecode('Mantels'),jdecode(''),'/11585/index.html','true',[ 
		['PAGE','33901',jdecode('Arrowflame'),jdecode(''),'/11585/33901.html','true',[],''],
		['PAGE','33922',jdecode('Classic+Flame'),jdecode(''),'/11585/33922.html','true',[],''],
		['PAGE','33943',jdecode('Dimplex'),jdecode(''),'/11585/33943.html','true',[],''],
		['PAGE','36243',jdecode('Phoenix+Innovations'),jdecode(''),'/11585/36243.html','true',[],''],
		['PAGE','36264',jdecode('Premier+Fireplaces'),jdecode(''),'/11585/36264.html','true',[],'']
	],''],
	['PAGE','11606',jdecode('Corner+Mantels'),jdecode(''),'/11606/index.html','true',[ 
		['PAGE','33964',jdecode('Arrowflame'),jdecode(''),'/11606/33964.html','true',[],''],
		['PAGE','33985',jdecode('Classic+Flame'),jdecode(''),'/11606/33985.html','true',[],''],
		['PAGE','34006',jdecode('Dimplex'),jdecode(''),'/11606/34006.html','true',[],''],
		['PAGE','36285',jdecode('Phoenix+Innovations'),jdecode(''),'/11606/36285.html','true',[],''],
		['PAGE','36306',jdecode('Premier+Fireplaces'),jdecode(''),'/11606/36306.html','true',[],'']
	],''],
	['PAGE','22301',jdecode('Wall+Mount+Fireplaces'),jdecode(''),'/22301/index.html','true',[ 
		['PAGE','40401',jdecode('Sterling+Fires'),jdecode(''),'/22301/40401.html','true',[],'']
	],''],
	['PAGE','11564',jdecode('Mini+Fireplaces'),jdecode(''),'/11564.html','true',[],''],
	['PAGE','14022',jdecode('Stoves+'),jdecode(''),'/14022/index.html','true',[ 
		['PAGE','36327',jdecode('Phoenix+Innovations'),jdecode(''),'/14022/36327.html','true',[],'']
	],''],
	['PAGE','11501',jdecode('Built+In+Inserts'),jdecode(''),'/11501.html','true',[],''],
	['PAGE','11522',jdecode('Fireboxes'),jdecode(''),'/11522/index.html','true',[ 
		['PAGE','25301',jdecode('Arrowflame'),jdecode(''),'/11522/25301.html','true',[],''],
		['PAGE','25001',jdecode('Classic+Flame'),jdecode(''),'/11522/25001.html','true',[],''],
		['PAGE','25022',jdecode('Dimplex'),jdecode(''),'/11522/25022.html','true',[],'']
	],''],
	['PAGE','19601',jdecode('Electric+Log+Sets'),jdecode(''),'/19601/index.html','true',[ 
		['PAGE','34027',jdecode('Arrowflame'),jdecode(''),'/19601/34027.html','true',[],''],
		['PAGE','34048',jdecode('Classic+Flame'),jdecode(''),'/19601/34048.html','true',[],''],
		['PAGE','34069',jdecode('Dimplex'),jdecode(''),'/19601/34069.html','true',[],'']
	],''],
	['PAGE','11543',jdecode('Trim+Kits'),jdecode(''),'/11543.html','true',[],''],
	['PAGE','14043',jdecode('Farming+Equipment'),jdecode(''),'/14043/index.html','true',[ 
		['PAGE','26801',jdecode('Ritchie+Products'),jdecode(''),'/14043/26801.html','true',[],'']
	],''],
	['PAGE','14085',jdecode('Gas+Grills+and+Accessories'),jdecode(''),'/14085/index.html','true',[ 
		['PAGE','31401',jdecode('Dragon+Fire+Kamado'),jdecode(''),'/14085/31401.html','true',[],''],
		['PAGE','24501',jdecode('Sterling+Forge+Grills'),jdecode(''),'/14085/24501.html','true',[],''],
		['PAGE','24522',jdecode('Texas+Sizzler+Grills'),jdecode(''),'/14085/24522.html','true',[],'']
	],''],
	['PAGE','24201',jdecode('Commercial+Mowers'),jdecode(''),'/24201.html','true',[],''],
	['PAGE','11627',jdecode('Clearance+Center'),jdecode(''),'/11627.html','true',[],''],
	['PAGE','19622',jdecode('View+All+Products'),jdecode(''),'/19622.html','true',[],''],
	['PAGE','26822',jdecode('Search+by+Color'),jdecode(''),'/26822.html','true',[],''],
	['PAGE','13801',jdecode('Contact+Us'),jdecode(''),'/13801.html','true',[],''],
	['PAGE','11669',jdecode('About+Us'),jdecode(''),'/11669.html','true',[],'']];
var siteelementCount=46;
theSitetree.topTemplateName='Displace';
theSitetree.paletteFamily='CFCFCF';
theSitetree.keyvisualId='11075';
theSitetree.keyvisualName='kv_11075.jpg';
theSitetree.fontsetId='31958';
theSitetree.graphicsetId='13799';
theSitetree.contentColor='342500';
theSitetree.contentBGColor='CFCFCF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Displace',
				paletteFamily: 	'CFCFCF',
				keyvisualId: 	'11075',
				keyvisualName: 	'kv_11075.jpg',
				fontsetId: 		'31958',
				graphicsetId: 	'13799',
				contentColor: 	'342500',
				contentBGColor: 'CFCFCF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20090413-150041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20090414-150252'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '10501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14043',
internalId:  '',
customField: '20090413-145303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14085',
internalId:  '',
customField: '20090427-134614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11669',
internalId:  '',
customField: '20090413-140128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11543',
internalId:  '',
customField: '20090413-140128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11585',
internalId:  '',
customField: '20090427-122804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11606',
internalId:  '',
customField: '20090427-122929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11564',
internalId:  '',
customField: '20090413-140128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14022',
internalId:  '',
customField: '20090427-112801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11522',
internalId:  '',
customField: '20090427-143702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19601',
internalId:  '',
customField: '20090427-123804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11627',
internalId:  '',
customField: '20090413-140128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19622',
internalId:  '',
customField: '20090414-103717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13801',
internalId:  '',
customField: '20090413-143833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22301',
internalId:  '',
customField: '20090428-090332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24201',
internalId:  '',
customField: '20090427-120922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24501',
internalId:  '',
customField: '20090415-123907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24522',
internalId:  '',
customField: '20090415-124048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25001',
internalId:  '',
customField: '20090415-124859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25301',
internalId:  '',
customField: '20090427-144439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25022',
internalId:  '',
customField: '20090415-124206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27601',
internalId:  '',
customField: '20090427-121305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27622',
internalId:  '',
customField: '20090427-143318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31401',
internalId:  '',
customField: '20090416-151341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27706',
internalId:  '',
customField: '20090427-124539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27727',
internalId:  '',
customField: '20090427-124557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33901',
internalId:  '',
customField: '20090427-123142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33922',
internalId:  '',
customField: '20090427-123200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33943',
internalId:  '',
customField: '20090427-122916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33964',
internalId:  '',
customField: '20090427-122952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33985',
internalId:  '',
customField: '20090427-123008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34006',
internalId:  '',
customField: '20090427-123024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34027',
internalId:  '',
customField: '20090427-144543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34048',
internalId:  '',
customField: '20090427-124003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34069',
internalId:  '',
customField: '20090427-124020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36201',
internalId:  '',
customField: '20090427-140224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36285',
internalId:  '',
customField: '20090427-135957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40401',
internalId:  '',
customField: '20090428-090237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36222',
internalId:  '',
customField: '20090427-133619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36243',
internalId:  '',
customField: '20090427-133619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36264',
internalId:  '',
customField: '20090427-133619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36306',
internalId:  '',
customField: '20090427-133619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36327',
internalId:  '',
customField: '20090427-133619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26801',
internalId:  '',
customField: '20090415-151145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26822',
internalId:  '',
customField: '20090415-151145'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN3DH8';
var companyName   = 'Advanced+Products';
var htmlTitle	  = '';
var metaKeywords  = '';
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();
};

