/* [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('Home'),jdecode(''),'/4598.html','true',[],''],
	['PAGE','4655',jdecode('Inicio'),jdecode(''),'/4655.html','true',[],''],
	['PAGE','4682',jdecode('%C2%BFQuienes+somos%3F'),jdecode(''),'/4682/index.html','true',[ 
		['PAGE','4709',jdecode('Nuestro+equipo'),jdecode(''),'/4682/4709.html','true',[],'']
	],''],
	['PAGE','4736',jdecode('Productos'),jdecode(''),'/4736/index.html','true',[ 
		['PAGE','4763',jdecode('Primer+Producto'),jdecode(''),'/4736/4763.html','true',[],''],
		['PAGE','4790',jdecode('Segundo+Producto'),jdecode(''),'/4736/4790.html','true',[],'']
	],''],
	['PAGE','4817',jdecode('Cont%C3%A1ctenos'),jdecode(''),'/4817/index.html','true',[ 
		['PAGE','7202',jdecode('Cont%C3%A1ctenos+%28follow+up+page%29'),jdecode(''),'/4817/7202.html','false',[],''],
		['PAGE','4844',jdecode('Direcciones'),jdecode(''),'/4817/4844.html','true',[],'']
	],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='AAA769';
theSitetree.keyvisualId='2453';
theSitetree.keyvisualName='garten.jpg';
theSitetree.fontsetId='403';
theSitetree.graphicsetId='462';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				name: 			'Collage',
				paletteFamily: 	'AAA769',
				keyvisualId: 	'2453',
				keyvisualName: 	'garten.jpg',
				fontsetId: 		'403',
				graphicsetId: 	'462',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'AAA769',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4598',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20081201-185349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4817',
internalId:  '',
customField: '20090107-124645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4844',
internalId:  '',
customField: '20081210-020328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4655',
internalId:  '',
customField: '20071231-172924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4682',
internalId:  '',
customField: '20081201-185147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4709',
internalId:  '',
customField: '20071203-190653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4736',
internalId:  '',
customField: '20060913-110656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4763',
internalId:  '',
customField: '20060806-225502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4790',
internalId:  '',
customField: '20081201-184340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7202',
internalId:  '',
customField: '20060124-203956'
};
webappMappings['7008']=webappMappings['7008-8127']={
webappId:    '7008',
documentId:  '4817',
internalId:  '8127',
customField: 'language:es;country:ES;'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INX3WL';
var companyName   = 'ING.+AGRONOMO+CARLOS+C.+CRUZ+HDZ.';
var htmlTitle	  = 'www.jardineriariegoautomatico.com.mx';
var metaKeywords  = 'ARROPE+DE+JARDIN%2C+ARROPE+DE+PASTO%2C+HELADA+EN+JARDIN%2C++remodelacion+%2C+CONSTRUCCION%2C+ARQUITECTURA%2C++MONTERREY%2C++JARDINERIA%2C++RIEGO+AUTOMATICO%2C+++ARBOLES+ARTIFICIALES%2C++PAISAJISMO+DISE%2365533%2C++MANTENIMIENTO+JARDINES%2C+CANCHAS+FUTBOL%2C+SIEMBRA%2C+++DECORACION%2CSECCION+AMARILLA%2C+YAHOO%2C+MEJORES+PRECIOS%2C+URGENTE%2C+MONTERREY%2C';
var metaContents  = '+TEL.+818+343+06+54%2C+INSTALACION+DE+JARDINES%2C+SISTEMAS+DE+RIEGO%2C+RIEGO+AUTOMATICO%2C+EL+MEJOR+PRECIO+EN+SERVICIOS%2C+DISE%C3%91O+Y+PAISAJISMO%2C+MANTENIMIENTO+Y+REHABILITACION+DE+AREAS+VERDES%2C+MONTERREY%2C+MEXICO%2C+EL+MEJOR+PRECIO+EN+JARDINERIA%2C+ASPERSORES+Y+TURBINAS%2C+AUTOMATIZACION+DEL+RIEGO%2C+CONTROL+DE+PLAGAS%2C+HERBICIDAS%2C+ARBOLES+Y+PLANTAS+ARTIFICIALES%2C+MACETAS%2C+DECORACION+DE+INTERIORES.+JARDINERIA+';
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();
};

