/* [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','2001',jdecode('Home'),jdecode(''),'/2001.html','true',[],''],
	['PAGE','8401',jdecode('Photographs'),jdecode(''),'/8401.html','true',[],''],
	['PAGE','62901',jdecode('Short+Films'),jdecode(''),'/62901.html','true',[],''],
	['PAGE','111070',jdecode('Haiti'),jdecode(''),'/111070.html','true',[],''],
	['PAGE','102333',jdecode('Activism'),jdecode(''),'/102333.html','true',[],''],
	['PAGE','101233',jdecode('Short+Films+for+Children'),jdecode(''),'/101233.html','true',[],''],
	['PAGE','107475',jdecode('Meditation+Films'),jdecode(''),'/107475.html','true',[],''],
	['PAGE','8422',jdecode('Video'),jdecode(''),'/8422.html','true',[],''],
	['PAGE','8485',jdecode('Music'),jdecode(''),'/8485.html','true',[],''],
	['PAGE','8443',jdecode('Sculpture'),jdecode(''),'/8443.html','true',[],''],
	['PAGE','8464',jdecode('Paintings'),jdecode(''),'/8464.html','true',[],''],
	['PAGE','8506',jdecode('Links+%26+Other'),jdecode(''),'/8506.html','true',[],''],
	['PAGE','32501',jdecode('Contact%2FBuy'),jdecode(''),'/32501.html','true',[],''],
	['PAGE','47601',jdecode('Comments'),jdecode(''),'/47601.html','true',[],''],
	['PAGE','66134',jdecode('Cemeteries'),jdecode(''),'/66134.html','false',[],''],
	['PAGE','78056',jdecode('Himba+African+Tribe'),jdecode(''),'/78056.html','false',[],''],
	['PAGE','81976',jdecode('Portraits+and+People'),jdecode(''),'/81976.html','false',[],''],
	['PAGE','118426',jdecode('Note+from+the+March+2010+Haiti+Trip'),jdecode(''),'/118426.html','false',[],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20100221-190232'
};
webappMappings['1002']=webappMappings['1002-47601aendu0in3ued']={
webappId:    '1002',
documentId:  '47601',
internalId:  '47601aendu0in3ued',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8422',
internalId:  '',
customField: '20100601-203112'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8401',
internalId:  '',
customField: '20100307-232928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8443',
internalId:  '',
customField: '20100717-172441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8485',
internalId:  '',
customField: '20100117-195527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8464',
internalId:  '',
customField: '20100402-153859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8506',
internalId:  '',
customField: '20091015-212842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32501',
internalId:  '',
customField: '20090710-231133'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47601',
internalId:  '',
customField: '20090711-002737'
};
webappMappings['7060']=webappMappings['7060-6dd6e1b9b6553d06bbd4caaa83b78b71']={
webappId:    '7060',
documentId:  '66134',
internalId:  '6dd6e1b9b6553d06bbd4caaa83b78b71',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62901',
internalId:  '',
customField: '20100425-175737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66134',
internalId:  '',
customField: '20091018-000510'
};
webappMappings['7060']=webappMappings['7060-68932c9d117b1fb24c7ef6c87be96f99']={
webappId:    '7060',
documentId:  '78056',
internalId:  '68932c9d117b1fb24c7ef6c87be96f99',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78056',
internalId:  '',
customField: '20091108-223157'
};
webappMappings['7060']=webappMappings['7060-c5cd989c5bd92d0aefc80d325be55fce']={
webappId:    '7060',
documentId:  '81976',
internalId:  'c5cd989c5bd92d0aefc80d325be55fce',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81976',
internalId:  '',
customField: '20091108-194145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107475',
internalId:  '',
customField: '20100120-170752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101233',
internalId:  '',
customField: '20100512-163107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102333',
internalId:  '',
customField: '20100401-232340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111070',
internalId:  '',
customField: '20100406-133247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118426',
internalId:  '',
customField: '20100302-221648'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN3UED';
var companyName   = 'Gino+Salerno';
var htmlTitle	  = 'Gino+Salerno';
var metaKeywords  = 'Gino+Salerno%2C+Kansas%2C+Wichita%2C+wood+sculptor%2C+art%2C+artist%2C+fine+art%2C+sculpture%2C+chain+saw+sculpture%2C+wood+carvings%2C+carving%2C+statue%2C+wood+statue%2C+music%2C+video%2C+film%2C+finewoodsculpture%2C+Martina+Salerno%2C+homeless%2C+documentary%2C+addressless%2C+John+Matthews%2C+Marsha+Salerno%2C+world+music%2C+equinox%2C+mandolin+music%2C+guitar+music%2C+Trevor+Steward%2C+Terry+Corbett%2C+Haiti%2C+medical+missions+to+Haiti';
var metaContents  = 'Gino+is+a+multimedia+artist.+He+has+completed+many+features+films%2C+documentaries%2C+and+short+films+as+well+as+paintings%2C+photography+and+writing+and+performing+music.++Many+people+remember+Gino+for+making+the+chainsaw+or+tree+sculptures+in+Wichita%2C+KANSAS%2C++parks.++He+has+sculpted+over+a+thousand+statues.+';
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();
};
