/* [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','5101',jdecode('Home%2F+News'),jdecode(''),'/5101.html','true',[],'',''],
	['PAGE','5152',jdecode('Funky+Shoes'),jdecode(''),'/5152/index.html','true',[ 
		['PAGE','19601',jdecode('Menschen+und+Blumen'),jdecode(''),'/5152/19601.html','true',[],'',''],
		['PAGE','8501',jdecode('Tiere'),jdecode(''),'/5152/8501.html','true',[],'',''],
		['PAGE','8522',jdecode('Coole+Boys+and+Girls'),jdecode(''),'/5152/8522.html','true',[],'','']
	],'',''],
	['PAGE','5173',jdecode('Funky+Clothing'),jdecode(''),'/5173/index.html','true',[ 
		['PAGE','19622',jdecode('Shirts+und+Strampler'),jdecode(''),'/5173/19622.html','true',[],'',''],
		['PAGE','19643',jdecode('M%C3%BCtzen'),jdecode(''),'/5173/19643.html','true',[],'','']
	],'',''],
	['PAGE','5194',jdecode('Funky+Bags'),jdecode(''),'/5194.html','true',[],'',''],
	['PAGE','5215',jdecode('Geschenkideen'),jdecode(''),'/5215.html','true',[],'',''],
	['PAGE','33701',jdecode('Lagerbestand'),jdecode(''),'/33701.html','true',[],'',''],
	['PAGE','19685',jdecode('Preise+%2F+Lieferung'),jdecode(''),'/19685.html','true',[],'',''],
	['PAGE','5257',jdecode('Bestellung'),jdecode(''),'/5257.html','true',[],'',''],
	['PAGE','19706',jdecode('Fussabdr%C3%BCcke'),jdecode(''),'/19706.html','true',[],'',''],
	['PAGE','19727',jdecode('Impressum%2F+Links'),jdecode(''),'/19727.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Comedy';
theSitetree.paletteFamily='D34848';
theSitetree.keyvisualId='2798';
theSitetree.keyvisualName='schnecke.jpg';
theSitetree.fontsetId='10422';
theSitetree.graphicsetId='10721';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='DB6A6A';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Comedy',
				paletteFamily: 	'D34848',
				keyvisualId: 	'2798',
				keyvisualName: 	'schnecke.jpg',
				fontsetId: 		'10422',
				graphicsetId: 	'10721',
				contentColor: 	'FFFFFF',
				contentBGColor: 'DB6A6A',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'BC2E2E',
				e_color: 		'BC2E2E',
				f_color: 		'BC2E2E',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-7386']={
webappId:    '7008',
documentId:  '5257',
internalId:  '7386',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20100805-093925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5152',
internalId:  '',
customField: '20100622-075135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5173',
internalId:  '',
customField: '20100323-124659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8501',
internalId:  '',
customField: '20100301-194542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8522',
internalId:  '',
customField: '20100301-193904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5215',
internalId:  '',
customField: '20100709-152701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5257',
internalId:  '',
customField: '20100323-122113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5194',
internalId:  '',
customField: '20100301-192157'
};
webappMappings['1002']=webappMappings['1002-19706abw330ineydw']={
webappId:    '1002',
documentId:  '19706',
internalId:  '19706abw330ineydw',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19601',
internalId:  '',
customField: '20100301-193041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19622',
internalId:  '',
customField: '20100323-124730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19643',
internalId:  '',
customField: '20100301-191913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33701',
internalId:  '',
customField: '20100805-093524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19706',
internalId:  '',
customField: '20091206-175508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19685',
internalId:  '',
customField: '20100709-152258'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19727',
internalId:  '',
customField: '20091206-192618'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW330INEYDW';
var companyName   = 'funkyfeet.ch';
var htmlTitle	  = 'funkyfeet';
var metaKeywords  = 'Lederfinken%2C+Lederfinkli%2C+funkyfeet%2C+Strampler%2C+Shirt%2C+Bestellung%2C+Gr%C3%B6sse%2C+Monate%2C+funky%2C+cool%2C+Blumen%2C+Menschen%2C+Tiere%2C+Textilien%2C+Artikel%2C+Produkt';
var metaContents  = 'Verkauf+von+Lederfinken+und+Textilien%2C+Shirts%2C+Strampler';
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();
};
