/* [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','177522',jdecode('Pr%C3%B3ximos+eventos'),jdecode(''), jdecode('%2F177522.html'), 'true',[],'',''],
	['PAGE','250520',jdecode('Ao+competidor'),jdecode(''), jdecode('%2F250520.html'), 'true',[],'',''],
	['PAGE','2301',jdecode('Quem+somos%3F'),jdecode(''), jdecode('%2F2301.html'), 'true',[],'',''],
	['PAGE','165767',jdecode('Open+runner'),jdecode(''), jdecode('%2F165767.html'), 'true',[],'',''],
	['PAGE','167989',jdecode('Coment%C3%A1rios'),jdecode(''), jdecode('%2F167989.html'), 'true',[],'',''],
	['PAGE','232176',jdecode('Copa+Shihan+'),jdecode(''), jdecode('%2F232176.html'), 'true',[],'',''],
	['PAGE','137523',jdecode('Cadastre-se'),jdecode(''), jdecode('%2F137523.html'), 'true',[],'',''],
	['PAGE','99323',jdecode('Entrevistas'),jdecode(''), jdecode('%2F99323.html'), 'true',[],'',''],
	['PAGE','2415',jdecode('Calend%C3%A1rio'),jdecode(''), jdecode('%2F2415.html'), 'true',[],'',''],
	['PAGE','128465',jdecode('Nossa+loja'),jdecode(''), jdecode('%2F128465.html'), 'false',[],'',''],
	['PAGE','128444',jdecode('Checagem'),jdecode(''), jdecode('%2F128444.html'), 'true',[],'',''],
	['PAGE','168410',jdecode('Novidades'),jdecode(''), jdecode('%2F168410.html'), 'true',[],'',''],
	['PAGE','2436',jdecode('No+limite'),jdecode(''), jdecode('%2F2436.html'), 'true',[],'',''],
	['PAGE','128486',jdecode('Membro'),jdecode(''), jdecode('%2F128486.html'), 'false',[],'',''],
	['PAGE','171789',jdecode('Servi%C3%A7os'),jdecode(''), jdecode('%2F171789.html'), 'true',[],'',''],
	['PAGE','172389',jdecode('Enquete'),jdecode(''), jdecode('%2F172389.html'), 'false',[],'',''],
	['PAGE','131423',jdecode('Exterior'),jdecode(''), jdecode('%2F131423.html'), 'true',[],'',''],
	['PAGE','131823',jdecode('Contato'),jdecode(''), jdecode('%2F131823.html'), 'true',[],'',''],
	['PAGE','210688',jdecode('Arquivo'),jdecode(''), jdecode('%2F210688.html'), 'true',[],'',''],
	['PAGE','172689',jdecode('Atletas'),jdecode(''), jdecode('%2F172689.html'), 'true',[],'',''],
	['PAGE','207788',jdecode('Gi+nogi'),jdecode(''), jdecode('%2F207788.html'), 'true',[],'',''],
	['PAGE','11801',jdecode('Videos'),jdecode(''), jdecode('%2F11801.html'), 'true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Card';
theSitetree.paletteFamily='990000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='427';
theSitetree.graphicsetId='479';
theSitetree.contentColor='000000';
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: 			'Card',
				paletteFamily: 	'990000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'427',
				graphicsetId: 	'479',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-167989avec10inp0jk']={
webappId:    '1002',
documentId:  '167989',
internalId:  '167989avec10inp0jk',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20111123-110057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '250520',
internalId:  '',
customField: '20111207-122232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2436',
internalId:  '',
customField: '20110111-135447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2415',
internalId:  '',
customField: '20120211-180234'
};
webappMappings['7060']=webappMappings['7060-0ac9f05e2353b5009d97b759222a654a']={
webappId:    '7060',
documentId:  '165767',
internalId:  '0ac9f05e2353b5009d97b759222a654a',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '207788',
internalId:  '',
customField: '20110412-163614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11801',
internalId:  '',
customField: '20110819-102052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '131823',
internalId:  '',
customField: '20110503-105720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99323',
internalId:  '',
customField: '20110226-122956'
};
webappMappings['7008']=webappMappings['7008-15487']={
webappId:    '7008',
documentId:  '128486',
internalId:  '15487',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '232176',
internalId:  '',
customField: '20110818-091520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128486',
internalId:  '',
customField: '20110111-135601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '210688',
internalId:  '',
customField: '20110415-121057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128444',
internalId:  '',
customField: '20111101-113340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '165767',
internalId:  '',
customField: '20100820-191829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128465',
internalId:  '',
customField: '20100309-222648'
};
webappMappings['7060']=webappMappings['7060-97b7fe9547f3731c6b829d34f14cd738']={
webappId:    '7060',
documentId:  '207788',
internalId:  '97b7fe9547f3731c6b829d34f14cd738',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '177522',
internalId:  '',
customField: '20120214-175823'
};
webappMappings['1501']=webappMappings['1501-14013942']={
webappId:    '1501',
documentId:  '177522',
internalId:  '14013942',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '131423',
internalId:  '',
customField: '20110226-125436'
};
webappMappings['7008']=webappMappings['7008-15540']={
webappId:    '7008',
documentId:  '131823',
internalId:  '15540',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '137523',
internalId:  '',
customField: '20100515-212416'
};
webappMappings['7008']=webappMappings['7008-17142']={
webappId:    '7008',
documentId:  '137523',
internalId:  '17142',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-0379ba4b2fdb7667b6620e0193446cc0']={
webappId:    '7060',
documentId:  '232176',
internalId:  '0379ba4b2fdb7667b6620e0193446cc0',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '167989',
internalId:  '',
customField: '20100829-210553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '168410',
internalId:  '',
customField: '20110819-095851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '172689',
internalId:  '',
customField: '20101001-045831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '172389',
internalId:  '',
customField: '20101220-172439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '171789',
internalId:  '',
customField: '20101020-151903'
};
webappMappings['7005']=webappMappings['7005-1727']={
webappId:    '7005',
documentId:  '172389',
internalId:  '1727',
customField: 'language:pt;country:BR;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '177522',
internalId:  '1006',
customField: '1006'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INP0JK';
var companyName   = 'ORGAF+JIUJITSU+%26+SUB-MISSION+';
var htmlTitle	  = 'ORGAF';
var metaKeywords  = 'augusto+ferrari';
var metaContents  = 'orgaf+';
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();
};

