/* [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','8001',jdecode('Home'),jdecode(''),'/8001.html','true',[],'',''],
	['PAGE','12301',jdecode('Pers%C3%B6nliches'),jdecode(''),'/12301.html','true',[],'',''],
	['PAGE','12343',jdecode('Mein+Blog'),jdecode(''),'/12343.html','false',[],'',''],
	['PAGE','13101',jdecode('Muba-Bilder'),jdecode(''),'/13101.html','false',[],'',''],
	['PAGE','33101',jdecode('MUBA-Malwettbewerb'),jdecode(''),'/33101.html','true',[],'',''],
	['PAGE','24501',jdecode('FC+Basel'),jdecode(''),'/24501.html','true',[],'',''],
	['PAGE','12601',jdecode('Autogramme'),jdecode(''),'/12601.html','true',[],'',''],
	['PAGE','12322',jdecode('G%C3%A4stebuch'),jdecode(''),'/12322.html','true',[],'',''],
	['PAGE','27101',jdecode('Links'),jdecode(''),'/27101.html','true',[],'',''],
	['PAGE','33701',jdecode('Homepage-Info'),jdecode(''),'/33701.html','true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Match';
theSitetree.paletteFamily='8FB7DA';
theSitetree.keyvisualId='2704';
theSitetree.keyvisualName='kv_2704.jpg';
theSitetree.fontsetId='10404';
theSitetree.graphicsetId='10632';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='CDE4F7';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Match',
				paletteFamily: 	'8FB7DA',
				keyvisualId: 	'2704',
				keyvisualName: 	'kv_2704.jpg',
				fontsetId: 		'10404',
				graphicsetId: 	'10632',
				contentColor: 	'000000',
				contentBGColor: 'CDE4F7',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'EE0202',
				e_color: 		'707070',
				f_color: 		'707070',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20101005-150712'
};
webappMappings['7002']=webappMappings['7002-910']={
webappId:    '7002',
documentId:  '12322',
internalId:  '910',
customField: 'language:de;country:CH;'
};
webappMappings['7050']=webappMappings['7050-605']={
webappId:    '7050',
documentId:  '12343',
internalId:  '605',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12301',
internalId:  '',
customField: '20100406-153936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12322',
internalId:  '',
customField: '20100305-143314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12343',
internalId:  '',
customField: '20100204-094925'
};
webappMappings['7060']=webappMappings['7060-bf99c11a439f220ef7d7a7c724a81306']={
webappId:    '7060',
documentId:  '13101',
internalId:  'bf99c11a439f220ef7d7a7c724a81306',
customField: 'language:de;country:CH;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '8001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24501',
internalId:  '',
customField: '20100407-101220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20091229-113704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12601',
internalId:  '',
customField: '20100407-120108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27101',
internalId:  '',
customField: '20100407-092442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33101',
internalId:  '',
customField: '20100406-152954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33701',
internalId:  '',
customField: '20100407-115821'
};
webappMappings['7060']=webappMappings['7060-639615e124b063a361522341ad39514e']={
webappId:    '7060',
documentId:  '33101',
internalId:  '639615e124b063a361522341ad39514e',
customField: 'language:de;country:CH;'
};
var canonHostname = 'wsc.genotec.ch';
var accountId     = 'AGT010IN2YQV';
var companyName   = 'Janick+Kamber';
var htmlTitle	  = 'Janick+Kamber+U17-Nati+Weltmeister+Schweiz+%28FC+Basel+FCB%29';
var metaKeywords  = 'Janick%2C+Kamber%2C+Jannick%2C+Nachwuchs%2C+FCB%2C+U21%2C+U17%2C+Weltmeister%2C+Nati%2C+Nigeria%2C+Talent%2C+Basel%2C+Stadt+Basel%2C+FC+Basel%2C+Kader%2C+M%C3%BCmliswil%2C+Iwan%2C+Fernandez%2C+Dersu%2C+Heri%2C+Oliver%2C+Klaus%2C+Marco+Amman%2C+Marko%2C+Bicvic%2C+Drazen%2C+Cosic%2C+Marc%2C+Dinkel%2C+Dennis%2C+Iapichino%2C+Fabio%2C+Puglisi%2C+Fabian+Ritter%2C+Stefan%2C+Schindelholz%2C+Joel%2C+Stampfli%2C+Niki%2C+Wiedmann%2C+Ramon%2C+Cecchini%2C+Fatih%2C+Dogan%2C+Samet%2C+G%C3%BCnd%C3%BCz%2C+David%2C+Hasler%2C+Dominic%2C+Schiling%2C+Taulant%2C+Xhaka%2C+Granit%2C+Xhaka%2C+Kevin%2C+Eigenmann%2C+Michel%2C+Gadient%2C+Altin%2C+Osmani%2C+Marco%2C+Weisskopf%2C+Jannik%2C+Janik%2C+Jannick%2C+Kamper%2C+Testspiel%2C+Final%2C+Thorsten%2C+Fink%2C+Gigi%2C+Oeri%2C+Novartis%2C+Settelen%2C+Genotec%2C+Genotech%2C+Selmoni%2C+Drynette%2C+Marco%2C+Falchi%2C+obi%2C+Jost%2C+Umz%C3%BCge%2C+Ferrum%2C+booboo.ch%2C+intercar%2C+W%C3%A4scherei%2C+L%C3%BCdin%2C+Roth%2C+Ger%C3%BCste%2C+1.+Liga%2C+Solothurn%2C+KV%2C+Reinach%2C+National+Suisse';
var metaContents  = 'Internetauftritt+von+Janick%2FJannick+Kamber%2C+U-17-Weltmeister+Schweiz+%28FC+Basel%29.+Internet-Homepage+erstellt+mit+WebCreator+Privat%3A+http%3A%2F%2Fwww.genotec.ch%2Fwebcreator';
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();
};

