/* [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','4559',jdecode('HOME'),jdecode(''),'/4559.html','true',[],'',''],
	['PAGE','14111',jdecode('WIR+%C3%9CBER+UNS'),jdecode(''),'/14111/index.html','true',[ 
		['PAGE','14165',jdecode('Philosophie'),jdecode(''),'/14111/14165.html','true',[],'',''],
		['PAGE','14138',jdecode('Unser+Team'),jdecode(''),'/14111/14138.html','true',[],'','']
	],'',''],
	['PAGE','13425',jdecode('PARTNER%2FSORTIMENT'),jdecode(''),'/13425.html','true',[],'',''],
	['PAGE','58723',jdecode('AKTIONEN'),jdecode(''),'/58723.html','true',[],'',''],
	['PAGE','25282',jdecode('FITNESS'),jdecode(''),'/25282.html','true',[],'',''],
	['PAGE','13371',jdecode('FERRARI'),jdecode(''),'/13371.html','true',[],'',''],
	['PAGE','25309',jdecode('RUNNING'),jdecode(''),'/25309.html','true',[],'',''],
	['PAGE','66217',jdecode('HALLENSPORT'),jdecode(''),'/66217.html','true',[],'',''],
	['PAGE','25336',jdecode('FUSSBALL'),jdecode(''),'/25336.html','true',[],'',''],
	['PAGE','69856',jdecode('FCZ+FRAUEN'),jdecode(''),'/69856.html','true',[],'',''],
	['PAGE','70082',jdecode('WM+SHOP+2010'),jdecode(''),'/70082.html','true',[],'',''],
	['PAGE','25255',jdecode('TEAMSPORT'),jdecode(''),'/25255.html','true',[],'',''],
	['PAGE','25390',jdecode('NEWS+%2F+EVENTS'),jdecode(''),'/25390.html','true',[],'',''],
	['PAGE','13452',jdecode('LAGEPLAN'),jdecode(''),'/13452.html','true',[],'',''],
	['PAGE','16189',jdecode('KONTAKT'),jdecode(''),'/16189/index.html','true',[ 
		['PAGE','18166',jdecode('KONTAKT+%28Folgeseite%29'),jdecode(''),'/16189/18166.html','false',[],'','']
	],'',''],
	['PAGE','25023',jdecode('FREESTYLE'),jdecode(''),'/25023.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='003399';
theSitetree.keyvisualId='1234';
theSitetree.keyvisualName='hantel.jpg';
theSitetree.fontsetId='190';
theSitetree.graphicsetId='228';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Profile',
				paletteFamily: 	'003399',
				keyvisualId: 	'1234',
				keyvisualName: 	'hantel.jpg',
				fontsetId: 		'190',
				graphicsetId: 	'228',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'003399',
				b_color: 		'000066',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70082',
internalId:  '',
customField: '20100513-163631'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4559',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69856',
internalId:  '',
customField: '20100513-172240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4559',
internalId:  '',
customField: '20100325-123546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66217',
internalId:  '',
customField: '20100105-122919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25336',
internalId:  '',
customField: '20091208-142734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14111',
internalId:  '',
customField: '20100105-142205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14165',
internalId:  '',
customField: '20030526-123243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14138',
internalId:  '',
customField: '20081022-111733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13425',
internalId:  '',
customField: '20090107-140839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58723',
internalId:  '',
customField: '20100508-120935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25282',
internalId:  '',
customField: '20090115-145551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13371',
internalId:  '',
customField: '20090107-142039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25309',
internalId:  '',
customField: '20090204-162244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25255',
internalId:  '',
customField: '20090107-141433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25390',
internalId:  '',
customField: '20100105-122958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13452',
internalId:  '',
customField: '20041209-142242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16189',
internalId:  '',
customField: '20030625-160607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18166',
internalId:  '',
customField: '20030625-160527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25023',
internalId:  '',
customField: '20090131-154905'
};
webappMappings['7008']=webappMappings['7008-5998']={
webappId:    '7008',
documentId:  '16189',
internalId:  '5998',
customField: 'language:de;country:CH;'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXEAL';
var companyName   = 'L.A.+SPORTS+FASHION+GmbH';
var htmlTitle	  = 'L.A.+Sports+Fashion';
var metaKeywords  = 'adidas%2C+puma%2C+nike%2C+jako%2C+erima%2C+mizuno%2C+carrera%2C+sponser%2C+reebok%2C+fila%2C+lotto%2C+schwinn%2C+reusch%2C+ferrari%2C+schuhmacher%2C+beckham%2C+henry%2C+davids%2C+juve%2C+real%2C+bayern%2C+palermo%2C+kamerun%2C+brasil%2C+holland%2C+croatia%2C+suisse%2C+italia%2C+total90%2C+speedcat%2C+tuscany%2C+goodyear%2C+errea%2C+mikasa%2C+mft+';
var metaContents  = 'Running%2C+Fitness%2C+Lifestyle%2C+Teamwear%2C+Soccer%2C+Fussball%2C+Workout%2C+Brillen%2C+B%C3%A4lle%2C+Tasche%2C+T-Shirt%2C+Sweat-Shirt%2C+Trainer%2C+Schuhe%2C+Stand+up+Speak+up%2C+Beach%2C+Beachball%2C+Volley%2C+Volleyball%2C';
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();
};
