/* [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','1901',jdecode('Home'),jdecode(''), jdecode('%2F1901.html'), 'true',[],'',''],
	['PAGE','6201',jdecode('A+Escola'),jdecode(''), jdecode('%2F6201.html'), 'true',[],'',''],
	['PAGE','6222',jdecode('Pedagogia+Waldorf'),jdecode(''), jdecode('%2F6222%2Findex.html'), 'true',[ 
		['PAGE','42101',jdecode('Sobre+o+Ensino+Fundamental'),jdecode(''), jdecode('%2F6222%2F42101.html'), 'true',[],'',''],
		['PAGE','54958',jdecode('Escolas+Waldorf+no+mundo'),jdecode(''), jdecode('%2F6222%2F54958.html'), 'true',[],'','']
	],'',''],
	['PAGE','60358',jdecode('Imagens+da+Quer%C3%AAncia'),jdecode(''), jdecode('%2F60358.html'), 'true',[],'',''],
	['PAGE','21001',jdecode('Forma%C3%A7%C3%A3o+de+professores'),jdecode(''), jdecode('%2F21001.html'), 'true',[],'',''],
	['PAGE','6501',jdecode('Eventos'),jdecode(''), jdecode('%2F6501.html'), 'true',[],'',''],
	['PAGE','6522',jdecode('Calend%C3%A1rio+2012'),jdecode(''), jdecode('%2F6522.html'), 'true',[],'',''],
	['PAGE','16701',jdecode('Links'),jdecode(''), jdecode('%2F16701.html'), 'true',[],'',''],
	['PAGE','6564',jdecode('Fale+conosco'),jdecode(''), jdecode('%2F6564.html'), 'true',[],'',''],
	['PAGE','1606',jdecode('Livro+de+visitas%2FF%C3%B3rum'),jdecode(''), jdecode('%2F1606.html'), 'true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Tendril';
theSitetree.paletteFamily='E4EBF5';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33095';
theSitetree.graphicsetId='14057';
theSitetree.contentColor='255092';
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: 			'Tendril',
				paletteFamily: 	'E4EBF5',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33095',
				graphicsetId: 	'14057',
				contentColor: 	'255092',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-1606avec10inlgfn']={
webappId:    '1002',
documentId:  '1606',
internalId:  '1606avec10inlgfn',
customField: 'icq=false'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '1901',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6201',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['7008']=webappMappings['7008-1268']={
webappId:    '7008',
documentId:  '6564',
internalId:  '1268',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20120109-122546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20110203-114841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6222',
internalId:  '',
customField: '20100726-143633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21001',
internalId:  '',
customField: '20120109-083120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20100726-141957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6522',
internalId:  '',
customField: '20120131-135922'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6222',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16701',
internalId:  '',
customField: '20110528-134731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6564',
internalId:  '',
customField: '20110501-115906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60358',
internalId:  '',
customField: '20110501-124837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1606',
internalId:  '',
customField: '20071015-142527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42101',
internalId:  '',
customField: '20090820-104404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54958',
internalId:  '',
customField: '20100122-070145'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '42101',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '54958',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '60358',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '21001',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6501',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6522',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '16701',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6564',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '1606',
internalId:  '',
customField: 'language:pt;country:BR;'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INLGFN';
var companyName   = 'Escola+Waldorf+Quer%C3%AAncia+de+Ensino+Fundamental';
var htmlTitle	  = 'Escola+Waldorf+Quer%C3%AAncia+-+Porto+Alegre+-+RS';
var metaKeywords  = 'Querencia%2C+Quer%C3%AAncia%2C+escola%2C+waldorf%2C+Porto%2C+Alegre%2C+educacao%2C+ensino%2C+pedagogia%2C+fundamental%2C+Associativo%2C+Associativa%2C+b%C3%A1sico%2C+basico%2C+primeiro+grau%2C+1%C2%B0+Grau%2C+2%C2%B0+Grau%2C+Rudolf+Steiner%2C+Antroposofia%2C+euritimia%2C+euritmia%2C+manualidades%2C+ecologia%2C+PAZ%2C+crian%C3%A7a%2C+poesia%2C+artes%2C+ci%C3%AAncia%2C+cultura';
var metaContents  = 'Escola+Waldorf+Quer%C3%AAncia+de+Ensino+Fundamental%2C+pioneira+em+Pedagogia+Waldorf+no+Rio+Grande+do+Sul%21%21';
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();
};

