/* [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','15101',jdecode('Energia'),jdecode(''), jdecode('%2F15101%2Findex.html'), 'true',[ 
		['PAGE','14601',jdecode('Combustible'),jdecode(''), jdecode('%2F15101%2F14601.html'), 'true',[],'','']
	],'',''],
	['PAGE','14715',jdecode('Dep%C3%B3sitos-Lubricantes-Aditivos'),jdecode(''), jdecode('%2F14715%2Findex.html'), 'true',[ 
		['PAGE','14652',jdecode('Depositos'),jdecode(''), jdecode('%2F14715%2F14652.html'), 'true',[],'','']
	],'',''],
	['PAGE','14673',jdecode('Financiaci%C3%B3n'),jdecode(''), jdecode('%2F14673.html'), 'true',[],'',''],
	['PAGE','301',jdecode('Solicitud+Gasoleo'),jdecode(''), jdecode('%2F301%2Findex.html'), 'true',[ 
		['PAGE','16601',jdecode('Contacto'),jdecode(''), jdecode('%2F301%2F16601.html'), 'true',[],'',''],
		['PAGE','35001',jdecode('Contacto+%28follow+up+page%29'),jdecode(''), jdecode('%2F301%2F35001.html'), 'false',[],'','']
	],'',''],
	['PAGE','20301',jdecode('Oportunidades%2FPromos'),jdecode(''), jdecode('%2F20301.html'), 'true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Commercial';
theSitetree.paletteFamily='C5E8FE';
theSitetree.keyvisualId='10203';
theSitetree.keyvisualName='flowers.swf';
theSitetree.fontsetId='21116';
theSitetree.graphicsetId='13215';
theSitetree.contentColor='004272';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var prodDef={
  wl_name: 'arsys',
  product: 'WSCSYSSSSLYTC2IK'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Commercial',
				paletteFamily: 	'C5E8FE',
				keyvisualId: 	'10203',
				keyvisualName: 	'flowers.swf',
				fontsetId: 		'21116',
				graphicsetId: 	'13215',
				contentColor: 	'004272',
				contentBGColor: 'FFFFFF',
				a_color: 		'e6e6e6',
				b_color: 		'ffffff',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20111116-195143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14715',
internalId:  '',
customField: '20111116-195133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15101',
internalId:  '',
customField: '20111116-195047'
};
webappMappings['7008']=webappMappings['7008-7735']={
webappId:    '7008',
documentId:  '16601',
internalId:  '7735',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20301',
internalId:  '',
customField: '20111116-194833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16601',
internalId:  '',
customField: '20111116-195319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14601',
internalId:  '',
customField: '20091114-111506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14652',
internalId:  '',
customField: '20090611-174352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14673',
internalId:  '',
customField: '20111116-193821'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '15101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35001',
internalId:  '',
customField: '20090515-103737'
};
var webAppHostname = 'wsc.webaporter.com:80';
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20INVZPD';
var companyName   = 'Gasoil%40Domicili%2Ctraemos+tu+energia';
var htmlTitle	  = 'gasoil+calefacci%C3%B3n';
var metaKeywords  = 'gasoil+gasoleo+calefaccion+valles+maresme+barcelones+baix+llobregat+Financiacion+';
var metaContents  = 'Distribucio+Gasoils+a+Domicili.+Zona+Valles+Maresme+Barcelones+Baix+Llobregat.+tel.93.307.02.85+%2F+686.194.967+%2Ffax+93.308.46.86+%2Fgasoil%40gasoiladomicili.es+.+Financiaci%C3%B3n.+Alta+calidad+y+compromiso+de+servicio.+Precios+extremadamente+competitivos.Personal+cualificado.+Servimos+a+Calefacciones%2C+Obras%2C+Eventos%2C+Fires%2C+Grupos+Electrogenos%2C+Flotas+Empresa.+Tenemos+tambien+DEPOSITOS+HOMOLOGADOS+a+muy+buen+precio+para+Gasoil+%2CAgua+potable+y+Recogida+de+Lluvias.+Manguera+larga+y+vehiculos+adaptados+para+llegar+a+zonas+de+dificil+acceso.+Visa+si.+No+dude+en+contactar.+Financiacion';
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();
};

