/* [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','201',jdecode('Our+Journey+to+You'),jdecode(''),'/201.html','true',[],''],
	['PAGE','7501',jdecode('About+Me'),jdecode(''),'/7501.html','true',[],''],
	['PAGE','7522',jdecode('Created+Just+For+You'),jdecode(''),'/7522.html','true',[],''],
	['PAGE','7543',jdecode('Fast+Turnaround%21'),jdecode(''),'/7543.html','true',[],''],
	['PAGE','7564',jdecode('Adoption+Portfolios'),jdecode(''),'/7564.html','true',[],''],
	['PAGE','7585',jdecode('Birthmother+Letters'),jdecode(''),'/7585.html','true',[],''],
	['PAGE','7606',jdecode('Pricing'),jdecode(''),'/7606.html','true',[],''],
	['PAGE','11933',jdecode('Where+to+begin'),jdecode(''),'/11933.html','true',[],''],
	['PAGE','11912',jdecode('Contact+Me...'),jdecode(''),'/11912.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Porthole';
theSitetree.paletteFamily='A68025';
theSitetree.keyvisualId='6704';
theSitetree.keyvisualName='kv_6704.jpg';
theSitetree.fontsetId='11201';
theSitetree.graphicsetId='12016';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FBF7E7';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Porthole',
				paletteFamily: 	'A68025',
				keyvisualId: 	'6704',
				keyvisualName: 	'kv_6704.jpg',
				fontsetId: 		'11201',
				graphicsetId: 	'12016',
				contentColor: 	'000000',
				contentBGColor: 'FBF7E7',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '201',
internalId:  '',
customField: '20100206-075342'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7564',
internalId:  '',
customField: '20091102-134417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20100206-075715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7522',
internalId:  '',
customField: '20090124-092506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7543',
internalId:  '',
customField: '20091102-134220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7585',
internalId:  '',
customField: '20090807-124608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7606',
internalId:  '',
customField: '20100206-080459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11912',
internalId:  '',
customField: '20090807-125143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11933',
internalId:  '',
customField: '20100206-080736'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN2KHL';
var companyName   = 'Our+Journey+to+You';
var htmlTitle	  = 'Our+Journey+To+You%7ECustom+Birthmother+Letters%2C+Adoption+Profiles++%26+Adoption+Portfolios';
var metaKeywords  = 'Birthmother+letters%2C+Birthparent+Letters%2C+Adoption+Portfolios%2C+Adoption+Profiles%2C+Adoptive+Parents%2C+Birthmother+letter+help%2C+Birthparent+Letter+help%2C+Adoption+Portfolio+help%2C+Adoption+Profile+help%2CBirthmother+letter+creation%2C+Birthparent+Letter+creation%2C+Adoption+Portfolio+creation%2C+Adoption+Profile+creation%2C+How+to+write+a+Birthmother+Letter%2C+Writing+a+Birthmother+letter%2C+trying+to+adopt%2C+Adoption+Services%2C+Adoption+Resources%2C+Life+Books%2C+Adoption+Gifts%2C+E-mail+Adoption+Announcements%2CBirthmother+letter+services%2C+Birthparent+Letter+Services%2C+Adoption+Portfolio+services%2C+Adoption+Profile+services%2C+Writing+a+Dear+Birthmother+Letter%2C+Letter+to+the+Birthmother%2C+Writing+an+Adoption+Profile%2C+Birthmother+Letter+samples%2C+Birthparent+letter+samples%2C+adoption+letter+samples%2C+adoption+profile+samples%2C+adoption+portfolio+samples%2C+adoption+resources%2C+adoption+portfolio+resources%2C+adoption+profile+resources%2C+Birthmother+Letter+writing+resources%2C+great+birthmother+letters%2C+our+journey+to+you%2C+starting+an+adoption+profile%2C+starting+an+adoption+portfolio%2C+adoption+profiles+that+work%2C+great+adoption+profiles%2C+letter+to+a+birthmother%2C+Birthmother+letter+design%2C+Adoption+portfolio+design%2C+adoption+profile+design%2C+adoption+picture+profiles%2C+adoption+picture+portfolios%2C+adoption+portfolio%2C+Birthmother+letter+writing%2C+how+to+start+an+adoption+profile%2Chow+to+create+an+adoption+profile%2Chow+to+start+an+adoption+portfolio%2Chow+to+create+an+adoption+portfolio%2Chow+to+start+a+Dear+Birthmother+Letter%2C+how+to+create+a+Dear+Birthmother+Letter%2Chow+to+write+a+Dear+Birthmother+Letter%2Cmarketing+to+a+birthmother%2C+thank+you+letter+to+a+birthmother%2C+birthparents+letters%2C+birthparent+profiles%2C+adoptive+couple+profiles%2C+adoptive+family+profiles%2C+adoption+help%2C+birthmother+letter+help%2C+adoption+profile+help%2C+adoption+portfolio+help%2C+best+adoption+letter%2C+we+are+adopting%2C+what+to+do+when+you+are+adopting';
var metaContents  = 'Custom+Adoption+Portfolio+creation%2C+Adoption+Profile+creation%2C++Birthmother+Letter+Services...Let+me+help+you+create+a+Birthmother+letter+or++Adoption+portfolio+or+Adoption+Profile+that+reflects+you+in+your+truest%2C+best+light.++The+first+impression...A+first+step+to+the+dream+of+a+child...Let+us+help+to+tell+your+story%21++If+you+are+worried+you+do+not+have+to+time+or+the+knack+to+create+your+own%2C+let+an+adoptee+and+mother+of+3+adopted+children+help+you%21';
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();
};
