/* [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','401',jdecode('Home'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','452',jdecode('Couples'),jdecode(''), jdecode('%2F452.html'), 'true',[],'',''],
	['PAGE','473',jdecode('Families+and+Children'),jdecode(''), jdecode('%2F473.html'), 'true',[],'',''],
	['PAGE','2512',jdecode('Your+Ceremony'),jdecode(''), jdecode('%2F2512.html'), 'true',[],'',''],
	['PAGE','2533',jdecode('Reader%26%23x27%3Bs+Nook'),jdecode(''), jdecode('%2F2533.html'), 'true',[],'',''],
	['PAGE','2554',jdecode('Resources'),jdecode(''), jdecode('%2F2554.html'), 'true',[],'',''],
	['PAGE','494',jdecode('About+Celebrants'),jdecode(''), jdecode('%2F494.html'), 'true',[],'',''],
	['PAGE','43412',jdecode('Reviews+of+My+Services+'),jdecode(''), jdecode('%2F43412.html'), 'true',[],'',''],
	['PAGE','536',jdecode('Contact+Roberta'),jdecode(''), jdecode('%2F536.html'), 'true',[],'',''],
	['PAGE','557',jdecode('About+Roberta'),jdecode(''), jdecode('%2F557.html'), 'true',[],'',''],
	['PAGE','49612',jdecode('Driving+directions'),jdecode(''), jdecode('%2F49612.html'), 'true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Meadow';
theSitetree.paletteFamily='0000AA';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10703';
theSitetree.graphicsetId='10948';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='DAC8B9';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp19-dulles',
  product: 'WSCSYSSSSLYTCPI5'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Meadow',
				paletteFamily: 	'0000AA',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10703',
				graphicsetId: 	'10948',
				contentColor: 	'000000',
				contentBGColor: 'DAC8B9',
				a_color: 		'9D7250',
				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:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20120118-143649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43412',
internalId:  '',
customField: '20120118-143828'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '49612',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20110903-084213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20111025-133150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2512',
internalId:  '',
customField: '20110903-075753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2533',
internalId:  '',
customField: '20111214-135304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2554',
internalId:  '',
customField: '20110903-080144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20111025-180735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20110903-105013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20110903-082510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49612',
internalId:  '',
customField: '20081130-143257'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN3YRA';
var companyName   = 'SteppingStoneCeremonies.com';
var htmlTitle	  = 'Personalized+Wedding+and+Commitment+Ceremonies+';
var metaKeywords  = 'personalized+wedding+and+commitment+ceremonies%2C+New+York+officiant%2C+New+York+City+marriage+officiants%2C+New+York+City+interfaith+ministers%2C+wedding+officiants%2C+interfaith+ministers%2C++secular+weddings%2C+celebrants%2C+small+weddings%2C+wedding+ceremonies%2C+commitment+ceremonies%2C+civil+unions%2C+adoptions%2C+Roberta+Koepfer+';
var metaContents  = 'As+a+certified+celebrant%2C+my+expertise+lies+in+designing+and+performing+personalized+ceremonies+that+commemorate+life%E2%80%99s+milestones%3A+weddings%2C+commitment+ceremonies%2C+civil+unions+and+other+events%2C+both+joyous+and+somber.++I+honor+all+philosophies+and+religions%2C+beliefs+and+traditions%2C+whether+secular%2C+religious%2C+spiritual+or+interfaith.+';
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();
};

