/* [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 theSitetree=[ 
	['PAGE','801',jdecode('APRESENTA%C3%87%C3%83O'),jdecode(''),'/801.html','true',[],''],
	['PAGE','7701',jdecode('AMIL'),jdecode(''),'/7701.html','true',[],''],
	['PAGE','16801',jdecode('clientes+amil'),jdecode(''),'/16801.html','true',[],''],
	['PAGE','16822',jdecode('ALL+LIFE'),jdecode(''),'/16822.html','true',[],''],
	['PAGE','16843',jdecode('Clientes+All+life'),jdecode(''),'/16843.html','true',[],''],
	['PAGE','7743',jdecode('BRADESCO+SAUDE'),jdecode(''),'/7743.html','true',[],''],
	['PAGE','11543',jdecode('clientes+Bradesco'),jdecode(''),'/11543.html','true',[],''],
	['PAGE','11585',jdecode('DIX+CLINIHAUER'),jdecode(''),'/11585.html','true',[],''],
	['PAGE','11606',jdecode('clientes+dix+clinihauer'),jdecode(''),'/11606.html','true',[],''],
	['PAGE','7785',jdecode('SUL+AMERICA+SA%C3%9ADE'),jdecode(''),'/7785.html','true',[],''],
	['PAGE','11627',jdecode('clientes+sul+america+sa%C3%BAde'),jdecode(''),'/11627.html','true',[],''],
	['PAGE','7806',jdecode('UNIMED'),jdecode(''),'/7806.html','true',[],''],
	['PAGE','16864',jdecode('clientes+unimed'),jdecode(''),'/16864.html','true',[],''],
	['PAGE','11669',jdecode('ANS'),jdecode(''),'/11669.html','true',[],''],
	['PAGE','11690',jdecode('NOTICIAS'),jdecode(''),'/11690.html','true',[],''],
	['PAGE','11711',jdecode('SAUDE+E+BEM+ESTAR'),jdecode(''),'/11711.html','true',[],''],
	['PAGE','16885',jdecode('FORMUL%C3%81RIO+COTA%C3%87%C3%83O+VIA+EMAIL'),jdecode(''),'/16885.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Vita02';
theSitetree.paletteFamily='C5E6FB';
theSitetree.keyvisualId='11283';
theSitetree.keyvisualName='kv_11283.jpg';
theSitetree.fontsetId='32116';
theSitetree.graphicsetId='13933';
theSitetree.contentColor='8B313F';
theSitetree.contentBGColor='F6FBFE';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				name: 			'Vita02',
				paletteFamily: 	'C5E6FB',
				keyvisualId: 	'11283',
				keyvisualName: 	'kv_11283.jpg',
				fontsetId: 		'32116',
				graphicsetId: 	'13933',
				contentColor: 	'8B313F',
				contentBGColor: 'F6FBFE',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20090611-142759'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20090611-144942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16864',
internalId:  '',
customField: '20090531-161117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16822',
internalId:  '',
customField: '20090611-150954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16801',
internalId:  '',
customField: '20090611-150257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7743',
internalId:  '',
customField: '20090531-202016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11543',
internalId:  '',
customField: '20090531-202051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16843',
internalId:  '',
customField: '20090611-151129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16885',
internalId:  '',
customField: '20090611-151301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11585',
internalId:  '',
customField: '20080321-200840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11606',
internalId:  '',
customField: '20080321-200840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7785',
internalId:  '',
customField: '20090531-161118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11627',
internalId:  '',
customField: '20080321-200840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7806',
internalId:  '',
customField: '20090531-161118'
};
webappMappings['1501']=webappMappings['1501-14135601']={
webappId:    '1501',
documentId:  '801',
internalId:  '14135601',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11669',
internalId:  '',
customField: '20080321-200840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11690',
internalId:  '',
customField: '20080321-200840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11711',
internalId:  '',
customField: '20080321-200840'
};
webappMappings['7008']=webappMappings['7008-8162']={
webappId:    '7008',
documentId:  '16885',
internalId:  '8162',
customField: 'language:pt;country:BR;'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INLJMQ';
var companyName   = '+COM+SA%C3%9ADE+VOCE+APROVEITA+O+QUE+A+VIDA+TEM+DE+MELHOR%2CSolicite+cota%C3%A7%C3%A3o+%21%21';
var htmlTitle	  = 'CONVENIOS+AMIL%2C+ALL+LIFE%2C+UNIMED+BRADESCO+SAUDE%2C+CLINIPAM+DIX+%2C+CLINIHAUER++EM+CURITIBA+ESCOLHA+FORMA+DE+ATENDIMENTO';
var metaKeywords  = 'convenios+m%C3%A9dicos%2C+planos+de+saude%2Call+life+curitiba%2C+all+life+realthy%2C++dix%2C+dix+clinihauer%2C+clinihauer%2C+clinipan%2C+clinipam%2C+unimed%2C+unimede%2C+%2C+sul+america%2C+bradesco+saude%2C+amil%2C+amil+dental%2C+planos%2C+empresariais%2C+individuais%2C+familiares%2C+cota%C3%A7%C3%A3o%2C+on+line%2C+saude%2C+hospitais+curitiba%2C+pronto+soccorro+%2C+pediatras%2C+cardiologistas%2C+clinicas%2C+kids%2C+hospital+infantil+pequeno+principe%2Ctelefone+ans+flx+unimed+empresarial%2C+flex';
var metaContents  = 'O+Portal+da+Consultora+Sandra+de+Conv%7Eenios+e+planos+de+sa%C3%BAde+Sandra+corretora+on+line++Planos+m%C3%A9dicos++Amil%2C+All+life%2C+Unimed%2C+Clinipam%2C+Clinipan%2C+Clinihauer%2C+Bradesco+Sa%C3%BAde%2C+Sul+Am%C3%A9rica+sa%C3%BAde+planos+individuai%2C+familiares+e+empresariais';
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();
};
