/* [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','4599',jdecode('Home+'),jdecode(''), jdecode('%2F4599.html'), 'true',[],'',''],
	['PAGE','5082',jdecode('Portrait'),jdecode(''), jdecode('%2F5082.html'), 'true',[],'',''],
	['PAGE','4656',jdecode('Produkte'),jdecode(''), jdecode('%2F4656%2Findex.html'), 'true',[ 
		['PAGE','4683',jdecode('Tische'),jdecode(''), jdecode('%2F4656%2F4683.html'), 'true',[],'',''],
		['PAGE','4710',jdecode('St%C3%BChle'),jdecode(''), jdecode('%2F4656%2F4710.html'), 'true',[],'',''],
		['PAGE','4737',jdecode('M%C3%B6bel'),jdecode(''), jdecode('%2F4656%2F4737.html'), 'true',[],'',''],
		['PAGE','29002',jdecode('Fenster'),jdecode(''), jdecode('%2F4656%2F29002.html'), 'true',[],'','']
	],'',''],
	['PAGE','4764',jdecode('Werkstatt+%2F+Team'),jdecode(''), jdecode('%2F4764.html'), 'true',[],'',''],
	['PAGE','4791',jdecode('Aktuelles'),jdecode(''), jdecode('%2F4791%2Findex.html'), 'true',[ 
		['PAGE','29289',jdecode('Medien'),jdecode(''), jdecode('%2F4791%2F29289.html'), 'true',[],'',''],
		['PAGE','29308',jdecode('Auszugstisch'),jdecode(''), jdecode('%2F4791%2F29308.html'), 'true',[],'',''],
		['PAGE','29430',jdecode('Stach'),jdecode(''), jdecode('%2F4791%2F29430.html'), 'true',[],'',''],
		['PAGE','29443',jdecode('Form+1'),jdecode(''), jdecode('%2F4791%2F29443.html'), 'true',[],'','']
	],'',''],
	['PAGE','21802',jdecode('Kontakt'),jdecode(''), jdecode('%2F21802.html'), 'true',[],'',''],
	['PAGE','28800',jdecode('Sonderangebote'),jdecode(''), jdecode('%2F28800.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Global';
theSitetree.paletteFamily='CC3300';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='87';
theSitetree.graphicsetId='107';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Global',
				paletteFamily: 	'CC3300',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'87',
				graphicsetId: 	'107',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'CB1C00',
				b_color: 		'FF9900',
				c_color: 		'000000',
				d_color: 		'EAEAEA',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4599',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4599',
internalId:  '',
customField: '20111010-112505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4656',
internalId:  '',
customField: '20091108-123806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4683',
internalId:  '',
customField: '20110722-110849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4737',
internalId:  '',
customField: '20120128-134256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5082',
internalId:  '',
customField: '20090413-194027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4710',
internalId:  '',
customField: '20101204-195857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4764',
internalId:  '',
customField: '20090413-193625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4791',
internalId:  '',
customField: '20110502-194503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21802',
internalId:  '',
customField: '20110502-194210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29430',
internalId:  '',
customField: '20110515-124209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28800',
internalId:  '',
customField: '20111212-194447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29002',
internalId:  '',
customField: '20091005-120418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29443',
internalId:  '',
customField: '20110502-200904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29308',
internalId:  '',
customField: '20101204-194638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29289',
internalId:  '',
customField: '20101204-195017'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXZA3';
var companyName   = 'Tisch+Team+';
var htmlTitle	  = 'Seit+2004+werden+die+Tische+nun+in+8912+Obfelden%2C+an+der+Brunnenstrasse+4%2C+hergestellt.+Auch+hier+werden+mit+viel+Liebe%2C+Erfahrung%2C+Pr%C3%A4zision+und+handwerklichem+Know-how+massgeschreinerte+Tische+in+ihrer+sch%C3%B6nsten+Form+und+nach+Kundenw%C3%BCnschen+gefertigt.+J';
var metaKeywords  = 'Camenzind%2C+Heinrich%2C+Heiri%2C+Tisch%2C+Tische%2C+St%C3%BChle%2C+M%C3%B6bel%2C+Beizentisch%2C+H%C3%BCrlimann-Tische%2C+H%C3%BCrlimann%2C+Brandschenke%2C+Z%C3%BCrich%2C+Obfelden%2C+Schreinerei%2C+Innenausbau%2C+Tischteam%2C+Tisch-Team%2C+Team%2C+Tisch+Team%2C+Stadler%2C+Etzelstrasse%2C+Brunnenstrasse%2C+Quadro%2C+Cubus%2C+Biedermeiertisch%2C+Bistrotisch%2C+Tiziana%2C+Virginia%2C+Nathalie%2C+Marie-Ang%C3%A8le%2C+Jamie%2C+Nachttisch%2C+Haust%C3%BCren%2C+Fenster%2C+Gartentisch%2C+Gehrungstisch%2C+Tabourettli%2C+Betten%2C+Massivholztisch%2C+Massivholzm%C3%B6bel%2C+Schweizertisch%2C+Brauerei%2C+Brauereitisch%2C+Schweizerm%C3%B6bel%2C+Designertisch%2C+Tischdesign%2C+Holztisch%2C+Konferenztisch%2C+Spezialgr%C3%B6ssentisch%2C+Uebergr%C3%B6ssentisch%2C+Tisch+nach+Mass%2C+B%C3%BCrotisch%2C+Arbeitstisch%2C+K%C3%BCchentisch%2C+Tischplatte%2C+Tischf%C3%BCsse%2C+Tischbeine%2C+Salontisch%2C+Clubtisch%2C+Klubtisch%2C+Beistelltisch%2C+Waschtisch%2C+Badezimmertisch%2C+Restauranttisch%2C+Esstisch%2C+Wohnzimmertisch%2C+Einzelm%C3%B6bel%2C+Eichentisch%2C+Ulmentisch%2C+Nussbaumtisch%2C+Kirschbaumtisch%2C+Ahorntisch%2C+Birnbaumtisch%2C+Elsbeertisch%2C+Buchentisch%2C+Spezialanfertigungen+in+Holz%2C+Spezialbetten%2C+Einzelanfertigungen%2C+Tisch+auffrischen%2C+Tisch+schleifen%2C+Holzdecken%2C+T%C3%A4ferdecken%2C+K%C3%BCchenplatten%2C+K%C3%BCchenabdeckung+in+Holz++';
var metaContents  = 'Seit+2004+werden+die+Tische+nun+in+8912+Obfelden%2C+an+der+Brunnenstrasse+4%2C+hergestellt.+Auch+hier+werden+mit+viel+Liebe%2C+Erfahrung%2C+Pr%C3%A4zision+und+handwerklichem+Know-how+massgeschreinerte+Tische+in+ihrer+sch%C3%B6nsten+Form+und+nach+Kundenw%C3%BCnschen+gefertigt.+Jedes+St%C3%BCck+ist+ein+Unikat+und+entspricht+h%C3%B6chsten+Qualit%C3%A4tsanforderungen.';
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();
};

