/* [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('Deutsch'),jdecode(''), jdecode('%2F5001%2Findex.html'), 'true',[ 
		['PAGE','44101',jdecode('Der+Fonds+in+K%C3%BCrze'),jdecode(''), jdecode('%2F5001%2F44101.html'), 'true',[],'',''],
		['PAGE','552',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F5001%2F552.html'), 'true',[],'',''],
		['PAGE','8301',jdecode('Anlagestil'),jdecode(''), jdecode('%2F5001%2F8301.html'), 'true',[],'',''],
		['PAGE','573',jdecode('Downloads'),jdecode(''), jdecode('%2F5001%2F573.html'), 'true',[],'',''],
		['PAGE','67201',jdecode('Medien'),jdecode(''), jdecode('%2F5001%2F67201.html'), 'true',[],'',''],
		['PAGE','94701',jdecode('Fotogalerie'),jdecode(''), jdecode('%2F5001%2F94701.html'), 'true',[],'',''],
		['PAGE','28301',jdecode('Partner'),jdecode(''), jdecode('%2F5001%2F28301.html'), 'true',[],'',''],
		['PAGE','43801',jdecode('Kontakt'),jdecode(''), jdecode('%2F5001%2F43801.html'), 'true',[],'',''],
		['PAGE','6501',jdecode('Disclaimer'),jdecode(''), jdecode('%2F5001%2F6501.html'), 'true',[],'','']
	],'',''],
	['PAGE','66322',jdecode('English'),jdecode(''), jdecode('%2F66322%2Findex.html'), 'true',[ 
		['PAGE','66301',jdecode('The+fund+at+a+glance'),jdecode(''), jdecode('%2F66322%2F66301.html'), 'true',[],'',''],
		['PAGE','66343',jdecode('About+us'),jdecode(''), jdecode('%2F66322%2F66343.html'), 'true',[],'',''],
		['PAGE','66364',jdecode('Investment+style'),jdecode(''), jdecode('%2F66322%2F66364.html'), 'true',[],'',''],
		['PAGE','66385',jdecode('Downloads'),jdecode(''), jdecode('%2F66322%2F66385.html'), 'true',[],'',''],
		['PAGE','67222',jdecode('Media'),jdecode(''), jdecode('%2F66322%2F67222.html'), 'true',[],'',''],
		['PAGE','94722',jdecode('Photo+gallery'),jdecode(''), jdecode('%2F66322%2F94722.html'), 'true',[],'',''],
		['PAGE','66406',jdecode('Partners'),jdecode(''), jdecode('%2F66322%2F66406.html'), 'true',[],'',''],
		['PAGE','66427',jdecode('Contact'),jdecode(''), jdecode('%2F66322%2F66427.html'), 'true',[],'',''],
		['PAGE','66448',jdecode('Disclaimer'),jdecode(''), jdecode('%2F66322%2F66448.html'), 'true',[],'','']
	],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Meeting';
theSitetree.paletteFamily='F4F5BF';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10707';
theSitetree.graphicsetId='10464';
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: 			'Meeting',
				paletteFamily: 	'F4F5BF',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10707',
				graphicsetId: 	'10464',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20120214-110951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44101',
internalId:  '',
customField: '20120214-111004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66322',
internalId:  '',
customField: '20120214-111032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66301',
internalId:  '',
customField: '20120214-111045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20091214-161210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8301',
internalId:  '',
customField: '20070130-111734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20120207-140312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67201',
internalId:  '',
customField: '20090114-152015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94701',
internalId:  '',
customField: '20091026-060504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28301',
internalId:  '',
customField: '20090724-165325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43801',
internalId:  '',
customField: '20071027-132351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20100111-084837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66343',
internalId:  '',
customField: '20090813-152512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66364',
internalId:  '',
customField: '20070315-143812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66385',
internalId:  '',
customField: '20120207-141926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67222',
internalId:  '',
customField: '20090114-153052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94722',
internalId:  '',
customField: '20091026-060410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66406',
internalId:  '',
customField: '20090724-165712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66427',
internalId:  '',
customField: '20071027-132434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66448',
internalId:  '',
customField: '20100111-084909'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2RKQ';
var companyName   = 'PR1ME+ASIA+Small+%26+Mid+Cap+Fund+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++';
var htmlTitle	  = '';
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();
};

