/* [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','901',jdecode('Home'),jdecode(''),'/901.html','true',[],'',''],
	['PAGE','5101',jdecode('About+us'),jdecode(''),'/5101/index.html','true',[ 
		['PAGE','5122',jdecode('Our+Team'),jdecode(''),'/5101/5122.html','true',[],'',''],
		['PAGE','5143',jdecode('Dance+Recitals'),jdecode(''),'/5101/5143.html','true',[],'','']
	],'',''],
	['PAGE','5164',jdecode('Classes'),jdecode(''),'/5164.html','true',[],'',''],
	['PAGE','5206',jdecode('Dance+Camps'),jdecode(''),'/5206.html','true',[],'',''],
	['PAGE','5227',jdecode('2010-2011+Fall+Schedule+'),jdecode(''),'/5227.html','true',[],'',''],
	['PAGE','5248',jdecode('Calendar'),jdecode(''),'/5248.html','true',[],'',''],
	['PAGE','5269',jdecode('Links'),jdecode(''),'/5269.html','true',[],'',''],
	['PAGE','5290',jdecode('NEEMA+News'),jdecode(''),'/5290.html','true',[],'',''],
	['PAGE','5311',jdecode('Registration'),jdecode(''),'/5311.html','true',[],'',''],
	['PAGE','5332',jdecode('Studio+Space'),jdecode(''),'/5332.html','true',[],'',''],
	['PAGE','5353',jdecode('Contact'),jdecode(''),'/5353/index.html','true',[ 
		['PAGE','19301',jdecode('Contact+%28follow+up+page%29'),jdecode(''),'/5353/19301.html','false',[],'',''],
		['PAGE','5374',jdecode('Addresses'),jdecode(''),'/5353/5374.html','true',[],'',''],
		['PAGE','5395',jdecode('How+to+find+us'),jdecode(''),'/5353/5395.html','true',[],'',''],
		['PAGE','31201',jdecode('Adresses'),jdecode(''),'/5353/31201.html','true',[],'','']
	],'',''],
	['PAGE','5416',jdecode('Jobs'),jdecode(''),'/5416.html','true',[],'',''],
	['PAGE','20606',jdecode('Guestbook'),jdecode(''),'/20606/index.html','true',[ 
		['PAGE','20601',jdecode('Read+Guestbook'),jdecode(''),'/20606/20601.html','false',[],'','']
	],'',''],
	['PAGE','27901',jdecode('NEEMA+faces'),jdecode(''),'/27901.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Bow';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='12028';
theSitetree.keyvisualName='kv_12028.jpg';
theSitetree.fontsetId='33246';
theSitetree.graphicsetId='14117';
theSitetree.contentColor='333333';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Bow',
				paletteFamily: 	'000000',
				keyvisualId: 	'12028',
				keyvisualName: 	'kv_12028.jpg',
				fontsetId: 		'33246',
				graphicsetId: 	'14117',
				contentColor: 	'333333',
				contentBGColor: 'FFFFFF',
				a_color: 		'F2F5F8',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-11566483']={
webappId:    '1501',
documentId:  '901',
internalId:  '11566483',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-20606aen010inv99d']={
webappId:    '1002',
documentId:  '20606',
internalId:  '20606aen010inv99d',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '901',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-8f0c399c4f145a519173441d33ed765f']={
webappId:    '7060',
documentId:  '27901',
internalId:  '8f0c399c4f145a519173441d33ed765f',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20100112-144640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20100112-142525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5122',
internalId:  '',
customField: '20100607-054138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5143',
internalId:  '',
customField: '20100112-143843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5164',
internalId:  '',
customField: '20100112-143711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5206',
internalId:  '',
customField: '20100114-070350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5227',
internalId:  '',
customField: '20100802-101331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5248',
internalId:  '',
customField: '20091229-093238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5269',
internalId:  '',
customField: '20080102-201118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5290',
internalId:  '',
customField: '20090810-043602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5311',
internalId:  '',
customField: '20080101-125709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5332',
internalId:  '',
customField: '20080101-130046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5353',
internalId:  '',
customField: '20080101-131958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19301',
internalId:  '',
customField: '20080101-130334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5374',
internalId:  '',
customField: '20080101-132846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5395',
internalId:  '',
customField: '20080101-133036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31201',
internalId:  '',
customField: '20080722-101822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5416',
internalId:  '',
customField: '20080102-201657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20606',
internalId:  '',
customField: '20080101-134255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20601',
internalId:  '',
customField: '20080101-134255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27901',
internalId:  '',
customField: '20080408-130603'
};
webappMappings['7008']=webappMappings['7008-1338']={
webappId:    '7008',
documentId:  '5353',
internalId:  '1338',
customField: 'language:en;country:US;'
};
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN010INV99D';
var companyName   = 'NEEMA+International+Performing+Arts';
var htmlTitle	  = 'NEEMA';
var metaKeywords  = '';
var metaContents  = '';
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();
};
