/* [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','401',jdecode('Home'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','473',jdecode('%C2%BFQuienes+somos%3F'),jdecode(''), jdecode('%2F473.html'), 'true',[],'',''],
	['PAGE','14301',jdecode('Empaquetaduras'),jdecode(''), jdecode('%2F14301.html'), 'true',[],'',''],
	['PAGE','536',jdecode('Juntas'),jdecode(''), jdecode('%2F536.html'), 'true',[],'',''],
	['PAGE','17901',jdecode('Productos+de+Teflon'),jdecode(''), jdecode('%2F17901.html'), 'true',[],'',''],
	['PAGE','22501',jdecode('Empaques+para+Calderas'),jdecode(''), jdecode('%2F22501.html'), 'true',[],'',''],
	['PAGE','44301',jdecode('Laminas+-+Otros+productos'),jdecode(''), jdecode('%2F44301.html'), 'true',[],'',''],
	['PAGE','6401',jdecode('Promociones'),jdecode(''), jdecode('%2F6401.html'), 'true',[],'',''],
	['PAGE','4901',jdecode('Contacto'),jdecode(''), jdecode('%2F4901.html'), 'true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Champagne';
theSitetree.paletteFamily='52504D';
theSitetree.keyvisualId='11361';
theSitetree.keyvisualName='kv_11361.jpg';
theSitetree.fontsetId='31943';
theSitetree.graphicsetId='13784';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='52504D';
var localeDef={
  language: 'es',
  country: 'ES'
};
var prodDef={
  wl_name: 'grp13-hostin',
  product: 'WSCVWLSSSLYTC2IW'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Champagne',
				paletteFamily: 	'52504D',
				keyvisualId: 	'11361',
				keyvisualName: 	'kv_11361.jpg',
				fontsetId: 		'31943',
				graphicsetId: 	'13784',
				contentColor: 	'000000',
				contentBGColor: '52504D',
				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['1501']=webappMappings['1501-10286018']={
webappId:    '1501',
documentId:  '401',
internalId:  '10286018',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-4418']={
webappId:    '7008',
documentId:  '4901',
internalId:  '4418',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100825-144838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20090513-104948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20100825-150237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14301',
internalId:  '',
customField: '20100825-150841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17901',
internalId:  '',
customField: '20100407-174412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22501',
internalId:  '',
customField: '20091002-133122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20100407-174207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20100407-175205'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44301',
internalId:  '',
customField: '20100407-174644'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INVDK4';
var companyName   = 'INURES+S.A+DE+C.V.';
var htmlTitle	  = '';
var metaKeywords  = 'empaquetaduras%2C+empaques+industriales%2C+cinta+de+teflon%2C+empaquetadura+industrial%2C+juntas%2C+teflon%2C+laminas+CINTA+DE+TFE%2C+CINTA+DE+TEFLON%2C+EMPAQUETADURA+TRENZADA%2C+GRAFITADO%2C+ASBESTO%2C+TEFLON+VIRGEN%2C+PELICULA+STRETCH%2C+PLASTICO+PARA+EMPLAYAR%2C+ACEITE%2C+AFLOJATODO%2C+JUNTA+TIPO+ANILLO%2C+CLT%2C+CRT%2C+LAMINA+DE+ASBESTO%2C+GARLOCK%2C+TEADIT%2C+GORETEX%2C+CARA+COMPLETA%2C+CALDERAS%2C+FABRICANTE%2C+EMPAQUETADURA+GRAFITADA+%0D%0AASBESTO+CON+TEFLON%2C+KEVLAR%2C+XOCHIMILCO%2C+FABRICAS%2C+FABRICANTES%2C+TELA+ASBESTO%2C+FIBRA+DE+VIDRIO%2C+CINTAS%2C+TEFLON%2C+LAMINA+DE+TEFLON%2C+TEFLON+VIRGEN%2C+ASBESTO+CON+TEFLON%2C+SELLADO%2C+FLUIDOS%2C+TADPOLE%2C+ENTRADA+HOMBRE%2C+ENTRADA+MANO%0D%0AASBESTO+CON+TEFLON%2C+TEFLON+VIRGEN%2C+GRAFITADO';
var metaContents  = 'SOMOS+FABRICANTES+DE+EMPAQUETADURAS+INDUSTRIALES+PARA+SELLADO+DE+FLUIDOS.+EMPAQUETADURA+TRENZADA%2C+EMPAQUES+PARA+CALDERAS%2C+PRODUCTOS+DE+TEFLON%2C+LAMINAS+DE+ASBESTO+Y+NO+ASBESTO%2C+MATERIAS+PRIMAS+PARA+EMPAQUETADURAS+ETC.%0D%0A%0D%0A';
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();
};

