/* [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','4598',jdecode('Home'),jdecode(''),'/4598.html','true',[],'',''],
	['PAGE','21949',jdecode('El+Instituto+del+Salterio'),jdecode(''),'/21949.html','true',[],'',''],
	['PAGE','5605',jdecode('Costrucci%C3%B3n+de+Salterios'),jdecode(''),'/5605.html','true',[],'',''],
	['PAGE','5632',jdecode('Grupos+M%C3%BAsicales+y+CDs'),jdecode(''),'/5632.html','true',[],'',''],
	['PAGE','5926',jdecode('Recital'),jdecode(''),'/5926.html','true',[],'',''],
	['PAGE','4763',jdecode('Contacto+y+Repertorio'),jdecode(''),'/4763.html','true',[],'',''],
	['PAGE','6762',jdecode('Orquesta+Tipica+de+la+Cd+Mexico'),jdecode(''),'/6762.html','true',[],'',''],
	['PAGE','22019',jdecode('Otros+Grupos+Musicales'),jdecode(''),'/22019.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Business';
theSitetree.paletteFamily='662A00';
theSitetree.keyvisualId='2487';
theSitetree.keyvisualName='seminar.jpg';
theSitetree.fontsetId='418';
theSitetree.graphicsetId='465';
theSitetree.contentColor='020E66';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Business',
				paletteFamily: 	'662A00',
				keyvisualId: 	'2487',
				keyvisualName: 	'seminar.jpg',
				fontsetId: 		'418',
				graphicsetId: 	'465',
				contentColor: 	'020E66',
				contentBGColor: 'FFFFFF',
				a_color: 		'662A00',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4598',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-72413']={
webappId:    '1501',
documentId:  '4598',
internalId:  '72413',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20080514-083757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6762',
internalId:  '',
customField: '20090908-100815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21949',
internalId:  '',
customField: '20080303-174745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5605',
internalId:  '',
customField: '20080214-092212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5632',
internalId:  '',
customField: '20080508-075123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5926',
internalId:  '',
customField: '20091001-090912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4763',
internalId:  '',
customField: '20080403-105016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22019',
internalId:  '',
customField: '20080404-110732'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INXXIH';
var companyName   = 'MIGUEL+PACHECO';
var htmlTitle	  = 'Miguel+Pacheco+y+su+Salterio';
var metaKeywords  = 'miguel%2C+pacheco%2C+salterio%2C+orquesta%2C+m%C3%BAsica%2C+t%C3%ADpica%2Cmusic%2Cmexican%2Cmariachi%2Cfree%2Cgratis%2Cdescargas%2Ceventos%2Ccontrataciones%2Corquesta%2Crevolucion%2Cvalses%2Crecital%2Cmexicanos%2Cfabricacion%2Csalterios%2Cdulcimer%2Chackbrett%2Ccimbalom%2Cgrupo%2Ctipico%2Ctipica%2Cfiestas%2Creuniones%2Cgrabaciones%2Cdiscos%2Cpartituras%2Carreglos%2Cmusicales%2Cproducciones';
var metaContents  = 'miguel+pacheco+salterista+mexicano+para+toda+clase+de+eventos+%2855%29+56-10-69-09+';
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();
};
