/* [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','301',jdecode('In%C3%ADcio'),jdecode(''),'/301.html','true',[],''],
	['PAGE','352',jdecode('Quem+somos'),jdecode(''),'/352.html','true',[],''],
	['PAGE','4701',jdecode('Lista+de+Servi%C3%A7os'),jdecode(''),'/4701/index.html','true',[ 
		['PAGE','21801',jdecode('Lembrancinhas'),jdecode(''),'/4701/21801.html','true',[],'']
	],''],
	['PAGE','12001',jdecode('Festas+e+Eventos'),jdecode(''),'/12001.html','true',[],''],
	['PAGE','13401',jdecode('Filmagem+e+Edi%C3%A7%C3%A3o'),jdecode(''),'/13401.html','true',[],''],
	['PAGE','14901',jdecode('Equipamentos'),jdecode(''),'/14901.html','true',[],''],
	['PAGE','5122',jdecode('Or%C3%A7amento'),jdecode(''),'/5122.html','true',[],''],
	['PAGE','19401',jdecode('Cultura'),jdecode(''),'/19401.html','true',[],''],
	['PAGE','30001',jdecode('A+Arte+de+Julian+Beever'),jdecode(''),'/30001.html','true',[],''],
	['PAGE','5143',jdecode('Contato'),jdecode(''),'/5143.html','true',[],''],
	['PAGE','35406',jdecode('Livro+de+visitas%2FF%C3%B3rum'),jdecode(''),'/35406/index.html','true',[ 
		['PAGE','35701',jdecode('Agradecimento'),jdecode(''),'/35406/35701.html','true',[],''],
		['PAGE','35401',jdecode('Servi%C3%A7o+de+bilhetes'),jdecode(''),'/35406/35401.html','false',[],'']
	],''],
	['PAGE','46401',jdecode('Fotos'),jdecode(''),'/46401.html','true',[],''],
	['PAGE','58501',jdecode('Master+Info'),jdecode(''),'/58501.html','true',[],''],
	['PAGE','58522',jdecode('Transfer+e+Hot+Stamp'),jdecode(''),'/58522.html','true',[],''],
	['PAGE','49701',jdecode('Parceiros'),jdecode(''),'/49701.html','true',[],''],
	['PAGE','56301',jdecode('Clientes'),jdecode(''),'/56301.html','true',[],'']];
var siteelementCount=19;
theSitetree.topTemplateName='Trend';
theSitetree.paletteFamily='3F70CF';
theSitetree.keyvisualId='7932';
theSitetree.keyvisualName='kv_7932.jpg';
theSitetree.fontsetId='16911';
theSitetree.graphicsetId='12323';
theSitetree.contentColor='163D88';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				name: 			'Trend',
				paletteFamily: 	'3F70CF',
				keyvisualId: 	'7932',
				keyvisualName: 	'kv_7932.jpg',
				fontsetId: 		'16911',
				graphicsetId: 	'12323',
				contentColor: 	'163D88',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-4965806']={
webappId:    '1501',
documentId:  '301',
internalId:  '4965806',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-2570']={
webappId:    '7008',
documentId:  '5122',
internalId:  '2570',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20091104-095824'
};
webappMappings['7060']=webappMappings['7060-9a480bbb6bb8451f356d98d7b72d48f3']={
webappId:    '7060',
documentId:  '30001',
internalId:  '9a480bbb6bb8451f356d98d7b72d48f3',
customField: 'language:pt;country:BR;'
};
webappMappings['1002']=webappMappings['1002-35406avec10invjks']={
webappId:    '1002',
documentId:  '35406',
internalId:  '35406avec10invjks',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56301',
internalId:  '',
customField: '20090107-113106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '352',
internalId:  '',
customField: '20070518-233407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20070531-191949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21801',
internalId:  '',
customField: '20070521-232007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20070518-182613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13401',
internalId:  '',
customField: '20070518-180854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14901',
internalId:  '',
customField: '20070518-230052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5122',
internalId:  '',
customField: '20081007-205054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19401',
internalId:  '',
customField: '20070520-094806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30001',
internalId:  '',
customField: '20070531-192053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5143',
internalId:  '',
customField: '20070518-232409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35406',
internalId:  '',
customField: '20070526-191113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35701',
internalId:  '',
customField: '20070531-191801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35401',
internalId:  '',
customField: '20070531-192201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46401',
internalId:  '',
customField: '20091104-100140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58501',
internalId:  '',
customField: '20081108-185648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58522',
internalId:  '',
customField: '20081007-211612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49701',
internalId:  '',
customField: '20081007-210132'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INVJKS';
var companyName   = 'A+solu%C3%A7%C3%A3o+digital+perfeita+para+suas+festas+e+eventos';
var htmlTitle	  = 'Master+Vision+Produ%C3%A7%C3%B5es';
var metaKeywords  = 'Festas+e+Eventos';
var metaContents  = 'Sonoriza%C3%A7%C3%A3o+com+DJ+ou+Banda+Festas+e+Eventos.+Casamentos%2C+Anivers%C3%A1rios%2C+Desfiles%2C+Confraterniza%C3%A7%C3%B5es.+Estudio+de+Audio+e+Video.';
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();
};
