/* [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','3301',jdecode('Home'),jdecode(''), jdecode('%2F3301.html'), 'true',[],'',''],
	['PAGE','5001',jdecode('why+Write+Now+is+unique'),jdecode(''), jdecode('%2F5001%2Findex.html'), 'true',[ 
		['PAGE','5501',jdecode('maek+mstakes'),jdecode(''), jdecode('%2F5001%2F5501.html'), 'true',[],'',''],
		['PAGE','5522',jdecode('writing+exercises'),jdecode(''), jdecode('%2F5001%2F5522.html'), 'true',[],'','']
	],'',''],
	['PAGE','3701',jdecode('where+and+how+to+begin%3F'),jdecode(''), jdecode('%2F3701%2Findex.html'), 'true',[ 
		['PAGE','6101',jdecode('classes+and+workshops'),jdecode(''), jdecode('%2F3701%2F6101.html'), 'true',[],'',''],
		['PAGE','6122',jdecode('individual+work'),jdecode(''), jdecode('%2F3701%2F6122.html'), 'true',[],'','']
	],'',''],
	['PAGE','6143',jdecode('what+people+are+saying'),jdecode(''), jdecode('%2F6143.html'), 'true',[],'',''],
	['PAGE','9701',jdecode('currently+being+offered'),jdecode(''), jdecode('%2F9701.html'), 'true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Snapshot';
theSitetree.paletteFamily='67845B';
theSitetree.keyvisualId='3620';
theSitetree.keyvisualName='kv_3620.jpg';
theSitetree.fontsetId='10458';
theSitetree.graphicsetId='10877';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='67845B';
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: 			'Snapshot',
				paletteFamily: 	'67845B',
				keyvisualId: 	'3620',
				keyvisualName: 	'kv_3620.jpg',
				fontsetId: 		'10458',
				graphicsetId: 	'10877',
				contentColor: 	'FFFFFF',
				contentBGColor: '67845B',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FC5E7B',
				e_color: 		'BFBFBF',
				f_color: 		'050001',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3301',
internalId:  '',
customField: '20111011-124120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20111011-124209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20111006-112530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5522',
internalId:  '',
customField: '20111006-112611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3701',
internalId:  '',
customField: '20111011-123527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6143',
internalId:  '',
customField: '20111006-114828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6101',
internalId:  '',
customField: '20111006-113834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6122',
internalId:  '',
customField: '20111006-113710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9701',
internalId:  '',
customField: '20111118-073312'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INPLDE';
var companyName   = 'Write+Now';
var htmlTitle	  = '';
var metaKeywords  = 'creative+writing%2C+editing%2C+developmental+editing%2C+writing+coach%2C+writing%2C+flash+fiction%2C+memoir%2C+autobiography%2C+screenplay%2C+sudden+fiction%2C+poetry%2C+paragraph%2C+writing+workshops%2C+writing+class%2C+writing+instruction%2C+library%2C+book+group%2C+creative+arts%2C+Ellen+Szabo%2C+Harvard+graduate%2C+Columbia+graduate%2C+grant+writer%2C+editor%2C+writer%2C+getting+published%2C+short+story%2C+novel%0AMassachusetts%2C+New+Hampshire%2C+North+Shore%2C+Newburyport%2C+Newbury%2C+West+Newbury%2C+Amesbury%2C+Merrimac%2C+Groveland%2C+Georgetown%2C+Ipswich%2C+Boxford%2C+Hamilton%2C+Byfield%2C+Topsfield%2C+Andover%2C+North+Andover%2C+Salem%2C+Atkinson%2C+Plaistow%2C+Hampstead%2C++Newton%2C+South+Hampton%2C+North+Hampton%2C+Exeter%2C+Boston%2C+Malden%2C+South+End%2C+North+End%2C+Charlestown%2C+Beacon+Hill%2C+Seabrook%2C+Salisbury%2C+Rowley%2C+Ipswich%2C+Essex%2C+Gloucester%2C+Rockport%2C+Manchester%2C++Manchester-by-the-Sea%2C+Beverly%2C+Danvers%2C+Peabody%2C+Marblehead%2C+Salem%2C+Lynn%2C+Swampscott%2C+Winchester%2C+Burlington%2C+Reading%2C+North+Reading%2C+Arlington%2C+Chelmsford%2C+Lexington%2C+Bedford%2C+Lincoln%2C+Concord%2C+Westford%2C+Wenham%2C%0A';
var metaContents  = 'The+founding+principle+of+Write+Now+is+that+creative+expression+is+best+facilitated+in+a+safe+and+compassionate+environment.++Workshops%2C+seminars%2C+lectures+%2C+developmental+editing+and+coaching+sessions+are+designed+to+enhance+creativity+and+provide+insights+and+information+in+a+supportive+atmosphere+that+encourages+creative+expression.+';
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();
};

