/* [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','7723',jdecode('Home'),jdecode(''), jdecode('%2F7723.html'), 'true',[],'',''],
	['PAGE','7774',jdecode('Member+Rides'),jdecode(''), jdecode('%2F7774%2Findex.html'), 'true',[ 
		['PAGE','24974',jdecode('Justin%26%23x27%3Bs+6'),jdecode(''), jdecode('%2F7774%2F24974.html'), 'true',[],'',''],
		['PAGE','25016',jdecode('Heather%26%23x27%3Bs+350z'),jdecode(''), jdecode('%2F7774%2F25016.html'), 'true',[],'',''],
		['PAGE','25058',jdecode('Sway%26%23x27%3Bs+SC300'),jdecode(''), jdecode('%2F7774%2F25058.html'), 'true',[],'',''],
		['PAGE','25079',jdecode('Kareen%26%23x27%3Bs+Mustang'),jdecode(''), jdecode('%2F7774%2F25079.html'), 'true',[],'',''],
		['PAGE','25121',jdecode('Eric%26%23x27%3Bs+R6'),jdecode(''), jdecode('%2F7774%2F25121.html'), 'true',[],'',''],
		['PAGE','25142',jdecode('Stag%26%23x27%3Bs+STI'),jdecode(''), jdecode('%2F7774%2F25142.html'), 'true',[],'',''],
		['PAGE','25163',jdecode('Tom%26%23x27%3Bs+Nova'),jdecode(''), jdecode('%2F7774%2F25163.html'), 'true',[],'',''],
		['PAGE','25184',jdecode('Eric%26%23x27%3Bs+Cobalt+SS'),jdecode(''), jdecode('%2F7774%2F25184.html'), 'true',[],'',''],
		['PAGE','28153',jdecode('Brian%26%23x27%3Bs+Gen+Coupe'),jdecode(''), jdecode('%2F7774%2F28153.html'), 'true',[],'',''],
		['PAGE','31353',jdecode('Gary%26%23x27%3Bs+Speed+6'),jdecode(''), jdecode('%2F7774%2F31353.html'), 'true',[],'',''],
		['PAGE','35353',jdecode('Joe%26%23x27%3Bs+Stang'),jdecode(''), jdecode('%2F7774%2F35353.html'), 'true',[],'',''],
		['PAGE','36053',jdecode('Jimmy%26%23x27%3Bs+STI'),jdecode(''), jdecode('%2F7774%2F36053.html'), 'true',[],'','']
	],'',''],
	['PAGE','12853',jdecode('Services'),jdecode(''), jdecode('%2F12853%2Findex.html'), 'true',[ 
		['PAGE','12895',jdecode('Tuning'),jdecode(''), jdecode('%2F12853%2F12895.html'), 'true',[],'',''],
		['PAGE','15653',jdecode('Affiliates'),jdecode(''), jdecode('%2F12853%2F15653.html'), 'true',[],'','']
	],'',''],
	['PAGE','12916',jdecode('Dates%2FEvents'),jdecode(''), jdecode('%2F12916.html'), 'true',[],'',''],
	['PAGE','17653',jdecode('Club+Policies'),jdecode(''), jdecode('%2F17653.html'), 'true',[],'',''],
	['PAGE','7795',jdecode('Contact+Us'),jdecode(''), jdecode('%2F7795.html'), 'true',[],'',''],
	['PAGE','23853',jdecode('Guestbook'),jdecode(''), jdecode('%2F23853.html'), 'true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='5E5E5E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10553';
theSitetree.graphicsetId='10448';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='5e5e5e';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'gate',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Akropolis',
				paletteFamily: 	'5E5E5E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10553',
				graphicsetId: 	'10448',
				contentColor: 	'FFFFFF',
				contentBGColor: '5e5e5e',
				a_color: 		'5E5E5E',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7723',
internalId:  '',
customField: '20110928-180323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7774',
internalId:  '',
customField: '20111017-121851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7795',
internalId:  '',
customField: '20110705-071036'
};
webappMappings['7008']=webappMappings['7008-10396']={
webappId:    '7008',
documentId:  '7795',
internalId:  '10396',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25079',
internalId:  '',
customField: '20110117-214107'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '7723',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15653',
internalId:  '',
customField: '20110104-100458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12853',
internalId:  '',
customField: '20110928-180439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25058',
internalId:  '',
customField: '20110117-213925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12895',
internalId:  '',
customField: '20110103-205229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12916',
internalId:  '',
customField: '20110103-205732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17653',
internalId:  '',
customField: '20111020-133727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25016',
internalId:  '',
customField: '20110117-213753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23853',
internalId:  '',
customField: '20110109-222116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24974',
internalId:  '',
customField: '20111017-122024'
};
webappMappings['1002']=webappMappings['1002-23853ahw050inl4rc']={
webappId:    '1002',
documentId:  '23853',
internalId:  '23853ahw050inl4rc',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25121',
internalId:  '',
customField: '20110117-214257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25142',
internalId:  '',
customField: '20110126-084040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25163',
internalId:  '',
customField: '20110117-214630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25184',
internalId:  '',
customField: '20110117-211715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35353',
internalId:  '',
customField: '20110629-135550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28153',
internalId:  '',
customField: '20110124-212920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31353',
internalId:  '',
customField: '20111017-122336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36053',
internalId:  '',
customField: '20110629-140528'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INL4RC';
var companyName   = 'Twisted+Visionz+Car+Club';
var htmlTitle	  = 'Twisted+Visionz+Car+Club';
var metaKeywords  = 'car+club%2C+twisted+visionz%2C+mazda%2C+nissan%2C+auto+club%2C+car+club%2C+toyota%2C+lexus%2C+subaru%2C+mitsubishi%2C+honda%2C+ford%2C+chevy%2C+kawasaki%2C+suzuki%2C+yamaha%2C+all+cars+';
var metaContents  = 'Twisted+Visionz+Is+a+car+club+based+out+of+Dutchess+County%2C+NY.++We+believe+in+Quality+not+Quantity+when+it+comes+to+our+members.+We+are+a+family%2C+not+just+a+club.+Come+join+our+Family.';
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();
};

