/* [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','1201',jdecode('Home'),jdecode(''),'/1201.html','true',[],''],
	['PAGE','15101',jdecode('Gallery+1'),jdecode(''),'/15101.html','true',[],''],
	['PAGE','5748',jdecode('Gallery+2'),jdecode(''),'/5748.html','true',[],''],
	['PAGE','7901',jdecode('Gallery+3'),jdecode(''),'/7901.html','true',[],''],
	['PAGE','7922',jdecode('Gallery+4'),jdecode(''),'/7922.html','true',[],''],
	['PAGE','15122',jdecode('Gallery+5'),jdecode(''),'/15122.html','true',[],''],
	['PAGE','5706',jdecode('Contact'),jdecode(''),'/5706.html','true',[],''],
	['PAGE','17501',jdecode('Links'),jdecode(''),'/17501.html','true',[],'']];
var siteelementCount=8;
theSitetree.topTemplateName='Vehicle';
theSitetree.paletteFamily='0B0B0B';
theSitetree.keyvisualId='11866';
theSitetree.keyvisualName='kv_11866.jpg';
theSitetree.fontsetId='33170';
theSitetree.graphicsetId='14084';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='0B0B0B';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Vehicle',
				paletteFamily: 	'0B0B0B',
				keyvisualId: 	'11866',
				keyvisualName: 	'kv_11866.jpg',
				fontsetId: 		'33170',
				graphicsetId: 	'14084',
				contentColor: 	'FFFFFF',
				contentBGColor: '0B0B0B',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'0B0B0B',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1201',
internalId:  '',
customField: '20081021-010238'
};
webappMappings['7060']=webappMappings['7060-3cd4e9cf39a2c9c76923df931bbd7030']={
webappId:    '7060',
documentId:  '15101',
internalId:  '3cd4e9cf39a2c9c76923df931bbd7030',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15101',
internalId:  '',
customField: '20090831-194258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17501',
internalId:  '',
customField: '20100228-145947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5706',
internalId:  '',
customField: '20081021-014925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5748',
internalId:  '',
customField: '20080319-202202'
};
webappMappings['7060']=webappMappings['7060-68725f4fa28c43aaebaedea6f09a1a9c']={
webappId:    '7060',
documentId:  '5748',
internalId:  '68725f4fa28c43aaebaedea6f09a1a9c',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-4c7db08fa5daa296357d1e239eece747']={
webappId:    '7060',
documentId:  '7901',
internalId:  '4c7db08fa5daa296357d1e239eece747',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-1419203037ef12161826cc2ce0963dd7']={
webappId:    '7060',
documentId:  '7922',
internalId:  '1419203037ef12161826cc2ce0963dd7',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-de664364374c3a1338cc947100030bb2']={
webappId:    '7060',
documentId:  '15122',
internalId:  'de664364374c3a1338cc947100030bb2',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7901',
internalId:  '',
customField: '20081021-005920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7922',
internalId:  '',
customField: '20081021-005920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15122',
internalId:  '',
customField: '20090831-194258'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10IN3RCP';
var companyName   = 'PROVECTUS+CUSTOMZ';
var htmlTitle	  = 'Provectus+Customz';
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();
};

