/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],''],
	['PAGE','7401',jdecode('Quem+somos'),jdecode(''),'/7401.html','true',[],''],
	['PAGE','7422',jdecode('Produtos+e+Servi%C3%A7os'),jdecode(''),'/7422.html','true',[],''],
	['PAGE','7443',jdecode('Clientes'),jdecode(''),'/7443.html','true',[],''],
	['PAGE','44201',jdecode('Portif%C3%B3lio'),jdecode(''),'/44201/index.html','true',[ 
		['PAGE','49701',jdecode('%E2%80%A2+Identidade+Visual'),jdecode(''),'/44201/49701.html','true',[],''],
		['PAGE','44222',jdecode('%E2%80%A2+Jornais+e+Revistas'),jdecode(''),'/44201/44222.html','true',[],''],
		['PAGE','44285',jdecode('%E2%80%A2+Logotipos'),jdecode(''),'/44201/44285.html','true',[],''],
		['PAGE','45501',jdecode('%E2%80%A2+Papelaria'),jdecode(''),'/44201/45501.html','true',[],''],
		['PAGE','44243',jdecode('%E2%80%A2+An%C3%BAncios'),jdecode(''),'/44201/44243.html','true',[],''],
		['PAGE','64901',jdecode('%E2%80%A2+Convites'),jdecode(''),'/44201/64901.html','true',[],''],
		['PAGE','44264',jdecode('%E2%80%A2+Marketing+Direto'),jdecode(''),'/44201/44264.html','true',[],''],
		['PAGE','44306',jdecode('%E2%80%A2+Outros'),jdecode(''),'/44201/44306.html','true',[],'']
	],''],
	['PAGE','9201',jdecode('Parceiros'),jdecode(''),'/9201.html','true',[],''],
	['PAGE','694',jdecode('Contato'),jdecode(''),'/694.html','true',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='NewYork';
theSitetree.paletteFamily='660000';
theSitetree.keyvisualId='1003';
theSitetree.keyvisualName='color.jpg';
theSitetree.fontsetId='168';
theSitetree.graphicsetId='197';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				name: 			'NewYork',
				paletteFamily: 	'660000',
				keyvisualId: 	'1003',
				keyvisualName: 	'color.jpg',
				fontsetId: 		'168',
				graphicsetId: 	'197',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'660000',
				c_color: 		'000000',
				d_color: 		'990000',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-3217']={
webappId:    '7008',
documentId:  '694',
internalId:  '3217',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20090216-162846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20090212-222956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7422',
internalId:  '',
customField: '20071112-213937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7443',
internalId:  '',
customField: '20090213-004553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44201',
internalId:  '',
customField: '20071108-213159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44222',
internalId:  '',
customField: '20090212-174813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44243',
internalId:  '',
customField: '20090211-200612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49701',
internalId:  '',
customField: '20090213-000404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45501',
internalId:  '',
customField: '20090212-164628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64901',
internalId:  '',
customField: '20071120-160615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44264',
internalId:  '',
customField: '20090212-205820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44285',
internalId:  '',
customField: '20090211-204104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44306',
internalId:  '',
customField: '20090212-204016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9201',
internalId:  '',
customField: '20070528-121054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '694',
internalId:  '',
customField: '20080213-204310'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN333O';
var companyName   = 'comunica%C3%A7%C3%A3o+e+design+gr%C3%A1fico';
var htmlTitle	  = 'Casa+da+Arte+Comunica%C3%A7%C3%A3o+Visual';
var metaKeywords  = 'Casa+da+Arte+Comunica%C3%A7%C3%A3o+Visual%2C+Casa+dArte+Comunica%C3%A7%C3%A3o+Visual%2C+design+gr%C3%A1fico%2C+publicidade%2C+Luciana+Carranca%2C+Paulo+Victor+de+Mello%2C+cria%C3%A7%C3%A3o%2C+comunica%C3%A7%C3%A3o%2C+diagrama%C3%A7%C3%A3o%2C+identidade+visual%2C+logomarcas%2C+logotipos%2C+jornais%2C+revistas%2C+an%C3%BAncios%2C+cat%C3%A1logos%2C+folders%2C+cart%C3%B5es%2C+convites%2C+escaneamento%2C+tratamento+de+imagens%2C+ilustra%C3%A7%C3%B5es%2C+convites+personalizados';
var metaContents  = 'Casa+da+Arte+Comunica%C3%A7%C3%A3o+Visual%2C+Casa+dArte+Comunica%C3%A7%C3%A3o+Visual%2C+design+gr%C3%A1fico%2C+publicidade%2C+Luciana+Carranca%2C+Paulo+Victor+de+Mello%2C+cria%C3%A7%C3%A3o%2C+comunica%C3%A7%C3%A3o%2C+diagrama%C3%A7%C3%A3o%2C+identidade+visual%2C+logomarcas%2C+logotipos%2C+jornais%2C+revistas%2C+an%C3%BAncios%2C+cat%C3%A1logos%2C+folders%2C+cart%C3%B5es%2C+convites%2C+escaneamento%2C+tratamento+de+imagens%2C+ilustra%C3%A7%C3%B5es%2C+convites+personalizados';
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();
};
