/* [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','4521',jdecode('Home'),jdecode(''),'/4521.html','true',[],'',''],
	['PAGE','141978',jdecode('Mappa+del+sito'),jdecode(''),'/141978.html','true',[],'',''],
	['PAGE','9073',jdecode('Floristica'),jdecode(''),'/9073.html','true',[],'',''],
	['PAGE','138137',jdecode('Servizi+per+matrimoni'),jdecode(''),'/138137.html','true',[],'',''],
	['PAGE','9019',jdecode('Le+nostre+colture%2C+sguardo'),jdecode(''),'/9019.html','true',[],'',''],
	['PAGE','138245',jdecode('Viole'),jdecode(''),'/138245.html','true',[],'',''],
	['PAGE','168151',jdecode('Dipladenia%2FMandevilla'),jdecode(''),'/168151.html','true',[],'',''],
	['PAGE','8965',jdecode('Piante+annuali'),jdecode(''),'/8965.html','true',[],'',''],
	['PAGE','138164',jdecode('Gerani'),jdecode(''),'/138164.html','true',[],'',''],
	['PAGE','242095',jdecode('Die+Dipladenien+%28deutsch%29'),jdecode(''),'/242095.html','true',[],'',''],
	['PAGE','168124',jdecode('Piante+da+esterno'),jdecode(''),'/168124.html','true',[],'',''],
	['PAGE','9100',jdecode('Piante+da+appartamento'),jdecode(''),'/9100.html','true',[],'',''],
	['PAGE','168097',jdecode('Crisantemi'),jdecode(''),'/168097.html','true',[],'',''],
	['PAGE','138218',jdecode('Ciclamini'),jdecode(''),'/138218.html','true',[],'',''],
	['PAGE','138272',jdecode('Stelle+di+Natale'),jdecode(''),'/138272.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='AC2323';
theSitetree.keyvisualId='1737';
theSitetree.keyvisualName='blumen.jpg';
theSitetree.fontsetId='292';
theSitetree.graphicsetId='356';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='AC2323';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'AC2323',
				keyvisualId: 	'1737',
				keyvisualName: 	'blumen.jpg',
				fontsetId: 		'292',
				graphicsetId: 	'356',
				contentColor: 	'FFFFFF',
				contentBGColor: 'AC2323',
				a_color: 		'AC2323',
				b_color: 		'480F0F',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4521',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4521',
internalId:  '',
customField: '20100223-205945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '141978',
internalId:  '',
customField: '20090306-012412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9073',
internalId:  '',
customField: '20080122-144737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138137',
internalId:  '',
customField: '20080725-214148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9019',
internalId:  '',
customField: '20091018-133854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138245',
internalId:  '',
customField: '20090305-234532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '168151',
internalId:  '',
customField: '20100221-193752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138164',
internalId:  '',
customField: '20100223-210020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8965',
internalId:  '',
customField: '20090901-203600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '168097',
internalId:  '',
customField: '20081101-123420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138218',
internalId:  '',
customField: '20081109-132128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138272',
internalId:  '',
customField: '20081026-202857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '168124',
internalId:  '',
customField: '20080122-144650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9100',
internalId:  '',
customField: '20081012-215605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '242095',
internalId:  '',
customField: '20100221-142143'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXSB1';
var companyName   = 'M.+WEBER+fioricoltura';
var htmlTitle	  = 'weber+fiori+fioricoltura+floristica+gerani+orchidea+piante+dipladenia+mandevilla';
var metaKeywords  = 'Orchidea+Gerani+Crisantemi+Fiori+Fioricoltura+Weber+Weberfiori+Mandevilla+Dipladenia';
var metaContents  = 'Fiori+recisi+Gerani+Orchidee+floreale+Weber+Phalaenopsis+sposalizi+fioricoltura++mandevilla+dipladenia';
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();
};
