/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],''],
	['PAGE','9301',jdecode('Gregory+L.+Seibert'),jdecode(''),'/9301.html','true',[],''],
	['PAGE','4601',jdecode('Legal+Services'),jdecode(''),'/4601/index.html','true',[ 
		['PAGE','4622',jdecode('Personal+Injury'),jdecode(''),'/4601/4622.html','true',[],''],
		['PAGE','9322',jdecode('Driving+While+Impared'),jdecode(''),'/4601/9322.html','true',[],''],
		['PAGE','4643',jdecode('Traffic+Tickets'),jdecode(''),'/4601/4643.html','true',[],''],
		['PAGE','9343',jdecode('Criminal+Cases'),jdecode(''),'/4601/9343.html','true',[],''],
		['PAGE','4664',jdecode('Aviation+Law'),jdecode(''),'/4601/4664.html','true',[],''],
		['PAGE','4685',jdecode('Mediation+and+Arbitration'),jdecode(''),'/4601/4685.html','true',[],''],
		['PAGE','9364',jdecode('Other+Practice+Areas'),jdecode(''),'/4601/9364.html','true',[],'']
	],''],
	['PAGE','4706',jdecode('Legal+Links'),jdecode(''),'/4706.html','true',[],''],
	['PAGE','4832',jdecode('Contact+Us'),jdecode(''),'/4832/index.html','true',[ 
		['PAGE','4727',jdecode('Address'),jdecode(''),'/4832/4727.html','true',[],''],
		['PAGE','4748',jdecode('Hours'),jdecode(''),'/4832/4748.html','true',[],'']
	],''],
	['PAGE','9385',jdecode('Forms'),jdecode(''),'/9385.html','true',[],''],
	['PAGE','9406',jdecode('Attorney+Referral'),jdecode(''),'/9406.html','true',[],''],
	['PAGE','17901',jdecode('Map'),jdecode(''),'/17901.html','true',[],''],
	['PAGE','18001',jdecode('Driving+directions'),jdecode(''),'/18001.html','true',[],''],
	['PAGE','22001',jdecode('Disclaimer'),jdecode(''),'/22001.html','true',[],'']];
var siteelementCount=19;
theSitetree.topTemplateName='Art';
theSitetree.paletteFamily='660000';
theSitetree.keyvisualId='1770';
theSitetree.keyvisualName='anwalt.jpg';
theSitetree.fontsetId='288';
theSitetree.graphicsetId='352';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='660000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Art',
				paletteFamily: 	'660000',
				keyvisualId: 	'1770',
				keyvisualName: 	'anwalt.jpg',
				fontsetId: 		'288',
				graphicsetId: 	'352',
				contentColor: 	'FFFFFF',
				contentBGColor: '660000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'660000',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '17901',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '18001',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20071130-195120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4832',
internalId:  '',
customField: '20071202-181746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22001',
internalId:  '',
customField: '20071128-223144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20071129-143157'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INZO7C';
var companyName   = 'The+Law+Offices+of+Gregory+L.+Seibert';
var htmlTitle	  = 'www.seibert.com';
var metaKeywords  = 'attorney%2C+lawyer%2C+legal+services%2C+Wake++County%2C+Raleigh%2C+North+Carolina%2C+traffic%2C+traffic+tickets%2C+speeding+tickets%2C+driving+while+impaired%2C+criminal%2C+district+court%2C+aviation%2C+pilot%2C+FAA%2C+DMV%2C+wrongful+death%2C+personal+injury%2C+pilot+actions%2C+mediator%2C+arbitrator%2C+mediation%2C+arbitration%2C+DWI%2C+DUI%2C+violations%2C+court%2C+airplane%2C+aircraft%2C+AOPA%2C+DRC+certified+mediator%2C+accident%2C+accidents%2C+automobile%2C+car%2C+crash%2C+helicopter';
var metaContents  = 'Raleigh%2C+North+Carolina+law+firm+offering+services+for+personal+injury%2C+wrongful+death%2C+aviation+cases%2C+driving+while+impaired%2C+criminal+offenses%2C+traffic+violations%2C+mediation+and+arbitration.';
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();
};
