/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','552',jdecode('Service'),jdecode(''),'/552.html','true',[],'',''],
	['PAGE','594',jdecode('Parts'),jdecode(''),'/594.html','true',[],'',''],
	['PAGE','573',jdecode('Engines'),jdecode(''),'/573/index.html','true',[ 
		['PAGE','58123',jdecode('2.7+'),jdecode(''),'/573/58123.html','true',[],'',''],
		['PAGE','56723',jdecode('3.0+'),jdecode(''),'/573/56723.html','true',[],'',''],
		['PAGE','57223',jdecode('3.3+Turbo'),jdecode(''),'/573/57223.html','true',[],'',''],
		['PAGE','56744',jdecode('3.4'),jdecode(''),'/573/56744.html','true',[],'',''],
		['PAGE','56765',jdecode('3.4+Turbo+'),jdecode(''),'/573/56765.html','true',[],'',''],
		['PAGE','56786',jdecode('3.4+996'),jdecode(''),'/573/56786.html','true',[],'',''],
		['PAGE','56807',jdecode('3.6+964'),jdecode(''),'/573/56807.html','true',[],'',''],
		['PAGE','56828',jdecode('3.6+993'),jdecode(''),'/573/56828.html','true',[],'',''],
		['PAGE','56849',jdecode('3.6+997+Twin+Turbo'),jdecode(''),'/573/56849.html','true',[],'','']
	],'',''],
	['PAGE','11801',jdecode('Transmissions'),jdecode(''),'/11801.html','true',[],'',''],
	['PAGE','615',jdecode('Dyno'),jdecode(''),'/615.html','true',[],'',''],
	['PAGE','636',jdecode('Fuel+Injection'),jdecode(''),'/636/index.html','true',[ 
		['PAGE','27701',jdecode('ECUs'),jdecode(''),'/636/27701.html','true',[],'',''],
		['PAGE','32501',jdecode('Haltech+E6X'),jdecode(''),'/636/32501.html','true',[],'',''],
		['PAGE','34101',jdecode('E6x+Flying+Lead+Kit-Short'),jdecode(''),'/636/34101.html','false',[],'',''],
		['PAGE','34701',jdecode('+E6X+Flying+Lead+Kit-Long+'),jdecode(''),'/636/34701.html','false',[],'',''],
		['PAGE','35201',jdecode('E6X+4cyl+Terminated+Kit'),jdecode(''),'/636/35201.html','false',[],'',''],
		['PAGE','36201',jdecode('E6X+6+Cyl+Terminated+Kit'),jdecode(''),'/636/36201.html','false',[],'',''],
		['PAGE','36701',jdecode('E6x+8+Cyl+Terminated+Kit'),jdecode(''),'/636/36701.html','false',[],'',''],
		['PAGE','36722',jdecode('E6X+ECU+ONLY'),jdecode(''),'/636/36722.html','false',[],'',''],
		['PAGE','37601',jdecode('++++Haltech+E8+'),jdecode(''),'/636/37601.html','true',[],'',''],
		['PAGE','38201',jdecode('E8+Flying+Lead+Kit-Short'),jdecode(''),'/636/38201.html','false',[],'',''],
		['PAGE','38222',jdecode('E8+Flying+Lead+Kit-Long'),jdecode(''),'/636/38222.html','false',[],'',''],
		['PAGE','38243',jdecode('E8+ECU+ONLY'),jdecode(''),'/636/38243.html','false',[],'',''],
		['PAGE','38264',jdecode('E8+Flying+Lead+Harness-Short'),jdecode(''),'/636/38264.html','false',[],'',''],
		['PAGE','38285',jdecode('E8+Flying+Lead+Harness-Long'),jdecode(''),'/636/38285.html','false',[],'',''],
		['PAGE','27722',jdecode('Boost+Accessories'),jdecode(''),'/636/27722.html','true',[],'',''],
		['PAGE','27743',jdecode('Idle+Air+Control+Housing'),jdecode(''),'/636/27743.html','true',[],'',''],
		['PAGE','27764',jdecode('Race+Packs+%26+Dash+Units'),jdecode(''),'/636/27764.html','true',[],'',''],
		['PAGE','27785',jdecode('Sensors'),jdecode(''),'/636/27785.html','true',[],'',''],
		['PAGE','27806',jdecode('Tuning+Components'),jdecode(''),'/636/27806.html','true',[],'','']
	],'',''],
	['PAGE','657',jdecode('Projects'),jdecode(''),'/657/index.html','true',[ 
		['PAGE','52312',jdecode('1979+Turbo+Slant'),jdecode(''),'/657/52312.html','true',[],'',''],
		['PAGE','18401',jdecode('Convertibe+Top'),jdecode(''),'/657/18401.html','true',[],'',''],
		['PAGE','18701',jdecode('Floor+Panel'),jdecode(''),'/657/18701.html','true',[],'','']
	],'',''],
	['PAGE','11401',jdecode('Custom+Work'),jdecode(''),'/11401.html','true',[],'',''],
	['PAGE','678',jdecode('Customer+Cars'),jdecode(''),'/678.html','true',[],'',''],
	['PAGE','47701',jdecode('Forum'),jdecode(''),'/47701.html','true',[],'',''],
	['PAGE','699',jdecode('Contact+Us'),jdecode(''),'/699.html','true',[],'',''],
	['PAGE','48301',jdecode('New+ECU%26%23x27%3Bs'),jdecode(''),'/48301.html','true',[],'','']];
