/* [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','87526',jdecode('PAIS'),jdecode(''),'/87526.html','false',[],'',''],
	['PAGE','83926',jdecode('INFORMATIVO'),jdecode(''),'/83926.html','false',[],'',''],
	['PAGE','12',jdecode('BOUQUETS'),jdecode(''),'/12.html','true',[],'',''],
	['PAGE','1708',jdecode('ARRANJOS'),jdecode(''),'/1708.html','true',[],'',''],
	['PAGE','94026',jdecode('FLORES+PLANTADAS'),jdecode(''),'/94026.html','true',[],'',''],
	['PAGE','1057',jdecode('AMOR'),jdecode(''),'/1057.html','true',[],'',''],
	['PAGE','96026',jdecode('COMPLEMENTOS'),jdecode(''),'/96026.html','true',[],'',''],
	['PAGE','81226',jdecode('DECORA%C3%87%C3%95ES'),jdecode(''),'/81226.html','true',[],'',''],
	['PAGE','47801',jdecode('CESTAS'),jdecode(''),'/47801.html','true',[],'',''],
	['PAGE','2679',jdecode('CESTAS+GOURMET'),jdecode(''),'/2679.html','true',[],'',''],
	['PAGE','1075',jdecode('FA%C3%87A+SEU+PEDIDO'),jdecode(''),'/1075.html','true',[],'',''],
	['PAGE','56801',jdecode('ENTREGAS+E+FRETE'),jdecode(''),'/56801.html','true',[],'',''],
	['PAGE','1022',jdecode('COMO+PAGAR%3F'),jdecode(''),'/1022.html','true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Startup';
theSitetree.paletteFamily='000066';
theSitetree.keyvisualId='1383';
theSitetree.keyvisualName='callcenter2.jpg';
theSitetree.fontsetId='232';
theSitetree.graphicsetId='292';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Startup',
				paletteFamily: 	'000066',
				keyvisualId: 	'1383',
				keyvisualName: 	'callcenter2.jpg',
				fontsetId: 		'232',
				graphicsetId: 	'292',
				contentColor: 	'000066',
				contentBGColor: 'FFFFFF',
				a_color: 		'000066',
				b_color: 		'666666',
				c_color: 		'000000',
				d_color: 		'FF0000',
				e_color: 		'FF0000',
				f_color: 		'FF0000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7050']=webappMappings['7050-162']={
webappId:    '7050',
documentId:  '2679',
internalId:  '162',
customField: 'language:pt;country:BR;'
};
webappMappings['7008']=webappMappings['7008-1044']={
webappId:    '7008',
documentId:  '1075',
internalId:  '1044',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12',
internalId:  '',
customField: '20100111-043636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1708',
internalId:  '',
customField: '20100113-105118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1057',
internalId:  '',
customField: '20100113-104029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47801',
internalId:  '',
customField: '20100113-111335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2679',
internalId:  '',
customField: '20090804-195135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1075',
internalId:  '',
customField: '20100122-130450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1022',
internalId:  '',
customField: '20100113-111511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56801',
internalId:  '',
customField: '20091207-084404'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '12',
internalId:  '1501',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81226',
internalId:  '',
customField: '20100113-110428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83926',
internalId:  '',
customField: '20100212-065902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96026',
internalId:  '',
customField: '20100122-120205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87526',
internalId:  '',
customField: '20090804-194048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94026',
internalId:  '',
customField: '20100113-103450'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN2226';
var companyName   = 'MONET+FLORES+16-3011-7971';
var htmlTitle	  = 'www.monetflores.com.br';
var metaKeywords  = 'floricultura%2C+flores%2Ccestas%2Cdecora%C3%A7%C3%B5es%2C+eventos%2Cassinaturas%2C+festas%2Carranjos%2Cbouquets%2C+PRESENTES%2C+ANIVERSARIOS%2C+BODAS%2C+COFFEE-+BREAKS%2C+FORMATURAS%2C+CASAMENTO%2C+FLORES+TROPICAIS%2C+CESTA+DE+CAF%C3%89+DA+MANH%C3%83%2C+CESTA+DE+CHOCOLATE%2C+MANUTEN%C3%87%C3%83O+DE+ARRANJOS%2C+cestas+dia+das+m%C3%A3es%2C+flores+dia+das+m%C3%A3es';
var metaContents  = 'floricultura%2C+flores%2Ccestas%2Cdecora%C3%A7%C3%B5es%2Ceventos%2C+assinaturas%2C+festas%2C+arranjos%2C+bouquets%2C+PRESENTES%2C+ANIVERS%C3%81RIOS%2C+FORMATURAS%2C+COFFEE-+BREAKS%2C+CASAMENTOS%2C+FLORES+TROPICAIS%2C+ROSAS%2C+CESTAS+DE+CAF%C3%89+DA+MANH%C3%83%2C+CESTAS+DE+CHOCOLATE%2C+MANUTEN%C3%87%C3%83O+DE+ARRANJOS%2C+floricultura+ribeir%C3%A3o+preto%2C+cestas+dia+das+m%C3%A3es%2C+flores+dia+das+m%C3%A3es';
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();
};
