/* [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','17501',jdecode('Home'),jdecode(''),'/17501.html','true',[],'',''],
	['PAGE','25501',jdecode('Search'),jdecode(''),'/25501.html','true',[],'',''],
	['PAGE','17552',jdecode('SALES+'),jdecode(''),'/17552.html','true',[],'',''],
	['PAGE','19601',jdecode('Our+Vehicles'),jdecode(''),'/19601/index.html','true',[ 
		['PAGE','96901',jdecode('ST%23806P'),jdecode(''),'/19601/96901.html','false',[],'',''],
		['PAGE','40411',jdecode('ST%23789P'),jdecode(''),'/19601/40411.html','false',[],'',''],
		['PAGE','40474',jdecode('ST%23782P'),jdecode(''),'/19601/40474.html','false',[],'',''],
		['PAGE','40690',jdecode('ST%23791P'),jdecode(''),'/19601/40690.html','false',[],'',''],
		['PAGE','69590',jdecode('ST%23785P'),jdecode(''),'/19601/69590.html','false',[],'',''],
		['PAGE','69611',jdecode('ST%23786P'),jdecode(''),'/19601/69611.html','false',[],'',''],
		['PAGE','70411',jdecode('ST%23781P'),jdecode(''),'/19601/70411.html','false',[],'',''],
		['PAGE','70453',jdecode('ST%23749P'),jdecode(''),'/19601/70453.html','false',[],'',''],
		['PAGE','75390',jdecode('ST%23798P'),jdecode(''),'/19601/75390.html','false',[],'',''],
		['PAGE','78190',jdecode('ST%23802P'),jdecode(''),'/19601/78190.html','false',[],'',''],
		['PAGE','89590',jdecode('ST%23805P'),jdecode(''),'/19601/89590.html','false',[],'',''],
		['PAGE','109101',jdecode('ST%23811P'),jdecode(''),'/19601/109101.html','false',[],'','']
	],'',''],
	['PAGE','17657',jdecode('SERVICE+'),jdecode(''),'/17657/index.html','true',[ 
		['PAGE','20601',jdecode('Service+Specials'),jdecode(''),'/17657/20601.html','true',[],'','']
	],'',''],
	['PAGE','101501',jdecode('R.A.S.A.+'),jdecode(''),'/101501.html','true',[],'',''],
	['PAGE','80890',jdecode('PARTS'),jdecode(''),'/80890.html','true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='5E5E5E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10344';
theSitetree.graphicsetId='10448';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='5e5e5e';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Akropolis',
				paletteFamily: 	'5E5E5E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10344',
				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:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17501',
internalId:  '',
customField: '20100726-104237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17552',
internalId:  '',
customField: '20100427-142709'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '17501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19601',
internalId:  '',
customField: '20100716-130422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17657',
internalId:  '',
customField: '20100309-152701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25501',
internalId:  '',
customField: '20091103-094803'
};
webappMappings['1501']=webappMappings['1501-14470574']={
webappId:    '1501',
documentId:  '17501',
internalId:  '14470574',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70411',
internalId:  '',
customField: '20100205-151937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20601',
internalId:  '',
customField: '20100318-153345'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '25501',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109101',
internalId:  '',
customField: '20100420-162717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78190',
internalId:  '',
customField: '20100205-152914'
};
webappMappings['7060']=webappMappings['7060-a3d063dcf3ec2ffa0674e82ea3032676']={
webappId:    '7060',
documentId:  '101501',
internalId:  'a3d063dcf3ec2ffa0674e82ea3032676',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69611',
internalId:  '',
customField: '20100205-151848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69590',
internalId:  '',
customField: '20100205-151804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40690',
internalId:  '',
customField: '20100205-151718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96901',
internalId:  '',
customField: '20100212-105212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101501',
internalId:  '',
customField: '20100316-093433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40411',
internalId:  '',
customField: '20100205-115702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40474',
internalId:  '',
customField: '20100205-151242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70453',
internalId:  '',
customField: '20100205-152606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75390',
internalId:  '',
customField: '20100205-152733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80890',
internalId:  '',
customField: '20100715-092115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89590',
internalId:  '',
customField: '20100127-100350'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHFA4';
var companyName   = 'STRANDQUIST+MOTOR+CO.';
var htmlTitle	  = '';
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();
};
