/* [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','86',jdecode('Home'),jdecode(''), jdecode('%2F86.html'), 'true',[],'',''],
	['PAGE','107',jdecode('Bio+%26+CV'),jdecode(''), jdecode('%2F107.html'), 'true',[],'',''],
	['PAGE','125',jdecode('Genealogy'),jdecode(''), jdecode('%2F125.html'), 'true',[],'',''],
	['PAGE','134',jdecode('Taxing+Situations'),jdecode(''), jdecode('%2F134.html'), 'true',[],'',''],
	['PAGE','143',jdecode('Interactive+Zone'),jdecode(''), jdecode('%2F143.html'), 'true',[],'',''],
	['PAGE','152',jdecode('News'),jdecode(''), jdecode('%2F152.html'), 'true',[],'',''],
	['PAGE','1374',jdecode('Contact+%26+Feedback'),jdecode(''), jdecode('%2F1374%2Findex.html'), 'true',[ 
		['PAGE','1434',jdecode('Contact+%26+Feedback+%28follow+up+page%29'),jdecode(''), jdecode('%2F1374%2F1434.html'), 'false',[],'','']
	],'',''],
	['PAGE','161',jdecode('Links'),jdecode(''), jdecode('%2F161.html'), 'true',[],'',''],
	['PAGE','1447',jdecode('Pics'),jdecode(''), jdecode('%2F1447.html'), 'true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Delta';
theSitetree.paletteFamily='080245';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10615';
theSitetree.graphicsetId='10811';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='080245';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'netnation',
  product: 'WSCSYSSSSLYTCPH7'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Delta',
				paletteFamily: 	'080245',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10615',
				graphicsetId: 	'10811',
				contentColor: 	'FFFFFF',
				contentBGColor: '080245',
				a_color: 		'221785',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '86',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-bd62ea919eebab7716cc5d7ff333257e']={
webappId:    '7060',
documentId:  '1447',
internalId:  'bd62ea919eebab7716cc5d7ff333257e',
customField: 'language:en;country:US;'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTCPH7']={
webappId:    '5003',
documentId:  '86',
internalId:  'tid:1;pid:WSCSYSSSSLYTCPH7',
customField: 'en:US:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86',
internalId:  '',
customField: '20111106-003716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '161',
internalId:  '',
customField: '20111106-005851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '152',
internalId:  '',
customField: '20111106-005627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107',
internalId:  '',
customField: '20111106-004030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125',
internalId:  '',
customField: '20110130-000624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134',
internalId:  '',
customField: '20110130-000837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143',
internalId:  '',
customField: '20110130-001013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1374',
internalId:  '',
customField: '20110130-004228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1434',
internalId:  '',
customField: '20060913-025000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1447',
internalId:  '',
customField: '20110130-004154'
};
webappMappings['7008']=webappMappings['7008-8870']={
webappId:    '7008',
documentId:  '1374',
internalId:  '8870',
customField: 'language:en;country:US;'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INX2WK';
var companyName   = 'The+Domain+of+Phil+Parkinson';
var htmlTitle	  = 'Phil+Parkinson+Presents%3A+The+Domain+of+Phil+Parkinson';
var metaKeywords  = 'philip+parkinson%2C+philip+parkinson+canada%2C+philip+parkinson+tax+accountant%2C+philip+parkinson+accountant%2C+philip+parkinson+chartered+accountant%2C+income+tax+professional%2C+parkinson+genealogy%2C+phillys+two+cents%2C+philip+parkinson+MBA%2C+philip+parkinson+ontario%2C+philip+parkinson+london%2C+parkinson+family%2C+philip+parkinson+tax%2C+philip+parkinson+domain%2C+the+domain+of+philip+parkinson%2C+philip+parkinson+tax+specialist%2C+philip+parkinson+CA%2C+philip+parkinson+linkedin%2C+philparkinson.ca%2C+philip+parkinson+facebook%2C+philparkinson.com%2C+philip+parkinson+twitter%2C+philip+parkinson+CPA';
var metaContents  = 'philparkinson.com+and+philparkinson.ca+are+the+domains+of+Phil+Parkinson+from+Ontario%2C+Canada.+The+domain+provides+information+about+Phil+Parkinson+and+the+things+that+relate+to+Phil+Parkinson+and+Phil+Parkinson%27s+life.';
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();
};

