/* [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('No.+1+-+World+Wonder'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','376501',jdecode('Contact'),jdecode(''), jdecode('%2F376501.html'), 'true',[],'',''],
	['PAGE','122101',jdecode('THE+HAMM+STORY'),jdecode(''), jdecode('%2F122101.html'), 'true',[],'',''],
	['PAGE','345401',jdecode('Exhib.+University+Leipzig'),jdecode(''), jdecode('%2F345401.html'), 'true',[],'',''],
	['PAGE','382501',jdecode('Art+Expo+Basel+2000'),jdecode(''), jdecode('%2F382501.html'), 'true',[],'',''],
	['PAGE','362101',jdecode('THE+CENTURY+STORY'),jdecode(''), jdecode('%2F362101.html'), 'true',[],'',''],
	['PAGE','122701',jdecode('1.RAPHAEL%3A+Transfig..+'),jdecode(''), jdecode('%2F122701.html'), 'true',[],'',''],
	['PAGE','115101',jdecode('2.RAPHAEL%3A+Resurrect.++'),jdecode(''), jdecode('%2F115101.html'), 'true',[],'',''],
	['PAGE','281001',jdecode('3.RAPHAEL%3A+4+drawings'),jdecode(''), jdecode('%2F281001.html'), 'true',[],'',''],
	['PAGE','124401',jdecode('4.LEONARDO%3A+St.Anne'),jdecode(''), jdecode('%2F124401.html'), 'true',[],'',''],
	['PAGE','129601',jdecode('5.GIORGIONE%3A+Venus'),jdecode(''), jdecode('%2F129601.html'), 'true',[],'',''],
	['PAGE','213301',jdecode('6.TIZIAN%3A+Madonna'),jdecode(''), jdecode('%2F213301.html'), 'true',[],'',''],
	['PAGE','131201',jdecode('9.CARAVAGGIO%3A+Cain+'),jdecode(''), jdecode('%2F131201.html'), 'true',[],'',''],
	['PAGE','131243',jdecode('15.DURER%3A+Ecce+Homo'),jdecode(''), jdecode('%2F131243.html'), 'true',[],'',''],
	['PAGE','166801',jdecode('16.DURER%3A+Mother'),jdecode(''), jdecode('%2F166801.html'), 'true',[],'',''],
	['PAGE','131306',jdecode('19.CRANACH%3A+Elector'),jdecode(''), jdecode('%2F131306.html'), 'true',[],'',''],
	['PAGE','481601',jdecode('CRANACH+crucifixion'),jdecode(''), jdecode('%2F481601.html'), 'true',[],'',''],
	['PAGE','215401',jdecode('21.J.M.W.TURNER%3A'),jdecode(''), jdecode('%2F215401.html'), 'true',[],'',''],
	['PAGE','257501',jdecode('22.MONET%3AMme.Salerou'),jdecode(''), jdecode('%2F257501.html'), 'true',[],'',''],
	['PAGE','293001',jdecode('23.TOULOUSE-LAUTREC'),jdecode(''), jdecode('%2F293001.html'), 'true',[],'',''],
	['PAGE','323401',jdecode('24.MAX+BECKMANN'),jdecode(''), jdecode('%2F323401.html'), 'true',[],'',''],
	['PAGE','532401',jdecode('25.Pablo+PICASSO'),jdecode(''), jdecode('%2F532401.html'), 'true',[],'',''],
	['PAGE','535301',jdecode('PABLO+PICASSO'),jdecode(''), jdecode('%2F535301.html'), 'true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Nurseries';
theSitetree.paletteFamily='FFE57B';
theSitetree.keyvisualId='7908';
theSitetree.keyvisualName='kv_7908.jpg';
theSitetree.fontsetId='16877';
theSitetree.graphicsetId='12313';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFE57B';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MH'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'true',
				name: 			'Nurseries',
				paletteFamily: 	'FFE57B',
				keyvisualId: 	'7908',
				keyvisualName: 	'kv_7908.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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '362101',
internalId:  '',
customField: '20101213-084346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20120208-171129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '376501',
internalId:  '',
customField: '20120208-171144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '122101',
internalId:  '',
customField: '20111219-234503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '122701',
internalId:  '',
customField: '20111202-174205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115101',
internalId:  '',
customField: '20120116-145819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '281001',
internalId:  '',
customField: '20120128-014941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124401',
internalId:  '',
customField: '20111201-203950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129601',
internalId:  '',
customField: '20120122-150746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '213301',
internalId:  '',
customField: '20091219-023140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '131201',
internalId:  '',
customField: '20110323-083954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '131243',
internalId:  '',
customField: '20101223-095937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '166801',
internalId:  '',
customField: '20110306-192730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '131306',
internalId:  '',
customField: '20110315-020458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '215401',
internalId:  '',
customField: '20111201-202055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '257501',
internalId:  '',
customField: '20110306-191214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '293001',
internalId:  '',
customField: '20111220-171903'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '323401',
internalId:  '',
customField: '20111220-021927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '345401',
internalId:  '',
customField: '20111220-033251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '382501',
internalId:  '',
customField: '20120128-020727'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '401',
internalId:  '1501',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '481601',
internalId:  '',
customField: '20100722-192155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '532401',
internalId:  '',
customField: '20110306-205258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '535301',
internalId:  '',
customField: '20110323-082719'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INEDYR';
var companyName   = 'Hamm+Institute-Foundation+for+the+Saving+of+Humanity';
var htmlTitle	  = 'The++eternal+No.+1++world+wonder';
var metaKeywords  = 'The+eternal+No.1+World+Wonder';
var metaContents  = 'The+eternal+No.1+World+Wonder';
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();
};

