/* [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','32',jdecode('Home'),jdecode(''),'/32.html','true',[],''],
	['PAGE','53',jdecode('About+us'),jdecode(''),'/53.html','true',[],''],
	['PAGE','116',jdecode('Offers'),jdecode(''),'/116.html','true',[],''],
	['PAGE','125',jdecode('Jobs'),jdecode(''),'/125.html','true',[],''],
	['PAGE','134',jdecode('Contact'),jdecode(''),'/134.html','true',[],''],
	['PAGE','161',jdecode('Tips+%26+Tricks'),jdecode(''),'/161.html','true',[],''],
	['PAGE','170',jdecode('How+to+find+us'),jdecode(''),'/170.html','true',[],''],
	['PAGE','179',jdecode('Achievements'),jdecode(''),'/179/index.html','true',[ 
		['PAGE','188',jdecode('Installation'),jdecode(''),'/179/188.html','true',[],''],
		['PAGE','197',jdecode('Communication'),jdecode(''),'/179/197.html','true',[],''],
		['PAGE','206',jdecode('Lighting'),jdecode(''),'/179/206.html','true',[],''],
		['PAGE','224',jdecode('Electric+heating'),jdecode(''),'/179/224.html','true',[],''],
		['PAGE','233',jdecode('Networking'),jdecode(''),'/179/233.html','true',[],''],
		['PAGE','251',jdecode('Lightning+protection'),jdecode(''),'/179/251.html','true',[],''],
		['PAGE','260',jdecode('Solar+energy'),jdecode(''),'/179/260.html','true',[],''],
		['PAGE','278',jdecode('Alarm+systems'),jdecode(''),'/179/278.html','true',[],'']
	],''],
	['PAGE','287',jdecode('Service'),jdecode(''),'/287/index.html','true',[ 
		['PAGE','305',jdecode('Consulting'),jdecode(''),'/287/305.html','true',[],''],
		['PAGE','323',jdecode('Maintenance'),jdecode(''),'/287/323.html','true',[],'']
	],''],
	['PAGE','332',jdecode('Tips+and+tricks'),jdecode(''),'/332.html','true',[],''],
	['PAGE','341',jdecode('References'),jdecode(''),'/341.html','true',[],''],
	['PAGE','350',jdecode('Imprint'),jdecode(''),'/350.html','true',[],''],
	['PAGE','1360',jdecode('Guestbook'),jdecode(''),'/1360/index.html','true',[ 
		['PAGE','1359',jdecode('Read+Guestbook'),jdecode(''),'/1360/1359.html','false',[],'']
	],'']];
var siteelementCount=24;
theSitetree.topTemplateName='Evolution';
theSitetree.paletteFamily='668697';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10819';
theSitetree.graphicsetId='11266';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Evolution',
				paletteFamily: 	'668697',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10819',
				graphicsetId: 	'11266',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20091003-133549'
};
webappMappings['1002']=webappMappings['1002-1360AHW050IN3TAB']={
webappId:    '1002',
documentId:  '1360',
internalId:  '1360AHW050IN3TAB',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '32',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20091003-133220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116',
internalId:  '',
customField: '20091003-135356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125',
internalId:  '',
customField: '20061019-235834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134',
internalId:  '',
customField: '20091003-140206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '161',
internalId:  '',
customField: '20061019-235834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '170',
internalId:  '',
customField: '20061019-235834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '179',
internalId:  '',
customField: '20061019-235834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '188',
internalId:  '',
customField: '20061019-235834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '197',
internalId:  '',
customField: '20061019-235835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '206',
internalId:  '',
customField: '20061019-235835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '224',
internalId:  '',
customField: '20061019-235835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '233',
internalId:  '',
customField: '20061019-235835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '251',
internalId:  '',
customField: '20061019-235835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '260',
internalId:  '',
customField: '20061019-235836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '278',
internalId:  '',
customField: '20061019-235836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '287',
internalId:  '',
customField: '20061019-235836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '305',
internalId:  '',
customField: '20061019-235836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '323',
internalId:  '',
customField: '20061019-235836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '332',
internalId:  '',
customField: '20061019-235837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '341',
internalId:  '',
customField: '20061019-235837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '350',
internalId:  '',
customField: '20061019-235837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1360',
internalId:  '',
customField: '20061024-173628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1359',
internalId:  '',
customField: '20061020-000100'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3TAB';
var companyName   = 'IGNOZZA+ELECTRIC';
var htmlTitle	  = '';
var metaKeywords  = 'NJ+ELECTRICAL+CONTRACTORS++IGNOZZA+ELECTRIC++MORRIS+COUNTY+ELECTRICAL+CONTRACTORS++IGNOZZA+ELECTRIC';
var metaContents  = 'MORRIS+CNTY+NJ+ELECTRICIANS';
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();
};
