/* [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(''),'/501.html','true',[],'',''],
	['PAGE','552',jdecode('Caballos'),jdecode(''),'/552.html','true',[],'',''],
	['PAGE','84923',jdecode('Yeguadas%2C+cuadras%2C+h%C3%ADpicas'),jdecode(''),'/84923.html','true',[],'',''],
	['PAGE','32222',jdecode('Carruajes%2C+van...'),jdecode(''),'/32222.html','true',[],'',''],
	['PAGE','91223',jdecode('Hipoterapia%2C+excursiones...'),jdecode(''),'/91223.html','true',[],'',''],
	['PAGE','68612',jdecode('Ayuda+Online'),jdecode(''),'/68612.html','true',[],'',''],
	['PAGE','79912',jdecode('Obtener+presupuesto'),jdecode(''),'/79912.html','true',[],'',''],
	['PAGE','32264',jdecode('Empresas+colaboradoras'),jdecode(''),'/32264.html','true',[],'',''],
	['PAGE','90023',jdecode('Noticias+y+articulos'),jdecode(''),'/90023.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='NewYork';
theSitetree.paletteFamily='FFCC33';
theSitetree.keyvisualId='923';
theSitetree.keyvisualName='agentur.jpg';
theSitetree.fontsetId='166';
theSitetree.graphicsetId='199';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'NewYork',
				paletteFamily: 	'FFCC33',
				keyvisualId: 	'923',
				keyvisualName: 	'agentur.jpg',
				fontsetId: 		'166',
				graphicsetId: 	'199',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000066',
				b_color: 		'FFCC33',
				c_color: 		'000000',
				d_color: 		'406BC0',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100609-151659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20100904-153152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79912',
internalId:  '',
customField: '20100331-233136'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68612',
internalId:  '',
customField: '20100221-223104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32222',
internalId:  '',
customField: '20100427-152552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90023',
internalId:  '',
customField: '20100711-003940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32264',
internalId:  '',
customField: '20100715-102115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91223',
internalId:  '',
customField: '20100906-133819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84923',
internalId:  '',
customField: '20100510-145232'
};
webappMappings['7008']=webappMappings['7008-9206']={
webappId:    '7008',
documentId:  '84923',
internalId:  '9206',
customField: 'language:es;country:ES;'
};
webappMappings['7008']=webappMappings['7008-10570']={
webappId:    '7008',
documentId:  '91223',
internalId:  '10570',
customField: 'language:es;country:ES;'
};
webappMappings['7008']=webappMappings['7008-8534']={
webappId:    '7008',
documentId:  '79912',
internalId:  '8534',
customField: 'language:es;country:ES;'
};
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20INVBRS';
var companyName   = 'SEGUROSEQUITACION.COM';
var htmlTitle	  = '';
var metaKeywords  = 'Seguros+para+caballos%2Cseguiros+para+caballos+en+valencia%2C+seguros+para+caballos+en+Castellon%2C+seguros+para+caballos+en+Alicante%2C+seguros+para+caballos+en+Barcelona%2C+seuros+para+caballos+en+Sevilla%2C+seguros+para+caballos+en+Madrid%2C+seguros+para+caballos+en+Espa%C3%B1a%2C+seguro+para+caballo%2C+seguros+caballos%2C+asegura+tu+caballo%2C+seguro+de+caballos%2C+seguros+para+caballos+LLOYD%C2%B4S%2C+asegura+tu+caballo%2C+h%C3%ADpica%2C+caballos%2C+yeguadas%2C+semental%2C+salto%2C+doma%2C+equitacion%2C+ecuestre%2C+yegua%2C+potro%2C+polo%2C+carreras%2C+club%2C+enganche%2C+riendas%2C+rejoneo%2C+pura+raza+espa%C3%B1ola%2C+lusitano%2C+soto+grande%2C+sicab%2C+gescab%2C+fiecval%2C+salon+del+caballo%2C+horse%2C+dresage';
var metaContents  = 'Los+seguros+para+caballos+mas+completos+y+al+mejor+precio+del+mercado.%0D%0ASeguros+a+todo+riesgo+para+caballos%2C+seguros+para+el+transporte+nacional+e+internacional+de+caballos%2C+seguros+para+la+gestaci%C3%B3n+de+yeguas%2C+seguros+de+perdida+de+uso+de+caballos+de+deporte...%0D%0AAtenci%C3%B3n+personalizada+24h';
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();
};
