/* [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','2601',jdecode('Home'),jdecode(''), jdecode('%2F2601.html'), 'true',[],'',''],
	['PAGE','103496',jdecode('Catalogo+Completo'),jdecode(''), jdecode('%2F103496.html'), 'true',[],'',''],
	['PAGE','10401',jdecode('Animais'),jdecode(''), jdecode('%2F10401.html'), 'true',[],'',''],
	['PAGE','33401',jdecode('Bandeiras'),jdecode(''), jdecode('%2F33401.html'), 'true',[],'',''],
	['PAGE','36201',jdecode('Bras%C3%B5es'),jdecode(''), jdecode('%2F36201.html'), 'true',[],'',''],
	['PAGE','37285',jdecode('Carros'),jdecode(''), jdecode('%2F37285.html'), 'true',[],'',''],
	['PAGE','35101',jdecode('Caveiras+e+Piratas'),jdecode(''), jdecode('%2F35101.html'), 'true',[],'',''],
	['PAGE','39185',jdecode('Couwntry'),jdecode(''), jdecode('%2F39185.html'), 'true',[],'',''],
	['PAGE','41885',jdecode('Desenhos+%2FCinema'),jdecode(''), jdecode('%2F41885.html'), 'true',[],'',''],
	['PAGE','46185',jdecode('Diversos'),jdecode(''), jdecode('%2F46185.html'), 'true',[],'',''],
	['PAGE','50485',jdecode('Esportes'),jdecode(''), jdecode('%2F50485.html'), 'true',[],'',''],
	['PAGE','169896',jdecode('H+D'),jdecode(''), jdecode('%2F169896.html'), 'true',[],'',''],
	['PAGE','53285',jdecode('Indigenas'),jdecode(''), jdecode('%2F53285.html'), 'true',[],'',''],
	['PAGE','54885',jdecode('Jeep'),jdecode(''), jdecode('%2F54885.html'), 'true',[],'',''],
	['PAGE','56885',jdecode('Militares%2FPoliciais+e+Afins'),jdecode(''), jdecode('%2F56885.html'), 'true',[],'',''],
	['PAGE','61985',jdecode('Motos'),jdecode(''), jdecode('%2F61985.html'), 'true',[],'',''],
	['PAGE','62185',jdecode('Musicais'),jdecode(''), jdecode('%2F62185.html'), 'true',[],'',''],
	['PAGE','62985',jdecode('Pesca+e+Afins'),jdecode(''), jdecode('%2F62985.html'), 'true',[],'',''],
	['PAGE','138996',jdecode('Profiss%C3%B5es'),jdecode(''), jdecode('%2F138996.html'), 'true',[],'',''],
	['PAGE','27301',jdecode('Rock+e+Afins'),jdecode(''), jdecode('%2F27301.html'), 'true',[],'',''],
	['PAGE','94196',jdecode('Tipos+Sangue'),jdecode(''), jdecode('%2F94196.html'), 'true',[],'',''],
	['PAGE','142696',jdecode('MERCADO+LIVRE'),jdecode(''), jdecode('%2F142696.html'), 'false',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Trend';
theSitetree.paletteFamily='619A45';
theSitetree.keyvisualId='7972';
theSitetree.keyvisualName='kv_7972.jpg';
theSitetree.fontsetId='16910';
theSitetree.graphicsetId='12324';
theSitetree.contentColor='386721';
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: 			'Trend',
				paletteFamily: 	'619A45',
				keyvisualId: 	'7972',
				keyvisualName: 	'kv_7972.jpg',
				fontsetId: 		'16910',
				graphicsetId: 	'12324',
				contentColor: 	'386721',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103496',
internalId:  '',
customField: '20110712-164101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20110812-134816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10401',
internalId:  '',
customField: '20110614-175757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33401',
internalId:  '',
customField: '20110614-180017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36201',
internalId:  '',
customField: '20110615-133549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37285',
internalId:  '',
customField: '20110615-164454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35101',
internalId:  '',
customField: '20110615-174340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39185',
internalId:  '',
customField: '20110616-143643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41885',
internalId:  '',
customField: '20110616-152400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46185',
internalId:  '',
customField: '20110616-162838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50485',
internalId:  '',
customField: '20110811-151951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '169896',
internalId:  '',
customField: '20110811-152028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53285',
internalId:  '',
customField: '20110811-151557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54885',
internalId:  '',
customField: '20110811-152402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56885',
internalId:  '',
customField: '20110812-152346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61985',
internalId:  '',
customField: '20110812-161641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62185',
internalId:  '',
customField: '20101001-163801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138996',
internalId:  '',
customField: '20101001-165105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142696',
internalId:  '',
customField: '20110112-084609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62985',
internalId:  '',
customField: '20081015-134027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27301',
internalId:  '',
customField: '20101001-171857'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2601',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-15397937']={
webappId:    '1501',
documentId:  '2601',
internalId:  '15397937',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94196',
internalId:  '',
customField: '20101001-172126'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INPRU7';
var companyName   = '';
var htmlTitle	  = 'BORDADOS';
var metaKeywords  = 'bordados+termocolantes%2C+patches%2C+bones%2C+camisetas%2C+fbi%2C+swat%2C+toalhas%2C+bordados+para+motoclubes';
var metaContents  = 'Bordados+computadorizados%2C+desenvolvimento+de+programas+para+bordar%2C+patches%2C+bordados+termocolantes%2C+bordados+para+motoclubes';
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();
};

