/* [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('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','11001',jdecode('Historia+'),jdecode(''),'/11001.html','true',[],'',''],
	['PAGE','11801',jdecode('Radio+Online'),jdecode(''),'/11801.html','true',[],'',''],
	['PAGE','11822',jdecode('Tv+online'),jdecode(''),'/11822.html','true',[],'',''],
	['PAGE','11843',jdecode('Prog+Grabados'),jdecode(''),'/11843.html','true',[],'',''],
	['PAGE','11885',jdecode('Enlaces'),jdecode(''),'/11885.html','true',[],'',''],
	['PAGE','11927',jdecode('Cont%C3%A1ctenos'),jdecode(''),'/11927/index.html','true',[ 
		['PAGE','14201',jdecode('Cont%C3%A1ctenos+%28follow+up+page%29'),jdecode(''),'/11927/14201.html','false',[],'','']
	],'',''],
	['PAGE','29701',jdecode('Rock'),jdecode(''),'/29701.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Family';
theSitetree.paletteFamily='CBCCCD';
theSitetree.keyvisualId='3821';
theSitetree.keyvisualName='kv_3821.jpg';
theSitetree.fontsetId='10635';
theSitetree.graphicsetId='11024';
theSitetree.contentColor='4F4F4F';
theSitetree.contentBGColor='CBCCCD';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Family',
				paletteFamily: 	'CBCCCD',
				keyvisualId: 	'3821',
				keyvisualName: 	'kv_3821.jpg',
				fontsetId: 		'10635',
				graphicsetId: 	'11024',
				contentColor: 	'4F4F4F',
				contentBGColor: 'CBCCCD',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'AEAEAF',
				e_color: 		'AEAEAF',
				f_color: 		'AEAEAF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100721-144905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11001',
internalId:  '',
customField: '20100421-230244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11927',
internalId:  '',
customField: '20081129-113557'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '11001',
internalId:  '',
customField: 'language:es;country:ES;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '401',
internalId:  '',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11801',
internalId:  '',
customField: '20100102-185118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11822',
internalId:  '',
customField: '20100106-224505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11843',
internalId:  '',
customField: '20081128-183602'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '11801',
internalId:  '',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11885',
internalId:  '',
customField: '20100227-224816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20081126-145508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29701',
internalId:  '',
customField: '20100710-144402'
};
webappMappings['7008']=webappMappings['7008-7740']={
webappId:    '7008',
documentId:  '11927',
internalId:  '7740',
customField: 'language:es;country:ES;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '11843',
internalId:  '',
customField: 'language:es;country:ES;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '11822',
internalId:  '',
customField: 'language:es;country:ES;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '11885',
internalId:  '',
customField: 'language:es;country:ES;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '11927',
internalId:  '',
customField: 'language:es;country:ES;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '14201',
internalId:  '',
customField: 'language:es;country:ES;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '29701',
internalId:  '',
customField: 'language:es;country:ES;'
};
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20IN3LUJ';
var companyName   = 'RtvTanos+105.3+FM';
var htmlTitle	  = 'RtvTanos.es+105.3+FM+%C2%A1%C2%A1%C2%A1TU+SINTONIA+LIBRE%2C+TU+SINTONIA+ALTERNATIVA%21%21%21+%C2%A1%C2%A1%C2%A110+A%C3%91OS+JUNTOS%21%21%21';
var metaKeywords  = 'Cantabria%2CTanos%2CTorrelavega%2CRtvTanos%2CTvTanos%2CRldt%2C+Radio+Local+de+Tanos%2C+Alvaro+Saenz+Garcia%2C+Eolapaz%2C+Corocotta+Tv%2C+Torrelavega%2C+Medios+de+Comunicacion+de+Cantabria%2Csintonias+libres%2C+radios+libres%2C+radios+sin+animo+de+lucro%2C+radios+alternativas%2C+saenzgrupo%2C+tropezon%2C+pe%C3%B1atropezon%2C+rebujasrock';
var metaContents  = 'Pagina+Web++de+RtvTanos+105.3+FM+';
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();
};
