/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],''],
	['PAGE','9164',jdecode('Mickey+Mantle%26%23x27%3Bs+49'),jdecode(''),'/9164.html','true',[],''],
	['PAGE','12515',jdecode('%26%23x27%3B53+BelAir'),jdecode(''),'/12515.html','true',[],''],
	['PAGE','12536',jdecode('%26%23x27%3B57+BelAir'),jdecode(''),'/12536.html','true',[],''],
	['PAGE','12557',jdecode('%26%23x27%3B65+Impala+SS396'),jdecode(''),'/12557.html','true',[],''],
	['PAGE','23457',jdecode('%26%23x27%3B66+Impala+SS427'),jdecode(''),'/23457.html','true',[],''],
	['PAGE','12599',jdecode('%26%23x27%3B66+Corvette+'),jdecode(''),'/12599.html','true',[],''],
	['PAGE','12620',jdecode('Z8+%23888'),jdecode(''),'/12620.html','true',[],''],
	['PAGE','12641',jdecode('850+CSi+%2312'),jdecode(''),'/12641.html','true',[],''],
	['PAGE','12662',jdecode('850+CSi+%23169'),jdecode(''),'/12662.html','true',[],''],
	['PAGE','12683',jdecode('%26%23x27%3B73+2002+tii'),jdecode(''),'/12683.html','true',[],''],
	['PAGE','19457',jdecode('BMW+Z1'),jdecode(''),'/19457.html','true',[],''],
	['PAGE','18857',jdecode('Buick'),jdecode(''),'/18857.html','true',[],''],
	['PAGE','34255',jdecode('Rolls+Royce'),jdecode(''),'/34255.html','true',[],''],
	['PAGE','32155',jdecode('Studebaker+Power+Hawk'),jdecode(''),'/32155.html','true',[],''],
	['PAGE','10801',jdecode('Previously+Owned'),jdecode(''),'/10801/index.html','true',[ 
		['PAGE','12578',jdecode('%26%23x27%3B65+Corvair+Corsa'),jdecode(''),'/10801/12578.html','true',[],''],
		['PAGE','20557',jdecode('Pontiac'),jdecode(''),'/10801/20557.html','true',[],'']
	],''],
	['PAGE','10843',jdecode('Guestbook+-+Sign+In'),jdecode(''),'/10843.html','true',[],''],
	['PAGE','10864',jdecode('Email+Us'),jdecode(''),'/10864.html','true',[],'']];
var siteelementCount=20;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='F9C116';
theSitetree.keyvisualId='2469';
theSitetree.keyvisualName='verkehr.jpg';
theSitetree.fontsetId='403';
theSitetree.graphicsetId='459';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Collage',
				paletteFamily: 	'F9C116',
				keyvisualId: 	'2469',
				keyvisualName: 	'verkehr.jpg',
				fontsetId: 		'403',
				graphicsetId: 	'459',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'F9C116',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20100312-133448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9164',
internalId:  '',
customField: '20090213-093930'
};
webappMappings['1002']=webappMappings['1002-10843ahw050inxlwd']={
webappId:    '1002',
documentId:  '10843',
internalId:  '10843ahw050inxlwd',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18857',
internalId:  '',
customField: '20090309-090016'
};
webappMappings['7008']=webappMappings['7008-801']={
webappId:    '7008',
documentId:  '10864',
internalId:  '801',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-787']={
webappId:    '7008',
documentId:  '10864',
internalId:  '787',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10864',
internalId:  '',
customField: '20090512-101412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10843',
internalId:  '',
customField: '20090512-101255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23457',
internalId:  '',
customField: '20100228-164417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10801',
internalId:  '',
customField: '20090616-162957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34255',
internalId:  '',
customField: '20100228-164835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12515',
internalId:  '',
customField: '20090213-092831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32155',
internalId:  '',
customField: '20090901-180114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12620',
internalId:  '',
customField: '20090313-020051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12641',
internalId:  '',
customField: '20081206-115456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12662',
internalId:  '',
customField: '20081206-123546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12536',
internalId:  '',
customField: '20090616-161439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12557',
internalId:  '',
customField: '20090616-162807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12578',
internalId:  '',
customField: '20100228-162602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12599',
internalId:  '',
customField: '20100228-164003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12683',
internalId:  '',
customField: '20081208-100718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19457',
internalId:  '',
customField: '20090316-090300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20557',
internalId:  '',
customField: '20100228-162711'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INXLWD';
var companyName   = 'Classic+Car+Collection';
var htmlTitle	  = '';
var metaKeywords  = 'BMW+850+Mickey+Mantle+Z8+Chevy+BelAir+classic+car+collectors';
var metaContents  = 'Personal+car+collection+of+Jon+Shevelew';
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();
};
