/* [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','2801',jdecode('Home+%2F+About+Us'),jdecode(''), jdecode('%2F2801.html'), 'true',[],'',''],
	['PAGE','17612',jdecode('Products+%26+Services'),jdecode(''), jdecode('%2F17612.html'), 'true',[],'',''],
	['PAGE','18512',jdecode('Service+Agreements+%2F+Contracts'),jdecode(''), jdecode('%2F18512.html'), 'true',[],'',''],
	['PAGE','44823',jdecode('PMSA+Purchase'),jdecode(''), jdecode('%2F44823.html'), 'false',[],'',''],
	['PAGE','53023',jdecode('Terms+and+Conditions'),jdecode(''), jdecode('%2F53023.html'), 'false',[],'',''],
	['PAGE','32823',jdecode('Specials+%26+Payment+Options'),jdecode(''), jdecode('%2F32823.html'), 'true',[],'',''],
	['PAGE','18575',jdecode('Testimonials'),jdecode(''), jdecode('%2F18575.html'), 'true',[],'',''],
	['PAGE','44423',jdecode('Tips+%26+Suggestions'),jdecode(''), jdecode('%2F44423.html'), 'true',[],'',''],
	['PAGE','18533',jdecode('FAQs+%26+Glossary+of+Terms'),jdecode(''), jdecode('%2F18533.html'), 'true',[],'',''],
	['PAGE','18596',jdecode('Affiliations+%26+Accreditations'),jdecode(''), jdecode('%2F18596.html'), 'true',[],'',''],
	['PAGE','18554',jdecode('Contact+Us'),jdecode(''), jdecode('%2F18554.html'), 'true',[],'',''],
	['PAGE','49023',jdecode('Search'),jdecode(''), jdecode('%2F49023.html'), 'false',[],'',''],
	['PAGE','58123',jdecode('Customer+Satisfaction+Survey'),jdecode(''), jdecode('%2F58123.html'), 'true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Vita02';
theSitetree.paletteFamily='88A6B5';
theSitetree.keyvisualId='11283';
theSitetree.keyvisualName='kv_11283.jpg';
theSitetree.fontsetId='32116';
theSitetree.graphicsetId='13936';
theSitetree.contentColor='3C3D3C';
theSitetree.contentBGColor='F6FBFE';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'fatcow',
  product: 'WSCSYSSSSLY0XRN4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Vita02',
				paletteFamily: 	'88A6B5',
				keyvisualId: 	'11283',
				keyvisualName: 	'kv_11283.jpg',
				fontsetId: 		'32116',
				graphicsetId: 	'13936',
				contentColor: 	'3C3D3C',
				contentBGColor: 'F6FBFE',
				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:  '2801',
internalId:  '',
customField: '20110316-154224'
};
webappMappings['7008']=webappMappings['7008-30002']={
webappId:    '7008',
documentId:  '18554',
internalId:  '30002',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18596',
internalId:  '',
customField: '20110316-142752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18512',
internalId:  '',
customField: '20110316-143227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17612',
internalId:  '',
customField: '20110316-144024'
};
webappMappings['1501']=webappMappings['1501-32197171']={
webappId:    '1501',
documentId:  '2801',
internalId:  '32197171',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18533',
internalId:  '',
customField: '20110316-142717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18554',
internalId:  '',
customField: '20110316-142814'
};
webappMappings['7008']=webappMappings['7008-30366']={
webappId:    '7008',
documentId:  '44823',
internalId:  '30366',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18575',
internalId:  '',
customField: '20110316-142609'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44423',
internalId:  '',
customField: '20110316-142643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32823',
internalId:  '',
customField: '20110316-143023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44823',
internalId:  '',
customField: '20100811-112847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49023',
internalId:  '',
customField: '20100808-194629'
};
webappMappings['7080']=webappMappings['7080-820']={
webappId:    '7080',
documentId:  '2801',
internalId:  '820',
customField: 'language:en;country:US;'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '49023',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53023',
internalId:  '',
customField: '20100811-112639'
};
webappMappings['7008']=webappMappings['7008-32742']={
webappId:    '7008',
documentId:  '58123',
internalId:  '32742',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58123',
internalId:  '',
customField: '20110316-142835'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INLLZE';
var companyName   = 'Air+Conditioning%2C+Heating+%26+Plumbing+++++++++++703-580-8858';
var htmlTitle	  = 'TB+Lucas+Mechanical+%7E+HVAC+%7E+Maintain%2C+Repair+%26+Install+%7E+We+Do+It+All%21++703-580-8858';
var metaKeywords  = 'air+conditioning%2C+heating%2C+HVAC%2C+repair%2C+maintenance%2C+replacement%2C+installation%2C+install%2C+A%2FC%2C+heat%2C+repairman%2C+contractor%2C+ductwork%2C+Carrier%2C+Goodman%2C+Trane%2C+Lennox%2C+Bryant%2C+Heil%2C+Frigidaire%2C+York%2C+condensate%2C+blower+wheel%2C+air+filter%2C+unit+freezing+up%2C+head+pressure%2C+indoor+coil%2C+evaporator+coil%2C+air+handler%2C+boiler%2C+furnace%2C+refrigerant%2C+R-22%2C+freon%2C+R410A%2C+410A%2C+puron%2C+TXV%2C+compressor%2C+heat+exchanger%2C+capacitor%2C+SEER%2C+thermostat%2C+air+cleaner%2C+UV+lamp%2C+lineset%2C+drain+pan%2C+contactor%2C+unit%2C+system%2C+blower+motor%2C+fan+motor%2C+t-stat%2C+cooling%2C+superheat%2C+subcooling%2C+condensor+coil%2C+coil%2C+heat+pump%2C+Duncane%2C+Amana%2C+Gibson%2C+Rheem%2C+Ruud';
var metaContents  = 'Family+owned+and+operated+air+conditioning%2C+heating+%26+plumbing+%28HVAC%29+company+located+in+Woodbridge%2C+Virginia.';
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();
};

