/* [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('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','641',jdecode('K%C3%BCnstler'),jdecode(''),'/641.html','true',[],'',''],
	['PAGE','31901',jdecode('Blynd+Horsez'),jdecode(''),'/31901.html','true',[],'',''],
	['PAGE','9301',jdecode('Katalog'),jdecode(''),'/9301.html','true',[],'',''],
	['PAGE','14101',jdecode('Essays'),jdecode(''),'/14101.html','true',[],'',''],
	['PAGE','17901',jdecode('Gallery+Links'),jdecode(''),'/17901.html','true',[],'',''],
	['PAGE','17922',jdecode('Favoriten'),jdecode(''),'/17922.html','true',[],'',''],
	['PAGE','5901',jdecode('Weblog'),jdecode(''),'/5901.html','true',[],'',''],
	['PAGE','15901',jdecode('Forum'),jdecode(''),'/15901.html','true',[],'',''],
	['PAGE','6006',jdecode('G%C3%A4stebuch'),jdecode(''),'/6006/index.html','true',[ 
		['PAGE','6001',jdecode('Eintr%C3%A4ge'),jdecode(''),'/6006/6001.html','false',[],'','']
	],'',''],
	['PAGE','10801',jdecode('Voting'),jdecode(''),'/10801.html','true',[],'',''],
	['PAGE','37312',jdecode('Onlineshop'),jdecode(''),'/37312.html','true',[],'',''],
	['PAGE','10822',jdecode('Kontaktformular'),jdecode(''),'/10822.html','true',[],'',''],
	['PAGE','6201',jdecode('Anfahrt'),jdecode(''),'/6201.html','true',[],'',''],
	['PAGE','30301',jdecode('Routenplaner'),jdecode(''),'/30301.html','true',[],'',''],
	['PAGE','31401',jdecode('Kultur'),jdecode(''),'/31401.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Blues';
theSitetree.paletteFamily='8B6601';
theSitetree.keyvisualId='2752';
theSitetree.keyvisualName='gitarre.jpg';
theSitetree.fontsetId='10418';
theSitetree.graphicsetId='10705';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Blues',
				paletteFamily: 	'8B6601',
				keyvisualId: 	'2752',
				keyvisualName: 	'gitarre.jpg',
				fontsetId: 		'10418',
				graphicsetId: 	'10705',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'8B6601',
				e_color: 		'8B6601',
				f_color: 		'8B6601',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['7050']=webappMappings['7050-12']={
webappId:    '7050',
documentId:  '5901',
internalId:  '12',
customField: 'language:de;country:CH;'
};
webappMappings['1002']=webappMappings['1002-6006ahopt0in3gng']={
webappId:    '1002',
documentId:  '6006',
internalId:  '6006ahopt0in3gng',
customField: 'icq=false'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '6201',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['4001']=webappMappings['4001-23001536']={
webappId:    '4001',
documentId:  '37312',
internalId:  '23001536',
customField: 'language:de;country:CH;'
};
webappMappings['7060']=webappMappings['7060-85ea51661f6d09e4565cf658b41c15c8']={
webappId:    '7060',
documentId:  '9301',
internalId:  '85ea51661f6d09e4565cf658b41c15c8',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100814-114730'
};
webappMappings['7005']=webappMappings['7005-17']={
webappId:    '7005',
documentId:  '10801',
internalId:  '17',
customField: 'language:de;country:CH;'
};
webappMappings['7060']=webappMappings['7060-4dc846e8e0bc9d8ff24dca30df86b72c']={
webappId:    '7060',
documentId:  '14101',
internalId:  '4dc846e8e0bc9d8ff24dca30df86b72c',
customField: 'language:de;country:CH;'
};
webappMappings['1003']=webappMappings['1003-ahopt0in3gng11706c098e2']={
webappId:    '1003',
documentId:  '15901',
internalId:  'ahopt0in3gng11706c098e2',
customField: 'de:CH:'
};
webappMappings['1501']=webappMappings['1501-13224960']={
webappId:    '1501',
documentId:  '401',
internalId:  '13224960',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-121']={
webappId:    '7008',
documentId:  '10822',
internalId:  '121',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31901',
internalId:  '',
customField: '20100814-114813'
};
webappMappings['7090']=webappMappings['7090-27']={
webappId:    '7090',
documentId:  '31401',
internalId:  '27',
customField: 'language:de;country:CH;name:;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20100814-114835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14101',
internalId:  '',
customField: '20100814-114853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37312',
internalId:  '',
customField: '20100814-115114'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '30301',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30301',
internalId:  '',
customField: '20100814-115209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31401',
internalId:  '',
customField: '20100814-115229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10822',
internalId:  '',
customField: '20100814-115133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '641',
internalId:  '',
customField: '20100814-114750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17901',
internalId:  '',
customField: '20100814-114912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17922',
internalId:  '',
customField: '20100814-114932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20100814-114952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15901',
internalId:  '',
customField: '20100814-115012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6006',
internalId:  '',
customField: '20100814-115036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20090328-163752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10801',
internalId:  '',
customField: '20100814-115057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20100814-115150'
};
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'AHOPT0IN3GNG';
var companyName   = 'Blind+Horse+Gallery';
var htmlTitle	  = 'Blind+Horse+Gallery';
var metaKeywords  = 'St%C3%BCdli%2C+Stuedli%2C+Hans-Erich+St%C3%BCdli%2C+Rocksaurier%2C+Tagelswangen%2C+Neustadthus%2C+arts%2C+gallery%2C+painter%2C+stained+glass%2C+Fritz+J.+Dold%2C+artist%2C+paintings%2C+rock-pop-art%2C+faces%2C+small+faces%2C+swissart%2C+cyber-art%2C+Maler%2C+Kunst%2C+Kuenstler%2C+Blind+Horse%2C+Blind+Horse+Gallery%2C+Gallerie%2C+Traveling+Wilburys%2C+Motorhead%2C+Pauline+Stuedli%2C+Alice+Cooper%2C+Blynd+Horsez%2C+Bassersdorf%2C+Starchild%2C+30+days+in+the+hole%2C+Misfits%2C+Thunder%2C+Dandy+in+the+mud%2C+When+my+minds+gone';
var metaContents  = 'BLIND+HORSE+GALLERY+befasst+sich+mit+der+virtuellen+Praesentation+und+dem+Verkauf+von+Rock-Pop-Art+Bildern+gemalt+in+spezieller+Acrylfarbentechnik+vom+Kuenstler+Hans-Erich+Stuedli+direkt.';
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();
};
