/* [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','23601',jdecode('Home'),jdecode(''),'/23601.html','true',[],''],
	['PAGE','76901',jdecode('About'),jdecode(''),'/76901.html','true',[],''],
	['PAGE','76401',jdecode('Services'),jdecode(''),'/76401/index.html','true',[ 
		['PAGE','76422',jdecode('Editing'),jdecode(''),'/76401/76422.html','true',[],''],
		['PAGE','76464',jdecode('Consulting%2FWriting'),jdecode(''),'/76401/76464.html','true',[],''],
		['PAGE','76485',jdecode('Other+Services'),jdecode(''),'/76401/76485.html','true',[],'']
	],''],
	['PAGE','76506',jdecode('Happy+Clients'),jdecode(''),'/76506.html','true',[],''],
	['PAGE','76527',jdecode('Contact'),jdecode(''),'/76527.html','true',[],'']];
var siteelementCount=8;
theSitetree.topTemplateName='Longsights';
theSitetree.paletteFamily='FBBB6D';
theSitetree.keyvisualId='6400';
theSitetree.keyvisualName='kv_6400.jpg';
theSitetree.fontsetId='11157';
theSitetree.graphicsetId='11967';
theSitetree.contentColor='4C1B00';
theSitetree.contentBGColor='FCD5A6';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Longsights',
				paletteFamily: 	'FBBB6D',
				keyvisualId: 	'6400',
				keyvisualName: 	'kv_6400.jpg',
				fontsetId: 		'11157',
				graphicsetId: 	'11967',
				contentColor: 	'4C1B00',
				contentBGColor: 'FCD5A6',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23601',
internalId:  '',
customField: '20090913-162152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76401',
internalId:  '',
customField: '20090903-173456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76422',
internalId:  '',
customField: '20090912-115257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76901',
internalId:  '',
customField: '20100205-132509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76506',
internalId:  '',
customField: '20100205-134210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76464',
internalId:  '',
customField: '20090912-120518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76485',
internalId:  '',
customField: '20090912-120748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76527',
internalId:  '',
customField: '20100205-133210'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN2WS6';
var companyName   = 'Irwin+Editing+and+Consulting+Services';
var htmlTitle	  = 'Elizabeth+Irwin+Editing+Writing+Consulting%2C+NW+Ohio';
var metaKeywords  = 'communications%2C+writing%2C+editing%2C+proofreading%2C+marketing%2C+publicity%2C+media%2C+manuscripts%2C+authors%2C+fiction%2C+non-fiction%2C+articles%2C+brochures%2C+scripts%2C+radio%2C+television%2C+narration%2C+voiceover%2C+web%2C+consulting%2C+northwest%2C+Ohio%2C+southeast%2C+Michigan%2C+research%2C+history%2C+news%2C+release%2C+ghostwriting%2C+opinion%2C+novels%2C+fantasy%2C+mystery%2C+science%2C+thriller%2C+romance%2C+memoir%2C+journalism';
var metaContents  = 'Irwin+Editing%2C+Writing+and+Consulting+Services+provides+friendly%2C+professional+service+to+meet+the+literary+and+communications+needs+of+individuals+and+businesses.++Elizabeth+Irwin+offers+20+years+of+writing%2C+editing%2C+proofreading%2C+voicing+and+research+experience+to+a+range+of+clients+from+independent+authors+to+home-based+entrepreneurs+to+small+business+owners.';
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();
};
