/* [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','4598',jdecode('Nuestra+Empresa'),jdecode(''),'/4598.html','true',[],'',''],
	['PAGE','4682',jdecode('COTIZACIONES+2010'),jdecode(''),'/4682.html','true',[],'',''],
	['PAGE','4763',jdecode('SOBRE++Fest%C3%B3n'),jdecode(''),'/4763.html','true',[],'',''],
	['PAGE','15401',jdecode('SOBRE++Pelo+de+%C3%A1ngel'),jdecode(''),'/15401.html','true',[],'',''],
	['PAGE','7022',jdecode('SOBRE+Texturas'),jdecode(''),'/7022.html','true',[],'',''],
	['PAGE','7001',jdecode('SOBRE+Pinos'),jdecode(''),'/7001.html','true',[],'',''],
	['PAGE','4709',jdecode('SOBRE+Pinos+Monumentales'),jdecode(''),'/4709.html','true',[],'',''],
	['PAGE','17301',jdecode('SOBRE+Coronas+'),jdecode(''),'/17301.html','true',[],'',''],
	['PAGE','4790',jdecode('LOGOTIPOS+2D+Y+3D'),jdecode(''),'/4790.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Jakarta';
theSitetree.paletteFamily='6176B2';
theSitetree.keyvisualId='7885';
theSitetree.keyvisualName='kv_7885.jpg';
theSitetree.fontsetId='16854';
theSitetree.graphicsetId='12296';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='ABBBE8';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'true',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Jakarta',
				paletteFamily: 	'6176B2',
				keyvisualId: 	'7885',
				keyvisualName: 	'kv_7885.jpg',
				fontsetId: 		'16854',
				graphicsetId: 	'12296',
				contentColor: 	'000000',
				contentBGColor: 'ABBBE8',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'6176B2',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4598',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-229973']={
webappId:    '1501',
documentId:  '4598',
internalId:  '229973',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20100127-151045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4763',
internalId:  '',
customField: '20090917-185706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15401',
internalId:  '',
customField: '20090217-223008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4682',
internalId:  '',
customField: '20100202-162811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20091120-100609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7022',
internalId:  '',
customField: '20090210-230203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4790',
internalId:  '',
customField: '20100125-202044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4709',
internalId:  '',
customField: '20090917-192847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17301',
internalId:  '',
customField: '20090921-150620'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INXL3M';
var companyName   = 'Plast+Metal+de+M%C3%A9xico+SA+de+CV';
var htmlTitle	  = 'Tenemos+amplia+gama+de+colores%2C+pregunte%21%21%21';
var metaKeywords  = 'fest%C3%B3n%2C+floc%2C+pelo+de+angel%2C+poliestireno%2C+colores+llamativos%2C+oportunidades+de+desarrollo%2C+adorno+econ%C3%B3mico';
var metaContents  = 'Fabricantes+de+fibra+pl%C3%A1stica+en+vistosos+colores%2C+como+Pelo+de+Angel+ornamental+y+tambi%C3%A9n+se+usa+para+elaboraci%C3%B3n+de+fest%C3%B3n+y+figuras+de+unicel';
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();
};
