/* [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','1301',jdecode('Home'),jdecode(''), jdecode('%2F1301.html'), 'true',[],'',''],
	['PAGE','10606',jdecode('Saiu+na+m%C3%ADdia'),jdecode(''), jdecode('%2F10606.html'), 'true',[],'',''],
	['PAGE','10627',jdecode('Tempo+de+Tramento'),jdecode(''), jdecode('%2F10627.html'), 'true',[],'',''],
	['PAGE','20601',jdecode('Implantes+dent%C3%A1rios'),jdecode(''), jdecode('%2F20601.html'), 'true',[],'',''],
	['PAGE','113812',jdecode('Implantes+Guiados%28+sem+corte%29'),jdecode(''), jdecode('%2F113812.html'), 'true',[],'',''],
	['PAGE','10585',jdecode('Curriculo'),jdecode(''), jdecode('%2F10585.html'), 'true',[],'',''],
	['PAGE','10564',jdecode('Ortodontia'),jdecode(''), jdecode('%2F10564.html'), 'true',[],'',''],
	['PAGE','88412',jdecode('Ortodontia+Est%C3%A9tica'),jdecode(''), jdecode('%2F88412.html'), 'true',[],'',''],
	['PAGE','10543',jdecode('Tratamentos+est%C3%A9ticos'),jdecode(''), jdecode('%2F10543.html'), 'true',[],'',''],
	['PAGE','10501',jdecode('Consult%C3%B3rio'),jdecode(''), jdecode('%2F10501.html'), 'true',[],'',''],
	['PAGE','11501',jdecode('Deixe+sua+d%C3%BAvida'),jdecode(''), jdecode('%2F11501.html'), 'true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='AAA769';
theSitetree.keyvisualId='2445';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='406';
theSitetree.graphicsetId='462';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var prodDef={
  wl_name: 'brazilprod',
  product: 'WSCSYSSSSLY0X9WF'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Collage',
				paletteFamily: 	'AAA769',
				keyvisualId: 	'2445',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'406',
				graphicsetId: 	'462',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'AAA769',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-3105']={
webappId:    '7008',
documentId:  '11501',
internalId:  '3105',
customField: 'language:pt;country:BR;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1301',
internalId:  '',
customField: '20110311-082414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10606',
internalId:  '',
customField: '20090719-213723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10585',
internalId:  '',
customField: '20101208-102509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10543',
internalId:  '',
customField: '20080925-213208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20601',
internalId:  '',
customField: '20100831-102516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10564',
internalId:  '',
customField: '20081019-124535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20080206-155333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10627',
internalId:  '',
customField: '20110105-141422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88412',
internalId:  '',
customField: '20101019-100751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20080131-193050'
};
webappMappings['1501']=webappMappings['1501-13424538']={
webappId:    '1501',
documentId:  '1301',
internalId:  '13424538',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '113812',
internalId:  '',
customField: '20101208-103127'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INVX5Y';
var companyName   = 'Dr.+Milton+Sabino+-+Odontologia+';
var htmlTitle	  = 'Milton+Sabino+Odontologia+Especializada';
var metaKeywords  = 'odonto%2Codontologia%2Cdente%2Cperiodontia%2Cest%C3%A9tica%2Cclareamento%2Cimplante%2Cimplante+imediato%2Cdrsabino.com%2Cdrsabino.net%2Corto%2Cortodontia%2Ccirurgia+de+estomago%2Cbariatrica%2Cprotese%2Creabilita%C3%A7%C3%A3o%2Cartigos%2Ccasos+clinicos%2Cdentista%2Cprofessor%2Cconsultorio%2Cdentario%2Cdentista%2Cortodontista%2Cperiodontista%2Cimplantodontista%2Cpre%C3%A7o%2Cspa%2Cmilton%2Csabino%2Curgencia%2Cemergencia%2Ccurso%2Cprofessor%2Cmoema%2Csafira%2Cauto-ligavel%2Csao+paulo%2C+itatiba';
var metaContents  = 'odontologia%2Cartigos%2Csa%C3%BAde%2Cmedicina%2Cperiodontia%2Cortodontia%2Cest%C3%A9tica%2Cimplantes';
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();
};

