/* [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','53',jdecode('Home'),jdecode(''),'/53.html','true',[],''],
	['PAGE','74',jdecode('About+us'),jdecode(''),'/74/index.html','true',[ 
		['PAGE','83',jdecode('Our+team'),jdecode(''),'/74/83.html','true',[],'']
	],''],
	['PAGE','92',jdecode('Our+products'),jdecode(''),'/92.html','true',[],''],
	['PAGE','101',jdecode('Current+offers'),jdecode(''),'/101.html','true',[],''],
	['PAGE','110',jdecode('Our+service'),jdecode(''),'/110.html','true',[],''],
	['PAGE','5901',jdecode('Bikes'),jdecode(''),'/5901.html','true',[],''],
	['PAGE','137',jdecode('Contact'),jdecode(''),'/137/index.html','true',[ 
		['PAGE','1223',jdecode('Contact+%28follow+up+page%29'),jdecode(''),'/137/1223.html','false',[],'']
	],''],
	['PAGE','2341',jdecode('Directions'),jdecode(''),'/2341.html','true',[],''],
	['PAGE','2364',jdecode('How+to+find+us'),jdecode(''),'/2364.html','true',[],''],
	['PAGE','2152',jdecode('Further+links'),jdecode(''),'/2152.html','true',[],'']];
var siteelementCount=12;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='4A587F';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10553';
theSitetree.graphicsetId='10449';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='4A587F';
var theTemplate={
				name: 			'Akropolis',
				paletteFamily: 	'4A587F',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10553',
				graphicsetId: 	'10449',
				contentColor: 	'FFFFFF',
				contentBGColor: '4A587F',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'4A587F',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1001']=webappMappings['1001-ahw050in3i9189bf8a0cfa857158']={
webappId:    '1001',
documentId:  '137',
internalId:  'ahw050in3i9189bf8a0cfa857158',
customField: ''
};
webappMappings['1001']=webappMappings['1001-ahw050in3i9189bf8a0cfa857158']={
webappId:    '1001',
documentId:  '1223',
internalId:  'ahw050in3i9189bf8a0cfa857158',
customField: 'followUp'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '53',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1857824']={
webappId:    '1501',
documentId:  '53',
internalId:  '1857824',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '2341',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '2364',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20091118-112336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101',
internalId:  '',
customField: '20091118-105510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74',
internalId:  '',
customField: '20081114-134544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83',
internalId:  '',
customField: '20071011-184009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92',
internalId:  '',
customField: '20081114-134735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110',
internalId:  '',
customField: '20081114-135434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '137',
internalId:  '',
customField: '20071207-183905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1223',
internalId:  '',
customField: '20071207-183345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2341',
internalId:  '',
customField: '20080110-165040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2364',
internalId:  '',
customField: '20080110-160008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2152',
internalId:  '',
customField: '20071214-193156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20091118-161419'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC24G']={
webappId:    '5003',
documentId:  '53',
internalId:  'tid:1;pid:WSCSYSSSSLYTC24G',
customField: 'en:US::;language:en;country:US;'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3I91';
var companyName   = 'EAST+COAST+SUPERBIKES';
var htmlTitle	  = 'East+Coast+Superbikes%2C+Long+Island%2C+N.Y.';
var metaKeywords  = 'east+coast+superbikes%2Csuperbikes%2Charley%2Charley+davidson%2Ceast+coast%2Cmotorcycles%2Crepairs%2Cservice%2Cmachine+shop%2Cengine+building%2Cdyno-jet%2Cwelding%2Cchrome%2Cpaint%2Cpowdercoating%2Ccollision%2Cmotorcycle+tuning%2Cdyno+tuning%2Cmotorcycle+modification%2Cfabrication%2Clong+island%2Cnew+york%2Cwest+babylon%2Cv-twin%2Cmaintenance%2C525+sunrise+hwy%2C+schott%2Ccustom+bike+builds%2Cnys+inspection%2Charley+parts';
var metaContents  = 'Parts+and+service+for+harley+davidson+motorcycles%2C+Long+Island%2C+N.Y.';
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();
};
