/* [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','601',jdecode('CLIC+DE+1+A+6++'),jdecode(''), jdecode('%2F601.html'), 'true',[],'',''],
	['PAGE','2001',jdecode('+1%C2%BA+CONDI%C3%87%C3%83O+DE+LOCA%C3%87%C3%83O'),jdecode(''), jdecode('%2F2001.html'), 'true',[],'',''],
	['PAGE','149301',jdecode('2%C2%BA+PEDIR+UM+OR%C3%87AMENTO'),jdecode(''), jdecode('%2F149301.html'), 'true',[],'',''],
	['PAGE','148901',jdecode('3%C2%BA+CONFIRMAR+RESERVA'),jdecode(''), jdecode('%2F148901.html'), 'true',[],'',''],
	['PAGE','2127',jdecode('4%C2%BA+TABELA+INVERNO'),jdecode(''), jdecode('%2F2127.html'), 'true',[],'',''],
	['PAGE','156301',jdecode('5%C2%BA+TABELA+VER%C3%83O'),jdecode(''), jdecode('%2F156301.html'), 'true',[],'',''],
	['PAGE','137801',jdecode('6%C2%BA+CONTATOS'),jdecode(''), jdecode('%2F137801.html'), 'true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Folder';
theSitetree.paletteFamily='A5C14F';
theSitetree.keyvisualId='11434';
theSitetree.keyvisualName='kv_11434.jpg';
theSitetree.fontsetId='31973';
theSitetree.graphicsetId='13809';
theSitetree.contentColor='54524D';
theSitetree.contentBGColor='A5C14F';
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: 			'Folder',
				paletteFamily: 	'A5C14F',
				keyvisualId: 	'11434',
				keyvisualName: 	'kv_11434.jpg',
				fontsetId: 		'31973',
				graphicsetId: 	'13809',
				contentColor: 	'54524D',
				contentBGColor: 'A5C14F',
				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:  '601',
internalId:  '',
customField: '20110729-163759'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '156301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20111206-160829'
};
webappMappings['7008']=webappMappings['7008-6397']={
webappId:    '7008',
documentId:  '149301',
internalId:  '6397',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2127',
internalId:  '',
customField: '20111121-141904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156301',
internalId:  '',
customField: '20120119-102518'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '156301',
internalId:  '1501',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '137801',
internalId:  '',
customField: '20110729-164550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '149301',
internalId:  '',
customField: '20110729-164007'
};
webappMappings['7008']=webappMappings['7008-6392']={
webappId:    '7008',
documentId:  '148901',
internalId:  '6392',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148901',
internalId:  '',
customField: '20110729-164108'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INEY56';
var companyName   = 'KIKOCAR+RENT+A+CAR';
var htmlTitle	  = 'ALUGUEL+DE+CARROS+EM+FLORIANOPOLIS+A+PARTIR+R%2460%2C00+++++++++DIA+ALUGUEL+DE+CARROS+EM+FLORIANOPOLIS%2CALUGUEL+DE+CARROS+FLORIANOPOLIS%2CALUGUEL+DE+CARROS+FLORIANOPOLIS%2CALUGUEL+DE+CARROS+FLORIPA%2CLOCADORA+CARROS+FLORIANOPOLIS+++++++++++++++++++++++++++++++++++++';
var metaKeywords  = '++ALUGUEL+DE+CARROS+EM+FLORIANOPOLIS++aluguel+de+carro+florianopolis%2Cflorianopolis+aluguel+de+carro%2Caluguel+carro+florianopolis%2Ccarros+de+aluguel+em+florianopolis%2C+rent+a+car+florianopolis%2C+alquiler+coche+florianopolis%2C+locadora+de+carros+florianopolis%2Caluguel+de+carros+em+florianopolis%2C+aluguel+de+carro+floripa%2Crent+a+car+floripa%2C+rent+a+car+floripa%2C+alquiler+coche+florianopolis%2C+carros+de+aluguel+em+florianopolis%2C+rentar+car+floripa%2Cfloripa+rent+a+car%2C+coche+alquiler+florianopolis%2C+coche+alquiler+floripa%2C+rental+car+florianopolis%2C+aluguel+car+florianopolis%2C+alugar+carro+em+florianopolis%2C+alugar+carro+em+florianopolis%2Crentar+car+em+florianopolis%2Calugar+um+carro+em+florianopolis%2C+florianopolis+sc%2C+florianopolis+santa+catarina%2Csanta+catarina+rent+a+car%2C+florianopolis%2C+santa+catarina+locadora+de+carros%2C%3Cmeta+Name%3D%E2%80%9Drobots%E2%80%9D+content%3D%E2%80%9Dindex%E2%80%9D%3E';
var metaContents  = 'ENTREGAMOS+NO+AEROPORTO+%2F+RODOVI%C3%81RIA%2C+KM+%2F+SEGURO+INCLUIDO++++++++++++++++++++++++++++++%280xx%2948-30345559-+RADIO+126*59301+TIM+48-99929560+OI+48-84614094++++++++++++++++++++++++++TEMOS+DOBLO+1.8+COMPLETA%2C+PALIO+FIRE+FLEX+4+PTAS+BASICO+E+COMPLETO+E+OUTROS+MODELOS+ATENDiMENTO+ONLINE%2CAEROPORTO+DE+FLORIANOPOLIS%2CALUGUEL+DE+CARROS+EM+FLORIANOPOLIS%2CALUGUEL+DE+CARROS+FLORIANOPOLIS%2CLOCADORA+DE+CARROS+FLORIANOPOLIS';
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();
};

