/* [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','5101',jdecode('Home'),jdecode(''),'/5101.html','true',[],''],
	['PAGE','16101',jdecode('24+Hr.+Hood+Cleanings'),jdecode(''),'/16101.html','true',[],''],
	['PAGE','20901',jdecode('Hood%2Ffan+installation'),jdecode(''),'/20901.html','true',[],''],
	['PAGE','28701',jdecode('What+is+NFPA+96+%3F'),jdecode(''),'/28701.html','false',[],''],
	['PAGE','20922',jdecode('Products'),jdecode(''),'/20922.html','true',[],''],
	['PAGE','15701',jdecode('Stainless+Steel'),jdecode(''),'/15701.html','false',[],''],
	['PAGE','16343',jdecode('24hr+Service%2FMaintenance'),jdecode(''),'/16343.html','true',[],''],
	['PAGE','27601',jdecode('Satisfied+Customers'),jdecode(''),'/27601.html','false',[],''],
	['PAGE','31201',jdecode('Contact'),jdecode(''),'/31201.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1753';
theSitetree.keyvisualName='industrie.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1753',
				keyvisualName: 	'industrie.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20100215-104308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15701',
internalId:  '',
customField: '20091110-102059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16101',
internalId:  '',
customField: '20100204-211912'
};
webappMappings['7008']=webappMappings['7008-24512']={
webappId:    '7008',
documentId:  '31201',
internalId:  '24512',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20922',
internalId:  '',
customField: '20091122-155939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16343',
internalId:  '',
customField: '20090611-102043'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5101',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '16101',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31201',
internalId:  '',
customField: '20100103-191957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20901',
internalId:  '',
customField: '20091107-105147'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '15701',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '16343',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-17897588']={
webappId:    '1501',
documentId:  '5101',
internalId:  '17897588',
customField: '1501'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '20901',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '20922',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27601',
internalId:  '',
customField: '20091021-180817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28701',
internalId:  '',
customField: '20100204-212915'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '28701',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '27601',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '31201',
internalId:  '',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN3GG1';
var companyName   = 'One+Call+Ventilation';
var htmlTitle	  = 'One+Call+Ventilation';
var metaKeywords  = 'Massachusetts%2Crestaurant+hood%2C+restaurant+hoods%2C++Kitchen+Ventilation%2C+hoods%2C+hood%2Chood+cleaning+%2Crestaurant%2C+installation+%2Cservice%2C+one+call%2C+Boston%2C+Ikeca+certified+%2Cinsured+%2Clicensed+%2Cduct+%2Cfans%2C+exhaust%2C+belts%2C+24hr%2C+New+Hampshire%2C+grease%2C+filters%2C+power+wash%2CI.K.E.C.A.%2C+huds%2C+cleening%2C+greese%2C+ventillation%2C+belt%2C+belts%2C+hood%2C+fan%2Cduck%2C+MA%2C+mass.%2CMass.%2C+steem+clean%2C+steam+clean%2C+degrease%2C+degreese%2C+hood+inspection%2C+grease+inspection%2C+inspection%2C+kitchen+inspection%2C+ventilation+inspection%2C+duct+inspection%2C+IKECA+inspection%2C+hood+and+fan+inspection%2C+exhaust+inspection%2C+resterant%2C+cleening%2C+power+wash+hood%2C+steem+clean%2C+steam+clean%2C+state+license%2C+state+lisence%2C+state+licensse%2C+fire+marshal%2C+instal%2C+install+hood%2C+instal+hood%2C+State+Certified%2C+state+fire+marshal%2C+';
var metaContents  = 'One+Call+Ventilation+is+fully+licensed+and+certified+by+the+Boston+Fire+Department+and+the+Massachusetts+State+Fire+Marshals+Office+to+clean+kitchen+ventilation+systems+per+NFPA+96.++We+also+service%2C+repair+fans.++and+install+new+hood+systems.++We+clean+the+entire+system%2C+including+all++hoods%2C+ductwork%2C+and+fans+from+top+to+bottom.++We+offer+FREE+ESTIMATES.++We+offer+Before+and+After+photos+of+all+work.++We+are+fully+insured.';
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();
};
