/* [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','501',jdecode('Bienvenidos+'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','552',jdecode('La+flor+preservada'),jdecode(''),'/552.html','true',[],'',''],
	['PAGE','573',jdecode('Creaciones'),jdecode(''),'/573.html','true',[],'',''],
	['PAGE','615',jdecode('Complementos+'),jdecode(''),'/615.html','true',[],'',''],
	['PAGE','9601',jdecode('Cont%C3%A1ctenos'),jdecode(''),'/9601/index.html','true',[ 
		['PAGE','10001',jdecode('Cont%C3%A1ctenos+%28follow+up+page%29'),jdecode(''),'/9601/10001.html','false',[],'','']
	],'',''],
	['PAGE','16201',jdecode('Rosmelias'),jdecode(''),'/16201.html','true',[],'',''],
	['PAGE','18601',jdecode('Bouquets'),jdecode(''),'/18601.html','true',[],'',''],
	['PAGE','18701',jdecode('Dise%C3%B1os+originales'),jdecode(''),'/18701.html','true',[],'',''],
	['PAGE','33201',jdecode('Tocados'),jdecode(''),'/33201.html','true',[],'',''],
	['PAGE','34801',jdecode('Decoracion+con+velas'),jdecode(''),'/34801.html','true',[],'',''],
	['PAGE','19306',jdecode('Libro+de+visitas'),jdecode(''),'/19306/index.html','true',[ 
		['PAGE','19301',jdecode('Leer+el+libro+de+Visitas'),jdecode(''),'/19306/19301.html','false',[],'','']
	],'',''],
	['PAGE','31601',jdecode('Enlaces'),jdecode(''),'/31601.html','true',[],'',''],
	['PAGE','35801',jdecode('Sevilla+de+Boda+2009++'),jdecode(''),'/35801.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Nurseries';
theSitetree.paletteFamily='FFE57B';
theSitetree.keyvisualId='7905';
theSitetree.keyvisualName='kv_7905.jpg';
theSitetree.fontsetId='16877';
theSitetree.graphicsetId='12313';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFE57B';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'true',
				name: 			'Nurseries',
				paletteFamily: 	'FFE57B',
				keyvisualId: 	'7905',
				keyvisualName: 	'kv_7905.jpg',
				fontsetId: 		'16877',
				graphicsetId: 	'12313',
				contentColor: 	'000000',
				contentBGColor: 'FFE57B',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100308-144610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20081114-155241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20100308-144756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9601',
internalId:  '',
customField: '20100323-091359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20100308-144829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19301',
internalId:  '',
customField: '20090205-235655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10001',
internalId:  '',
customField: '20081114-154322'
};
webappMappings['7060']=webappMappings['7060-fc8afed150ac7bbadab4fc02ecb73bfd']={
webappId:    '7060',
documentId:  '18601',
internalId:  'fc8afed150ac7bbadab4fc02ecb73bfd',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16201',
internalId:  '',
customField: '20090205-235007'
};
webappMappings['7060']=webappMappings['7060-fab1c498ce87c415dd0093a13e4ac40d']={
webappId:    '7060',
documentId:  '16201',
internalId:  'fab1c498ce87c415dd0093a13e4ac40d',
customField: 'language:es;country:ES;'
};
webappMappings['7060']=webappMappings['7060-06ad92c744d85814593f6f6ed49aca47']={
webappId:    '7060',
documentId:  '18701',
internalId:  '06ad92c744d85814593f6f6ed49aca47',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18601',
internalId:  '',
customField: '20090205-234335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18701',
internalId:  '',
customField: '20090205-234431'
};
webappMappings['1002']=webappMappings['1002-19306aars20invd14']={
webappId:    '1002',
documentId:  '19306',
internalId:  '19306aars20invd14',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19306',
internalId:  '',
customField: '20090205-235800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31601',
internalId:  '',
customField: '20091214-001443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33201',
internalId:  '',
customField: '20091222-001327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34801',
internalId:  '',
customField: '20091008-161201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35801',
internalId:  '',
customField: '20091215-210456'
};
webappMappings['7008']=webappMappings['7008-7975']={
webappId:    '7008',
documentId:  '9601',
internalId:  '7975',
customField: 'language:es;country:ES;'
};
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20INVD14';
var companyName   = 'Rosmelia%2C++Taller+de+dise%C3%B1o+floral';
var htmlTitle	  = 'www.rosmelia.com';
var metaKeywords  = 'flores+preservadas+%2C+rosmelia+%2C+ramo+novia+';
var metaContents  = 'flores+preservadas%2C+Ramos+de+novia+preservados%2C+decoracion+floral%2C+detalles+para+invitados+y+complementos%2C+Ramo+de+novia+preservado%2C+flores+preservadas';
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();
};
