/* [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 theSitetree=[ 
	['PAGE','901',jdecode('English'),jdecode(''),'/901/index.html','true',[ 
		['PAGE','952',jdecode('About+us'),jdecode(''),'/901/952.html','true',[],''],
		['PAGE','80901',jdecode('Habitats'),jdecode(''),'/901/80901.html','true',[],''],
		['PAGE','17401',jdecode('Order'),jdecode(''),'/901/17401.html','true',[],''],
		['PAGE','1036',jdecode('Contact'),jdecode(''),'/901/1036.html','true',[],'']
	],''],
	['PAGE','35001',jdecode('Deutsch'),jdecode(''),'/35001/index.html','true',[ 
		['PAGE','35022',jdecode('Wir+%C3%BCber+uns'),jdecode(''),'/35001/35022.html','true',[],''],
		['PAGE','77601',jdecode('Biotope'),jdecode(''),'/35001/77601.html','true',[],''],
		['PAGE','35043',jdecode('Bestellung'),jdecode(''),'/35001/35043.html','true',[],''],
		['PAGE','35064',jdecode('Kontakt'),jdecode(''),'/35001/35064.html','true',[],'']
	],''],
	['PAGE','79401',jdecode('Gallery'),jdecode(''),'/79401/index.html','true',[ 
		['PAGE','79422',jdecode('Welse+-+catfish'),jdecode(''),'/79401/79422.html','true',[],''],
		['PAGE','79443',jdecode('Salmler+-+tetras'),jdecode(''),'/79401/79443.html','true',[],''],
		['PAGE','79464',jdecode('Cichlidien+-+cichlids'),jdecode(''),'/79401/79464.html','false',[],''],
		['PAGE','79485',jdecode('Wirbellose+-+invertebrates'),jdecode(''),'/79401/79485.html','false',[],''],
		['PAGE','79506',jdecode('Sonstige+-+others'),jdecode(''),'/79401/79506.html','false',[],'']
	],'']];
var siteelementCount=16;
theSitetree.topTemplateName='Logg';
theSitetree.paletteFamily='3D4B78';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='421';
theSitetree.graphicsetId='468';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3D4B78';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				name: 			'Logg',
				paletteFamily: 	'3D4B78',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'421',
				graphicsetId: 	'468',
				contentColor: 	'FFFFFF',
				contentBGColor: '3D4B78',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'3D4B78',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				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:  '80901',
internalId:  '',
customField: '20090614-184654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79422',
internalId:  '',
customField: '20090611-133250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79401',
internalId:  '',
customField: '20090614-192055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20090516-213406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '952',
internalId:  '',
customField: '20080116-214512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17401',
internalId:  '',
customField: '20090712-211433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1036',
internalId:  '',
customField: '20090712-210928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79464',
internalId:  '',
customField: '20090516-205118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79485',
internalId:  '',
customField: '20090516-205118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79506',
internalId:  '',
customField: '20090516-205118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35001',
internalId:  '',
customField: '20090511-213436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35022',
internalId:  '',
customField: '20090611-132535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35043',
internalId:  '',
customField: '20090712-211214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35064',
internalId:  '',
customField: '20090712-211006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79443',
internalId:  '',
customField: '20090516-205118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77601',
internalId:  '',
customField: '20090614-185514'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW1X0IN2PVE';
var companyName   = 'IUPA+S.R.L';
var htmlTitle	  = 'IUPA+S.R.L+-+Ornamental+fish+Bolivia';
var metaKeywords  = 'Ornamental+fish%2C+Zierfisch%2C+peces+ornamentales%2C+poisson+ornamental%2C+Export%2C+import%2C+South+America%2C+S%C3%BCdamerika%2C+Bolivia%2C+Bolivie%2C+Bolivien%2C+Cichlidae%2C+Callichthydae%2C+Piranha%2C+IUPA';
var metaContents  = 'IUPA+S.+R.+L.+is+the+first+and+the+only+firm+who+is+exporting+ornamental+fishes+from+Bolivia%2FSouth+America+on+a+legal+way.+The+work+is+performed+under+the+strict+control+of+a+competent+French+biologist.+He+founded+and+developped+the+enterprise+with+a+lot+of+enthusiasm+and+affection+for+nature.+';
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();
};
