/* [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','2201',jdecode('INICIO'),jdecode(''),'/2201.html','true',[],'',''],
	['PAGE','34601',jdecode('BODAS'),jdecode(''),'/34601.html','true',[],'',''],
	['PAGE','34622',jdecode('KARAOKE'),jdecode(''),'/34622.html','true',[],'',''],
	['PAGE','2401',jdecode('ARMA+TU+EVENTO'),jdecode(''),'/2401/index.html','true',[ 
		['PAGE','9101',jdecode('SERVICIOS'),jdecode(''),'/2401/9101.html','true',[],'',''],
		['PAGE','2422',jdecode('PAQUETES'),jdecode(''),'/2401/2422.html','true',[],'','']
	],'',''],
	['PAGE','2443',jdecode('GALERIA'),jdecode(''),'/2443.html','true',[],'',''],
	['PAGE','2464',jdecode('CONTACTOS'),jdecode(''),'/2464.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Elegant';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32899';
theSitetree.graphicsetId='13971';
theSitetree.contentColor='cab397';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Elegant',
				paletteFamily: 	'000000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32899',
				graphicsetId: 	'13971',
				contentColor: 	'cab397',
				contentBGColor: '000000',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20100716-185114'
};
webappMappings['7060']=webappMappings['7060-7200faccf6660b92a969590f1c00160e']={
webappId:    '7060',
documentId:  '2443',
internalId:  '7200faccf6660b92a969590f1c00160e',
customField: 'language:es;country:ES;'
};
webappMappings['7008']=webappMappings['7008-10379']={
webappId:    '7008',
documentId:  '2464',
internalId:  '10379',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20100715-141645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2422',
internalId:  '',
customField: '20100115-145350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2464',
internalId:  '',
customField: '20100124-135907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2443',
internalId:  '',
customField: '20100125-232313'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9101',
internalId:  '',
customField: '20100125-231631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34601',
internalId:  '',
customField: '20100719-103454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34622',
internalId:  '',
customField: '20100719-103144'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHSOB';
var companyName   = 'PAAX+PRODUCCIONES';
var htmlTitle	  = 'PAAX+PRODUCCIONES';
var metaKeywords  = 'fiesta%2C+eventos%2C+renta%2C+montaje%2C+audio%2C+video%2C+iluminaci%C3%B3n%2C+pantallas+plasma%2C+pisos+iluminados%2C+suvenirs%2C+cumplea%C3%B1os%2C+bodas%2C+bautizos%2C+conferencias%2C+graduaciones%2C+quince+a%C3%B1os%2C+xv+a%C3%B1os%2C+eventos+empresariales%2C+fiestas+fin+de+a%C3%B1o%2C+grupos+musicales%2C+luz+y+sonido%2C+luz%2C+sonido%2C+vj%C2%B4s%2C+dj%C2%B4s%2C+paax%2C+producciones%2C+musica%2C+music%2C+sillas%2C+mesas%2C+carpas%2C+salas%2C+lounge%2Crenta+audio%2C+renta+sonido%2C+renta+de+audio%2C+renta+de+sonido';
var metaContents  = 'Empresa+dedicada+al+montaje+y+renta+de+equpos+profesionales+de+video%2C+audio%2C+iluminaci%C3%B3n%2C+pantallas+de+plasma%2C+suvenirs%2C+para+cualquier+tipo+de+eventos.';
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();
};
