/* [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','401',jdecode('Inicio'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','4843',jdecode('Discom%C3%B3vil'),jdecode(''), jdecode('%2F4843.html'), 'true',[],'',''],
	['PAGE','13822',jdecode('Proyecciones'),jdecode(''), jdecode('%2F13822.html'), 'true',[],'',''],
	['PAGE','13843',jdecode('En+construccion'),jdecode(''), jdecode('%2F13843.html'), 'true',[],'',''],
	['PAGE','71301',jdecode('Eventos+Empresa'),jdecode(''), jdecode('%2F71301.html'), 'true',[],'',''],
	['PAGE','9301',jdecode('Contacto'),jdecode(''), jdecode('%2F9301%2Findex.html'), 'true',[ 
		['PAGE','41501',jdecode('Contacte+%28follow+up+page%29'),jdecode(''), jdecode('%2F9301%2F41501.html'), 'true',[],'','']
	],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Art';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='1812';
theSitetree.keyvisualName='unterhaltungselektronik.jpg';
theSitetree.fontsetId='283';
theSitetree.graphicsetId='350';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'es',
  country: 'ES'
};
var prodDef={
  wl_name: 'arsys',
  product: 'WSCSYSSSSLYTC2IK'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Art',
				paletteFamily: 	'000000',
				keyvisualId: 	'1812',
				keyvisualName: 	'unterhaltungselektronik.jpg',
				fontsetId: 		'283',
				graphicsetId: 	'350',
				contentColor: 	'DDDDDD',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4843',
internalId:  '',
customField: 'language:es;country:ES;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '401',
internalId:  '',
customField: 'language:es;country:ES;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20110915-140635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4843',
internalId:  '',
customField: '20110915-140941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13843',
internalId:  '',
customField: '20101028-150213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13822',
internalId:  '',
customField: '20110915-141122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20101112-161711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41501',
internalId:  '',
customField: '20071004-172041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71301',
internalId:  '',
customField: '20111007-102811'
};
webappMappings['7008']=webappMappings['7008-7156']={
webappId:    '7008',
documentId:  '9301',
internalId:  '7156',
customField: 'language:es;country:ES;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '13822',
internalId:  '',
customField: 'language:es;country:ES;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '13843',
internalId:  '',
customField: 'language:es;country:ES;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '71301',
internalId:  '',
customField: 'language:es;country:ES;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '9301',
internalId:  '',
customField: 'language:es;country:ES;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '41501',
internalId:  '',
customField: 'language:es;country:ES;'
};
var webAppHostname = 'wsc.webaporter.com:80';
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20IN34AF';
var companyName   = 'PLAT%C3%93MUSIC+Produccions++';
var htmlTitle	  = 'Discomovil+para+Bodas+Fiestas+Particulares+DJ%C2%B4S+Sonido+Iluminaci%C3%B3n+Audiovisuales+DISCOMOBIL+BCN+DISCOMOVILES';
var metaKeywords  = 'Discom%C3%B3vil%2C+Discoteca+m%C3%B3vil+%2C+Disco+m%C3%B2bil%2C+Karaoke+%2CBoda%2C+Bodas%2C+Banquetes%2C+Banquete+%2Cdj%2C+discjokey%2C+deejay+%2Cservicios+musicales+%2CFiestas%2C+Fiesta+privada+%2CAnimaci%C3%B3n+%2C+Animaci%C3%B3n+infantil+%2C+M%C3%BAsica+%2CM%C3%BAsicos+%2C+sonido+%2C+Inauguraciones+%2C+Empresa+%2C+Ferias%2CSONORIZACIONES+.+SONORITZACIONS';
var metaContents  = 'Discomovil+para+fiestas+bodas+y+cumplea%C3%B1os.+iluminaci%C3%B3n+para+todo+tipo+de+fiestas+.+Empresa+de+sonido+y+iluminaci%C3%B3n+profesional';
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();
};

