/* [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','11',jdecode('Home'),jdecode(''),'/11.html','true',[],'',''],
	['PAGE','32',jdecode('Valores%2C+prazos+etc.'),jdecode(''),'/32/index.html','true',[ 
		['PAGE','41',jdecode('Dupla+Nacionalidade'),jdecode(''),'/32/41.html','true',[],'',''],
		['PAGE','50',jdecode('Rela%C3%A7%C3%B5es+Internacionais'),jdecode(''),'/32/50.html','true',[],'','']
	],'',''],
	['PAGE','59',jdecode('Nossos+profissionais'),jdecode(''),'/59.html','true',[],'',''],
	['PAGE','1294',jdecode('Servi%C3%A7os'),jdecode(''),'/1294.html','true',[],'',''],
	['PAGE','1558',jdecode('+Clientes+Satisfeitos'),jdecode(''),'/1558.html','true',[],'',''],
	['PAGE','1567',jdecode('Consultas+e+Pareceres'),jdecode(''),'/1567.html','true',[],'',''],
	['PAGE','9601',jdecode('English+Version'),jdecode(''),'/9601.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Straight';
theSitetree.paletteFamily='330066';
theSitetree.keyvisualId='1545';
theSitetree.keyvisualName='bildung.jpg';
theSitetree.fontsetId='238';
theSitetree.graphicsetId='301';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Straight',
				paletteFamily: 	'330066',
				keyvisualId: 	'1545',
				keyvisualName: 	'bildung.jpg',
				fontsetId: 		'238',
				graphicsetId: 	'301',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'003366',
				b_color: 		'D7D7D7',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '11',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11',
internalId:  '',
customField: '20100517-060949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20100712-082958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41',
internalId:  '',
customField: '20100212-121649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50',
internalId:  '',
customField: '20090703-114759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59',
internalId:  '',
customField: '20100322-111322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1294',
internalId:  '',
customField: '20100212-120507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1558',
internalId:  '',
customField: '20100714-094249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1567',
internalId:  '',
customField: '20100712-083135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9601',
internalId:  '',
customField: '20070622-085826'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN2E8X';
var companyName   = 'Rassi+Consultoria';
var htmlTitle	  = 'RASSI+CONSULTORIA+EM+RELA%C3%87%C3%95ES+INTERNACIONAIS';
var metaKeywords  = 'dupla+nacionalidade+italiana%3B+dupla+nacionalidade+portuguesa%3B+dupla+nacionalidade+espanhola%3B+dupla+nacionalidade+romena%3B+dupla+nacionalidade+polonesa%3B+dupla+nacionalidade+h%C3%BAngara%3B+vistos+para+o+Reino+Unido%3B+vistos+para+Portugal%3B+Vistos+para+a+Espanha%3B+vistos+para+estrangeiros%3B+Naturaliza%C3%A7%C3%B5es+Buscas+de+documentos+em+Portugal%2C+Espanha%2C+It%C3%A1lia+Highly+Skilled+Program+UK+A%C3%A7%C3%B5es+de+retifica%C3%A7%C3%A3o+A%C3%A7%C3%B5es+de+suprimento+de+assentamento+de+registro+civil';
var metaContents  = 'rela%C3%A7%C3%B5es+internacionais%2C+direito+internacional%2C+consultoria%2C+assessoria%2C+servi%C3%A7os+jur%C3%ADdicos%2C+dupla+nacionalidade%2C+vistos%2C+Reino+Unido%2C+Espanha%2C+Portugal%2Ccidadania+italiana%2C+cidadania+espanhola%2C+Highly+Skilled+Program+UK%2C+Buscas+de+documentos';
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();
};
