/* [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','3101',jdecode('Inicio'),jdecode(''), jdecode('%2F3101.html'), 'true',[],'',''],
	['PAGE','3152',jdecode('TRAYECTORIA'),jdecode(''), jdecode('%2F3152.html'), 'true',[],'',''],
	['PAGE','3422',jdecode('NOSOTROS'),jdecode(''), jdecode('%2F3422.html'), 'true',[],'',''],
	['PAGE','4001',jdecode('PRENSA+'),jdecode(''), jdecode('%2F4001.html'), 'true',[],'',''],
	['PAGE','3173',jdecode('ESCUELA++BNS'),jdecode(''), jdecode('%2F3173.html'), 'true',[],'',''],
	['PAGE','3236',jdecode('IM%C3%81GENES'),jdecode(''), jdecode('%2F3236.html'), 'true',[],'',''],
	['PAGE','3801',jdecode('CONTACTO'),jdecode(''), jdecode('%2F3801.html'), 'true',[],'',''],
	['PAGE','3215',jdecode('LINKS'),jdecode(''), jdecode('%2F3215.html'), 'true',[],'',''],
	['PAGE','24923',jdecode('GRACIAS+'),jdecode(''), jdecode('%2F24923.html'), 'true',[],'',''],
	['PAGE','3194',jdecode('ENGLISH'),jdecode(''), jdecode('%2F3194.html'), 'false',[],'',''],
	['PAGE','94134',jdecode('Javier'),jdecode(''), jdecode('%2F94134.html'), 'false',[],'',''],
	['PAGE','96434',jdecode('anahi'),jdecode(''), jdecode('%2F96434.html'), 'false',[],'',''],
	['PAGE','97834',jdecode('alexis'),jdecode(''), jdecode('%2F97834.html'), 'false',[],'',''],
	['PAGE','98634',jdecode('Fer'),jdecode(''), jdecode('%2F98634.html'), 'false',[],'',''],
	['PAGE','99634',jdecode('adriana'),jdecode(''), jdecode('%2F99634.html'), 'false',[],'',''],
	['PAGE','112256',jdecode('alejandrina'),jdecode(''), jdecode('%2F112256.html'), 'false',[],'',''],
	['PAGE','115156',jdecode('Ana+Ale'),jdecode(''), jdecode('%2F115156.html'), 'false',[],'',''],
	['PAGE','130010',jdecode('alejandra+'),jdecode(''), jdecode('%2F130010.html'), 'false',[],'',''],
	['PAGE','131589',jdecode('NOVEDADES'),jdecode(''), jdecode('%2F131589.html'), 'true',[],'',''],
	['PAGE','132789',jdecode('Kevin'),jdecode(''), jdecode('%2F132789.html'), 'false',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Welcome';
theSitetree.paletteFamily='990000';
theSitetree.keyvisualId='9178';
theSitetree.keyvisualName='kv_9178.jpg';
theSitetree.fontsetId='10785';
theSitetree.graphicsetId='10524';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='AC0A16';
var localeDef={
  language: 'es',
  country: 'ES'
};
var prodDef={
  wl_name: 'grp13-hostin',
  product: 'WSCSYSSSSLY0XJEZ'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Welcome',
				paletteFamily: 	'990000',
				keyvisualId: 	'9178',
				keyvisualName: 	'kv_9178.jpg',
				fontsetId: 		'10785',
				graphicsetId: 	'10524',
				contentColor: 	'FFFFFF',
				contentBGColor: 'AC0A16',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D6AAAA',
				e_color: 		'DC6C70',
				f_color: 		'68070E',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-e48e1c1abd917917092899ed9fb6067b']={
webappId:    '7060',
documentId:  '3236',
internalId:  'e48e1c1abd917917092899ed9fb6067b',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20120115-160158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99634',
internalId:  '',
customField: '20110920-182627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3152',
internalId:  '',
customField: '20120124-104302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3422',
internalId:  '',
customField: '20111125-164723'
};
webappMappings['7008']=webappMappings['7008-8568']={
webappId:    '7008',
documentId:  '3801',
internalId:  '8568',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3173',
internalId:  '',
customField: '20110923-151002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3215',
internalId:  '',
customField: '20110929-162456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20110331-222308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3194',
internalId:  '',
customField: '20110712-162710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3236',
internalId:  '',
customField: '20101230-222140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3801',
internalId:  '',
customField: '20110923-153326'
};
webappMappings['7008']=webappMappings['7008-13870']={
webappId:    '7008',
documentId:  '3194',
internalId:  '13870',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96434',
internalId:  '',
customField: '20120115-152026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97834',
internalId:  '',
customField: '20110527-112411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98634',
internalId:  '',
customField: '20110527-151854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24923',
internalId:  '',
customField: '20110923-153509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '130010',
internalId:  '',
customField: '20110920-184710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '131589',
internalId:  '',
customField: '20120115-154806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '132789',
internalId:  '',
customField: '20110920-174106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94134',
internalId:  '',
customField: '20120115-204639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112256',
internalId:  '',
customField: '20110920-184031'
};
webappMappings['1501']=webappMappings['1501-14021301']={
webappId:    '1501',
documentId:  '3101',
internalId:  '14021301',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115156',
internalId:  '',
customField: '20110524-151219'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN3KPH';
var companyName   = 'BALLET+DEL+NUEVO+SIGLO+';
var htmlTitle	  = 'BALLET+DEL+NUEVO+SIGLO';
var metaKeywords  = 'DANZA%2C+BALLET%2CESCUELA+DE+BALLET%2CCOMPA%C3%91%C3%8DA+DE+BALLET';
var metaContents  = 'BALLET+DEL+NUEVO+SIGLO%2C+DANZA.';
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();
};

