/* [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','701',jdecode('Home'),jdecode(''),'/701.html','true',[],''],
	['PAGE','752',jdecode('Tintas'),jdecode(''),'/752/index.html','true',[ 
		['PAGE','22001',jdecode('offset'),jdecode(''),'/752/22001.html','true',[],''],
		['PAGE','22022',jdecode('serigrafia'),jdecode(''),'/752/22022.html','true',[],'']
	],''],
	['PAGE','857',jdecode('Laminas+'),jdecode(''),'/857.html','true',[],''],
	['PAGE','5464',jdecode('Mantillas'),jdecode(''),'/5464.html','true',[],''],
	['PAGE','5590',jdecode('Pel%C3%ADculas'),jdecode(''),'/5590.html','true',[],''],
	['PAGE','5674',jdecode('Forros+Mojadores'),jdecode(''),'/5674.html','true',[],''],
	['PAGE','5758',jdecode('Quimicos'),jdecode(''),'/5758.html','true',[],''],
	['PAGE','21001',jdecode('Accesorios'),jdecode(''),'/21001.html','true',[],''],
	['PAGE','5926',jdecode('Cont%C3%A1ctenos'),jdecode(''),'/5926.html','true',[],'']];
var siteelementCount=11;
theSitetree.topTemplateName='Nurseries';
theSitetree.paletteFamily='FFE57B';
theSitetree.keyvisualId='7904';
theSitetree.keyvisualName='kv_7904.jpg';
theSitetree.fontsetId='16879';
theSitetree.graphicsetId='12313';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFE57B';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				name: 			'Nurseries',
				paletteFamily: 	'FFE57B',
				keyvisualId: 	'7904',
				keyvisualName: 	'kv_7904.jpg',
				fontsetId: 		'16879',
				graphicsetId: 	'12313',
				contentColor: 	'000000',
				contentBGColor: 'FFE57B',
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'true',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20070906-123535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20071019-153955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22001',
internalId:  '',
customField: '20070306-181324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22022',
internalId:  '',
customField: '20070306-173928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '857',
internalId:  '',
customField: '20070306-173026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5464',
internalId:  '',
customField: '20070221-185512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5590',
internalId:  '',
customField: '20070221-185752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5674',
internalId:  '',
customField: '20070222-094723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5758',
internalId:  '',
customField: '20070222-095917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21001',
internalId:  '',
customField: '20070302-173950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5926',
internalId:  '',
customField: '20070306-172420'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INEZ4C';
var companyName   = 'LUZ+Y+COLOR+Proveedora+Gr%C3%A1fica';
var htmlTitle	  = 'Luz+y+Color';
var metaKeywords  = 'luz%2C+proveedora+grafica%2C+proveedora%2C+grafica%2C+artes%2C+distribuidor%2C+sanchez%2C+colortec%2C+saphira%2C+prodaplag%2C+kodak%2C+fuji%2C+fibratel%2C+agfa%2C+servicio+express%2C+norkim%2C+pronova%2C+prisco%2C+artes+graficas';
var metaContents  = 'ARTES+GRAFICAS%2C+VENTA%2C+INSUMOS%2C+DISTRIBUIDOR';
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();
};
