/* [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','4556',jdecode('Home'),jdecode(''),'/4556.html','true',[],'',''],
	['PAGE','90402',jdecode('Chaleco+mod.+101'),jdecode(''),'/90402.html','true',[],'',''],
	['PAGE','89529',jdecode('Chaleco+mod.+340'),jdecode(''),'/89529.html','true',[],'',''],
	['PAGE','136279',jdecode('Chaleco+mod.+501+'),jdecode(''),'/136279.html','true',[],'',''],
	['PAGE','143280',jdecode('Chaleco+mod.+601'),jdecode(''),'/143280.html','true',[],'',''],
	['PAGE','93886',jdecode('Overoles++mod.+307'),jdecode(''),'/93886.html','true',[],'',''],
	['PAGE','143733',jdecode('Uniformes'),jdecode(''),'/143733.html','true',[],'',''],
	['PAGE','89502',jdecode('Proteccion+en+obra'),jdecode(''),'/89502.html','true',[],'',''],
	['PAGE','97702',jdecode('Banderolas'),jdecode(''),'/97702.html','true',[],'',''],
	['PAGE','94638',jdecode('Cascos%2FBotas%2FCaretas'),jdecode(''),'/94638.html','true',[],'',''],
	['PAGE','98417',jdecode('Lentes%2Fgoogle'),jdecode(''),'/98417.html','true',[],'',''],
	['PAGE','99302',jdecode('Guantes'),jdecode(''),'/99302.html','true',[],'',''],
	['PAGE','102402',jdecode('Impermeables'),jdecode(''),'/102402.html','true',[],'',''],
	['PAGE','92702',jdecode('Arneses'),jdecode(''),'/92702.html','true',[],'',''],
	['PAGE','12203',jdecode('Cont%C3%A1ctenos'),jdecode(''),'/12203/index.html','true',[ 
		['PAGE','12629',jdecode('Cont%C3%A1ctenos+%28follow+up+page%29'),jdecode(''),'/12203/12629.html','false',[],'','']
	],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Trend';
theSitetree.paletteFamily='3F70CF';
theSitetree.keyvisualId='7972';
theSitetree.keyvisualName='kv_7972.jpg';
theSitetree.fontsetId='16910';
theSitetree.graphicsetId='12323';
theSitetree.contentColor='163D88';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Trend',
				paletteFamily: 	'3F70CF',
				keyvisualId: 	'7972',
				keyvisualName: 	'kv_7972.jpg',
				fontsetId: 		'16910',
				graphicsetId: 	'12323',
				contentColor: 	'163D88',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143733',
internalId:  '',
customField: '20100812-175701'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4556',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4556',
internalId:  '',
customField: '20100812-174653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90402',
internalId:  '',
customField: '20100318-180306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89529',
internalId:  '',
customField: '20100809-170634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143280',
internalId:  '',
customField: '20100331-135450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '136279',
internalId:  '',
customField: '20100407-151608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89502',
internalId:  '',
customField: '20100322-145856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97702',
internalId:  '',
customField: '20100322-153835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94638',
internalId:  '',
customField: '20100322-140909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98417',
internalId:  '',
customField: '20051208-133429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99302',
internalId:  '',
customField: '20100319-180403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93886',
internalId:  '',
customField: '20100812-175734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102402',
internalId:  '',
customField: '20100322-175437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92702',
internalId:  '',
customField: '20100322-155355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12203',
internalId:  '',
customField: '20100812-175325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12629',
internalId:  '',
customField: '20051012-175301'
};
webappMappings['7008']=webappMappings['7008-7407']={
webappId:    '7008',
documentId:  '12203',
internalId:  '7407',
customField: 'language:es;country:ES;'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INXE15';
var companyName   = 'Grupo+Industrial+CG';
var htmlTitle	  = '';
var metaKeywords  = 'cascos%2Cchalecos%2Carnes%2Cconos%2Cguantes%2Cbanderolas%2Cmascarillas%2Creflejante%2Coveroles%2C+traficonos%2C+mascarillas%2C+botas%2C+googles%2Cchalecos+seguridad%2C+chalecos+reflejantes%2C+botas+contra+agua%2Cimpermeables%2C';
var metaContents  = 'CHALECOS+REFLEJANTES%2C+CASCOS%2C+EQUIPOS%2C+SEGURIDAD+INDUSTRIAL';
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();
};
