/* [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','401',jdecode('Bienvenida'),jdecode(''),'/401.html','true',[],''],
	['PAGE','14601',jdecode('Productos'),jdecode(''),'/14601/index.html','true',[ 
		['PAGE','16701',jdecode('Extrusi%C3%B3n-Spldo.'),jdecode(''),'/14601/16701.html','true',[],''],
		['PAGE','30801',jdecode('Estirado-Spldo.'),jdecode(''),'/14601/30801.html','true',[],''],
		['PAGE','30501',jdecode('Inyecci%C3%B3n'),jdecode(''),'/14601/30501.html','true',[],''],
		['PAGE','30522',jdecode('Maquinarias'),jdecode(''),'/14601/30522.html','true',[],''],
		['PAGE','34901',jdecode('Accesorios'),jdecode(''),'/14601/34901.html','true',[],''],
		['PAGE','34922',jdecode('Repuestos'),jdecode(''),'/14601/34922.html','true',[],'']
	],''],
	['PAGE','11322',jdecode('Equipos'),jdecode(''),'/11322/index.html','true',[ 
		['PAGE','17001',jdecode('CAD%2FCAM'),jdecode(''),'/11322/17001.html','true',[],''],
		['PAGE','15801',jdecode('CNC'),jdecode(''),'/11322/15801.html','true',[],''],
		['PAGE','15843',jdecode('Convencionales'),jdecode(''),'/11322/15843.html','true',[],''],
		['PAGE','18601',jdecode('EDM'),jdecode(''),'/11322/18601.html','true',[],'']
	],''],
	['PAGE','13801',jdecode('Clientes'),jdecode(''),'/13801.html','true',[],''],
	['PAGE','4843',jdecode('Contacto'),jdecode(''),'/4843.html','true',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Cogwheel';
theSitetree.paletteFamily='3370CC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10595';
theSitetree.graphicsetId='10603';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Cogwheel',
				paletteFamily: 	'3370CC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10595',
				graphicsetId: 	'10603',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'3370CC',
				e_color: 		'9E9D9D',
				f_color: 		'9E9D9D',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-5185290']={
webappId:    '1501',
documentId:  '401',
internalId:  '5185290',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20110721-165411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14601',
internalId:  '',
customField: '20110721-164355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16701',
internalId:  '',
customField: '20080801-114302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30801',
internalId:  '',
customField: '20080801-130628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30501',
internalId:  '',
customField: '20080721-220545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30522',
internalId:  '',
customField: '20080801-114023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11322',
internalId:  '',
customField: '20080721-134604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17001',
internalId:  '',
customField: '20080608-111731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15801',
internalId:  '',
customField: '20070514-075355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15843',
internalId:  '',
customField: '20100723-082248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18601',
internalId:  '',
customField: '20070319-084936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13801',
internalId:  '',
customField: '20110721-164213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4843',
internalId:  '',
customField: '20110721-165045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34901',
internalId:  '',
customField: '20090611-151838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34922',
internalId:  '',
customField: '20090611-153042'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10INEQN4';
var companyName   = 'ADORNOS+ILU%2C+S.A.';
var htmlTitle	  = 'Adornos+ILU%2C+S.A.';
var metaKeywords  = 'cnc%2C+CNC%2C+metalmec%C3%A1nica%2C+moldes%2C+inyecci%C3%B3n%2C+inyeccion%2C+soplado%2C+pl%C3%A1sticos%2C+plasticos%2C+pl%C3%A1stico%2C+plastico%2C+soldadura%2C+tig%2C+refacci%C3%B3n%2C+industria%2C+reparaci%C3%B3n%2C+reparacion%2C+refaccion%2C+m%C3%A1quina%2C+maquina%2C+soplado%2C+inyecci%C3%B3n%2C+envases%2C+tapas%2C+pet%2C+pead%2C+polietileno';
var metaContents  = 'Soplado+e+Inyecci%C3%B3n+de+Pl%C3%A1sticos.+Fabricaci%C3%B3n+de+Moldes+de+Inyeccion+y+Soplado+de+pl%C3%A1stico%2C+Refacci%C3%B3n+y+reparaci%C3%B3n+de+m%C3%A1quinas.+Metalmec%C3%A1nica+de+precici%C3%B3n+CNC.';
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();
};

