/* [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','9801',jdecode('Home'),jdecode(''),'/9801.html','true',[],''],
	['PAGE','14601',jdecode('How+to+find+us'),jdecode(''),'/14601.html','true',[],''],
	['PAGE','14622',jdecode('About+us'),jdecode(''),'/14622/index.html','true',[ 
		['PAGE','14643',jdecode('Our+team'),jdecode(''),'/14622/14643.html','true',[],'']
	],''],
	['PAGE','14664',jdecode('APS+Trade+Ally'),jdecode(''),'/14664.html','true',[],''],
	['PAGE','14685',jdecode('energy+efficiancy'),jdecode(''),'/14685.html','true',[],''],
	['PAGE','14706',jdecode('Solar+energy'),jdecode(''),'/14706.html','true',[],''],
	['PAGE','14727',jdecode('Lighting'),jdecode(''),'/14727.html','true',[],''],
	['PAGE','14748',jdecode('Installation'),jdecode(''),'/14748.html','true',[],''],
	['PAGE','14769',jdecode('Panels+and+service+upgrades'),jdecode(''),'/14769.html','true',[],''],
	['PAGE','14790',jdecode('Electric+heating'),jdecode(''),'/14790.html','true',[],''],
	['PAGE','14811',jdecode('Consulting'),jdecode(''),'/14811.html','true',[],''],
	['PAGE','14832',jdecode('Planning'),jdecode(''),'/14832/index.html','true',[ 
		['PAGE','14853',jdecode('New+page'),jdecode(''),'/14832/14853.html','true',[],'']
	],''],
	['PAGE','14874',jdecode('Search+clues'),jdecode(''),'/14874.html','false',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Abstract';
theSitetree.paletteFamily='FFF0D4';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10386';
theSitetree.graphicsetId='10582';
theSitetree.contentColor='A00000';
theSitetree.contentBGColor='FFF0D4';
var theTemplate={
				name: 			'Abstract',
				paletteFamily: 	'FFF0D4',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10386',
				graphicsetId: 	'10582',
				contentColor: 	'A00000',
				contentBGColor: 'FFF0D4',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9801',
internalId:  '',
customField: '20100111-175823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14601',
internalId:  '',
customField: '20100111-175417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14622',
internalId:  '',
customField: '20100111-152441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14643',
internalId:  '',
customField: '20100111-152441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14664',
internalId:  '',
customField: '20100111-152441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14685',
internalId:  '',
customField: '20100111-152441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14706',
internalId:  '',
customField: '20100111-152441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14727',
internalId:  '',
customField: '20100111-152441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14748',
internalId:  '',
customField: '20100111-152441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14769',
internalId:  '',
customField: '20100111-152441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14790',
internalId:  '',
customField: '20100111-152441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14811',
internalId:  '',
customField: '20100111-152441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14832',
internalId:  '',
customField: '20100111-152441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14853',
internalId:  '',
customField: '20100111-152441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14874',
internalId:  '',
customField: '20100111-152441'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '9801',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INZ92F';
var companyName   = 'DAK+Electric';
var htmlTitle	  = '';
var metaKeywords  = 'electrical+contractor%2C+electrician%2C+Prescott+electrical%2Celectrical+contractorselectrical+contractorelectricianselectricianelectric+contractorselectric+contractorelectrician+electrical+contractorelectrician+contractorelectrician+contractorselectrician+trainingelectrician+jobsindustrial+electrical+contractorsindependent+electrical+contractorsindustrial+electrical+contractorelectrical+electricianelectrician+apprenticeshipjob+electricianconstruction+electricianelectrical+helpmaster+electriciantop+50+electrical+contractorscommercial+electrical+contractorslargest+electrical+contractorsindependant+electrical+contractorstop+electrical+contractorslicensed+electricianselectrician+serviceselectrician+educationcommercial+electriciancommercial+electrical+contractorindependent+electrical+contractorunion+electricianjourneyman+electricianelectrical+contractors+electricianselectrician+estimatorweca+electricianlocal+electrical+contractorsnational+electrical+contractors+associationlow+voltage+electriciancommercial+electriciansmaster+electriciansemergency+electricianelectrician+pricesfind+electricianelectrician+service24+hour+electricianelectrician+estimateelectrician+companyhome+electricianfind+electrical+contractorelectrical+contractor+companyelectrician+testingelectrician+safetyelectrician+companiesresidential+electrical+contractorscheap+electricianelectrical+contractor+jobselectrician+trademaintenance+electricianelectrician+workelectricians+jobslicensed+electrical+contractorsunion+electricianscontractor+electricalelectrical+contractingelectrical+testingelectrical+safetyelectrical+jobselectrical+constructionelectricanelectrical+estimatingelectrical+contracting+businesselectrical+contracterselectric+contractingelectrcal+contractorelectrial+contractorcabling+contractorelecrical+contractoreletrical+contractorelctrical+contractormr+electricelectrical+serviceselectrical+companieselectrical+serviceelectrical+regulationselectricanselectrical+standardselectrical+trainingelectrical+apprenticeshipelectrical+installationselectrical+contracting+companyelectical+contractorcabling+contractorselectrical+contratorselectrcial+contractorelecrtical+contractorelectircal+contractorelectrical+contracteranecoibew+contractorelectrical+estimatorselectrical+seminarselectrical+cablingelectrical+workelectrical+problemtrulandhome+electricalelectrical+proelectrical+contractelectrical+upgradecommercial+electricalelectricialelectrical+jatcelectricial+contractorelectrical+installerselectrical+inspectionelectrical+fireelectrical+safety+equipmentelectrical+safety+testelectrical+safety+testingelectrical+problems+';
var metaContents  = 'DAK+Electric%2C+Prescott+Az.+source+for+quality+electircal+work%2C+we+specialize+in+Energy+Efficiency%2C+energy+efficient+lighting%2C+Prescotts+APS+Trade+Ally%2C+Take+advantage+of+APS+Rebates+on+energy+efficiency+and+tax+incentives+from+the+State+and+Federal+goverments.+++++Business+and+Residential+Service+calls%2C+get+it+right+the+first+time.+Panel+upgrades+and+repairs%2C+new+outlets+and+switches%2C+Trouble+shooting+building+wiring+or+machinery.+Call+us+at+928-445-8421+++';
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();
};
