/* [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','4592',jdecode('Home'),jdecode(''), jdecode('%2F4592.html'), 'true',[],'',''],
	['PAGE','94801',jdecode('Portrait'),jdecode(''), jdecode('%2F94801.html'), 'true',[],'',''],
	['PAGE','4703',jdecode('Philosophie'),jdecode(''), jdecode('%2F4703.html'), 'true',[],'',''],
	['PAGE','53524',jdecode('Unikat+Cards+'),jdecode(''), jdecode('%2F53524.html'), 'true',[],'',''],
	['PAGE','52185',jdecode('Galerie'),jdecode(''), jdecode('%2F52185%2Findex.html'), 'true',[ 
		['PAGE','104301',jdecode('Galerie+Karten'),jdecode(''), jdecode('%2F52185%2F104301.html'), 'true',[],'',''],
		['PAGE','117501',jdecode('Mix'),jdecode(''), jdecode('%2F52185%2F117501.html'), 'true',[],'',''],
		['PAGE','123401',jdecode('Sportkatzen'),jdecode(''), jdecode('%2F52185%2F123401.html'), 'true',[],'','']
	],'',''],
	['PAGE','119501',jdecode('Pinboard'),jdecode(''), jdecode('%2F119501.html'), 'true',[],'',''],
	['PAGE','17214',jdecode('Catsline+Events'),jdecode(''), jdecode('%2F17214.html'), 'true',[],'',''],
	['PAGE','9901',jdecode('Newsletter+Linelotti'),jdecode(''), jdecode('%2F9901.html'), 'true',[],'',''],
	['PAGE','4649',jdecode('Mit+Cats+leben'),jdecode(''), jdecode('%2F4649.html'), 'true',[],'',''],
	['PAGE','34086',jdecode('Keramik'),jdecode(''), jdecode('%2F34086.html'), 'true',[],'',''],
	['PAGE','4892',jdecode('Kontakt'),jdecode(''), jdecode('%2F4892%2Findex.html'), 'true',[ 
		['PAGE','53310',jdecode('Anfahrt'),jdecode(''), jdecode('%2F4892%2F53310.html'), 'true',[],'',''],
		['PAGE','53512',jdecode('Ihr+Weg+zu+uns'),jdecode(''), jdecode('%2F4892%2F53512.html'), 'true',[],'',''],
		['PAGE','111301',jdecode('Anfrage'),jdecode(''), jdecode('%2F4892%2F111301.html'), 'true',[],'','']
	],'',''],
	['PAGE','19915',jdecode('Links'),jdecode(''), jdecode('%2F19915.html'), 'true',[],'',''],
	['PAGE','5202',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F5202.html'), 'true',[],'',''],
	['PAGE','5203',jdecode('Eintr%C3%A4ge'),jdecode(''), jdecode('%2F5203.html'), 'false',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Quadrat';
theSitetree.paletteFamily='C95293';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10449';
theSitetree.graphicsetId='10839';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Quadrat',
				paletteFamily: 	'C95293',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10449',
				graphicsetId: 	'10839',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'C95293',
				e_color: 		'807E7E',
				f_color: 		'434242',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4592',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4592',
internalId:  '',
customField: '20120126-121129'
};
webappMappings['1002']=webappMappings['1002-5202ABW0X0INX2ZP']={
webappId:    '1002',
documentId:  '5202',
internalId:  '5202ABW0X0INX2ZP',
customField: 'icq=false'
};
webappMappings['1501']=webappMappings['1501-1309394']={
webappId:    '1501',
documentId:  '4592',
internalId:  '1309394',
customField: '1501'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '53512',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '53310',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94801',
internalId:  '',
customField: '20111001-103650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4703',
internalId:  '',
customField: '20120126-121626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53524',
internalId:  '',
customField: '20120126-122252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52185',
internalId:  '',
customField: '20120126-122854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34086',
internalId:  '',
customField: '20120126-130512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4649',
internalId:  '',
customField: '20120126-130001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104301',
internalId:  '',
customField: '20120126-123300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17214',
internalId:  '',
customField: '20120126-124241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20120126-125635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4892',
internalId:  '',
customField: '20120126-130834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111301',
internalId:  '',
customField: '20120126-131234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19915',
internalId:  '',
customField: '20120126-131512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5202',
internalId:  '',
customField: '20120126-132215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5203',
internalId:  '',
customField: '20030114-162107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53310',
internalId:  '',
customField: '20120126-131009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53512',
internalId:  '',
customField: '20120126-131046'
};
webappMappings['7008']=webappMappings['7008-9977']={
webappId:    '7008',
documentId:  '111301',
internalId:  '9977',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123401',
internalId:  '',
customField: '20111001-105507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119501',
internalId:  '',
customField: '20120126-124053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '117501',
internalId:  '',
customField: '20120126-123600'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INX2ZP';
var companyName   = 'H.P.+EHRAT%27S+CATSLINE+CARTOONS';
var htmlTitle	  = 'catsline';
var metaKeywords  = 'Catsline%2C+Kartenshop%2C++Katzenbilder%2C+Katzenkunst%2C+Katzenkarten%2C+Unikatkarten%2C+Katzenliebhaber%2C+Kunstkarten%2C+Wunschkarten%2C+Kreativatelier%2C+Katzengalerie%2C+Bahnhofatelier%2C+Hanspeter+Ehrat%2C+Katzenmaler%2C+Katzenillustrator%2C+Katzenzeichner%2C+Katzencatoons%2C++Kunsthandwerk%2C+Cartoons%2C+Cartoonatelier%2C+Atelier+f%C3%BCr+Katzencartoons%2C+Einzigartig%2C+Einmalig%2C++';
var metaContents  = 'www.catsline.ch%2CCatsline+Cartoons%2CKatzen+Cartoons%2C+Unikat+Karten%2C+Catsline+Cartoons%2C+';
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();
};

