/* [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 theSitetree=[ 
	['PAGE','4598',jdecode('INICIO'),jdecode(''),'/4598.html','true',[],''],
	['PAGE','4709',jdecode('Productos'),jdecode(''),'/4709/index.html','true',[ 
		['PAGE','4790',jdecode('ALFA+880'),jdecode(''),'/4709/4790.html','true',[],''],
		['PAGE','5520',jdecode('ASTURO'),jdecode(''),'/4709/5520.html','true',[],''],
		['PAGE','4736',jdecode('DEVILBISS+BINKS'),jdecode(''),'/4709/4736.html','true',[],''],
		['PAGE','4817',jdecode('GRACO'),jdecode(''),'/4709/4817.html','true',[],''],
		['PAGE','4763',jdecode('KREMLIN'),jdecode(''),'/4709/4763.html','true',[],'']
	],''],
	['PAGE','6646',jdecode('Libro+de+visitas'),jdecode(''),'/6646/index.html','true',[ 
		['PAGE','6647',jdecode('Leer+el+libro+de+Visitas'),jdecode(''),'/6646/6647.html','false',[],'']
	],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Cable';
theSitetree.paletteFamily='D30303';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10367';
theSitetree.graphicsetId='10527';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				name: 			'Cable',
				paletteFamily: 	'D30303',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10367',
				graphicsetId: 	'10527',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4598',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-85034']={
webappId:    '1501',
documentId:  '4598',
internalId:  '85034',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4709',
internalId:  '',
customField: '20090603-174244'
};
webappMappings['1002']=webappMappings['1002-6646AVEC10INXX3F']={
webappId:    '1002',
documentId:  '6646',
internalId:  '6646AVEC10INXX3F',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20060727-104327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4817',
internalId:  '',
customField: '20090603-165831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4736',
internalId:  '',
customField: '20060825-085703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6646',
internalId:  '',
customField: '20060825-090222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4763',
internalId:  '',
customField: '20060825-085811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4790',
internalId:  '',
customField: '20060825-085856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5520',
internalId:  '',
customField: '20060825-090012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6647',
internalId:  '',
customField: '20060727-111925'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INXX3F';
var companyName   = 'Geralsa+Tecnologia+en+Equipos+para+Pintar';
var htmlTitle	  = 'Soluciones+para+pintura+profesional';
var metaKeywords  = 'bombas%2C+mangueras%2C+compresores%2C+tanques%2C+pintura%2C+airless%2C+mistless%2C+airmix%2C+pistolas%2C+guns%2C+binks%2C+devilbiss%2C+graco%2C+kremlin%2C+asturo%2C+alfa+880%2C+EZ+Mix%2C+sames%2C+rexson%2C+sopleteadoras%2C+acoplamientos+para+mangueras%2C+adaptadores+para+mangueras%2C+aparatos+para+limpieza+a+presion%2C+bombas+neumaticas%2C+boquillas%2C+alta+presion%2C+HVLP%2C+cabinas%2C+Manometros%2C+Secadores%2C+valvulas+de+control+de+presion+de+aire%2C+reguladores+de+presion%2C+filtros+de+aire%2C+electrostatico%2C+pintura+en+polvo%2C+electrostatico+liquido%2C+autoclaves%2C+rociadores%2C+';
var metaContents  = 'Proveemos+soluciones+para+el+acabado+industrial+en+metales%2C+cer%C3%A1mica%2C+maderas%2C+pintura+en+polvo%2C+barnices+y+lacas%2C+aplicacion+airless+y+acabados+profesionales';
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();
};
