/* [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','4201',jdecode('Home'),jdecode(''),'/4201.html','true',[],''],
	['PAGE','43834',jdecode('About+Us'),jdecode(''),'/43834.html','true',[],''],
	['PAGE','4294',jdecode('Performance+Gallery'),jdecode(''),'/4294.html','true',[],''],
	['PAGE','4273',jdecode('Photo+Gallery'),jdecode(''),'/4273.html','true',[],''],
	['PAGE','4315',jdecode('News'),jdecode(''),'/4315.html','true',[],''],
	['PAGE','81634',jdecode('Parties%2FEvents'),jdecode(''),'/81634/index.html','true',[ 
		['PAGE','72134',jdecode('Childrens+Parties%2FEvents'),jdecode(''),'/81634/72134.html','true',[],''],
		['PAGE','81534',jdecode('Bachelorette%2FWedding+Events'),jdecode(''),'/81634/81534.html','true',[],'']
	],''],
	['PAGE','4701',jdecode('Contact+Us'),jdecode(''),'/4701.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Multimedia';
theSitetree.paletteFamily='3D464F';
theSitetree.keyvisualId='11111';
theSitetree.keyvisualName='kv_11111.jpg';
theSitetree.fontsetId='32007';
theSitetree.graphicsetId='13835';
theSitetree.contentColor='000F1F';
theSitetree.contentBGColor='3D464F';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Multimedia',
				paletteFamily: 	'3D464F',
				keyvisualId: 	'11111',
				keyvisualName: 	'kv_11111.jpg',
				fontsetId: 		'32007',
				graphicsetId: 	'13835',
				contentColor: 	'000F1F',
				contentBGColor: '3D464F',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4201',
internalId:  '',
customField: '20100411-105332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81634',
internalId:  '',
customField: '20100616-184638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4273',
internalId:  '',
customField: '20100502-101204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4294',
internalId:  '',
customField: '20100425-180550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20100616-184653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4315',
internalId:  '',
customField: '20100718-104430'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72134',
internalId:  '',
customField: '20100411-122049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81534',
internalId:  '',
customField: '20100411-122540'
};
webappMappings['7008']=webappMappings['7008-7415']={
webappId:    '7008',
documentId:  '4701',
internalId:  '7415',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43834',
internalId:  '',
customField: '20091221-114458'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN2H51';
var companyName   = 'Hip+Hop+Dance+Company';
var htmlTitle	  = 'Diva+le+Dance';
var metaKeywords  = 'Diva+le+Dance%2C+Hip+Hop%2C+Hip+Hop+Dance+Company%2C+Dance%2C+Dancers%2C+Dancing%2C+Performances%2C+Dyanna+Daniels%2C+Adrian+Faulkner%2C+Natalie+Gilberto%2C+Itzel+Carranza%2C+Aubrie+Nelson%2C+Megan+Vodrazka%2C+Kirsten+Goranson';
var metaContents  = 'Diva+le+Dance+has+been+around+since+2004+and+has+shifted+its+focus+to+the+Hip+Hop+aspect+of+the+company.+We+perform+to+various+Hip+Hop+artists+and+always+put+our+own+creative+twist+on+all+of+our+choreography.+If+you+want+a+hot+new+take+on+Hip+Hop%2C+Diva+le+Dance+is+what+you+are+looking+for%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();
};
