/* [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','5301',jdecode('Home'),jdecode(''),'/5301.html','true',[],'',''],
	['PAGE','5501',jdecode('About+Us'),jdecode(''),'/5501.html','true',[],'',''],
	['PAGE','5801',jdecode('Service+Areas'),jdecode(''),'/5801.html','true',[],'',''],
	['PAGE','5522',jdecode('Request+Quote'),jdecode(''),'/5522.html','true',[],'',''],
	['PAGE','5622',jdecode('Contact+Us'),jdecode(''),'/5622.html','true',[],'',''],
	['PAGE','5901',jdecode('What%26%23x27%3Bs+New'),jdecode(''),'/5901.html','true',[],'',''],
	['PAGE','5601',jdecode('Links'),jdecode(''),'/5601.html','true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20100920-092050'
};
webappMappings['7008']=webappMappings['7008-1153']={
webappId:    '7008',
documentId:  '5522',
internalId:  '1153',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-1156']={
webappId:    '7008',
documentId:  '5622',
internalId:  '1156',
customField: 'language:en;country:US;'
};
webappMappings['7050']=webappMappings['7050-571']={
webappId:    '7050',
documentId:  '5901',
internalId:  '571',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5301',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-6135874']={
webappId:    '1501',
documentId:  '5301',
internalId:  '6135874',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20100329-141536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20100329-142412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5522',
internalId:  '',
customField: '20080319-140359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5622',
internalId:  '',
customField: '20080319-140741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20080319-135459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20100920-093343'
};
webappMappings['1501']=webappMappings['1501-6136953']={
webappId:    '1501',
documentId:  '5301',
internalId:  '6136953',
customField: '1501'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN2AR1';
var companyName   = 'Above+the+Line+Signing';
var htmlTitle	  = 'Above+the+Line+Signing+Missouri+Mobile+Notary+Signing+Agent';
var metaKeywords  = 'Missouri%2C+Notary+Public%2C+Notary+Signing+Agent%2C+Mobile+Notary+Signing+Agent%2C+Notary%2C+Reverse+Mortgage%2C+Refinance%2C+Loan+Documents%2C+Purchase+Documents%2C+Mortgage%2C+Johnson+County%2C+Lafayette+County%2C+Pettis+County%2C+Henry+County%2C+Saline+County%2C+Jackson+County%2C++Knob+Noster%2C+65336%2C+Warrensburg%2C+64093%2C+Alma%2C+64001%2C+Blackburn%2C+65321%2C+Bates+City%2C+64011%2C+Blairstown%2C+64726%2C+Blue+Springs%2C+64013%2C+64014%2C+64015%2C+Calhoun%2C+65323%2C+Centerview%2C+64019%2C+Chilhowee%2C+64733%2C+Clinton%2C+65323%2C+Corder%2C+64021%2C+Deepwater%2C+64740%2C+Dover%2C+64022%2C+Emma%2C+65327%2C+Gilliam%2C+65330%2C+Grain+Valley%2C+64029%2C+Grand+Pass%2C+65339%2C+Grandview%2C+64030%2C+Green+Ridge%2C+65332%2C+Higginsville%2C+64037%2C+Holden%2C+64040%2C+Houstonia%2C+65333%2C+Hughesville%2C+65334%2C+Kingsville%2C+64061%2C+La+Monte%2C+65337%2C+Leeton%2C+64761%2C+Lexington%2C+64067%2C+Lone+Jack%2C+64070%2C+Malt+Bend%2C+65339%2C+Marshall%2C+65340%2C+Mayview%2C+64071%2C+Miami%2C+65344%2C+Montrose%2C+64770%2C+Mora%2C+65345%2C+Napoleon%2C+64074%2C+Napton%2C+65340%2C+Nelson%2C+65347%2C+Oak+Grove%2C+64075%2C+Odessa%2C+64076%2C+Sedalia%2C+65301%2C+65302%2C+Slater%2C+65349%2C+Smithton%2C+65350%2C+Sweet+Springs%2C+65351%2C+Tightwad%2C+64735%2C+Urich%2C+64788%2C+Waverly%2C+64096%2C+Wellington%2C+64097%2C+Whiteman+Air+Force+Base%2C+65305%2C+Windsor%2C+65360%2C+Otterville%2C+65348%2C+Richmond%2C+64085%2C';
var metaContents  = 'Missouri+Mobile+Notary+Signing+Agent%2C+Laura+Underwood%2C+Above+the+Line+Signing';
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();
};

