/* [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','4556',jdecode('Nuestra+marca'),jdecode(''),'/4556.html','true',[],'',''],
	['PAGE','4613',jdecode('Mini+Split'),jdecode(''),'/4613.html','true',[],'',''],
	['PAGE','98634',jdecode('Beneficios'),jdecode(''),'/98634.html','true',[],'',''],
	['PAGE','4640',jdecode('Centro+de+Servicio'),jdecode(''),'/4640/index.html','true',[ 
		['PAGE','121734',jdecode('Instalacion+basica'),jdecode(''),'/4640/121734.html','true',[],'',''],
		['PAGE','121755',jdecode('Inst.+Electrica'),jdecode(''),'/4640/121755.html','true',[],'',''],
		['PAGE','121934',jdecode('Mantenimiento'),jdecode(''),'/4640/121934.html','true',[],'','']
	],'',''],
	['PAGE','4667',jdecode('Servicio+al+Cliente'),jdecode(''),'/4667.html','true',[],'',''],
	['PAGE','117634',jdecode('Contacto'),jdecode(''),'/117634.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Strom';
theSitetree.paletteFamily='1A3873';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='250';
theSitetree.graphicsetId='324';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Strom',
				paletteFamily: 	'1A3873',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'250',
				graphicsetId: 	'324',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'1A3873',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98634',
internalId:  '',
customField: '20100513-082718'
};
webappMappings['1501']=webappMappings['1501-13300']={
webappId:    '1501',
documentId:  '4556',
internalId:  '13300',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '117634',
internalId:  '',
customField: '20100325-084736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121734',
internalId:  '',
customField: '20100327-011251'
};
webappMappings['7008']=webappMappings['7008-15713']={
webappId:    '7008',
documentId:  '117634',
internalId:  '15713',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4667',
internalId:  '',
customField: '20100321-211232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4613',
internalId:  '',
customField: '20100513-082646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4556',
internalId:  '',
customField: '20100510-154404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4640',
internalId:  '',
customField: '20100320-101557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121755',
internalId:  '',
customField: '20100325-085301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121934',
internalId:  '',
customField: '20100325-084654'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INXSI2';
var companyName   = '++++++++++Confort+a+tu+alcance';
var htmlTitle	  = 'Venta+y+Servicio+en+el+mismo+lugar';
var metaKeywords  = 'aire+acondicionado%2C+mini+split%2C+climas%2C+electrodomesticos%2C+refrigeradores%2C+lavadoras%2C+boilers%2C+estufas%2C+secadoras%2C+climas+centrales%2C+reparacion%2C+instalacion%2C+mantenimiento%2C+servicio%2C+linia+blanca%2C+monterrey%2C+aire+acondicionado+monterrey%2C+mini+split+monterrey%2C+venta+de+climas%2C+venta+de+mini+split%2C+venta+de+aire+acondicionado%2C+instalacion+de+mini+split%2C+mantenimiento+de+mini+split%2C+apodaca%2C+art+cool%2C+mini+split%2C+minisplit%2C+lg%2C+mirage%2C+gtair%2C+aux%2C+CENTRO+DE+SERVICIO+MIRAGE%2C+japando%2C+climas+montoya%2C+minisplit+montoya%2C+minisplit+japando%2C+minisplit+mirage';
var metaContents  = 'Venta%2C+Instalacion+y+Servicio+de+Aire+Acondicionado+y+Linea+Blanca.';
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();
};
