/* [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','5001',jdecode('Home'),jdecode(''), jdecode('%2F5001.html'), 'true',[],'',''],
	['PAGE','42612',jdecode('Bolsas'),jdecode(''), jdecode('%2F42612%2Findex.html'), 'true',[ 
		['PAGE','42633',jdecode('Bolsa+Ecol%C3%B3gica'),jdecode(''), jdecode('%2F42612%2F42633.html'), 'true',[],'','']
	],'',''],
	['PAGE','12301',jdecode('Display'),jdecode(''), jdecode('%2F12301%2Findex.html'), 'true',[ 
		['PAGE','7501',jdecode('Presentacion+de+productos'),jdecode(''), jdecode('%2F12301%2F7501.html'), 'true',[],'',''],
		['PAGE','7701',jdecode('Eventos+y+publicidad'),jdecode(''), jdecode('%2F12301%2F7701.html'), 'true',[],'',''],
		['PAGE','6301',jdecode('Disco+compacto'),jdecode(''), jdecode('%2F12301%2F6301.html'), 'true',[],'',''],
		['PAGE','6322',jdecode('Invitaciones'),jdecode(''), jdecode('%2F12301%2F6322.html'), 'true',[],'','']
	],'',''],
	['PAGE','49512',jdecode('Pantuflas+Promocionales'),jdecode(''), jdecode('%2F49512.html'), 'true',[],'',''],
	['PAGE','39712',jdecode('Pelota+antiestres'),jdecode(''), jdecode('%2F39712.html'), 'true',[],'',''],
	['PAGE','13301',jdecode('Cubo+mag%C3%ADco'),jdecode(''), jdecode('%2F13301.html'), 'true',[],'',''],
	['PAGE','13322',jdecode('Portagafete'),jdecode(''), jdecode('%2F13322.html'), 'true',[],'',''],
	['PAGE','36512',jdecode('Pulseras'),jdecode(''), jdecode('%2F36512.html'), 'true',[],'',''],
	['PAGE','13343',jdecode('Tatuajes'),jdecode(''), jdecode('%2F13343.html'), 'true',[],'',''],
	['PAGE','35612',jdecode('Impresion'),jdecode(''), jdecode('%2F35612%2Findex.html'), 'true',[ 
		['PAGE','32312',jdecode('Tampograf%C3%ADa'),jdecode(''), jdecode('%2F35612%2F32312.html'), 'true',[],'',''],
		['PAGE','32712',jdecode('Serigraf%C3%ADa'),jdecode(''), jdecode('%2F35612%2F32712.html'), 'true',[],'',''],
		['PAGE','32733',jdecode('Digital+textil'),jdecode(''), jdecode('%2F35612%2F32733.html'), 'true',[],'',''],
		['PAGE','32754',jdecode('Digital+cama+plana'),jdecode(''), jdecode('%2F35612%2F32754.html'), 'true',[],'','']
	],'',''],
	['PAGE','7722',jdecode('Cont%C3%A1ctenos'),jdecode(''), jdecode('%2F7722.html'), 'true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Nature';
theSitetree.paletteFamily='1503FF';
theSitetree.keyvisualId='3640';
theSitetree.keyvisualName='kv_3640.jpg';
theSitetree.fontsetId='10459';
theSitetree.graphicsetId='10879';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var prodDef={
  wl_name: 'grp13-hostin',
  product: 'WSCSYSSSSLY0XJEZ'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Nature',
				paletteFamily: 	'1503FF',
				keyvisualId: 	'3640',
				keyvisualName: 	'kv_3640.jpg',
				fontsetId: 		'10459',
				graphicsetId: 	'10879',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'1503FF',
				e_color: 		'1503FF',
				f_color: 		'1503FF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20110912-002150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6301',
internalId:  '',
customField: '20090114-173145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6322',
internalId:  '',
customField: '20090114-173219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20090115-111405'
};
webappMappings['7008']=webappMappings['7008-2991']={
webappId:    '7008',
documentId:  '7722',
internalId:  '2991',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20090114-173053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7722',
internalId:  '',
customField: '20120208-165927'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12301',
internalId:  '',
customField: '20091021-202053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13301',
internalId:  '',
customField: '20091207-141729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13322',
internalId:  '',
customField: '20091208-154805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13343',
internalId:  '',
customField: '20091208-123502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32312',
internalId:  '',
customField: '20091208-125517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32712',
internalId:  '',
customField: '20091208-152128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32733',
internalId:  '',
customField: '20091208-152302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32754',
internalId:  '',
customField: '20091208-155241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35612',
internalId:  '',
customField: '20100419-142410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36512',
internalId:  '',
customField: '20111110-232232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39712',
internalId:  '',
customField: '20110929-194742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42612',
internalId:  '',
customField: '20100520-085637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42633',
internalId:  '',
customField: '20110608-120608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49512',
internalId:  '',
customField: '20101003-140538'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INPSW2';
var companyName   = 'Empaques+para+promocionales';
var htmlTitle	  = 'promocionales+publicidad+usb+negocios';
var metaKeywords  = 'Articulos+promocionales%2Cregalos+promocionales%2Cplumas%2Cpulsera%2Cllavero%2Cplayeras%2Cgorras%2Cmemorias+usb%2Crelojes%2Creproductores+de+musica%2CMP3%2CMP4%2Ctimers%2Cmemorias+flash%2Cresproductores%2Cpastilleros%2Cmochilas%2Cusb%2Cagendas%2Ctermos%2Cgorras%2Creglas%2Cantiestres';
var metaContents  = 'Promocionales+suempaque%2Carticulos+promocionales%2Cregalos+promocionales%2Cempaques%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%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();
};

