/* [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','2001',jdecode('Inicial'),jdecode(''), jdecode('%2F2001.html'), 'true',[],'',''],
	['PAGE','2301',jdecode('Lemb.nascimento'),jdecode(''), jdecode('%2F2301.html'), 'true',[],'',''],
	['PAGE','2322',jdecode('Lemb.+casamento'),jdecode(''), jdecode('%2F2322.html'), 'true',[],'',''],
	['PAGE','2343',jdecode('Lemb.batizado'),jdecode(''), jdecode('%2F2343.html'), 'true',[],'',''],
	['PAGE','2364',jdecode('Enfeite+maternidade'),jdecode(''), jdecode('%2F2364.html'), 'true',[],'',''],
	['PAGE','2385',jdecode('kits+'),jdecode(''), jdecode('%2F2385.html'), 'true',[],'',''],
	['PAGE','2406',jdecode('Puxadores'),jdecode(''), jdecode('%2F2406.html'), 'true',[],'',''],
	['PAGE','2427',jdecode('Lustres'),jdecode(''), jdecode('%2F2427.html'), 'true',[],'',''],
	['PAGE','10701',jdecode('Abajur'),jdecode(''), jdecode('%2F10701.html'), 'true',[],'',''],
	['PAGE','10722',jdecode('Espelhos+p%2F+interruptor'),jdecode(''), jdecode('%2F10722.html'), 'true',[],'',''],
	['PAGE','10743',jdecode('Rel%C3%B3gios'),jdecode(''), jdecode('%2F10743.html'), 'true',[],'',''],
	['PAGE','10764',jdecode('Farmacinhas'),jdecode(''), jdecode('%2F10764.html'), 'true',[],'',''],
	['PAGE','10785',jdecode('Border+cerquinha'),jdecode(''), jdecode('%2F10785.html'), 'true',[],'',''],
	['PAGE','2052',jdecode('Contato'),jdecode(''), jdecode('%2F2052.html'), 'true',[],'',''],
	['PAGE','2448',jdecode('Dani+na+M%C3%ADdia'),jdecode(''), jdecode('%2F2448.html'), 'true',[],'',''],
	['PAGE','2469',jdecode('Livro+de+visitas'),jdecode(''), jdecode('%2F2469.html'), 'true',[],'',''],
	['PAGE','16101',jdecode('Formas+de+pagamento+e...'),jdecode(''), jdecode('%2F16101.html'), 'true',[],'',''],
	['PAGE','19501',jdecode('Tudo+personalizado+pra+vc...'),jdecode(''), jdecode('%2F19501.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Tendril';
theSitetree.paletteFamily='F5E7D2';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33100';
theSitetree.graphicsetId='14060';
theSitetree.contentColor='D0A363';
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: 	'F5E7D2',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33100',
				graphicsetId: 	'14060',
				contentColor: 	'D0A363',
				contentBGColor: 'FFFFFF',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20120104-001341'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2052',
internalId:  '',
customField: '20120104-011229'
};
webappMappings['1002']=webappMappings['1002-2469avf340i71yeh']={
webappId:    '1002',
documentId:  '2469',
internalId:  '2469avf340i71yeh',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20120104-014017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2385',
internalId:  '',
customField: '20120104-003708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2322',
internalId:  '',
customField: '20120104-002603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2343',
internalId:  '',
customField: '20110208-000504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2364',
internalId:  '',
customField: '20120104-003439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2406',
internalId:  '',
customField: '20120104-003858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2427',
internalId:  '',
customField: '20120104-004825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2448',
internalId:  '',
customField: '20120104-012212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2469',
internalId:  '',
customField: '20120104-012242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10701',
internalId:  '',
customField: '20120104-004939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10722',
internalId:  '',
customField: '20120104-005225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10743',
internalId:  '',
customField: '20120104-010021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10764',
internalId:  '',
customField: '20120104-010120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10785',
internalId:  '',
customField: '20101021-014525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19501',
internalId:  '',
customField: '20120104-012717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16101',
internalId:  '',
customField: '20120104-012514'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I71YEH';
var companyName   = 'Ateli%C3%AA+Dani+Decor+Baby';
var htmlTitle	  = '';
var metaKeywords  = 'Lembrancinhas+de+maternidade%2Clembrancinhas+de+nascimento%2Clembrancinhas%2Cdecora%C3%A7%C3%A3o+de+quartos+de+beb%C3%AA%2Cdecora%C3%A7%C3%A3o+infantil%2Ckit+beb%C3%AA%2Ckit+beb%C3%AA+decorativo%2Cenfeite+de+maternidade%2Cquadro+maternidade%2Cquadro+para+porta+de+maternidade%2Cenfeite+para+porta%2Clustre+beb%C3%AA%2Clustre+infantil%2Clembrancinhas+personalizadas%2Cpersonalizados%2Clembrancinha+para+batizado%2Clembrancinhas+de+batizado%2Cabajur%2Cpuxador+infantil%2Cpuxadores%2Cpuxaore+personalizado%2C';
var metaContents  = 'Decora%C3%A7%C3%A3o+infantil%2Cdecora%C3%A7%C3%A3o+beb%C3%AA%2Cdecora%C3%A7%C3%A3o+de+quartos+de+beb%C3%AA%2Cdecora%C3%A7%C3%A3o%2C';
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();
};

