/* [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','1801',jdecode('Inicial'),jdecode(''),'/1801.html','true',[],''],
	['PAGE','1852',jdecode('Quem+somos'),jdecode(''),'/1852.html','true',[],''],
	['PAGE','3501',jdecode('Projetos+desenvolvidos'),jdecode(''),'/3501.html','true',[],''],
	['PAGE','18523',jdecode('TV+Digital'),jdecode(''),'/18523.html','true',[],''],
	['PAGE','1873',jdecode('Servi%C3%A7o'),jdecode(''),'/1873.html','true',[],''],
	['PAGE','3522',jdecode('CFTV'),jdecode(''),'/3522.html','true',[],''],
	['PAGE','3543',jdecode('Antena+Coletiva'),jdecode(''),'/3543.html','true',[],''],
	['PAGE','5201',jdecode('Seguran%C3%A7a'),jdecode(''),'/5201.html','true',[],''],
	['PAGE','6912',jdecode('Livros+-+Fotos'),jdecode(''),'/6912.html','true',[],''],
	['PAGE','11312',jdecode('Alguns+Projetos+-+Fotos'),jdecode(''),'/11312.html','true',[],''],
	['PAGE','6933',jdecode('Prot%C3%B3tipos+-+Fotos'),jdecode(''),'/6933.html','true',[],''],
	['PAGE','17823',jdecode('Lay-Out'),jdecode(''),'/17823.html','true',[],''],
	['PAGE','1894',jdecode('Contato'),jdecode(''),'/1894.html','true',[],'']];
var siteelementCount=13;
theSitetree.topTemplateName='Weekend';
theSitetree.paletteFamily='4A53AF';
theSitetree.keyvisualId='4033';
theSitetree.keyvisualName='kv_4033.jpg';
theSitetree.fontsetId='10526';
theSitetree.graphicsetId='11142';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='5C65C1';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				name: 			'Weekend',
				paletteFamily: 	'4A53AF',
				keyvisualId: 	'4033',
				keyvisualName: 	'kv_4033.jpg',
				fontsetId: 		'10526',
				graphicsetId: 	'11142',
				contentColor: 	'FFFFFF',
				contentBGColor: '5C65C1',
				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: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20090608-085249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20090606-124211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1894',
internalId:  '',
customField: '20090606-124242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20090606-124412'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20090609-132754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3501',
internalId:  '',
customField: '20090606-124316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3522',
internalId:  '',
customField: '20090606-124341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3543',
internalId:  '',
customField: '20090606-124359'
};
webappMappings['1501']=webappMappings['1501-13631325']={
webappId:    '1501',
documentId:  '1801',
internalId:  '13631325',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6933',
internalId:  '',
customField: '20090608-195920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6912',
internalId:  '',
customField: '20090606-124436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11312',
internalId:  '',
customField: '20090608-195958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17823',
internalId:  '',
customField: '20090608-195843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18523',
internalId:  '',
customField: '20090806-210121'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHQG7';
var companyName   = 'Afterglow+Eletr%C3%B4nica';
var htmlTitle	  = 'Afterglow+Eletr%C3%B4nica';
var metaKeywords  = 'Eletr%C3%B4nica';
var metaContents  = 'Site+da+Afterglow+Eletr%C3%B4nica%2C+empresa+que+atua+no+desenvolvimento+de+circuitos+eletr%C3%B4nicos+e+manuten%C3%A7%C3%A3o+especifica.';
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();
};