var siteelementCount=44;
theSitetree.topTemplateName='Logg';
theSitetree.paletteFamily='3D4B78';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='422';
theSitetree.graphicsetId='467';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3D4B78';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Logg',
				paletteFamily: 	'3D4B78',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'422',
				graphicsetId: 	'467',
				contentColor: 	'FFFFFF',
				contentBGColor: '3D4B78',
				a_color: 		'3D4B78',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20090623-170236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20090907-161955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20081218-115139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '678',
internalId:  '',
customField: '20081223-123137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27701',
internalId:  '',
customField: '20090910-160152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27722',
internalId:  '',
customField: '20081212-132605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27785',
internalId:  '',
customField: '20081212-132605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '699',
internalId:  '',
customField: '20081204-154844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32501',
internalId:  '',
customField: '20081227-144659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34101',
internalId:  '',
customField: '20081219-115835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34701',
internalId:  '',
customField: '20081219-120049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35201',
internalId:  '',
customField: '20081219-120117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20081205-155922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36201',
internalId:  '',
customField: '20081218-121616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36701',
internalId:  '',
customField: '20081218-151637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36722',
internalId:  '',
customField: '20081219-120326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20081226-132748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37601',
internalId:  '',
customField: '20081227-144839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38201',
internalId:  '',
customField: '20081219-120358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38222',
internalId:  '',
customField: '20081219-120427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38243',
internalId:  '',
customField: '20081219-120446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38264',
internalId:  '',
customField: '20081219-120709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38285',
internalId:  '',
customField: '20081219-120730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11801',
internalId:  '',
customField: '20090120-155018'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20081205-170614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20081204-162009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27743',
internalId:  '',
customField: '20081212-132605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27764',
internalId:  '',
customField: '20081212-132605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27806',
internalId:  '',
customField: '20081212-132605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18401',
internalId:  '',
customField: '20081205-160157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18701',
internalId:  '',
customField: '20081205-171142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52312',
internalId:  '',
customField: '20091120-162431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11401',
internalId:  '',
customField: '20081205-154626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48301',
internalId:  '',
customField: '20090303-160159'
};
webappMappings['1003']=webappMappings['1003-avec10inpb4t11f145f39e3']={
webappId:    '1003',
documentId:  '47701',
internalId:  'avec10inpb4t11f145f39e3',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47701',
internalId:  '',
customField: '20090126-141639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56723',
internalId:  '',
customField: '20100809-221700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56744',
internalId:  '',
customField: '20100809-221700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56765',
internalId:  '',
customField: '20100809-221700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56786',
internalId:  '',
customField: '20100809-221700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56807',
internalId:  '',
customField: '20100809-221700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56828',
internalId:  '',
customField: '20100809-221700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56849',
internalId:  '',
customField: '20100809-221700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57223',
internalId:  '',
customField: '20100811-224854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58123',
internalId:  '',
customField: '20100811-220637'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INPB4T';
var companyName   = 'Valley+European+AutoService+Inc.';
var htmlTitle	  = 'http%3A%2F%2Fvalleyeuropean.com%2Fporsche%2Fporsche+service%2Feuropean+auto+service';
var metaKeywords  = '';
var metaContents  = '';
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();
};
