/* [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','641',jdecode('SHOWS+INFANTILES'),jdecode(''),'/641.html','true',[],'',''],
	['PAGE','452',jdecode('CASTILLOS'),jdecode(''),'/452.html','true',[],'',''],
	['PAGE','473',jdecode('TOBOGANES'),jdecode(''),'/473.html','true',[],'',''],
	['PAGE','494',jdecode('JUEGOS+INTERACTIVOS'),jdecode(''),'/494.html','true',[],'',''],
	['PAGE','515',jdecode('TORO+MECANICO+Y+JUEGOS+MECANICOS'),jdecode(''),'/515.html','true',[],'',''],
	['PAGE','39101',jdecode('PAYASOS'),jdecode(''),'/39101.html','true',[],'',''],
	['PAGE','662',jdecode('JUEGOS+DE+FERIA'),jdecode(''),'/662.html','true',[],'',''],
	['PAGE','70001',jdecode('VENTA+INFLABLES'),jdecode(''),'/70001/index.html','true',[ 
		['PAGE','80701',jdecode('TOBOGANES'),jdecode(''),'/70001/80701.html','true',[],'','']
	],'',''],
	['PAGE','124601',jdecode('SONIDO'),jdecode(''),'/124601.html','true',[],'',''],
	['PAGE','536',jdecode('COMIDA+KERMES'),jdecode(''),'/536/index.html','true',[ 
		['PAGE','557',jdecode('LUNCH+INFANTIL'),jdecode(''),'/536/557.html','true',[],'',''],
		['PAGE','578',jdecode('ANTOJITOS+MEXICANOS'),jdecode(''),'/536/578.html','true',[],'',''],
		['PAGE','599',jdecode('TAQUIZAS'),jdecode(''),'/536/599.html','true',[],'','']
	],'',''],
	['PAGE','7901',jdecode('PARRILLADAS'),jdecode(''),'/7901.html','true',[],'',''],
	['PAGE','746',jdecode('TACOS+AL+PASTOR'),jdecode(''),'/746.html','true',[],'',''],
	['PAGE','41501',jdecode('PUBLICITARIOS'),jdecode(''),'/41501.html','true',[],'',''],
	['PAGE','58901',jdecode('VENTA+TOROS+MECANICOS'),jdecode(''),'/58901.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='School';
theSitetree.paletteFamily='5663BE';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10745';
theSitetree.graphicsetId='11097';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='5663BE';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'School',
				paletteFamily: 	'5663BE',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10745',
				graphicsetId: 	'11097',
				contentColor: 	'FFFFFF',
				contentBGColor: '5663BE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'F78A8A',
				e_color: 		'F78A8A',
				f_color: 		'F78A8A',
				hasCustomLogo: 	'false',
				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['1501']=webappMappings['1501-283267']={
webappId:    '1501',
documentId:  '401',
internalId:  '283267',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100619-165112'
};
webappMappings['7008']=webappMappings['7008-3448']={
webappId:    '7008',
documentId:  '401',
internalId:  '3448',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '641',
internalId:  '',
customField: '20100619-164342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20100621-195518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20100703-124844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20100703-125522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20091102-204257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39101',
internalId:  '',
customField: '20070219-214156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '662',
internalId:  '',
customField: '20080919-194841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70001',
internalId:  '',
customField: '20080117-234204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80701',
internalId:  '',
customField: '20080117-233820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20100613-152241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20060924-155708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '578',
internalId:  '',
customField: '20060924-155927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '599',
internalId:  '',
customField: '20070131-193034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7901',
internalId:  '',
customField: '20070131-182907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '746',
internalId:  '',
customField: '20070131-185709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41501',
internalId:  '',
customField: '20080530-093900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58901',
internalId:  '',
customField: '20090822-211553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124601',
internalId:  '',
customField: '20090301-221208'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INXFI0';
var companyName   = 'Las+Fiestas+Infantiles.com.mx';
var htmlTitle	  = 'LAS+FIESTAS+INFANTILES';
var metaKeywords  = 'fiestas+infantiles%2Ceventos%2Cjuegos+inflables%2Ctoros+mecanicos%2Cjuegos+mecanicos%2Canimadoras%2Cpayasos%2Cjuegos+de+feria%2Ckermes%2Ccomidas+informales%2Cmobiliario%2Cbotargas%2Cshows+infantiles%2Cpintacaritas%2Cinflables%2C';
var metaContents  = 'Renta+y+venta+de+juegos+inflables%2Ctoros+mecanicos%2Cjuegos+mecanicos%2Cshows+con+botargas%2Canimadoras%2Cdespedidas+de+soltera%2Cbaby+shower%2Cpayasos%2Cbanquetes%2Cy+todo+lo+necesario+para+hacer+de+tu+fiesta+infantil+un+evento+inolvidable';
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();
};
