/* [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','7901',jdecode('Inicio'),jdecode(''), jdecode('%2F7901.html'), 'true',[],'',''],
	['PAGE','501',jdecode('CONTACTO'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','552',jdecode('catalogo'),jdecode(''), jdecode('%2F552.html'), 'true',[],'','']];
var siteelementCount=3;
theSitetree.topTemplateName='NewYork';
theSitetree.paletteFamily='660000';
theSitetree.keyvisualId='994';
theSitetree.keyvisualName='dachdecker2.jpg';
theSitetree.fontsetId='168';
theSitetree.graphicsetId='197';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var prodDef={
  wl_name: 'arsys',
  product: 'WSCSYSSSSLYTC2IF'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'NewYork',
				paletteFamily: 	'660000',
				keyvisualId: 	'994',
				keyvisualName: 	'dachdecker2.jpg',
				fontsetId: 		'168',
				graphicsetId: 	'197',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'660000',
				c_color: 		'000000',
				d_color: 		'990000',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20120201-211159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20120201-211428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7901',
internalId:  '',
customField: '20120201-210822'
};
webappMappings['7008']=webappMappings['7008-8000']={
webappId:    '7008',
documentId:  '501',
internalId:  '8000',
customField: 'language:es;country:ES;'
};
var webAppHostname = 'wsc.webaporter.com:80';
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20IN3YVH';
var companyName   = 'FIJACION+POR+LA+INDUSTRIA';
var htmlTitle	  = 'ROZA-GRAPI+S.A.';
var metaKeywords  = 'Grapadoras+para+cart%C3%B3n+y+madera.+Clavadoras+de+cajas+y+palets.++Flejadoras+de+pl%C3%A1stico+y+acero.++Cinta+adhesiva+y+maquinaria+precintadora.++Colas+t%C3%A9rmicas+y+aplicadores.+Grapadoras+de+oficina+y+taladradoras.+Cajas+de+cart%C3%B3n.Alambre+continuo+y+plastificado.+Etiquetadoras+y+navets.+Film+estirable+%28m%C3%A1quina+y+manual%29%2C+enfardadoras+y+retractiladoras.+Herramienta+neum%C3%A1tica.+Grapadoras+caja+armario.+Compresores.+Pl%C3%A1stico+con+burbujas%2C+Foampack+expandido%2C+cantoneras+r%C3%ADgidas+y+de+Foampack+y+papel+Kraft.++++++SISTEMAS+DE+EMBALAJE+Y+PROTECCI%C3%93N+Fleje%2FFlejadoras+Film%2FEnfardadoras+Pl%C3%A1stico%2FRetractiladora+Precinto%2FPrecintadoras+Grapa%2FGrapadoras+embalajes+Cola%2FEncoladoras+autom%C3%A1ticas+Protecciones+Externas+Material+de+relleno+Accesorios+embalajeSISTEMAS+DE+MARCAJE+Y+ETIQUETADO+Sobres+adhesivos+Etiquetas+adhesivas+rollo%2FM%C3%A1quina+Etiquetas+adhesivas+de+imprenta%2FMaquinaria+Hilos+pl%C3%A1sticos+%28NAVET%29%2FNaveteadoras+Grapadoras+etiquetas+Etiquetas+colgantes+Rotulaci%C3%B3n%2FSe%C3%B1alizaci%C3%B3n+Estarcido%2FEstampaci%C3%B3nSISTEMAS+DE+CIERRE+Y+ENVASADO+Cosedoras+sacos+Atadoras%2FCuerdas+Cierres+de+alambre%3A+Tie-Fix%2FAtalazo%2FGrapa+Anilla+Cierres+de+pl%C3%A1stico%3A+Bridas%2FCierres+de+seguridad+Cierre+de+cinta%3A+Cerradoras+bolsas+Taponadoras+Termoselladoras+Envasadoras+al+vac%C3%ADo%2FMoldeadoras%2FSkin-Pack+Retractiladoras+Enfajadoras+Envasado+pl%C3%A1stico%3A+Bolsas%2FTubo%2FSemituboSISTEMAS+DE+FIJACI%C3%93N+Y+UNI%C3%93N+Grapa%2FGrapadoras+Clavos%2FClavadoras+Cola+t%C3%A9rmica%2FEncoladoras+Tornillos%2FTornillos+encintados+Remaches%2FRemaches+encintados+Construcci%C3%B3n+Peleter%C3%ADa+Suelos+madera%2FTarima+Textil+Enmarcaci%C3%B3nSECTORES+DIVERSOS+Compresores%2FHerramientas+neum%C3%A1ticas%2FPintura+Maquinaria+para+la+madera+Herramientas+el%C3%A9ctricas%3A+Taladros%2FAtornilladores+Artes+Gr%C3%A1ficas++++AEG-MILWAKEE%2CBOSCH%2C+CMT%2C+COMBINADAS+CEMA%2C+DE-WALT.+EIN-PORT%2C+FELISSATTI%2C+FESTO%2C+HILTI%2C+HITACHI%2C+LEGNA%2C+LOMBARTE%2C+MAFELL%2C+MAKITA%2C%2C+METABO%2C+OMGA%2C+RUPES%2C+RYOBI%2C+SEHER%2C+SKILL%2C+STANLEY%2C+STIHL%2C+VIRUTEX%2C+AIRY%2C+ATRO%2C+BASSO%2C+BEA%2C+BESCO%2C+BESCO%2C+BOSTITCH%2C+CLAVESA%2C+DUO-FAST%2C+EZ-FASTEN%2C+HAU-BOLD%2C+MAESTRI%2C+MAX%2C+PREBENA%2C+RAINCO%2C+RAPID%2C+SENCO%2C+TEMAR%2C+VIM+INTERNATIONAL%2C+FIAC%2C+PINTUC%2C+ABAC%2C+ABC%2C+JOSVAL++';
var metaContents  = 'Grapadoras+para+cart%C3%B3n+y+madera.+Clavadoras+de+cajas+y+palets.++Flejadoras+de+pl%C3%A1stico+y+acero.++Cinta+adhesiva+y+maquinaria+precintadora.++Colas+t%C3%A9rmicas+y+aplicadores.+Grapadoras+de+oficina+y+taladradoras.+Cajas+de+cart%C3%B3n.Alambre+continuo+y+plastificado.+Etiquetadoras+y+navets.+Film+estirable+%28m%C3%A1quina+y+manual%29%2C+enfardadoras+y+retractiladoras.+Herramienta+neum%C3%A1tica.+Grapadoras+caja+armario.+Compresores.+Pl%C3%A1stico+con+burbujas%2C+Foampack+expandido%2C+cantoneras+r%C3%ADgidas+y+de+Foampack+y+papel+Kraft.++++++SISTEMAS+DE+EMBALAJE+Y+PROTECCI%C3%93N+Fleje%2FFlejadoras+Film%2FEnfardadoras+Pl%C3%A1stico%2FRetractiladora+Precinto%2FPrecintadoras+Grapa%2FGrapadoras+embalajes+Cola%2FEncoladoras+autom%C3%A1ticas+Protecciones+Externas+Material+de+relleno+Accesorios+embalajeSISTEMAS+DE+MARCAJE+Y+ETIQUETADO+Sobres+adhesivos+Etiquetas+adhesivas+rollo%2FM%C3%A1quina+Etiquetas+adhesivas+de+imprenta%2FMaquinaria+Hilos+pl%C3%A1sticos+%28NAVET%29%2FNaveteadoras+Grapadoras+etiquetas+Etiquetas+colgantes+Rotulaci%C3%B3n%2FSe%C3%B1alizaci%C3%B3n+Estarcido%2FEstampaci%C3%B3nSISTEMAS+DE+CIERRE+Y+ENVASADO+Cosedoras+sacos+Atadoras%2FCuerdas+Cierres+de+alambre%3A+Tie-Fix%2FAtalazo%2FGrapa+Anilla+Cierres+de+pl%C3%A1stico%3A+Bridas%2FCierres+de+seguridad+Cierre+de+cinta%3A+Cerradoras+bolsas+Taponadoras+Termoselladoras+Envasadoras+al+vac%C3%ADo%2FMoldeadoras%2FSkin-Pack+Retractiladoras+Enfajadoras+Envasado+pl%C3%A1stico%3A+Bolsas%2FTubo%2FSemituboSISTEMAS+DE+FIJACI%C3%93N+Y+UNI%C3%93N+Grapa%2FGrapadoras+Clavos%2FClavadoras+Cola+t%C3%A9rmica%2FEncoladoras+Tornillos%2FTornillos+encintados+Remaches%2FRemaches+encintados+Construcci%C3%B3n+Peleter%C3%ADa+Suelos+madera%2FTarima+Textil+Enmarcaci%C3%B3nSECTORES+DIVERSOS+Compresores%2FHerramientas+neum%C3%A1ticas%2FPintura+Maquinaria+para+la+madera+Herramientas+el%C3%A9ctricas%3A+Taladros%2FAtornilladores+Artes+Gr%C3%A1ficas++++AEG-MILWAKEE%2CBOSCH%2C+CMT%2C+COMBINADAS+CEMA%2C+DE-WALT.+EIN-PORT%2C+FELISSATTI%2C+FESTO%2C+HILTI%2C+HITACHI%2C+LEGNA%2C+LOMBARTE%2C+MAFELL%2C+MAKITA%2C%2C+METABO%2C+OMGA%2C+RUPES%2C+RYOBI%2C+SEHER%2C+SKILL%2C+STANLEY%2C+STIHL%2C+VIRUTEX%2C+AIRY%2C+ATRO%2C+BASSO%2C+BEA%2C+BESCO%2C+BESCO%2C+BOSTITCH%2C+CLAVESA%2C+DUO-FAST%2C+EZ-FASTEN%2C+HAU-BOLD%2C+MAESTRI%2C+MAX%2C+PREBENA%2C+RAINCO%2C+RAPID%2C+SENCO%2C+TEMAR%2C+VIM+INTERNATIONAL%2C+FIAC%2C+PINTUC%2C+ABAC%2C+ABC%2C+JOSVAL++';
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();
};

