/* [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','4394',jdecode('Home+%2F+NEWS'),jdecode(''), jdecode('%2F4394.html'), 'true',[],'',''],
	['PAGE','53654',jdecode('Geschichte'),jdecode(''), jdecode('%2F53654.html'), 'true',[],'',''],
	['PAGE','4505',jdecode('Ausstellungen'),jdecode(''), jdecode('%2F4505.html'), 'true',[],'',''],
	['PAGE','53645',jdecode('R%C3%BCckblicke'),jdecode(''), jdecode('%2F53645.html'), 'true',[],'',''],
	['PAGE','4451',jdecode('Karten'),jdecode(''), jdecode('%2F4451.html'), 'true',[],'',''],
	['PAGE','26012',jdecode('Boutique-Artikel'),jdecode(''), jdecode('%2F26012.html'), 'true',[],'',''],
	['PAGE','4559',jdecode('Ch%C3%A4ller-Galerie+'),jdecode(''), jdecode('%2F4559.html'), 'true',[],'',''],
	['PAGE','4532',jdecode('Links+%2F+Kontakt'),jdecode(''), jdecode('%2F4532.html'), 'true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Neon';
theSitetree.paletteFamily='6699CC';
theSitetree.keyvisualId='902';
theSitetree.keyvisualName='feder.jpg';
theSitetree.fontsetId='160';
theSitetree.graphicsetId='186';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2QE'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Neon',
				paletteFamily: 	'6699CC',
				keyvisualId: 	'902',
				keyvisualName: 	'feder.jpg',
				fontsetId: 		'160',
				graphicsetId: 	'186',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'666666',
				c_color: 		'000000',
				d_color: 		'6699CC',
				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:  '4394',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53645',
internalId:  '',
customField: '20100606-203020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4451',
internalId:  '',
customField: '20111013-201106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4505',
internalId:  '',
customField: '20111208-214126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53654',
internalId:  '',
customField: '20100606-202823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4394',
internalId:  '',
customField: '20120119-232854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26012',
internalId:  '',
customField: '20111208-213656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4559',
internalId:  '',
customField: '20110621-100117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4532',
internalId:  '',
customField: '20110809-223813'
};
webappMappings['7008']=webappMappings['7008-11771']={
webappId:    '7008',
documentId:  '26012',
internalId:  '11771',
customField: 'language:de;country:CH;'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INX2HW';
var companyName   = '%22Scherischnitt%22+Beatrice+Straubhaar';
var htmlTitle	  = 'scherischnitt';
var metaKeywords  = 'Scherischnitt%2C+Scherenschnitt%2C+Scherenschnitte%2C+Scherenschnitt-Demonstration%2C+Scherenschnittkunst%2C+Scherenschnittkuenstler%2C+Scherenschnittk%C3%BCnstlerin%2C+Scherenschneider%2C+Scherenschneiderin%2C+Scherenschneiderinnen%2C+Scherenschnitt-Ausstellung%2C+Scherenschnitt-Verkaufsausstellung%2C+Scherenschnitt-Motiv%2C+Scherenschnitt-Sujet%2C+Brauch%2C+Brauchtum%2C+Volkskunst%2C+Kunsthandwerk%2C+Tradition%2C+traditionelle%2C+Symmetrie%2C+Schere%2C+Papier%2C+Faltschnitt%2C+Lauenen%2C+Gstaad%2C+Ch%C3%A4ller-Galerie%2C+Saanenland%2C+Johann+Jakob+Hauswirth%2C+Christian+Schwizgebel%2C+Verein+Freunde+des+Scherenschnitts%2C+Ethno%2C+D%C3%A9coupage%2C+D%C3%A9coupages%2C+Paper+Cut%2C+Paper+cuttings%2C+Paper+cutting%2C++Scherenschnitt-Tassen%2C+Espresso-Tassen%2C+Mug%2C+Mugs%2C+Appenzeller-T%C3%BCechli%2C+Scherenschnitt-T%C3%BCechli%2C+Halst%C3%BCechli%2C+Nikkit%C3%BCechli%2C+Holzkleiderb%C3%BCgel%2C+Handt%C3%BCcher%2C+Tischset%2C+Tischsets%2C+Servietten%2C+Windlichter%2C+Gl%C3%A4ser+mit+Scherenschnitt%2C+Geburtsanzeige%2C+Hochzeitsanzeige%2C+Heiratsanzeige%2C+Online-Karten%2C+Hochzeitskarte%2C+Weihnachtskarte%2C+Online-Karte%2C+Tischset+laminiert%2C+laminierte+Tischset%2C+Lichth%C3%BCllen%2C+Licht-H%C3%BCllen%2C+Tischdekoration%2C+Tisch-Dekoration';
var metaContents  = 'Geschichte+des+Scherenschnittes+und+seine+Entwicklung.+Scherenschnitt-Ausstellung.+Scherenschnitt-Verkaufsausstellung.+Scherenschnitt-Demonstration.++Einblick+in+die+Kunst+des+Scherenschnitts.+Traditionelle+Scherenschnitte%2C+Scherenschnitt-Karten%2C+Holzkleiderbuegel%2C+Tassen%2C+Windlichter%2C+Handt%C3%BCcher+alles+bedruckt+mit+traditonellen+Scherenschnittmotiven.+Ch%C3%A4ller-Galerie+Gstaad.+Appenzeller-T%C3%BCechli%2C+Scherenschnitt-T%C3%BCechli%2C+Halst%C3%BCechli%2C+Nikkit%C3%BCechli%2C+Espresso-Tassen%2C+Geburtsanzeigen%2C+Online-Karten%2C+Geburtsanzeige%2C+Hochzeitskarte%2C+Weihnachstkarte%2C+Lichth%C3%BCllen%2C+Licht-H%C3%BCllen%2C+Tischdekoration%2C+Tisch-Dekoration%2C+Tischset+laminiert%2C+laminierte+Tischset';
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();
};

