/* [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','501',jdecode('INICIO'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','5301',jdecode('CONTACTO'),jdecode(''), jdecode('%2F5301.html'), 'true',[],'',''],
	['PAGE','180101',jdecode('Act.+Sindical'),jdecode(''), jdecode('%2F180101.html'), 'true',[],'',''],
	['PAGE','5322',jdecode('NOTICIAS'),jdecode(''), jdecode('%2F5322.html'), 'true',[],'',''],
	['PAGE','28201',jdecode('LICENCIAS'),jdecode(''), jdecode('%2F28201.html'), 'true',[],'',''],
	['PAGE','26201',jdecode('LEGISLACION'),jdecode(''), jdecode('%2F26201.html'), 'true',[],'',''],
	['PAGE','232001',jdecode('ESTATUTOS'),jdecode(''), jdecode('%2F232001.html'), 'true',[],'',''],
	['PAGE','292523',jdecode('Ries.+Laborales'),jdecode(''), jdecode('%2F292523.html'), 'true',[],'',''],
	['PAGE','6401',jdecode('PUEBLOS'),jdecode(''), jdecode('%2F6401.html'), 'true',[],'',''],
	['PAGE','7201',jdecode('FORMACION'),jdecode(''), jdecode('%2F7201.html'), 'true',[],'',''],
	['PAGE','218901',jdecode('Serv.+Juridicos'),jdecode(''), jdecode('%2F218901.html'), 'true',[],'',''],
	['PAGE','106701',jdecode('TELEFONOS+'),jdecode(''), jdecode('%2F106701.html'), 'true',[],'',''],
	['PAGE','171401',jdecode('PRENSA'),jdecode(''), jdecode('%2F171401.html'), 'true',[],'',''],
	['PAGE','232401',jdecode('TERRORISMO'),jdecode(''), jdecode('%2F232401.html'), 'true',[],'',''],
	['PAGE','240401',jdecode('Material+Policial'),jdecode(''), jdecode('%2F240401.html'), 'true',[],'',''],
	['PAGE','7701',jdecode('ACUERDOS'),jdecode(''), jdecode('%2F7701.html'), 'true',[],'',''],
	['PAGE','241601',jdecode('TRANSPORTES+'),jdecode(''), jdecode('%2F241601.html'), 'true',[],'',''],
	['PAGE','225001',jdecode('HOSPITALES+'),jdecode(''), jdecode('%2F225001.html'), 'true',[],'',''],
	['PAGE','175101',jdecode('Banca+Electronica'),jdecode(''), jdecode('%2F175101.html'), 'true',[],'',''],
	['PAGE','235101',jdecode('CINES'),jdecode(''), jdecode('%2F235101.html'), 'true',[],'',''],
	['PAGE','214301',jdecode('RADIO'),jdecode(''), jdecode('%2F214301.html'), 'true',[],'',''],
	['PAGE','16822',jdecode('AVENTURA'),jdecode(''), jdecode('%2F16822.html'), 'true',[],'',''],
	['PAGE','178801',jdecode('GALERIA+FOTOS'),jdecode(''), jdecode('%2F178801%2Findex.html'), 'true',[ 
		['PAGE','178822',jdecode('Policiales'),jdecode(''), jdecode('%2F178801%2F178822.html'), 'true',[],'',''],
		['PAGE','178843',jdecode('Edificios'),jdecode(''), jdecode('%2F178801%2F178843.html'), 'true',[],'','']
	],'',''],
	['PAGE','37901',jdecode('INSTALACIONES'),jdecode(''), jdecode('%2F37901.html'), 'true',[],'',''],
	['PAGE','148001',jdecode('SORTEOS'),jdecode(''), jdecode('%2F148001.html'), 'true',[],'',''],
	['PAGE','46401',jdecode('+ALCAZABA'),jdecode(''), jdecode('%2F46401.html'), 'true',[],'',''],
	['PAGE','21506',jdecode('+SUGERENCIAS'),jdecode(''), jdecode('%2F21506%2Findex.html'), 'true',[ 
		['PAGE','21501',jdecode('Ver+libro'),jdecode(''), jdecode('%2F21506%2F21501.html'), 'false',[],'','']
	],'',''],
	['PAGE','268823',jdecode('Donde+Estamos'),jdecode(''), jdecode('%2F268823.html'), 'true',[],'','']];
var siteelementCount=31;
theSitetree.topTemplateName='Jakarta';
theSitetree.paletteFamily='6176B2';
theSitetree.keyvisualId='7885';
theSitetree.keyvisualName='kv_7885.jpg';
theSitetree.fontsetId='16854';
theSitetree.graphicsetId='12296';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='ABBBE8';
var localeDef={
  language: 'es',
  country: 'ES'
};
var prodDef={
  wl_name: 'arsys',
  product: 'WSCSYSSSSLYTC2IR'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'true',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Jakarta',
				paletteFamily: 	'6176B2',
				keyvisualId: 	'7885',
				keyvisualName: 	'kv_7885.jpg',
				fontsetId: 		'16854',
				graphicsetId: 	'12296',
				contentColor: 	'000000',
				contentBGColor: 'ABBBE8',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'6176B2',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20110624-103032'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20080514-120519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5322',
internalId:  '',
customField: '20090926-093934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20090520-164605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20091215-175737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7201',
internalId:  '',
customField: '20080514-120757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '178801',
internalId:  '',
customField: '20080610-094249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '171401',
internalId:  '',
customField: '20080511-182459'
};
webappMappings['1002']=webappMappings['1002-21506aars20in3xvp']={
webappId:    '1002',
documentId:  '21506',
internalId:  '21506aars20in3xvp',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106701',
internalId:  '',
customField: '20080504-191417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21506',
internalId:  '',
customField: '20080514-121428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16822',
internalId:  '',
customField: '20080514-121142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26201',
internalId:  '',
customField: '20080626-122910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28201',
internalId:  '',
customField: '20090520-120713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21501',
internalId:  '',
customField: '20080425-205403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '268823',
internalId:  '',
customField: '20080801-140323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '292523',
internalId:  '',
customField: '20081116-105559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37901',
internalId:  '',
customField: '20080514-121236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46401',
internalId:  '',
customField: '20080511-175920'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '268823',
internalId:  'routing',
customField: 'es_ES'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148001',
internalId:  '',
customField: '20080521-174038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '175101',
internalId:  '',
customField: '20080506-114216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '178822',
internalId:  '',
customField: '20080531-175904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '178843',
internalId:  '',
customField: '20080506-175950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '180101',
internalId:  '',
customField: '20100228-093832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '214301',
internalId:  '',
customField: '20080516-114329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '218901',
internalId:  '',
customField: '20080520-114043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '225001',
internalId:  '',
customField: '20080526-230809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '232001',
internalId:  '',
customField: '20080531-103439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '232401',
internalId:  '',
customField: '20080531-140223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '235101',
internalId:  '',
customField: '20080531-182447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '240401',
internalId:  '',
customField: '20080608-114042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '241601',
internalId:  '',
customField: '20080608-110356'
};
var webAppHostname = 'wsc.webaporter.com:80';
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20IN3XVP';
var companyName   = 'S.I.P.L.G';
var htmlTitle	  = 'Sindicato+Independiente+de+Policia+Local+de+Granada';
var metaKeywords  = 'siplg+sindicato+independiente+policia+local+granada+';
var metaContents  = 'Sindicato+independiente+de+policia+local+de+granada';
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();
};

