/* [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','5001',jdecode('Home'),jdecode(''),'/5001.html','true',[],'',''],
	['PAGE','5073',jdecode('Pro+Photography'),jdecode(''),'/5073/index.html','true',[ 
		['PAGE','5052',jdecode('Weddings+%2F+Events'),jdecode(''),'/5073/5052.html','true',[],'',''],
		['PAGE','34801',jdecode('Wedding+Gallery'),jdecode(''),'/5073/34801.html','true',[],'',''],
		['PAGE','36501',jdecode('Restorations+Gallery'),jdecode(''),'/5073/36501.html','true',[],'','']
	],'',''],
	['PAGE','32701',jdecode('Video+Services'),jdecode(''),'/32701/index.html','true',[ 
		['PAGE','5094',jdecode('Videography'),jdecode(''),'/32701/5094.html','true',[],'',''],
		['PAGE','32722',jdecode('Full+Video+Production'),jdecode(''),'/32701/32722.html','true',[],'','']
	],'',''],
	['PAGE','31801',jdecode('Seminars'),jdecode(''),'/31801.html','true',[],'',''],
	['PAGE','28901',jdecode('KNAPPTEK+Products'),jdecode(''),'/28901/index.html','true',[ 
		['PAGE','5178',jdecode('Automotive+Lubrication'),jdecode(''),'/28901/5178.html','true',[],'',''],
		['PAGE','5199',jdecode('DrSlide+tm+for+Engines+'),jdecode(''),'/28901/5199.html','true',[],'',''],
		['PAGE','43801',jdecode('+DrSlide+tm+Store'),jdecode(''),'/28901/43801.html','true',[],'',''],
		['PAGE','5157',jdecode('VET+Electronics+Cleaner'),jdecode(''),'/28901/5157.html','true',[],'',''],
		['PAGE','29001',jdecode('Electronics+Enhancement'),jdecode(''),'/28901/29001.html','true',[],'','']
	],'',''],
	['PAGE','29022',jdecode('Links'),jdecode(''),'/29022.html','true',[],'',''],
	['PAGE','5115',jdecode('%22Benefit+Mankind%22'),jdecode(''),'/5115.html','true',[],'',''],
	['PAGE','29043',jdecode('Address+and+Phone'),jdecode(''),'/29043.html','true',[],'',''],
	['PAGE','39222',jdecode('Email+Requests'),jdecode(''),'/39222.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Medium';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='2155';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='355';
theSitetree.graphicsetId='408';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Medium',
				paletteFamily: 	'000000',
				keyvisualId: 	'2155',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'355',
				graphicsetId: 	'408',
				contentColor: 	'DDDDDD',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'8EBFC6',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20100727-021111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5052',
internalId:  '',
customField: '20100619-011135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5073',
internalId:  '',
customField: '20100704-173033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5094',
internalId:  '',
customField: '20100704-014710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5157',
internalId:  '',
customField: '20100619-013622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5115',
internalId:  '',
customField: '20100613-025843'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5001',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5178',
internalId:  '',
customField: '20100616-145611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5199',
internalId:  '',
customField: '20100615-163958'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5115',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5052',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5073',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5094',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5157',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5178',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5199',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29043',
internalId:  '',
customField: '20100726-133805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29022',
internalId:  '',
customField: '20100704-045222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28901',
internalId:  '',
customField: '20100707-015835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29001',
internalId:  '',
customField: '20100704-034202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31801',
internalId:  '',
customField: '20100728-184051'
};
webappMappings['7008']=webappMappings['7008-30070']={
webappId:    '7008',
documentId:  '39222',
internalId:  '30070',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43801',
internalId:  '',
customField: '20100902-140641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32701',
internalId:  '',
customField: '20100717-095551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32722',
internalId:  '',
customField: '20100704-173526'
};
webappMappings['7060']=webappMappings['7060-65adf59f4dbb279525210d55228f03cf']={
webappId:    '7060',
documentId:  '34801',
internalId:  '65adf59f4dbb279525210d55228f03cf',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34801',
internalId:  '',
customField: '20100704-232818'
};
webappMappings['7060']=webappMappings['7060-a03ffda5d3b21212bb7cad1de494720e']={
webappId:    '7060',
documentId:  '36501',
internalId:  'a03ffda5d3b21212bb7cad1de494720e',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36501',
internalId:  '',
customField: '20100705-003220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39222',
internalId:  '',
customField: '20100726-132400'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INLB12';
var companyName   = 'K+N+A+P+P+T+E+K';
var htmlTitle	  = 'Upland+CA+Video+Production%2C+Film%2C+Photography%2C+Automotive+Lubrication%2C+Electronics+Cleaner';
var metaKeywords  = 'California%2C+weddings%2C+events%2C+wedding+photography%2C+wedding+videography%2C+wedding+photo+and+video%2C+wedding+DVD%2C+local+wedding%2C+videography%2C+photo%2C+restoration%2C+automotive%2C+lubrication%2C+engine%2C+conditioning%2C+electronics%2C+electronics+cleaner%2C+electronics+conditioner%2C+specialty%2C+product%2C+John+Knapp%2C+Upland%2C+Los+angeles%2C+copy%2C+old+photos%2C+restoration%2C+photo+restoration%2C+Los+Angeles%2C+Upland%2C+Rancho+Cucamonga%2C+Ontario%2C+San+Dimas%2C+La+Verne%2C+Diamond+Bar%2C+West+covia%2C+Glendora%2C+Montclair%2C+Claremont%2C+Alta+Loma%2C+Etiwanda%2C+local%2C+CA';
var metaContents  = 'Los+Angeles+California+based++Movie%2C+Video+Production%2C+Photography+for+weddings%2C+events%2C+head+shots%2C+studio%2C+location%2C+photo+restoration%2C+Video+for+weddings%2C+events%2C+music++videos%2C+DVD%2C+Blu-Ray%2C+editing%2C+post+production%2C+movies%2C+commercial+films%2C+Video+Services%2C+video+transfers%2C+DVD+duplicating+plus+departments+for+Automotive++Electronics+Product+Development%2C+DrSlide+tm+automotive+lubrication+product%2C+and+VET+Video++Electronics+Enhancement+specialty+cleaner+product+sales+for+United+States+and+Canada.';
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();
};
