/* [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','4598',jdecode('Home'),jdecode(''),'/4598.html','true',[],'',''],
	['PAGE','4655',jdecode('Artist'),jdecode(''),'/4655.html','true',[],'',''],
	['PAGE','4682',jdecode('Process'),jdecode(''),'/4682.html','true',[],'',''],
	['PAGE','306772',jdecode('My+Artbook'),jdecode(''),'/306772.html','true',[],'',''],
	['PAGE','306781',jdecode('Posters'),jdecode(''),'/306781.html','true',[],'',''],
	['PAGE','279422',jdecode('New+Releases'),jdecode(''),'/279422.html','true',[],'',''],
	['PAGE','4709',jdecode('Countryside+Art'),jdecode(''),'/4709.html','true',[],'',''],
	['PAGE','4736',jdecode('Modern+Art'),jdecode(''),'/4736.html','true',[],'',''],
	['PAGE','4763',jdecode('Exhibitions'),jdecode(''),'/4763.html','true',[],'',''],
	['PAGE','148597',jdecode('Links+%2FContact'),jdecode(''),'/148597/index.html','true',[ 
		['PAGE','149098',jdecode('Acquire+%28follow+up+page%29'),jdecode(''),'/148597/149098.html','false',[],'','']
	],'',''],
	['PAGE','198662',jdecode('Deutsch'),jdecode(''),'/198662.html','true',[],'',''],
	['PAGE','213562',jdecode('Reciprocal+Links'),jdecode(''),'/213562.html','true',[],'',''],
	['PAGE','151992',jdecode('Guestbook'),jdecode(''),'/151992/index.html','true',[ 
		['PAGE','151993',jdecode('Signed+Guests'),jdecode(''),'/151992/151993.html','false',[],'','']
	],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Elegant';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32899';
theSitetree.graphicsetId='13971';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Elegant',
				paletteFamily: 	'000000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32899',
				graphicsetId: 	'13971',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4598',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4655',
internalId:  '',
customField: '20090525-133607'
};
webappMappings['1002']=webappMappings['1002-151992ABW0X0INXSBH']={
webappId:    '1002',
documentId:  '151992',
internalId:  '151992ABW0X0INXSBH',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20100103-182053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4682',
internalId:  '',
customField: '20071228-121339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '306772',
internalId:  '',
customField: '20090416-213708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '306781',
internalId:  '',
customField: '20090416-213734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '279422',
internalId:  '',
customField: '20090620-190753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4709',
internalId:  '',
customField: '20090416-213841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4736',
internalId:  '',
customField: '20090416-213850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4763',
internalId:  '',
customField: '20090801-141325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148597',
internalId:  '',
customField: '20080822-140835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '149098',
internalId:  '',
customField: '20050224-172904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '198662',
internalId:  '',
customField: '20071228-121601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '213562',
internalId:  '',
customField: '20100408-192938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '151992',
internalId:  '',
customField: '20080822-185413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '151993',
internalId:  '',
customField: '20050313-154821'
};
webappMappings['7008']=webappMappings['7008-4605']={
webappId:    '7008',
documentId:  '148597',
internalId:  '4605',
customField: 'language:de;country:CH;'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXSBH';
var companyName   = '+Welcome+To+My+Page+of+Modern+Naive+Art+';
var htmlTitle	  = 'Welcome+To+My+Page+of+Modern+Naive+Art';
var metaKeywords  = 'naive+art%2C+primitive+modern+naive+art%2C+behind+glass%2C+self-taugh-art%2C+phantasy+world%2C+artistic+skill%2C+canvas%2C+colors%2C+cardboard%2C+glass+painting%2C+rural+life+painting%2C+Exhibitions%2C+picture%2C+process%2C+Laienmalerei%2C+Hinterglasmalerei%2COelfarben%2C+Volkskunst%2C+Landschaftsmaler%2C+Oelfarbe%2C+Country+side%2C+Ivan+Generalic%2C+Katarina+Henc%2C+Croatian+Hlebine%2C+Boris+Posavec+++';
var metaContents  = 'Boris+Posavec%2C+primitive+modern+naive+art%2C+painting+style+artist+presents+his+phantasy+and+charming+world+of+gueer+figures%2C+people+as+well+as+animals%2C+the+sun+and+the+stars.Even+though+it+represents+a+style+of+art%2C+the+word+primitive+having+the+function+of+an+atribute%2C+it+has+still+remained+faithful+to+its+origin.It+has+retained+the+subject+matter+of+simple+life+and+simple+forms%2C+demanding+a+maximum+of+artistic+skill.';
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();
};
