/* [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','1801',jdecode('Home'),jdecode(''), jdecode('%2F1801.html'), 'true',[],'',''],
	['PAGE','2643',jdecode('Current+Show'),jdecode(''), jdecode('%2F2643.html'), 'true',[],'',''],
	['PAGE','2601',jdecode('About+Us'),jdecode(''), jdecode('%2F2601%2Findex.html'), 'true',[ 
		['PAGE','42701',jdecode('2012+Commitee'),jdecode(''), jdecode('%2F2601%2F42701.html'), 'true',[],'',''],
		['PAGE','9801',jdecode('2011+Commitee'),jdecode(''), jdecode('%2F2601%2F9801.html'), 'true',[],'',''],
		['PAGE','2685',jdecode('Hall+of+Fame'),jdecode(''), jdecode('%2F2601%2F2685.html'), 'true',[],'','']
	],'',''],
	['PAGE','2622',jdecode('Past+Productions'),jdecode(''), jdecode('%2F2622%2Findex.html'), 'true',[ 
		['PAGE','41501',jdecode('Mary+Poppins'),jdecode(''), jdecode('%2F2622%2F41501.html'), 'true',[],'',''],
		['PAGE','41401',jdecode('No+Room+For+Love'),jdecode(''), jdecode('%2F2622%2F41401.html'), 'true',[],'','']
	],'',''],
	['PAGE','20001',jdecode('Gallery'),jdecode(''), jdecode('%2F20001%2Findex.html'), 'true',[ 
		['PAGE','20022',jdecode('Mary+Poppins'),jdecode(''), jdecode('%2F20001%2F20022.html'), 'true',[],'',''],
		['PAGE','29201',jdecode('More+Mary+Poppins...'),jdecode(''), jdecode('%2F20001%2F29201.html'), 'true',[],'',''],
		['PAGE','4701',jdecode('No+Room+For+Love'),jdecode(''), jdecode('%2F20001%2F4701.html'), 'true',[],'','']
	],'',''],
	['PAGE','8201',jdecode('Guest+Book'),jdecode(''), jdecode('%2F8201.html'), 'true',[],'',''],
	['PAGE','2664',jdecode('Contact+Us'),jdecode(''), jdecode('%2F2664.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Plainly';
theSitetree.paletteFamily='ABC600';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32125';
theSitetree.graphicsetId='13925';
theSitetree.contentColor='6e6e6d';
theSitetree.contentBGColor='fbfae8';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hetzner',
  product: 'WSCSYSSSSLY0XKDS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Plainly',
				paletteFamily: 	'ABC600',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32125',
				graphicsetId: 	'13925',
				contentColor: 	'6e6e6d',
				contentBGColor: 'fbfae8',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20120126-084106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8201',
internalId:  '',
customField: '20110407-094042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20110405-134719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2622',
internalId:  '',
customField: '20120104-100703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2643',
internalId:  '',
customField: '20120121-095743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2685',
internalId:  '',
customField: '20110405-143726'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-c911c813affaf6e1fb431a53098d227c']={
webappId:    '7060',
documentId:  '4701',
internalId:  'c911c813affaf6e1fb431a53098d227c',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20110405-164431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2664',
internalId:  '',
customField: '20120117-084556'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '41401',
internalId:  '-',
customField: '20120104-100348'
};
webappMappings['1002']=webappMappings['1002-8201ahtz10in2r4w']={
webappId:    '1002',
documentId:  '8201',
internalId:  '8201ahtz10in2r4w',
customField: 'icq=false'
};
webappMappings['1501']=webappMappings['1501-12120519']={
webappId:    '1501',
documentId:  '1801',
internalId:  '12120519',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9801',
internalId:  '',
customField: '20120121-095855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20022',
internalId:  '',
customField: '20110801-182545'
};
webappMappings['7060']=webappMappings['7060-21c61ff8806c7142581df25717ae33a0']={
webappId:    '7060',
documentId:  '20022',
internalId:  '21c61ff8806c7142581df25717ae33a0',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20001',
internalId:  '',
customField: '20120121-100201'
};
webappMappings['7060']=webappMappings['7060-421a978f8f06e0bda660c3cf601c2369']={
webappId:    '7060',
documentId:  '29201',
internalId:  '421a978f8f06e0bda660c3cf601c2369',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '29201',
internalId:  '-',
customField: '20111222-073334'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '41501',
internalId:  '-',
customField: '20120104-100458'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '42701',
internalId:  '-',
customField: '20120126-091024'
};
var webAppHostname = 'sitebuilder.host-h.net:80';
var canonHostname = 'sitebuilder1.jnb2.host-h.net';
var accountId     = 'AHTZ10IN2R4W';
var companyName   = 'Protea+Stage+Productions';
var htmlTitle	  = 'Protea+Stage+Productions+-+Bringing+theatre+back+into+the+community+of+Benoni%21';
var metaKeywords  = 'Community+Theatre%0D%0ACommunity+Theatre+Benoni%0D%0AProtea%0D%0AStage%0D%0AProductions%0D%0AActing%0D%0ATheatre%0D%0ABenoni';
var metaContents  = 'Protea+Stage+Productions+-+Bringing+theatre+back+into+the+community+of+Benoni%21+Watch+out+for+auditions+for+our+next+show%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();
};

