/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','22501',jdecode('Our+Team'),jdecode(''),'/22501.html','true',[],'',''],
	['PAGE','22522',jdecode('Process+Serving'),jdecode(''),'/22522.html','true',[],'',''],
	['PAGE','115001',jdecode('Virtual+Paralegal'),jdecode(''),'/115001.html','true',[],'',''],
	['PAGE','59201',jdecode('Notary+Signing+'),jdecode(''),'/59201.html','true',[],'',''],
	['PAGE','12601',jdecode('Legal+Blog'),jdecode(''),'/12601.html','true',[],'',''],
	['PAGE','23101',jdecode('Statewide+Service'),jdecode(''),'/23101.html','false',[],'',''],
	['PAGE','69901',jdecode('Contact+Us'),jdecode(''),'/69901.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Vista';
theSitetree.paletteFamily='7B98B4';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='13647';
theSitetree.graphicsetId='12112';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='7B98B4';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Vista',
				paletteFamily: 	'7B98B4',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'13647',
				graphicsetId: 	'12112',
				contentColor: 	'FFFFFF',
				contentBGColor: '7B98B4',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'2F4E6B',
				e_color: 		'2F4E6B',
				f_color: 		'2F4E6B',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20110310-115552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23101',
internalId:  '',
customField: '20101105-224959'
};
webappMappings['7050']=webappMappings['7050-18256']={
webappId:    '7050',
documentId:  '12601',
internalId:  '18256',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69901',
internalId:  '',
customField: '20110111-101519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12601',
internalId:  '',
customField: '20100912-190951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22522',
internalId:  '',
customField: '20110209-130039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59201',
internalId:  '',
customField: '20110209-130200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115001',
internalId:  '',
customField: '20110116-031241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22501',
internalId:  '',
customField: '20110310-110922'
};
webappMappings['7008']=webappMappings['7008-16717']={
webappId:    '7008',
documentId:  '22522',
internalId:  '16717',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN2KCG';
var companyName   = 'SERVOLOGY+-+A+TEXAS+PROCESS+SERVING+COMPANY+-+%28817%29+793-2099';
var htmlTitle	  = 'Certified+Civil+Connection';
var metaKeywords  = 'Process+Server+Arlington+Texas%2C+Process+Server+Bedford+Texas%2C+Process+Server+Blue+Mound+Texas%2C+Process+Server+Colleyville+texas%2C+Dalworthington++Gardens%2C+Edgecliff+Village%2C+Process+Server+Euless+Texas%2C+Everman%2C+Forrest+Hill%2C+Process+Server+Fort+Worth+Texas%2C+Grapevine+Texas+Process+Server+%2C+Grand+Prairie%2C+Haltom+City%2C+Haslet%2C+Hurst%2C+Keller+Texas+Process+Serverr%2C+Lake+Worth%2C+Lakeside%2C+Pantego%2C+Pelican+Bay%2C+North+Richland+Hills+Texas+Process+Server%2C+River+Oaks%2C+Saginaw%2C+Sansom+Park%2C+Southlake+Texas+Process+Server%2C+Watauga+Texas+Process+Server+%2C+Westlake+Texas+Process+Server+%2C+Westover+Hills+Texas+Process+Server%2C+Westworth+Village+Texas+Process+Server%2C+White+Settlement+Texas+Process+Server+';
var metaContents  = 'Texas+Process+Serving+is+made+simple+and+easy+with+Certified+Civil+Connection%2C+which+is+an+affiliated+partner+of+Servology.++All+of+our+process+servers+are+currently+certified+by+order+of+the+Supreme+Court+and+are+regulated+through+the+Process+Server+Review+Board.++Our+main+office+is+located+in+the+Dallas+Fort+Worth+Area%2C+but+we+provide+service+through-out+the+state+of+Texas.';
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();
};

