/* [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','33712',jdecode('Loja+Tieppo+-+Caxias+do+Sul+'),jdecode(''), jdecode('%2F33712.html'), 'true',[],'',''],
	['PAGE','101431',jdecode('Botas'),jdecode(''), jdecode('%2F101431.html'), 'true',[],'',''],
	['PAGE','69365',jdecode('Scarpin'),jdecode(''), jdecode('%2F69365.html'), 'true',[],'',''],
	['PAGE','164494',jdecode('Galochas'),jdecode(''), jdecode('%2F164494.html'), 'true',[],'',''],
	['PAGE','158183',jdecode('Oxford+'),jdecode(''), jdecode('%2F158183.html'), 'true',[],'',''],
	['PAGE','161894',jdecode('Noivas'),jdecode(''), jdecode('%2F161894.html'), 'true',[],'',''],
	['PAGE','70365',jdecode('Tieppo+Premium'),jdecode(''), jdecode('%2F70365.html'), 'true',[],'',''],
	['PAGE','122084',jdecode('Passione+Cal%C3%A7ados'),jdecode(''), jdecode('%2F122084.html'), 'true',[],'',''],
	['PAGE','146950',jdecode('Tamancos+premium'),jdecode(''), jdecode('%2F146950.html'), 'true',[],'',''],
	['PAGE','117773',jdecode('Sand%C3%A1lias+show'),jdecode(''), jdecode('%2F117773.html'), 'true',[],'',''],
	['PAGE','110653',jdecode('Novidades+verao+'),jdecode(''), jdecode('%2F110653.html'), 'true',[],'',''],
	['PAGE','140628',jdecode('Novidades+verao+S.+Bxo.'),jdecode(''), jdecode('%2F140628.html'), 'true',[],'',''],
	['PAGE','11422',jdecode('Meia+-+pata'),jdecode(''), jdecode('%2F11422.html'), 'true',[],'',''],
	['PAGE','73165',jdecode('Scarpin+Flex'),jdecode(''), jdecode('%2F73165.html'), 'true',[],'',''],
	['PAGE','72065',jdecode('Sapato+em+couro'),jdecode(''), jdecode('%2F72065.html'), 'true',[],'',''],
	['PAGE','113673',jdecode('Rasteiras'),jdecode(''), jdecode('%2F113673.html'), 'true',[],'',''],
	['PAGE','151161',jdecode('Sapatilhas+em+Couro.'),jdecode(''), jdecode('%2F151161.html'), 'true',[],'',''],
	['PAGE','116673',jdecode('Feiras+e+Eventos+'),jdecode(''), jdecode('%2F116673.html'), 'true',[],'',''],
	['PAGE','42233',jdecode('Mensagem+'),jdecode(''), jdecode('%2F42233.html'), 'true',[],'',''],
	['PAGE','1063',jdecode('Contato+'),jdecode(''), jdecode('%2F1063.html'), 'true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Georgia';
theSitetree.paletteFamily='6080D3';
theSitetree.keyvisualId='5994';
theSitetree.keyvisualName='kv_5994.jpg';
theSitetree.fontsetId='11118';
theSitetree.graphicsetId='11911';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='6080D3';
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: 			'Georgia',
				paletteFamily: 	'6080D3',
				keyvisualId: 	'5994',
				keyvisualName: 	'kv_5994.jpg',
				fontsetId: 		'11118',
				graphicsetId: 	'11911',
				contentColor: 	'FFFFFF',
				contentBGColor: '6080D3',
				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:  '146950',
internalId:  '',
customField: '20110206-133956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101431',
internalId:  '',
customField: '20110709-132158'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '33712',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '140628',
internalId:  '',
customField: '20110121-124209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '158183',
internalId:  '',
customField: '20110521-152319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116673',
internalId:  '',
customField: '20101114-140107'
};
webappMappings['1501']=webappMappings['1501-1303722']={
webappId:    '1501',
documentId:  '33712',
internalId:  '1303722',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110653',
internalId:  '',
customField: '20110111-174055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '113673',
internalId:  '',
customField: '20110220-155933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33712',
internalId:  '',
customField: '20111109-154326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1063',
internalId:  '',
customField: '20081228-102651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '161894',
internalId:  '',
customField: '20110709-135314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '151161',
internalId:  '',
customField: '20110220-152918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '117773',
internalId:  '',
customField: '20101224-053442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '122084',
internalId:  '',
customField: '20110101-094520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11422',
internalId:  '',
customField: '20101224-052831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73165',
internalId:  '',
customField: '20101230-143203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69365',
internalId:  '',
customField: '20110522-131022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70365',
internalId:  '',
customField: '20110519-114838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72065',
internalId:  '',
customField: '20091216-160605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42233',
internalId:  '',
customField: '20101230-141755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '164494',
internalId:  '',
customField: '20110709-133638'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN238M';
var companyName   = 'TIEPPO+CAL%C3%87ADOS';
var htmlTitle	  = 'TIEPPO+CAL%C3%87ADOS';
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();
};

