/* [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','1901',jdecode('Inicial'),jdecode(''), jdecode('%2F1901.html'), 'true',[],'',''],
	['PAGE','1952',jdecode('LOJA'),jdecode(''), jdecode('%2F1952.html'), 'true',[],'',''],
	['PAGE','1973',jdecode('RA%C3%87%C3%95ES'),jdecode(''), jdecode('%2F1973.html'), 'true',[],'',''],
	['PAGE','1994',jdecode('PEIXES'),jdecode(''), jdecode('%2F1994.html'), 'true',[],'',''],
	['PAGE','2015',jdecode('FILTROS'),jdecode(''), jdecode('%2F2015.html'), 'true',[],'',''],
	['PAGE','2036',jdecode('AQU%C3%81RIOS'),jdecode(''), jdecode('%2F2036.html'), 'true',[],'',''],
	['PAGE','2057',jdecode('PLANTAS'),jdecode(''), jdecode('%2F2057.html'), 'true',[],'',''],
	['PAGE','26812',jdecode('DECORA%C3%87%C3%83O'),jdecode(''), jdecode('%2F26812.html'), 'true',[],'',''],
	['PAGE','2078',jdecode('DICAS'),jdecode(''), jdecode('%2F2078.html'), 'true',[],'',''],
	['PAGE','2099',jdecode('NOVIDADES'),jdecode(''), jdecode('%2F2099.html'), 'true',[],'',''],
	['PAGE','2120',jdecode('PROMO%C3%87OES'),jdecode(''), jdecode('%2F2120.html'), 'true',[],'',''],
	['ITEM','21712',jdecode('MAPA'),jdecode(''), jdecode('http%3A%2F%2Fmaps.google.com.br%2Fmaps%3Ff%3Dq%26source%3Ds_q%26hl%3Dpt-br%26geocode%3D%26q%3DRua%2BMarqu%25C3%25AAs%2Bde%2BItu%2C%2BS%25C3%25A3o%2BPaulo%26aq%3D2%26sll%3D-14.239424%2C-53.186502%26sspn%3D41.538686%2C56.337891%26ie%3DUTF8%26hq%3D%26hnear%3DR.%2BMarqu%25C3%25AAs%2Bde%2BItu%2B-%2BS%25C3%25A3o%2BPaulo%26z%3D16'), 'true',[],'','_blank'],
	['PAGE','8301',jdecode('CONTATO'),jdecode(''), jdecode('%2F8301.html'), 'true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Transluszent';
theSitetree.paletteFamily='009900';
theSitetree.keyvisualId='9240';
theSitetree.keyvisualName='kv2.swf';
theSitetree.fontsetId='17363';
theSitetree.graphicsetId='12759';
theSitetree.contentColor='009900';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var prodDef={
  wl_name: 'brazilprod',
  product: 'WSCSYSSSSLY0X9A9'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Transluszent',
				paletteFamily: 	'009900',
				keyvisualId: 	'9240',
				keyvisualName: 	'kv2.swf',
				fontsetId: 		'17363',
				graphicsetId: 	'12759',
				contentColor: 	'009900',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-e3c2876bb7562e8b08be00f177eb0ba2']={
webappId:    '7060',
documentId:  '1952',
internalId:  'e3c2876bb7562e8b08be00f177eb0ba2',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-21fe32dc65ded7856be19a00b0282fbb']={
webappId:    '7060',
documentId:  '1973',
internalId:  '21fe32dc65ded7856be19a00b0282fbb',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-cdf490b1af28c5d2f61457fb8faef46a']={
webappId:    '7060',
documentId:  '1994',
internalId:  'cdf490b1af28c5d2f61457fb8faef46a',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-9f437a973b22cfcc47d04245b3815845']={
webappId:    '7060',
documentId:  '2015',
internalId:  '9f437a973b22cfcc47d04245b3815845',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-146dc71efd59abc81efa0909bc4ab692']={
webappId:    '7060',
documentId:  '2036',
internalId:  '146dc71efd59abc81efa0909bc4ab692',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-8a9078da1c5602446586782a6075069f']={
webappId:    '7060',
documentId:  '2057',
internalId:  '8a9078da1c5602446586782a6075069f',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-0bff70fb3f0acdc9d803a0a405f700f5']={
webappId:    '7060',
documentId:  '2099',
internalId:  '0bff70fb3f0acdc9d803a0a405f700f5',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-3a24562e3153a944c82b39db32ba813e']={
webappId:    '7060',
documentId:  '2120',
internalId:  '3a24562e3153a944c82b39db32ba813e',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20110913-220456'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1901',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-9834365']={
webappId:    '1501',
documentId:  '1901',
internalId:  '9834365',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1952',
internalId:  '',
customField: '20110912-225308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1973',
internalId:  '',
customField: '20110822-205407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1994',
internalId:  '',
customField: '20110912-224109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2015',
internalId:  '',
customField: '20110912-233107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2036',
internalId:  '',
customField: '20110913-220924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2057',
internalId:  '',
customField: '20101209-204354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2078',
internalId:  '',
customField: '20101217-200247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2099',
internalId:  '',
customField: '20110519-220410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2120',
internalId:  '',
customField: '20111102-192707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8301',
internalId:  '',
customField: '20110303-210227'
};
webappMappings['7008']=webappMappings['7008-27180']={
webappId:    '7008',
documentId:  '8301',
internalId:  '27180',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26812',
internalId:  '',
customField: '20110902-214927'
};
webappMappings['7060']=webappMappings['7060-1d3d3dd06c931e6929ad61444fb3e2b0']={
webappId:    '7060',
documentId:  '26812',
internalId:  '1d3d3dd06c931e6929ad61444fb3e2b0',
customField: 'language:pt;country:BR;'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I71LI6';
var companyName   = 'GALERIA+OCE%C3%82NICA';
var htmlTitle	  = 'galeria+oce%C3%A2nica';
var metaKeywords  = '';
var metaContents  = '';
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();
};

