/* [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','4901',jdecode('Home'),jdecode(''), jdecode('%2F4901.html'), 'true',[],'',''],
	['PAGE','4973',jdecode('Contact'),jdecode(''), jdecode('%2F4973.html'), 'true',[],'',''],
	['PAGE','10001',jdecode('About+Me'),jdecode(''), jdecode('%2F10001.html'), 'true',[],'',''],
	['PAGE','12701',jdecode('Portfolio'),jdecode(''), jdecode('%2F12701%2Findex.html'), 'true',[ 
		['PAGE','12722',jdecode('The+Library'),jdecode(''), jdecode('%2F12701%2F12722.html'), 'true',[],'',''],
		['PAGE','12901',jdecode('Clips'),jdecode(''), jdecode('%2F12701%2F12901.html'), 'true',[],'',''],
		['PAGE','15001',jdecode('Art+Links'),jdecode(''), jdecode('%2F12701%2F15001.html'), 'true',[],'','']
	],'',''],
	['ITEM','17101',jdecode('Living+with+Enough'),jdecode(''), jdecode('http%3A%2F%2Flivingwithenough.blogspot.com%2F'), 'true',[],'','_blank'],
	['ITEM','18101',jdecode('1340+'),jdecode(''), jdecode('http%3A%2F%2Fwww.amazon.com%2F1340-Considerations-lifes-Connie-Schlosberg%2Fdp%2F1441489940'), 'true',[],'','_blank']];
var siteelementCount=9;
theSitetree.topTemplateName='Caribic';
theSitetree.paletteFamily='7050FA';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10419';
theSitetree.graphicsetId='10707';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='B63636';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRNC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Caribic',
				paletteFamily: 	'7050FA',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10419',
				graphicsetId: 	'10707',
				contentColor: 	'DDDDDD',
				contentBGColor: 'B63636',
				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:  '4901',
internalId:  '',
customField: '20110903-213855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12701',
internalId:  '',
customField: '20110920-115819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12722',
internalId:  '',
customField: '20091129-172527'
};
webappMappings['7008']=webappMappings['7008-16898']={
webappId:    '7008',
documentId:  '4973',
internalId:  '16898',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4973',
internalId:  '',
customField: '20090729-211502'
};
webappMappings['1501']=webappMappings['1501-17848034']={
webappId:    '1501',
documentId:  '4901',
internalId:  '17848034',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10001',
internalId:  '',
customField: '20110904-124332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12901',
internalId:  '',
customField: '20090828-191102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15001',
internalId:  '',
customField: '20110904-124552'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN3GSY';
var companyName   = 'Connie+J.+Schlosberg';
var htmlTitle	  = 'The+Official+Website+of+Connie+Schlosberg';
var metaKeywords  = 'Connie+Schlosberg%2C+Connie+J+Schlosberg%2C+Connie+Musorofiti%2C+Writer%2C+Artist%2C+Journalist%2C+Photographer%2C+Photo-Journalist%2C+Editor%2C+Proofreader%2C+Author%2C+Ethnographer%2C+Creative+Non-Fiction+Writer%2C+Copywriter%2C+Technical+Writer%2C+Writer+for+Hire%2C+Freelance+Writer%2C+Novelist%2C+Poet%2C+Write%2C+Books%2C+Poetry%2C+Journalism%2C+Creative+Nonfiction%2C+Article+Writer%2C+Ethnography%2C+Copy+Writing%2C+Business+Writing%2C+Editing%2C+Proofreading%2C+Photography%2C+Art%2C+Article+Writing%2C+Ghostwriting%2C+Magazine+Writing%2C+Magazine+Writer%2C+Magazine+Editor%2C+Book+Editor%2C+Book+Editing%2C+Business+Writer%2C+Government+Writer%2C+Government+Writing%2C+Federal+Contracting+Writer%2C+Federal+Contracting+Writing';
var metaContents  = 'Welcome+to+Writer+and+Artist+Connie+Schlosberg%27s+website.++Please+come+in.';
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();
};

