/* [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','34273',jdecode('Home'),jdecode(''),'/34273.html','true',[],'',''],
	['PAGE','34294',jdecode('About+Lake+Arrowhead+Patrol+%26+Security+Services'),jdecode(''),'/34294/index.html','true',[ 
		['PAGE','34303',jdecode('Membership+and+Licensing'),jdecode(''),'/34294/34303.html','true',[],'','']
	],'',''],
	['PAGE','34312',jdecode('Alarm+Monitoring'),jdecode(''),'/34312.html','true',[],'',''],
	['PAGE','34321',jdecode('Alarms+Installation'),jdecode(''),'/34321.html','true',[],'',''],
	['PAGE','34330',jdecode('Patrol+%26+Security+Services'),jdecode(''),'/34330.html','true',[],'',''],
	['PAGE','34339',jdecode('Contact+Us'),jdecode(''),'/34339/index.html','true',[ 
		['PAGE','34348',jdecode('Map'),jdecode(''),'/34339/34348.html','true',[],'','']
	],'',''],
	['PAGE','34357',jdecode('Customer+Testimonials'),jdecode(''),'/34357.html','true',[],'',''],
	['PAGE','34366',jdecode('Important+LINKS'),jdecode(''),'/34366.html','true',[],'',''],
	['PAGE','34375',jdecode('Live+Webcams+and+Weather'),jdecode(''),'/34375.html','true',[],'',''],
	['PAGE','34384',jdecode('Road+Conditions'),jdecode(''),'/34384.html','true',[],'',''],
	['PAGE','34393',jdecode('Security+Tips'),jdecode(''),'/34393.html','true',[],'',''],
	['PAGE','34402',jdecode('Vacation+Tips'),jdecode(''),'/34402.html','true',[],'',''],
	['PAGE','34411',jdecode('Winterizing+Tips'),jdecode(''),'/34411.html','true',[],'',''],
	['PAGE','34420',jdecode('Employment+Opportunities'),jdecode(''),'/34420/index.html','true',[ 
		['PAGE','34429',jdecode('Employee+Application'),jdecode(''),'/34420/34429.html','true',[],'','']
	],'',''],
	['PAGE','34438',jdecode('Newsletter+Archives'),jdecode(''),'/34438.html','true',[],'',''],
	['PAGE','34447',jdecode('Tips+%26+Tricks'),jdecode(''),'/34447.html','true',[],'',''],
	['PAGE','34456',jdecode('Downloadable+Forms'),jdecode(''),'/34456.html','true',[],'',''],
	['PAGE','34868',jdecode('Casual+Elegance+Menu'),jdecode(''),'/34868.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Steps';
theSitetree.paletteFamily='516143';
theSitetree.keyvisualId='2282';
theSitetree.keyvisualName='telecommunication.jpg';
theSitetree.fontsetId='367';
theSitetree.graphicsetId='420';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='516143';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Steps',
				paletteFamily: 	'516143',
				keyvisualId: 	'2282',
				keyvisualName: 	'telecommunication.jpg',
				fontsetId: 		'367',
				graphicsetId: 	'420',
				contentColor: 	'FFFFFF',
				contentBGColor: '516143',
				a_color: 		'516143',
				b_color: 		'657953',
				c_color: 		'3366CC',
				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:  '34402',
internalId:  '',
customField: '20091127-151820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34420',
internalId:  '',
customField: '20091223-163322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34366',
internalId:  '',
customField: '20100506-121611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34384',
internalId:  '',
customField: '20091223-163917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34393',
internalId:  '',
customField: '20091124-130416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34348',
internalId:  '',
customField: '20091124-123838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34357',
internalId:  '',
customField: '20091127-151046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34312',
internalId:  '',
customField: '20091124-122950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34438',
internalId:  '',
customField: '20100329-160057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34339',
internalId:  '',
customField: '20100723-235403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34375',
internalId:  '',
customField: '20100517-152602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34303',
internalId:  '',
customField: '20091124-135030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34330',
internalId:  '',
customField: '20091127-150830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34321',
internalId:  '',
customField: '20091223-161758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34273',
internalId:  '',
customField: '20100422-132716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34294',
internalId:  '',
customField: '20091127-150547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34411',
internalId:  '',
customField: '20091124-131250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34456',
internalId:  '',
customField: '20091223-164032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34447',
internalId:  '',
customField: '20091124-133748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34429',
internalId:  '',
customField: '20091008-143052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34868',
internalId:  '',
customField: '20091124-134130'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INEDWP';
var companyName   = 'Lake+Arrowhead+Patrol+%26+Security+Services';
var htmlTitle	  = 'Lake+Arrowhead+Alarms-+Patrol+%26+Security+Services-+24+Hr+Alarm+and+Patrol+Services';
var metaKeywords  = 'alarm%2C+alarms%2C+alarm+system%2C+alarm+systems%2C+burglar+alarm%2C+burglar+alarms%2C+burglar+alarm+system%2C+burglar+alarm+systems%2C+residential+alarm%2C+residential+alarms%2C+residential+alarm+installation%2C+residiential+alarm+monitoring%2C+commercial+alarm+monitoring%2C+commercial+alarm+installation%2C+alarm+installation%2C+alarm+installations%2C+alarm+monitoring%2C+monitoring%2C+installation%2C+security%2C+intrusion+alarms%2C+intrusion+detection+systems%2C+intrusion+alarm%2C+intrusion+detection+system';
var metaContents  = 'Welcome+to+Lake+Arrowhead+Patrol++Security+Services%2C+home+of+the+finest+in+residential+and+commercial+burglar+alarm+monitoring%2C+installation+and+24-hour+guard+response.+We+serve+all+mountain+communities+including+Lake+Arrowhead%2C+Crestline%2C+Cedar+Glen%2C+Twin+Peaks%2C+Running+Springs%2C+Big+Bear%2C+and+Fawnskin+to+name+a+few.';
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();
};
