/* [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','601',jdecode('About+Us'),jdecode(''), jdecode('%2F601.html'), 'true',[],'',''],
	['PAGE','652',jdecode('Service'),jdecode(''), jdecode('%2F652.html'), 'true',[],'',''],
	['PAGE','24301',jdecode('Parts+%26+Products'),jdecode(''), jdecode('%2F24301.html'), 'true',[],'',''],
	['PAGE','53490',jdecode('Fire+Saftey+%26%23x27%3BPryCool%26%23x27%3B'),jdecode(''), jdecode('%2F53490.html'), 'true',[],'',''],
	['PAGE','5822',jdecode('Tips+%26+Tricks+%26+Things+you+should+know'),jdecode(''), jdecode('%2F5822%2Findex.html'), 'true',[ 
		['PAGE','35901',jdecode('Owners+you+need+to%3A'),jdecode(''), jdecode('%2F5822%2F35901.html'), 'true',[],'',''],
		['PAGE','35922',jdecode('Things+you+need+to+know'),jdecode(''), jdecode('%2F5822%2F35922.html'), 'true',[],'',''],
		['PAGE','36401',jdecode('Batteries'),jdecode(''), jdecode('%2F5822%2F36401.html'), 'true',[],'',''],
		['PAGE','36422',jdecode('Outdrive+Neglect'),jdecode(''), jdecode('%2F5822%2F36422.html'), 'true',[],'',''],
		['PAGE','36443',jdecode('Pre-purchase+Inspection'),jdecode(''), jdecode('%2F5822%2F36443.html'), 'true',[],'',''],
		['PAGE','49232',jdecode('Ethanol+-+what+you+need+to+know'),jdecode(''), jdecode('%2F5822%2F49232.html'), 'true',[],'','']
	],'',''],
	['PAGE','51920',jdecode('BLOGS'),jdecode(''), jdecode('%2F51920.html'), 'true',[],'',''],
	['PAGE','48675',jdecode('+Links+%26+Valuable+Contacts'),jdecode(''), jdecode('%2F48675.html'), 'true',[],'',''],
	['PAGE','673',jdecode('Contact+'),jdecode(''), jdecode('%2F673.html'), 'true',[],'',''],
	['PAGE','53367',jdecode('Testimonials'),jdecode(''), jdecode('%2F53367.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Bombay';
theSitetree.paletteFamily='395987';
theSitetree.keyvisualId='7536';
theSitetree.keyvisualName='kv_7536.jpg';
theSitetree.fontsetId='16582';
theSitetree.graphicsetId='12202';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='C0B89D';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'gate',
  product: 'WSCSYSSSSLYTCPCD'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Bombay',
				paletteFamily: 	'395987',
				keyvisualId: 	'7536',
				keyvisualName: 	'kv_7536.jpg',
				fontsetId: 		'16582',
				graphicsetId: 	'12202',
				contentColor: 	'000000',
				contentBGColor: 'C0B89D',
				a_color: 		'395987',
				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:  '51920',
internalId:  '',
customField: '20100712-153025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20110812-123100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20110812-124347'
};
webappMappings['1003']=webappMappings['1003-ahw050in2brl1254bd0e017']={
webappId:    '1003',
documentId:  '51920',
internalId:  'ahw050in2brl1254bd0e017',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24301',
internalId:  '',
customField: '20110812-125859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53490',
internalId:  '',
customField: '20110906-090625'
};
webappMappings['1501']=webappMappings['1501-6429232']={
webappId:    '1501',
documentId:  '601',
internalId:  '6429232',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53367',
internalId:  '',
customField: '20110617-122524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5822',
internalId:  '',
customField: '20070508-155432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35901',
internalId:  '',
customField: '20070508-140726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35922',
internalId:  '',
customField: '20101020-113813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36401',
internalId:  '',
customField: '20070508-144223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36422',
internalId:  '',
customField: '20070508-145540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36443',
internalId:  '',
customField: '20070508-150306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49232',
internalId:  '',
customField: '20080820-121529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48675',
internalId:  '',
customField: '20110322-133840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20110812-130230'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050IN2BRL';
var companyName   = 'Tampa+Boat+Repair+';
var htmlTitle	  = 'www.tampaboatrepair.com';
var metaKeywords  = '%2Coutboard+motors%2C+marine+parts%2C+lower+units%2C+out-drives%2Ctrailers%2Cpower-head+rebuild%2Cmarine+engines%2Crigging%2Cgel+coat+repair%2Ctrolling+motors%2Cbass+boats%2C+salt+water+boats%2Cdockside+repair%2Cmarine+engines%2C+power-head+rebuild';
var metaContents  = 'dockside+repair%2Csurvey%2C+out-drives%2C+outboard+motor+repair%2C+inboard%2C+marine+parts%2C+marine+engines%2C+stern-drive+repairs+%2C+propellers%2Chydraulic+steering%2C+tune+ups%2C+power+head+rebuild%2C+trailer%2C+trailer+parts%2Cinspection%2Cpower+heads%2C+surveys';
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();
};

