/* [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','4598',jdecode('Home'),jdecode(''), jdecode('%2F4598.html'), 'true',[],'',''],
	['PAGE','5430',jdecode('Tratamiento+de+riles+y+agua'),jdecode(''), jdecode('%2F5430.html'), 'true',[],'',''],
	['PAGE','5511',jdecode('Agroindustria'),jdecode(''), jdecode('%2F5511.html'), 'true',[],'',''],
	['PAGE','5457',jdecode('Industria+C%C3%A1rnica'),jdecode(''), jdecode('%2F5457.html'), 'true',[],'',''],
	['PAGE','5484',jdecode('Industria+Acu%C3%ADcola+%2F+Pesquera'),jdecode(''), jdecode('%2F5484.html'), 'true',[],'',''],
	['PAGE','52607',jdecode('Industria+Forestal+%2F+Maderera'),jdecode(''), jdecode('%2F52607.html'), 'true',[],'',''],
	['PAGE','52580',jdecode('Industria+Minera+%2F+Qu%C3%ADmica'),jdecode(''), jdecode('%2F52580.html'), 'true',[],'',''],
	['PAGE','59959',jdecode('Industria+metalmec%C3%A1nica'),jdecode(''), jdecode('%2F59959.html'), 'true',[],'',''],
	['PAGE','59771',jdecode('Cont%C3%A1ctenos'),jdecode(''), jdecode('%2F59771.html'), 'true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Business';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='2492';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='419';
theSitetree.graphicsetId='463';
theSitetree.contentColor='020E66';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var prodDef={
  wl_name: 'grp13-terra6',
  product: 'WSCVWLSSSLYTC2IW'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Business',
				paletteFamily: 	'003366',
				keyvisualId: 	'2492',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'419',
				graphicsetId: 	'463',
				contentColor: 	'020E66',
				contentBGColor: 'FFFFFF',
				a_color: 		'003366',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20100510-144354'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4598',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-97568']={
webappId:    '1501',
documentId:  '4598',
internalId:  '97568',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-2236']={
webappId:    '7008',
documentId:  '59771',
internalId:  '2236',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5430',
internalId:  '',
customField: '20070904-081040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5511',
internalId:  '',
customField: '20100518-160136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5457',
internalId:  '',
customField: '20091116-140855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5484',
internalId:  '',
customField: '20091116-140826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52607',
internalId:  '',
customField: '20070821-112250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52580',
internalId:  '',
customField: '20071029-124824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59959',
internalId:  '',
customField: '20080206-093912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59771',
internalId:  '',
customField: '20070517-100317'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INX243';
var companyName   = 'William+W.+Patrick';
var htmlTitle	  = 'www.wilpat.cl%2C+WILPAT%2C+equipamiento+industrial%2C+detectores+de+metales%2C+equipos+UV%2C+Mezcladoras+de+cinta%2C+b%C3%A1sculas+ensacadoras%2C+palletizadoras%2C+descargadores+de+silos%2C+separadores+magn%C3%A9ticos%2C+calefactores+radiantes%2C+tratamiento+de+riles%2C+tratamiento+de+pur';
var metaKeywords  = 'riles%2C+flotaci%C3%B3n%2C+floculaci%C3%B3n%2C+DAF%2C+Flotaci%C3%B3n+por+aire+disuelto%2C+est%C3%A1tico%2C+filtro+curvo+est%C3%A1tico%2C+filtro%2C+dosificaci%C3%B3n+polielectrolito%2C+unidad+dosificadora%2C+NaOH%2C+bomba%2C+bombas%2C+agua%2C+agua+residual%2C+tratamiento+de+aguas+residuales%2C+purines%2C+Holanda%2C+servicio%2C+pruebas+de+jarra%2C+pruebas+piloto%2C+paquete+de+lamelas%2C+industria%2C+alimentos%2C+aquarake%2C+detector+de+metales%2C+metal+detector%2C+sensibilidad%2C+digital%2C+DSP%2C+DDP%2C+bolas+de+prueba%2C+separadores+magn%C3%A9ticos%2C+hornos+ahumadores%2C+secadores%2C+ahumador+horizontal%2C+mezcladora+horizontal%2C+mezcladora+vertical%2C+congelado%2C+tuneles+IQF%2C+hielo+l%C3%ADquido%2C+hielo+en+escamas%2C+congelador+de+placas%2C+freezer%2C+criadoras%2C+calefactores%2C+cer%C3%A1micos%2C+bajo+consumo+de+gas+Sistemas+para+tratamiento+de+riles+-+Sistemas+de+tratamiento+UV+-+Detectores+de+metales+-+Hornos+ahumadores+de+flujo+horizontal+-+Hornos+ahumadores+de+flujo+vertical+-+Secadores+-+Sellos+pl%C3%A1sticos+-+Formax-+Tuneles+de+congelado+IQF-+Congeladores+de+placas+automatizados-+Sistemas+para+producir+hielo+l%C3%ADquido-+Sistemas+para+palletizado+autom%C3%A1tico+de+cajas+-+Clasificadoras+de+pescado-+Clasificadoras+de+peces-+Evisceradoras+para+jurel+y+trucha-+Autoclaves+horizontales-+Autoclaves+verticales-+Soluciones+para+proceso+de+bivalbos-+Despieladoras-+Descabezadoras-+Trituradoras-+Lavadoras+de+cajas+pl%C3%A1sticas-+Lavadoras+de+jabas+-+Lavadoras+de+bandejas-+Calefactores+radiantes+cer%C3%A1micos+-++Mezcladoras+de+cinta-++Mezcladoras+Horizontales-++Separadores+de+grano-+B%C3%A1sculas+Ensacadoras-+Sistemas+de+Palletizado+de+sacos-+Descargadores+de+silos-+cortadoras+de+plasma-+plegadoras-+prensas+hidr%C3%A1ulicas-+muescadoras-+purines+-+bins+depuraci%C3%B3n+y+desarenado+bivalvos-+choritos-+mejillones-+almejas-+mariscos+-+multicabezal+-+b%C3%A1sculas+multicabezales+-+dosificadoras+multicabezales+-+pesadoras+multicabezales-+pesadoras++-+equipos+de+proceso+para+productos+l%C3%A1cteos+-+tanques+de+proceso+-+evaporadores+-+tanques+de+cristacizaci%C3%B3n+-+intercambiadores+de+calor+de+superficie+raspada+-Terlotherm+Sistemas+de+vac%C3%ADo+y+gas+para+leche+en+polvo+-+equipos+bag+in+box';
var metaContents  = 'riles%2C+flotaci%C3%B3n%2C+floculaci%C3%B3n%2C+DAF%2C+Flotaci%C3%B3n+por+aire+disuelto%2C+est%C3%A1tico%2C+filtro+curvo+est%C3%A1tico%2C+filtro%2C+dosificaci%C3%B3n+polielectrolito%2C+unidad+dosificadora%2C+NaOH%2C+bomba%2C+bombas%2C+agua%2C+agua+residual%2C+tratamiento+de+aguas+residuales%2C+Holanda%2C+servicio%2C+pruebas+de+jarra%2C+pruebas+piloto%2C+paquete+de+lamelas%2C+industria%2C+alimentos%2C+aquarake%2C+detector+de+metales%2C+metal+detector%2C+sensibilidad%2C+digital%2C+DSP%2C+DDP%2C+bolas+de+prueba%2C+separadores+magn%C3%A9ticos%2C+hornos+ahumadores%2C+secadores%2C+ahumador+horizontal%2C+mezcladora+horizontal%2C+mezcladora+vertical%2C+congelado%2C+tuneles+IQF%2C+hielo+l%C3%ADquido%2C+hielo+en+escamas%2C+congelador+de+placas%2C+freezer%2C+criadoras%2C+calefactores+cer%C3%A1micos%2C+bajo+consumo+de+gas%2C+Sistemas+para+tratamiento+de+riles+-+Sistemas+de+tratamiento+UV+-+Detectores+de+metales+-+Hornos+ahumadores+de+flujo+horizontal+-+Hornos+ahumadores+de+flujo+vertical+-+Secadores+-+Sellos+pl%C3%A1sticos+-+Formax-+Tuneles+de+congelado+IQF-+Congeladores+de+placas+automatizados-+Sistemas+para+producir+hielo+l%C3%ADquido-+Sistemas+para+palletizado+autom%C3%A1tico+de+cajas+-+Clasificadoras+de+pescado-+Clasificadoras+de+peces-+Evisceradoras+para+jurel+y+trucha-+Autoclaves+horizontales-+Autoclaves+verticales-+Soluciones+para+proceso+de+bivalvos-+bins+para+depuraci%C3%B3n+y+deasarenado+de+choritos%2C+almejas+y+otros+bivalvos-+Despieladoras-+Descabezadoras-+Trituradoras-+Lavadoras+de+cajas+pl%C3%A1sticas-+Lavadoras+de+jabas+-+Lavadoras+de+bandejas-+Calefactores+radiantes+cer%C3%A1micos-++Mezcladoras+de+cinta-++Mezcladoras+Horizontales-++Separadores+de+grano-+B%C3%A1sculas+Ensacadoras-+Sistemas+de+Palletizado+de+sacos-+Descargadores+de+silos+-+purines+-+cortadoras+de+plasma-+plegadoras-+mandriles+de+seguridad++-+muescadoras+-+pesadoras+multicabezales+-+b%C3%A1sculas+multicabezales+-+equipos+de+proceso+para+productos+l%C3%A1cteos+-+tanques+de+proceso+-+evaporadores+-+tanques+de+cristacizaci%C3%B3n+-+intercambiadores+de+calor+de+superficie+raspada+-Terlotherm+-+Sistemas+de+vac%C3%ADo+y+gas+para+leche+en+polvo+-+equipos+bag+in+box';
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();
};

