/* [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','501',jdecode('Sobre+N%C3%B3s'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','51701',jdecode('Linha+Social+Fem.'),jdecode(''), jdecode('%2F51701.html'), 'true',[],'',''],
	['PAGE','51722',jdecode('Linha+Social+Masc.'),jdecode(''), jdecode('%2F51722.html'), 'true',[],'',''],
	['PAGE','51743',jdecode('Linha+Operacional'),jdecode(''), jdecode('%2F51743.html'), 'true',[],'',''],
	['PAGE','51764',jdecode('Linha+Hotelaria'),jdecode(''), jdecode('%2F51764.html'), 'true',[],'',''],
	['PAGE','51785',jdecode('Linha+Hospitalar'),jdecode(''), jdecode('%2F51785.html'), 'true',[],'',''],
	['PAGE','51806',jdecode('Linha+Esportiva'),jdecode(''), jdecode('%2F51806.html'), 'true',[],'',''],
	['PAGE','51827',jdecode('Linha+Escolar'),jdecode(''), jdecode('%2F51827.html'), 'true',[],'',''],
	['PAGE','51848',jdecode('Linha+Alimenta%C3%A7ao'),jdecode(''), jdecode('%2F51848.html'), 'true',[],'',''],
	['PAGE','51869',jdecode('Linha+Limpeza'),jdecode(''), jdecode('%2F51869.html'), 'true',[],'',''],
	['PAGE','51890',jdecode('Linha+Seguran%C3%A7a'),jdecode(''), jdecode('%2F51890.html'), 'true',[],'',''],
	['PAGE','52401',jdecode('Acess%C3%B3rios'),jdecode(''), jdecode('%2F52401.html'), 'true',[],'',''],
	['PAGE','52422',jdecode('Aventais'),jdecode(''), jdecode('%2F52422.html'), 'true',[],'',''],
	['PAGE','52443',jdecode('Blusas'),jdecode(''), jdecode('%2F52443.html'), 'true',[],'',''],
	['PAGE','52464',jdecode('Bon%C3%A9s'),jdecode(''), jdecode('%2F52464.html'), 'true',[],'',''],
	['PAGE','48343',jdecode('Cal%C3%A7as'),jdecode(''), jdecode('%2F48343.html'), 'true',[],'',''],
	['PAGE','52485',jdecode('Cal%C3%A7ados'),jdecode(''), jdecode('%2F52485.html'), 'true',[],'',''],
	['PAGE','48322',jdecode('Camisas+Polo'),jdecode(''), jdecode('%2F48322.html'), 'true',[],'',''],
	['PAGE','72169',jdecode('camisas+especiais'),jdecode(''), jdecode('%2F72169.html'), 'true',[],'',''],
	['PAGE','48553',jdecode('Camisetas'),jdecode(''), jdecode('%2F48553.html'), 'true',[],'',''],
	['PAGE','52506',jdecode('Capas'),jdecode(''), jdecode('%2F52506.html'), 'true',[],'',''],
	['PAGE','48616',jdecode('Maca%C3%A7%C3%B5es'),jdecode(''), jdecode('%2F48616.html'), 'true',[],'',''],
	['PAGE','52527',jdecode('Mochilas'),jdecode(''), jdecode('%2F52527.html'), 'true',[],'',''],
	['PAGE','49343',jdecode('Jaquetas'),jdecode(''), jdecode('%2F49343.html'), 'true',[],'',''],
	['PAGE','48595',jdecode('Jalecos'),jdecode(''), jdecode('%2F48595.html'), 'true',[],'',''],
	['PAGE','37401',jdecode('SERV.+A+TERCEIROS'),jdecode(''), jdecode('%2F37401.html'), 'true',[],'',''],
	['PAGE','14601',jdecode('CONTATO'),jdecode(''), jdecode('%2F14601.html'), 'true',[],'','']];
var siteelementCount=27;
theSitetree.topTemplateName='Ragtime';
theSitetree.paletteFamily='DBC984';
theSitetree.keyvisualId='3591';
theSitetree.keyvisualName='kv_3591.jpg';
theSitetree.fontsetId='10738';
theSitetree.graphicsetId='10848';
theSitetree.contentColor='6F6E49';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var prodDef={
  wl_name: 'brazilprod',
  product: 'WSCSYSSSSLY0X9A9'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Ragtime',
				paletteFamily: 	'DBC984',
				keyvisualId: 	'3591',
				keyvisualName: 	'kv_3591.jpg',
				fontsetId: 		'10738',
				graphicsetId: 	'10848',
				contentColor: 	'6F6E49',
				contentBGColor: 'FFFFFF',
				a_color: 		'DBC984',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'707272',
				e_color: 		'A99B63',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20110627-193308'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-8']={
webappId:    '7008',
documentId:  '14601',
internalId:  '8',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51701',
internalId:  '',
customField: '20110409-175843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51722',
internalId:  '',
customField: '20110409-203048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51743',
internalId:  '',
customField: '20110409-180132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51764',
internalId:  '',
customField: '20110409-180234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51785',
internalId:  '',
customField: '20110409-180320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51806',
internalId:  '',
customField: '20110409-180351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51827',
internalId:  '',
customField: '20110409-180427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51848',
internalId:  '',
customField: '20110409-180536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51869',
internalId:  '',
customField: '20110409-181116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51890',
internalId:  '',
customField: '20110409-181335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52401',
internalId:  '',
customField: '20110409-182006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52422',
internalId:  '',
customField: '20110409-182335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52443',
internalId:  '',
customField: '20110409-182904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52464',
internalId:  '',
customField: '20110409-182941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48343',
internalId:  '',
customField: '20110409-183347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52485',
internalId:  '',
customField: '20110409-183551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48322',
internalId:  '',
customField: '20110409-184142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48553',
internalId:  '',
customField: '20090326-131430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52506',
internalId:  '',
customField: '20110409-194727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48616',
internalId:  '',
customField: '20110409-200521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52527',
internalId:  '',
customField: '20110409-201657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49343',
internalId:  '',
customField: '20110627-205314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48595',
internalId:  '',
customField: '20110409-202250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37401',
internalId:  '',
customField: '20110409-202346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14601',
internalId:  '',
customField: '20110411-075129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72169',
internalId:  '',
customField: '20110409-193954'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INLW95';
var companyName   = 'CONFEC%C3%87%C3%83O+S%C3%83O+PAULO';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};

