/* [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(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','700113',jdecode('Neu'),jdecode(''), jdecode('%2F700113.html'), 'true',[],'',''],
	['PAGE','700613',jdecode('Blog'),jdecode(''), jdecode('%2F700613.html'), 'true',[],'',''],
	['PAGE','700134',jdecode('Info'),jdecode(''), jdecode('%2F700134.html'), 'true',[],'',''],
	['PAGE','700155',jdecode('Welpen'),jdecode(''), jdecode('%2F700155.html'), 'true',[],'',''],
	['PAGE','704213',jdecode('Wurf++2012'),jdecode(''), jdecode('%2F704213.html'), 'true',[],'',''],
	['PAGE','700634',jdecode('Gorena'),jdecode(''), jdecode('%2F700634.html'), 'true',[],'',''],
	['PAGE','700655',jdecode('Prisco'),jdecode(''), jdecode('%2F700655.html'), 'true',[],'',''],
	['PAGE','700676',jdecode('Darcy'),jdecode(''), jdecode('%2F700676.html'), 'true',[],'',''],
	['PAGE','700697',jdecode('Links'),jdecode(''), jdecode('%2F700697.html'), 'true',[],'',''],
	['PAGE','703513',jdecode('Banner'),jdecode(''), jdecode('%2F703513.html'), 'true',[],'',''],
	['PAGE','700718',jdecode('Kontakt'),jdecode(''), jdecode('%2F700718.html'), 'true',[],'',''],
	['PAGE','700739',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F700739.html'), 'true',[],'',''],
	['PAGE','700760',jdecode('Impressum'),jdecode(''), jdecode('%2F700760.html'), 'true',[],'',''],
	['PAGE','700781',jdecode('********'),jdecode(''), jdecode('%2F700781.html'), 'true',[],'',''],
	['PAGE','700802',jdecode('********'),jdecode(''), jdecode('%2F700802.html'), 'true',[],'',''],
	['PAGE','700823',jdecode('********'),jdecode(''), jdecode('%2F700823.html'), 'true',[],'',''],
	['PAGE','700844',jdecode('********'),jdecode(''), jdecode('%2F700844.html'), 'true',[],'',''],
	['PAGE','700865',jdecode('********'),jdecode(''), jdecode('%2F700865.html'), 'true',[],'',''],
	['PAGE','700886',jdecode('********'),jdecode(''), jdecode('%2F700886.html'), 'true',[],'',''],
	['PAGE','700907',jdecode('********'),jdecode(''), jdecode('%2F700907.html'), 'true',[],'',''],
	['PAGE','700928',jdecode('********'),jdecode(''), jdecode('%2F700928.html'), 'true',[],'',''],
	['PAGE','700949',jdecode('********'),jdecode(''), jdecode('%2F700949.html'), 'true',[],'',''],
	['PAGE','700970',jdecode('********'),jdecode(''), jdecode('%2F700970.html'), 'true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Guest';
theSitetree.paletteFamily='FFF475';
theSitetree.keyvisualId='11765';
theSitetree.keyvisualName='kv_11765.jpg';
theSitetree.fontsetId='33048';
theSitetree.graphicsetId='14038';
theSitetree.contentColor='330000';
theSitetree.contentBGColor='FFF2DC';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Guest',
				paletteFamily: 	'FFF475',
				keyvisualId: 	'11765',
				keyvisualName: 	'kv_11765.jpg',
				fontsetId: 		'33048',
				graphicsetId: 	'14038',
				contentColor: 	'330000',
				contentBGColor: 'FFF2DC',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20120130-154345'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700113',
internalId:  '-',
customField: '20120130-151027'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700134',
internalId:  '-',
customField: '20120130-134308'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700155',
internalId:  '-',
customField: '20120130-134411'
};
webappMappings['7050']=webappMappings['7050-1017']={
webappId:    '7050',
documentId:  '700613',
internalId:  '1017',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-13575']={
webappId:    '7008',
documentId:  '700718',
internalId:  '13575',
customField: 'language:de;country:CH;'
};
webappMappings['1002']=webappMappings['1002-700739abw1x0inedla']={
webappId:    '1002',
documentId:  '700739',
internalId:  '700739abw1x0inedla',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700634',
internalId:  '-',
customField: '20120130-142203'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700655',
internalId:  '-',
customField: '20120130-142108'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700676',
internalId:  '-',
customField: '20120130-142941'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700697',
internalId:  '-',
customField: '20120130-152142'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700718',
internalId:  '-',
customField: '20120130-143725'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700739',
internalId:  '-',
customField: '20120130-143906'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700760',
internalId:  '-',
customField: '20120130-145959'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700781',
internalId:  '-',
customField: '20120130-150029'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700802',
internalId:  '-',
customField: '20120130-150056'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700823',
internalId:  '-',
customField: '20120130-150122'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700844',
internalId:  '-',
customField: '20120130-150151'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700865',
internalId:  '-',
customField: '20120130-150215'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700886',
internalId:  '-',
customField: '20120130-150241'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700907',
internalId:  '-',
customField: '20120130-150334'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700928',
internalId:  '-',
customField: '20120130-150401'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700949',
internalId:  '-',
customField: '20120130-150435'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700970',
internalId:  '-',
customField: '20120130-150501'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '700613',
internalId:  '-',
customField: '20120130-151806'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '703513',
internalId:  '-',
customField: '20120130-154208'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '704213',
internalId:  '-',
customField: '20120130-154919'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW1X0INEDLA';
var companyName   = 'L+A+B+R+A+D+O+R+++R+E+T+R+I+E+V+E+R';
var htmlTitle	  = 'www.muellers-labrador.ch';
var metaKeywords  = '';
var metaContents  = '';
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();
};

