/* [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','9101',jdecode('%C2%BFQuienes+somos%3F'),jdecode(''), jdecode('%2F9101.html'), 'true',[],'',''],
	['PAGE','9222',jdecode('CEBOS+y+VARIOS'),jdecode(''), jdecode('%2F9222.html'), 'true',[],'',''],
	['PAGE','9243',jdecode('Nuestros+Servicios'),jdecode(''), jdecode('%2F9243.html'), 'true',[],'',''],
	['PAGE','9264',jdecode('D%C3%B3nde+encontrarnos'),jdecode(''), jdecode('%2F9264.html'), 'true',[],'',''],
	['PAGE','23301',jdecode('NUESTROS+PESCADORES'),jdecode(''), jdecode('%2F23301.html'), 'true',[],'','']];
var siteelementCount=5;
theSitetree.topTemplateName='NewYork';
theSitetree.paletteFamily='86862D';
theSitetree.keyvisualId='952';
theSitetree.keyvisualName='fisch.jpg';
theSitetree.fontsetId='166';
theSitetree.graphicsetId='196';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var prodDef={
  wl_name: 'piensa',
  product: 'WSCSYSSSSLYTC2IO'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'NewYork',
				paletteFamily: 	'86862D',
				keyvisualId: 	'952',
				keyvisualName: 	'fisch.jpg',
				fontsetId: 		'166',
				graphicsetId: 	'196',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'86862D',
				c_color: 		'000000',
				d_color: 		'2C331B',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9101',
internalId:  '',
customField: '20120212-190021'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '9101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23301',
internalId:  '',
customField: '20110301-194457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9222',
internalId:  '',
customField: '20110710-155934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9243',
internalId:  '',
customField: '20110225-121756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9264',
internalId:  '',
customField: '20110219-235956'
};
var webAppHostname = 'wsc.webaporter.com:80';
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AAS340INZI3S';
var companyName   = 'Todo+para+la+Pesca+Deportiva';
var htmlTitle	  = 'MEGAMAR+-+Todo+para+la+Pesca+Deportiva';
var metaKeywords  = 'busco+llubarreros%2C+busco+tita+francesa%2C+cebos+baratos%2C+cebos+economicos%2C+grauvell%2C+titas+de+palangre+en+barcelona%2C+titas+de+palangre+mollet%2C+titas+de+palangre+supercoup%2C+coreano+barato+economico%2C+coreano+1%2C79%E2%82%AC%2C+daiwa%2C+shimano%2C+asticot%2C+blog+de+juanito%2C+juan+gil+rosas%2C+megamar%2C+outlet+pesca%2C+jurelasjig.es%2C+nylon%2C+zona+del+valles%2C+comercios+valles%2C+guia+valles%2C+pesca+en+el+valles%2C+granollers%2C+zona+de+pesca%2C+calendario+lunar%2C+lombriz+de+tierra%2C+gusano+de+miel%2C+tienda+de+pesca+online%2C+montmelo%2C+terrassa%2C+parets%2C+la+llagosta%2C+santa+perpetua%2C+puerto+deportivo+de+premia%2C+las+garc%C3%ADas%2C+pau+garcia%2C+carles+garcia%2C+el+buzo%2C+jose+casta%C3%B1o%2C+toni+flores%2C+agujas%2C+toni+barrerra%2C+hilo+de+licra%2C+black-bass%2C+palomet%C3%B3n%2C+domi%2C+representate+daiwa%2C+sirulo%2C+juan+gil%2C+ca%C3%B1as+shmano%2C+los+primos%2C+manolo%2C+ferran+alfaro+garcia%2C+bruno+reina+garcia%2C+eric+solivellas+garcia%2C+cocinero%2C+salvador+garcia+martinez%2C+criadores+de+lombriz%2C+viveros%2C+delta+del+ebro%2C+pescadores%2C+grandes+pescadores%2C+ca%C3%B1as+mc+due+4%2C20%2C+capri+g70%2C+dorada+del+litoral%2C+jose+manuel+rold%C3%A1n%2C+montero%2C+jose+franco%2C+lubinas%2C+llubarro%2C+ivan+sant+feliu%2C+sa%26fresc%2C+restaurante+decathlon%2C+congrios+gigantes+en+premi%C3%A0+de+mar%2C+playa+del+prat+a%C3%B1o+1954%2C+jose+manuel+parada%2C+led-lenser%2C+jes%C3%BAs%2C+tom%C3%A1s+ferrer%2C+corvina%2C+carpas%2C+jordi+carri%C3%B3n%2C+francisco+carri%C3%B3n+molina%2C+www.ropajoven.net%2C+http%3A%2F%2Fwww.guiavalles.es%7C+http%3A%2F%2Fwww.comprarencerdanyola.com%7C+http%3A%2F%2Fwww.comprarenmontcada.com%7C+http%3A%2F%2Fwww.comprarenmollet.com%2C+www.solopescaonline.es%2C+bar+palentino%2C+carles+garc%C3%ADa+mena%2C+bruno+reina+garcia%2C+ferran+alfaro+garcia%2C+saray+garcia%2C+lorena+garcia%2C+antonio+cano%2C+club+nautico+premia%2C+embarcaci%C3%B3n+pescata%2C+eric+solivellas%2C+salvador+garcia%2C+manolo+megamar%2C+francisco+carrion%2C+jose+manuel+parada%2C+carles+martin%2C+ferre%2C+toni+flores%2C+serviola%2C+playa+del+prat%2C+congrios+gigantes%2C+playa+de+gava%2C+llubarrero+alvacio%2C+fundas+al+vacio%2C+cebo+del+mediterraneo%2C+galeras+peque%C3%B1as.%0D%0A%0D%0A%0D%0A%0D%0A';
var metaContents  = 'Tienda+especializada+en+todas+las+modalidades+de+Pesca+Deportiva%2C+situada+en+Mollet+del+Vall%C3%A8s.+';
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();
};

