/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','64001',jdecode('Marine'),jdecode(''),'/64001.html','true',[],'',''],
	['PAGE','64022',jdecode('Residential'),jdecode(''),'/64022.html','true',[],'',''],
	['PAGE','64064',jdecode('Awnings'),jdecode(''),'/64064.html','true',[],'',''],
	['PAGE','79101',jdecode('Photo+Gallery'),jdecode(''),'/79101.html','true',[],'',''],
	['PAGE','64043',jdecode('Commercial'),jdecode(''),'/64043.html','true',[],'',''],
	['PAGE','64901',jdecode('FAQ%26%23x27%3Bs'),jdecode(''),'/64901.html','true',[],'',''],
	['PAGE','557',jdecode('About+us'),jdecode(''),'/557.html','true',[],'',''],
	['PAGE','599',jdecode('Contact'),jdecode(''),'/599/index.html','true',[ 
		['PAGE','10901',jdecode('Contact+%28follow+up+page%29'),jdecode(''),'/599/10901.html','false',[],'','']
	],'',''],
	['PAGE','16101',jdecode('Map'),jdecode(''),'/16101.html','true',[],'',''],
	['PAGE','86012',jdecode('Links'),jdecode(''),'/86012.html','true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Diamond';
theSitetree.paletteFamily='DCDEDC';
theSitetree.keyvisualId='6243';
theSitetree.keyvisualName='kv_6243.jpg';
theSitetree.fontsetId='11092';
theSitetree.graphicsetId='11861';
theSitetree.contentColor='4B4B4B';
theSitetree.contentBGColor='DCDEDC';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Diamond',
				paletteFamily: 	'DCDEDC',
				keyvisualId: 	'6243',
				keyvisualName: 	'kv_6243.jpg',
				fontsetId: 		'11092',
				graphicsetId: 	'11861',
				contentColor: 	'4B4B4B',
				contentBGColor: 'DCDEDC',
				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['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '16101',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['7060']=webappMappings['7060-1a6bda0dd3fbceaabd16cd9d8ab2f8a2']={
webappId:    '7060',
documentId:  '79101',
internalId:  '1a6bda0dd3fbceaabd16cd9d8ab2f8a2',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20090209-125539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64001',
internalId:  '',
customField: '20080917-122332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64022',
internalId:  '',
customField: '20080917-122359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64064',
internalId:  '',
customField: '20080917-105120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79101',
internalId:  '',
customField: '20080917-114003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64043',
internalId:  '',
customField: '20080917-113941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64901',
internalId:  '',
customField: '20080909-133441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20090317-090657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '599',
internalId:  '',
customField: '20080917-114211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20080718-133609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16101',
internalId:  '',
customField: '20080909-133659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86012',
internalId:  '',
customField: '20090219-121540'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-8725']={
webappId:    '7008',
documentId:  '599',
internalId:  '8725',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050IN39J2';
var companyName   = 'The+Canvas+%26+Upholstery+Center%2C+Inc.';
var htmlTitle	  = 'The+Canvas+%26+Upholstery+Center%2C+Inc.+located+at+St.+Augustine+Marine.+High+Quality+Custom+Canvas+%26+Upholstery%21';
var metaKeywords  = 'Canvas%2C+Upholstery%2CSt.+Augustine%2C+Florida%2C+Hunt+Bowman%2C++custom+canvas%2C+custom+upholstery%2C+residential%2C+commercial%2C+awnings%2C+marine%2C+bimini%2C+enclosures%2C+dodgers%2C+boat+covers%2C+bedspreads%2C+pillows%2C+staterooms%2C+gyms%2C+doctors+offices%2C+airplanes%2C+restaraunts%2C+cushions%2C+mattresses%2C+foam%2C+memory+foam%2C+Sunbrella+fabrics%2C+Weblon%2C+Ultraleather.';
var metaContents  = 'The+Canvas++Upholstery+Center%2C+located+at+St.+Augustien+Marine+in+St.+Augustine%2C+Florida.+our+services+include+Canvas+Repair%2C+Upholstery+Repairs%2C.+Biminis%2C+Dodgers%2C+Enclosures%2C+Cushions%2C+Residential+Furniture%2C+Docotors+office%2C+Nursing+Homes.+A+wide+variety+of+Canvas+and+Upholstery+work.';
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();
};
