/* [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','401',jdecode('Empresa'),jdecode(''),'/401.html','true',[],''],
	['PAGE','26222',jdecode('Pula-Pula%2FPiscina+Bolinha'),jdecode(''),'/26222.html','true',[],''],
	['PAGE','26243',jdecode('Cama+El%C3%A1stica+'),jdecode(''),'/26243.html','true',[],''],
	['PAGE','26264',jdecode('Futebol+de+sab%C3%A3o+'),jdecode(''),'/26264.html','true',[],''],
	['PAGE','34901',jdecode('Cotonete%2FKid+Play+'),jdecode(''),'/34901.html','true',[],''],
	['PAGE','34922',jdecode('Tombo+legal%2F+Touro+Mec%C3%A2nico+'),jdecode(''),'/34922.html','true',[],''],
	['PAGE','34943',jdecode('Alpinismo%2FEstilingue+'),jdecode(''),'/34943.html','true',[],''],
	['PAGE','34964',jdecode('Tobog%C3%A3+Infl%C3%A1vel+'),jdecode(''),'/34964.html','true',[],''],
	['PAGE','64201',jdecode('Compre+Aqui'),jdecode(''),'/64201.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Seasons_summer';
theSitetree.paletteFamily='AAD165';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='21092';
theSitetree.graphicsetId='13191';
theSitetree.contentColor='2E2E2E';
theSitetree.contentBGColor='AAD165';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				name: 			'Seasons_summer',
				paletteFamily: 	'AAD165',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'21092',
				graphicsetId: 	'13191',
				contentColor: 	'2E2E2E',
				contentBGColor: 'AAD165',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-2733']={
webappId:    '7008',
documentId:  '64201',
internalId:  '2733',
customField: 'language:pt;country:BR;'
};
webappMappings['1501']=webappMappings['1501-8492970']={
webappId:    '1501',
documentId:  '401',
internalId:  '8492970',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20090218-113410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64201',
internalId:  '',
customField: '20090921-071212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26222',
internalId:  '',
customField: '20090218-113516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26243',
internalId:  '',
customField: '20090218-113605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26264',
internalId:  '',
customField: '20090218-113650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34901',
internalId:  '',
customField: '20090309-074959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34922',
internalId:  '',
customField: '20080324-102649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34943',
internalId:  '',
customField: '20080324-103513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34964',
internalId:  '',
customField: '20090717-073517'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INZYGT';
var companyName   = 'Magic+Toys+Loca%C3%A7%C3%A3o+Infl%C3%A1veis.';
var htmlTitle	  = 'Magic+Toys+Loca%C3%A7ao+Brinquedos+Infl%C3%A1veis%2CPula+Pula%2CPiscina+Bolinha';
var metaKeywords  = 'Piscina+Bolinha%2C+Cama+El%C3%A1stica%2C+Bal%C3%A3o+Pula%2C+Touro+Mec%C3%A2nico%2C+Futebol+Sab%C3%A3o%2C+Estilingue+Humano%2C+Kid+Play%2C+Parede+Alpinista%2C+Tobog%C3%A3%2C+Luta+Cotonete.+Tatame+Eva++0%2C50x0%2C50m';
var metaContents  = 'Loca%C3%A7%C3%A3o+e+venda+brinquedos+infl%C3%A1veis+com+Piscina+Bolinha%2C+Cama+El%C3%A1stica%2C+Bal%C3%A3o+Pula%2C+Touro+Mec%C3%A2nico%2C+Futebol+Sab%C3%A3o%2C+Estilingue+Humano%2C+Kid+Play%2C+Parede+Alpinista%2C+Tobog%C3%A3%2C+Luta+Cotonete.+Tapete+Tatame+Eva%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();
};
