/* [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 theSitetree=[ 
	['PAGE','301',jdecode('INICIO'),jdecode(''),'/301.html','true',[],''],
	['PAGE','352',jdecode('DOLORES+CANT%C3%9A'),jdecode(''),'/352.html','true',[],''],
	['PAGE','9801',jdecode('GALER%C3%8DA+DE+RETRATOS'),jdecode(''),'/9801/index.html','true',[ 
		['PAGE','8101',jdecode('Bodas'),jdecode(''),'/9801/8101.html','true',[],''],
		['PAGE','8601',jdecode('XV+A%C3%B1os'),jdecode(''),'/9801/8601.html','true',[],''],
		['PAGE','16301',jdecode('XV+A%C3%B1os+Fashion'),jdecode(''),'/9801/16301.html','true',[],''],
		['PAGE','16401',jdecode('XV+A%C3%B1os+Banners'),jdecode(''),'/9801/16401.html','true',[],''],
		['PAGE','8701',jdecode('Ni%C3%B1os'),jdecode(''),'/9801/8701.html','true',[],''],
		['PAGE','8801',jdecode('Primera+Comuni%C3%B3n'),jdecode(''),'/9801/8801.html','true',[],''],
		['PAGE','8901',jdecode('Embarazadas'),jdecode(''),'/9801/8901.html','true',[],''],
		['PAGE','9001',jdecode('Familias'),jdecode(''),'/9801/9001.html','true',[],'']
	],''],
	['PAGE','26312',jdecode('FOTOGRAFIA+COMERCIAL'),jdecode(''),'/26312.html','true',[],''],
	['PAGE','6601',jdecode('DIRECCI%C3%93N'),jdecode(''),'/6601.html','true',[],''],
	['PAGE','394',jdecode('CONT%C3%81CTANOS'),jdecode(''),'/394.html','true',[],'']];
var siteelementCount=14;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10892';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				name: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10892',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-4f64366ec604bc4216b8ae0d6fe052e3']={
webappId:    '7060',
documentId:  '8101',
internalId:  '4f64366ec604bc4216b8ae0d6fe052e3',
customField: 'language:es;country:ES;'
};
webappMappings['7060']=webappMappings['7060-ad64bc68ec7818118525cd97c04de1ce']={
webappId:    '7060',
documentId:  '8601',
internalId:  'ad64bc68ec7818118525cd97c04de1ce',
customField: 'language:es;country:ES;'
};
webappMappings['7060']=webappMappings['7060-1efcca3d7dbf7e864369201eab8c02f1']={
webappId:    '7060',
documentId:  '8701',
internalId:  '1efcca3d7dbf7e864369201eab8c02f1',
customField: 'language:es;country:ES;'
};
webappMappings['7060']=webappMappings['7060-a82c3dd4ceb62effee62789113b9e9d3']={
webappId:    '7060',
documentId:  '8801',
internalId:  'a82c3dd4ceb62effee62789113b9e9d3',
customField: 'language:es;country:ES;'
};
webappMappings['7060']=webappMappings['7060-2b1d8eeb26425ec9b0c20c28f39f2021']={
webappId:    '7060',
documentId:  '8901',
internalId:  '2b1d8eeb26425ec9b0c20c28f39f2021',
customField: 'language:es;country:ES;'
};
webappMappings['7060']=webappMappings['7060-6ddaa37ff76d3ac2b51cb6ba60266d9c']={
webappId:    '7060',
documentId:  '9001',
internalId:  '6ddaa37ff76d3ac2b51cb6ba60266d9c',
customField: 'language:es;country:ES;'
};
webappMappings['7060']=webappMappings['7060-9cf0e7d5f1842eef440e079b8c8e34e9']={
webappId:    '7060',
documentId:  '16301',
internalId:  '9cf0e7d5f1842eef440e079b8c8e34e9',
customField: 'language:es;country:ES;'
};
webappMappings['7060']=webappMappings['7060-0b93c69331447eb08861207638e68568']={
webappId:    '7060',
documentId:  '16401',
internalId:  '0b93c69331447eb08861207638e68568',
customField: 'language:es;country:ES;'
};
webappMappings['7060']=webappMappings['7060-0e7aaf55e62b774d455c28af6e927485']={
webappId:    '7060',
documentId:  '26312',
internalId:  '0e7aaf55e62b774d455c28af6e927485',
customField: 'language:es;country:ES;'
};
webappMappings['7008']=webappMappings['7008-7267']={
webappId:    '7008',
documentId:  '394',
internalId:  '7267',
customField: 'language:es;country:ES;'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN2KGR';
var companyName   = '';
var htmlTitle	  = 'Dolores+Cantu+Retratista';
var metaKeywords  = 'dolores+cantu+retratista+estudio+fotografico+monterrey+mexico';
var metaContents  = 'Estudio+fotografico+Dolores+Cantu+Retratista+en+Monterrey%2C+NL';
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();
};

