/* [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','5001',jdecode('Home'),jdecode(''), jdecode('%2F5001.html'), 'true',[],'',''],
	['ITEM','123312',jdecode('Onlineshop'),jdecode(''), jdecode('http%3A%2F%2Fshop.sedv.ch'), 'true',[],'','_blank'],
	['PAGE','24601',jdecode('Dienstleistungen'),jdecode(''), jdecode('%2F24601%2Findex.html'), 'true',[ 
		['PAGE','26901',jdecode('AGB+Dienstleistungen'),jdecode(''), jdecode('%2F24601%2F26901.html'), 'true',[],'','']
	],'',''],
	['PAGE','109412',jdecode('Support'),jdecode(''), jdecode('%2F109412%2Findex.html'), 'true',[ 
		['ITEM','131412',jdecode('Lifecycle+Microsoft'),jdecode(''), jdecode('http%3A%2F%2Fsupport.microsoft.com%2Fgp%2Flifeselect'), 'true',[],'','_blank'],
		['PAGE','54922',jdecode('Windows+7+'),jdecode(''), jdecode('%2F109412%2F54922.html'), 'true',[],'',''],
		['PAGE','23501',jdecode('Sicherheit+'),jdecode(''), jdecode('%2F109412%2F23501.html'), 'true',[],'',''],
		['PAGE','54901',jdecode('Linux'),jdecode(''), jdecode('%2F109412%2F54901.html'), 'true',[],'','']
	],'',''],
	['PAGE','78401',jdecode('Links'),jdecode(''), jdecode('%2F78401.html'), 'true',[],'',''],
	['PAGE','5101',jdecode('Kontakt'),jdecode(''), jdecode('%2F5101%2Findex.html'), 'true',[ 
		['PAGE','51101',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F5101%2F51101.html'), 'true',[],'','']
	],'',''],
	['PAGE','24801',jdecode('Impressum'),jdecode(''), jdecode('%2F24801%2Findex.html'), 'true',[ 
		['PAGE','5122',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F24801%2F5122.html'), 'true',[],'','']
	],'',''],
	['PAGE','24622',jdecode('AGB%26%23x27%3Bs'),jdecode(''), jdecode('%2F24622.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Bow';
theSitetree.paletteFamily='0086C2';
theSitetree.keyvisualId='12026';
theSitetree.keyvisualName='kv_12026.jpg';
theSitetree.fontsetId='33247';
theSitetree.graphicsetId='14115';
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: 			'Bow',
				paletteFamily: 	'0086C2',
				keyvisualId: 	'12026',
				keyvisualName: 	'kv_12026.jpg',
				fontsetId: 		'33247',
				graphicsetId: 	'14115',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'F2F5F8',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20120111-082303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20110902-145154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5122',
internalId:  '',
customField: '20100526-205809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24601',
internalId:  '',
customField: '20110822-174920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24801',
internalId:  '',
customField: '20120103-143111'
};
webappMappings['7008']=webappMappings['7008-7648']={
webappId:    '7008',
documentId:  '5101',
internalId:  '7648',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24622',
internalId:  '',
customField: '20091022-122327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23501',
internalId:  '',
customField: '20100928-173309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26901',
internalId:  '',
customField: '20091107-184302'
};
webappMappings['1002']=webappMappings['1002-51101abw330ineybg']={
webappId:    '1002',
documentId:  '51101',
internalId:  '51101abw330ineybg',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51101',
internalId:  '',
customField: '20091107-210747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54901',
internalId:  '',
customField: '20100906-124212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54922',
internalId:  '',
customField: '20110110-140942'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5001',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-30480648']={
webappId:    '1501',
documentId:  '5001',
internalId:  '30480648',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109412',
internalId:  '',
customField: '20120110-181200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78401',
internalId:  '',
customField: '20120110-181521'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INEYBG';
var companyName   = '';
var htmlTitle	  = 'Siegenthaler+EDV';
var metaKeywords  = 'Siegenthaler+EDV%2C+Computer%2C+Notebook%2C+HP%2C+Leonvo%2C+Netzwerk%2C+Wireless%2C+Beamer%2C+IT+Support%2C+Webshop%2C+Shop%2CHardware%2CSoftware';
var metaContents  = 'Siegenthaler+EDV%2C+Computer%2C+Notebook%2C+HP%2C+Leonvo%2C+Netzwerk%2C+Wireless%2C+Beamer%2C+IT+Support%2C+Webshop%2C+Shop%2CHardware%2CSoftware';
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();
};

