/* [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','601',jdecode('Welcome'),jdecode(''),'/601.html','true',[],'',''],
	['PAGE','6601',jdecode('About+us'),jdecode(''),'/6601.html','true',[],'',''],
	['PAGE','52001',jdecode('PTS+Tax+Q+%26+A'),jdecode(''),'/52001.html','true',[],'',''],
	['PAGE','6622',jdecode('History'),jdecode(''),'/6622.html','true',[],'',''],
	['PAGE','39263',jdecode('Contact+PTS'),jdecode(''),'/39263.html','true',[],'',''],
	['PAGE','14701',jdecode('Map'),jdecode(''),'/14701.html','true',[],'',''],
	['PAGE','6790',jdecode('Services'),jdecode(''),'/6790.html','true',[],'',''],
	['PAGE','12022',jdecode('Helpful+Links'),jdecode(''),'/12022.html','true',[],'',''],
	['PAGE','28401',jdecode('PTS+Privacy+Policy'),jdecode(''),'/28401.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Medium';
theSitetree.paletteFamily='F8F2E6';
theSitetree.keyvisualId='2156';
theSitetree.keyvisualName='boerse.jpg';
theSitetree.fontsetId='358';
theSitetree.graphicsetId='410';
theSitetree.contentColor='A00000';
theSitetree.contentBGColor='F8F2E6';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Medium',
				paletteFamily: 	'F8F2E6',
				keyvisualId: 	'2156',
				keyvisualName: 	'boerse.jpg',
				fontsetId: 		'358',
				graphicsetId: 	'410',
				contentColor: 	'A00000',
				contentBGColor: 'F8F2E6',
				a_color: 		'F8F2E6',
				b_color: 		'8EBFC6',
				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['1501']=webappMappings['1501-1248620']={
webappId:    '1501',
documentId:  '601',
internalId:  '1248620',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '14701',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52001',
internalId:  '',
customField: '20100713-195053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20100713-192742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20100713-192900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6622',
internalId:  '',
customField: '20100713-192926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39263',
internalId:  '',
customField: '20100713-192941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14701',
internalId:  '',
customField: '20100713-193057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6790',
internalId:  '',
customField: '20100713-193150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12022',
internalId:  '',
customField: '20100713-193223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28401',
internalId:  '',
customField: '20100713-193241'
};
webappMappings['1003']=webappMappings['1003-ahw050ine3u5129ce650296']={
webappId:    '1003',
documentId:  '52001',
internalId:  'ahw050ine3u5129ce650296',
customField: 'en:US'
};
webappMappings['7008']=webappMappings['7008-1523']={
webappId:    '7008',
documentId:  '39263',
internalId:  '1523',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INE3U5';
var companyName   = 'Individual+%26+Small+Business+Specialist';
var htmlTitle	  = 'PTS+Financial+%26+Tax+Services+%28Tacoma%2C+WA%29';
var metaKeywords  = 'Tax+Prep+Taxes++E-File++Local++Professional++Accounting+Small+Business+Corporate+Taxes+Enrolled+Agent+Tax+Planning+Consulting+Business+Set-Up+Taxes+IRS+Tax+Help+Tax+Questions+Tax+Pro+EA';
var metaContents  = 'Enrolled+Agent%2C+Expert+Income+Tax+Prepartion%2C+On-Line+Filing%2C+Tax+Planning%2C+Tax+Consulting%2C+Business+Taxes+and+Set-up%2C+File+Taxes%2C+State+Taxes%2C+Business+Tax+Help%2C+Tax+Pros%2C+Accounting%2C+EA%2C+NAEA+Member%2C+NATP+Member%2C+Q%26A';
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();
};
