/* [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','4598',jdecode('BIENVENIDO'),jdecode(''),'/4598.html','true',[],'',''],
	['PAGE','57501',jdecode('M+y+expo+vacaciones'),jdecode(''),'/57501.html','true',[],'',''],
	['PAGE','4709',jdecode('Boletos+Avi%C3%B3n+%28IATA%29'),jdecode(''),'/4709.html','true',[],'',''],
	['PAGE','6003',jdecode('Boletos+Autob%C3%BAs+Ticketbus'),jdecode(''),'/6003.html','true',[],'',''],
	['PAGE','4655',jdecode('SUD%C3%81FRICA+2010'),jdecode(''),'/4655.html','true',[],'',''],
	['PAGE','75422',jdecode('Paquetes+de+Viajes'),jdecode(''),'/75422.html','true',[],'',''],
	['ITEM','92501',jdecode('Reservas+on-line'),jdecode(''),'http://www.e-travelsolution.com.mx/Partners/Reservations/Hotels/list.aspx?asoc=plazaedi&destino=0 ','true',[],'','_blank'],
	['PAGE','60201',jdecode('Cont%C3%A1ctenos'),jdecode(''),'/60201.html','true',[],'',''],
	['PAGE','83401',jdecode('Blog+de+Viajes'),jdecode(''),'/83401.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='NewYork';
theSitetree.paletteFamily='86862D';
theSitetree.keyvisualId='935';
theSitetree.keyvisualName='haengematte.jpg';
theSitetree.fontsetId='168';
theSitetree.graphicsetId='196';
theSitetree.contentColor='006633';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'NewYork',
				paletteFamily: 	'86862D',
				keyvisualId: 	'935',
				keyvisualName: 	'haengematte.jpg',
				fontsetId: 		'168',
				graphicsetId: 	'196',
				contentColor: 	'006633',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'86862D',
				c_color: 		'000000',
				d_color: 		'2C331B',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4598',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-135624']={
webappId:    '1501',
documentId:  '4598',
internalId:  '135624',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-d6afa81d87fe18cbbd8efc8b6539a3cf']={
webappId:    '7060',
documentId:  '57501',
internalId:  'd6afa81d87fe18cbbd8efc8b6539a3cf',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20100102-122042'
};
webappMappings['7008']=webappMappings['7008-7877']={
webappId:    '7008',
documentId:  '60201',
internalId:  '7877',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4655',
internalId:  '',
customField: '20100102-130256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4709',
internalId:  '',
customField: '20090525-183922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6003',
internalId:  '',
customField: '20090525-183842'
};
webappMappings['7050']=webappMappings['7050-1982']={
webappId:    '7050',
documentId:  '83401',
internalId:  '1982',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75422',
internalId:  '',
customField: '20100102-133754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57501',
internalId:  '',
customField: '20090525-183812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60201',
internalId:  '',
customField: '20071228-204108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83401',
internalId:  '',
customField: '20090526-181043'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INXEQR';
var companyName   = 'VIAJES+EDI%C2%B4S+PLAZA';
var htmlTitle	  = '';
var metaKeywords  = 'Boletos+de+avi%C3%B3n%2C+tec%C3%A1mac%2C+ojo+de+agua%2C+boletos+autobus%2C+viajes+generaci%C3%B3n%2C+pirotecnia%2C+boda%2C+quince+a%C3%B1os%2C+XV+a%C3%B1os%2C+fin+de+semana%2C+best+day%2C+bestday%2C+vacaciones%2C+magnitur%2C+magnicharters%2C+agencia+de+viajes';
var metaContents  = 'Agencia+de+Viajes%2C+ticketbus%2C+IATA%2C+tec%C3%A1mac%2C+bestday%2C+best+day';
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();
};
