/* [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','4455',jdecode('Home'),jdecode(''),'/4455.html','true',[],'',''],
	['PAGE','4512',jdecode('Catalogo+productos'),jdecode(''),'/4512/index.html','true',[ 
		['PAGE','4539',jdecode('Monos+de+1+pieza+Racing+'),jdecode(''),'/4512/4539.html','true',[],'',''],
		['PAGE','4566',jdecode('Monos+de+2+piezas+Sport'),jdecode(''),'/4512/4566.html','true',[],'',''],
		['PAGE','46938',jdecode('Mujeres+-+Monos+%26+Chaquetas'),jdecode(''),'/4512/46938.html','true',[],'',''],
		['PAGE','4647',jdecode('Tallas+y+dise%C3%B1os+a+medida'),jdecode(''),'/4512/4647.html','true',[],'',''],
		['PAGE','4593',jdecode('Chaquetas+%26+pantalones'),jdecode(''),'/4512/4593.html','true',[],'',''],
		['PAGE','4620',jdecode('Guantes+piel'),jdecode(''),'/4512/4620.html','true',[],'',''],
		['PAGE','12004',jdecode('Beisboleras+replica++F1+%28follow+up+page%29'),jdecode(''),'/4512/12004.html','false',[],'','']
	],'',''],
	['PAGE','50938',jdecode('Lista+de+precios+2010'),jdecode(''),'/50938.html','true',[],'',''],
	['PAGE','4674',jdecode('Ofertas-promoci%C3%B3n'),jdecode(''),'/4674.html','true',[],'',''],
	['PAGE','4701',jdecode('Pedidos+On-line'),jdecode(''),'/4701/index.html','true',[ 
		['PAGE','11342',jdecode('Pedidos+On-line+%28follow+up+page%29'),jdecode(''),'/4701/11342.html','false',[],'',''],
		['PAGE','5385',jdecode('Pedidos+On-line+%28follow+up+page%29'),jdecode(''),'/4701/5385.html','false',[],'','']
	],'',''],
	['PAGE','4728',jdecode('%C2%BFQu%C3%A9+talla+tengo%3F'),jdecode(''),'/4728/index.html','true',[ 
		['PAGE','9651',jdecode('Que+talla+tengo%3F+%28follow+up+page%29'),jdecode(''),'/4728/9651.html','false',[],'','']
	],'',''],
	['PAGE','4755',jdecode('Cont%C3%A1ctenos'),jdecode(''),'/4755.html','true',[],'',''],
	['PAGE','4782',jdecode('Novedades+SPBSpain'),jdecode(''),'/4782.html','true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='9C42BD';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10897';
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: 			'Alpha',
				paletteFamily: 	'9C42BD',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10897',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'9C42BD',
				e_color: 		'9C42BD',
				f_color: 		'9C42BD',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-3130597']={
webappId:    '1501',
documentId:  '4455',
internalId:  '3130597',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4455',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-6511']={
webappId:    '7008',
documentId:  '4728',
internalId:  '6511',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4455',
internalId:  '',
customField: '20100619-012128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4674',
internalId:  '',
customField: '20100619-013727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4512',
internalId:  '',
customField: '20100308-131313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4539',
internalId:  '',
customField: '20100519-231051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4566',
internalId:  '',
customField: '20100412-233841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4593',
internalId:  '',
customField: '20090827-211615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4620',
internalId:  '',
customField: '20100218-182339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4647',
internalId:  '',
customField: '20100507-234225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20090301-102853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11342',
internalId:  '',
customField: '20061222-225136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5385',
internalId:  '',
customField: '20061201-010236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4728',
internalId:  '',
customField: '20100303-235415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9651',
internalId:  '',
customField: '20061202-005347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4755',
internalId:  '',
customField: '20070322-132334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4782',
internalId:  '',
customField: '20100218-182718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12004',
internalId:  '',
customField: '20061231-164347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46938',
internalId:  '',
customField: '20100406-010711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50938',
internalId:  '',
customField: '20100404-233436'
};
webappMappings['7008']=webappMappings['7008-6509']={
webappId:    '7008',
documentId:  '4701',
internalId:  '6509',
customField: 'language:es;country:ES;'
};
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'Aas010INE22R';
var companyName   = '';
var htmlTitle	  = 'MONOS+DE+CUERO+SPBSPAIN';
var metaKeywords  = 'monos+de+piel++mono+de+piel++mono+de+cuero+guantes+de+piel++ropa+moto++accesorios+piloto++monos+racing++chaquetas+de+piel++equipamiento+motociclismo++motociclismo++monos+de+cuero++monos+de+moto++chaquetas+de+cuero++chaquetas+de+piel++cazadoras+de+piel++chaquetas+de+piel++piel+para+la+moto++Mono+para+moto++mono+de+moto+monos+de+chica+monos+de+mujer+guantes+moto+pantalones+de+piel+moto';
var metaContents  = 'monos+de+piel+spbspain+prendas+de+piel+para+motoristas+accesorios+de+piel+para+piloto.+monos+de+cuero+de+alta+calidad.+Monos+de+moto';
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();
};
