/* [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','401',jdecode('Inicio'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','452',jdecode('%C2%BFQui%C3%A9nes+Somos%3F'),jdecode(''),'/452.html','true',[],'',''],
	['PAGE','473',jdecode('Servicios'),jdecode(''),'/473.html','true',[],'',''],
	['PAGE','5901',jdecode('Inmuebles'),jdecode(''),'/5901/index.html','true',[ 
		['PAGE','11401',jdecode('Casas'),jdecode(''),'/5901/11401.html','true',[],'',''],
		['PAGE','494',jdecode('Terr%C3%A9nos'),jdecode(''),'/5901/494.html','true',[],'',''],
		['PAGE','11422',jdecode('Comercios'),jdecode(''),'/5901/11422.html','true',[],'',''],
		['PAGE','11701',jdecode('Nav.+Industriales'),jdecode(''),'/5901/11701.html','true',[],'',''],
		['PAGE','23301',jdecode('Terr%C3%A9nos+Industriales'),jdecode(''),'/5901/23301.html','true',[],'',''],
		['PAGE','11722',jdecode('Oficinas+'),jdecode(''),'/5901/11722.html','true',[],'','']
	],'',''],
	['PAGE','13901',jdecode('Cont%C3%A1ctanos'),jdecode(''),'/13901.html','true',[],'',''],
	['PAGE','38401',jdecode('About+Us'),jdecode(''),'/38401.html','true',[],'',''],
	['PAGE','39101',jdecode('Our+Services'),jdecode(''),'/39101.html','true',[],'',''],
	['PAGE','39143',jdecode('Find+a+Home'),jdecode(''),'/39143.html','true',[],'',''],
	['PAGE','39164',jdecode('Land'),jdecode(''),'/39164.html','true',[],'',''],
	['PAGE','39185',jdecode('Shopping+Centers'),jdecode(''),'/39185.html','true',[],'',''],
	['PAGE','89701',jdecode('Offices'),jdecode(''),'/89701.html','true',[],'',''],
	['PAGE','39206',jdecode('Warehouses'),jdecode(''),'/39206.html','true',[],'',''],
	['PAGE','39227',jdecode('Industrial+%26+Comercial+'),jdecode(''),'/39227.html','true',[],'',''],
	['PAGE','45401',jdecode('Contact'),jdecode(''),'/45401.html','true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Medium';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='2153';
theSitetree.keyvisualName='architektur2.jpg';
theSitetree.fontsetId='355';
theSitetree.graphicsetId='408';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Medium',
				paletteFamily: 	'000000',
				keyvisualId: 	'2153',
				keyvisualName: 	'architektur2.jpg',
				fontsetId: 		'355',
				graphicsetId: 	'408',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'8EBFC6',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100308-111752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20070223-101249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11422',
internalId:  '',
customField: '20100308-112119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11401',
internalId:  '',
customField: '20100127-182940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39143',
internalId:  '',
customField: '20100127-183036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20070216-134950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20070222-094611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20100308-114135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11701',
internalId:  '',
customField: '20100303-110056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23301',
internalId:  '',
customField: '20071105-150354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11722',
internalId:  '',
customField: '20091218-172215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20080904-125459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38401',
internalId:  '',
customField: '20070223-190405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39101',
internalId:  '',
customField: '20070222-102042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39164',
internalId:  '',
customField: '20100308-114001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39185',
internalId:  '',
customField: '20100308-112319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89701',
internalId:  '',
customField: '20091218-170815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39206',
internalId:  '',
customField: '20100303-110125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39227',
internalId:  '',
customField: '20081013-171046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45401',
internalId:  '',
customField: '20080904-130048'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INE2HL';
var companyName   = 'ACIQRO+S.A.+DE+C.V.';
var htmlTitle	  = 'ACIQRO+S.A.+de+C.V.';
var metaKeywords  = 'Bienes+Ra%C3%ADces+Queretaro%2C+Inmobiliarias+Queretaro%2C+asesor%C3%ADa+inmobiliaria+jur%C3%ADdica+Queretaro%2C+venta+casas+Quer%C3%A9taro%2C+venta+terrenos+Quer%C3%A9taro%2C+desarrollo+proyectos+inmobiliarios+Quer%C3%A9taro+';
var metaContents  = 'Compra-Venta+de+inmuebles+en+Quer%C3%A9taro+y+ciudades+vecinas%2C+inversiones+en+proyectos+comerciales+y+de+oficinas+y+asesor%C3%ADa+jur%C3%ADdica+inmobiliaria+++Venta+casas%2C+Venta+terrenos%2C+Venta+locales%2C+Venta+Negocios%2C+Venta+naves+industriales';
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();
};
