/* [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','5101',jdecode('Home'),jdecode(''),'/5101.html','true',[],'',''],
	['PAGE','15801',jdecode('Insurance+Companies'),jdecode(''),'/15801.html','true',[],'',''],
	['PAGE','5194',jdecode('Request+Information'),jdecode(''),'/5194.html','true',[],'',''],
	['PAGE','5152',jdecode('Types+of+Insurance'),jdecode(''),'/5152.html','true',[],'',''],
	['PAGE','5173',jdecode('Customer+Service'),jdecode(''),'/5173.html','true',[],'',''],
	['PAGE','15843',jdecode('Our+Team'),jdecode(''),'/15843.html','true',[],'',''],
	['PAGE','15864',jdecode('How+to+find+us'),jdecode(''),'/15864.html','true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Nebula';
theSitetree.paletteFamily='7A7A7B';
theSitetree.keyvisualId='8791';
theSitetree.keyvisualName='kv_8791.jpg';
theSitetree.fontsetId='17095';
theSitetree.graphicsetId='12478';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='AFAEB0';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp13-bizcla',
  product: 'WSCSYSSSSLYTCPII'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Nebula',
				paletteFamily: 	'7A7A7B',
				keyvisualId: 	'8791',
				keyvisualName: 	'kv_8791.jpg',
				fontsetId: 		'17095',
				graphicsetId: 	'12478',
				contentColor: 	'000000',
				contentBGColor: 'AFAEB0',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20101001-142901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5152',
internalId:  '',
customField: '20100803-195303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5173',
internalId:  '',
customField: '20100917-145849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5194',
internalId:  '',
customField: '20100803-183227'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15843',
internalId:  '',
customField: '20100917-145857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15801',
internalId:  '',
customField: '20100917-145622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15864',
internalId:  '',
customField: '20100917-145958'
};
webappMappings['7008']=webappMappings['7008-18869']={
webappId:    '7008',
documentId:  '5194',
internalId:  '18869',
customField: 'language:en;country:US;'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I7CLRS';
var companyName   = 'Pagel+%26+Associates+Insurance';
var htmlTitle	  = 'Pagel+%26+Associates+Insurance+Agency';
var metaKeywords  = 'Gary+Pagel+Insurance%0D%0AKelly+Pagel+Insurance%0D%0AFred+Meinel+Insurance%0D%0AGary+Pagel%0D%0AKelly+Pagel%0D%0AFred+Meinel%0D%0Ainsurance+Green+Bay%0D%0Acar+insurance%0D%0Aauto+insurance%0D%0Atruck+insurance%0D%0Acycle+insurance%0D%0Amotorcycle+insurance%0D%0Aboat+insurance%0D%0Amotor+home+insurance%0D%0Arv+insurance%0D%0Afarm+insurance%0D%0Acheap+auto+insurance%0D%0Aautomobile+insurance+quote%0D%0Aauto+insurance+online%0D%0Aonline+auto+insurance+quote%0D%0Aauto+insurance+company%0D%0Aauto+insurance+quotes%0D%0Acheapest+auto+insurance%0D%0Ainsurance+agent%0D%0Ainsurance+coverage%0D%0Aauto+insurance+broker%0D%0Aonline+car+insurance%0D%0Ainsurance+agency%0D%0Aauto+insurance+rate+quote%0D%0Aauto+insurance+agency%0D%0Aauto+insurance+providers%0D%0Abuy+auto+insurance%0D%0Abuy+auto+insurance+online%0D%0Acheap+auto+insurance+quotes%0D%0Aauto+insurance+agent%0D%0Abest+auto+insurance+rates%0D%0Aaffordable+auto+insurance%0D%0Alowest+auto+insurance+rates%0D%0Aauto+insurance+company+online%0D%0Abest+auto+insurance+companies%0D%0Atop+auto+insurance+companies%0D%0Acheap+auto+insurance+companies%0D%0Acheapest+auto+insurance+companies%0D%0Atop+rated+auto+insurance+companies%0D%0AA1';
var metaContents  = 'Pagel+%26+Associates+Insurance+is+an+independent+insurance+agency+that+can+help+you+with+all+of+your+insurance+needs+including+car%2C+home%2C+commercial%2C+boat%2C+cycle+and+motor+homes+to+name+a+few.%0D%0A%0D%0A%0D%0A%0D%0AWith+over+60+years+of+insurance+experience+and+outstanding+customer+service%2C+this+family+owned+insurance+agency+will+work+with+you+to+get+the+best+coverage+at+the+lowest+price.';
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();
};

