/* [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','4596',jdecode('Home'),jdecode(''), jdecode('%2F4596.html'), 'true',[],'',''],
	['PAGE','196401',jdecode('News+2012'),jdecode(''), jdecode('%2F196401%2Findex.html'), 'true',[ 
		['PAGE','182101',jdecode('News+2011'),jdecode(''), jdecode('%2F196401%2F182101.html'), 'true',[],'',''],
		['PAGE','147501',jdecode('News+2010'),jdecode(''), jdecode('%2F196401%2F147501.html'), 'true',[],'',''],
		['PAGE','123101',jdecode('News+2009'),jdecode(''), jdecode('%2F196401%2F123101.html'), 'true',[],'','']
	],'',''],
	['PAGE','4653',jdecode('Appalachian%26%23x27%3Bs'),jdecode(''), jdecode('%2F4653.html'), 'true',[],'',''],
	['PAGE','4680',jdecode('Weilenleute'),jdecode(''), jdecode('%2F4680.html'), 'true',[],'',''],
	['PAGE','136201',jdecode('Unser+Rudel'),jdecode(''), jdecode('%2F136201%2Findex.html'), 'true',[ 
		['PAGE','4707',jdecode('MIN+'),jdecode(''), jdecode('%2F136201%2F4707.html'), 'true',[],'',''],
		['PAGE','115101',jdecode('Anarya'),jdecode(''), jdecode('%2F136201%2F115101.html'), 'true',[],'',''],
		['PAGE','75864',jdecode('Biiwana+'),jdecode(''), jdecode('%2F136201%2F75864.html'), 'true',[],'',''],
		['PAGE','153501',jdecode('Dakota'),jdecode(''), jdecode('%2F136201%2F153501.html'), 'true',[],'',''],
		['PAGE','66138',jdecode('Onyx+'),jdecode(''), jdecode('%2F136201%2F66138.html'), 'true',[],'',''],
		['PAGE','118201',jdecode('Onyx+Nachkommen'),jdecode(''), jdecode('%2F136201%2F118201.html'), 'true',[],'','']
	],'',''],
	['PAGE','4734',jdecode('Unsere+W%C3%BCrfe'),jdecode(''), jdecode('%2F4734%2Findex.html'), 'true',[ 
		['PAGE','66165',jdecode('B-Wurf'),jdecode(''), jdecode('%2F4734%2F66165.html'), 'true',[],'',''],
		['PAGE','66192',jdecode('C-Wurf'),jdecode(''), jdecode('%2F4734%2F66192.html'), 'true',[],'',''],
		['PAGE','56438',jdecode('D-Wurf'),jdecode(''), jdecode('%2F4734%2F56438.html'), 'true',[],'',''],
		['PAGE','72393',jdecode('E-Wurf'),jdecode(''), jdecode('%2F4734%2F72393.html'), 'true',[],'',''],
		['PAGE','118222',jdecode('F-Wurf'),jdecode(''), jdecode('%2F4734%2F118222.html'), 'true',[],'',''],
		['PAGE','140201',jdecode('G-Wurf'),jdecode(''), jdecode('%2F4734%2F140201.html'), 'true',[],'',''],
		['PAGE','152501',jdecode('H-Wurf'),jdecode(''), jdecode('%2F4734%2F152501.html'), 'true',[],'',''],
		['PAGE','173101',jdecode('I-Wurf'),jdecode(''), jdecode('%2F4734%2F173101.html'), 'true',[],'','']
	],'',''],
	['PAGE','184701',jdecode('Wurf-Pl%C3%A4ne'),jdecode(''), jdecode('%2F184701.html'), 'true',[],'',''],
	['PAGE','76214',jdecode('In+Memoria+-+Chima'),jdecode(''), jdecode('%2F76214.html'), 'true',[],'',''],
	['PAGE','4761',jdecode('rund+um+den+Toller'),jdecode(''), jdecode('%2F4761.html'), 'true',[],'',''],
	['PAGE','135301',jdecode('Familienhund+Toller%3F'),jdecode(''), jdecode('%2F135301.html'), 'true',[],'',''],
	['PAGE','118243',jdecode('Fotos'),jdecode(''), jdecode('%2F118243.html'), 'true',[],'',''],
	['PAGE','66219',jdecode('Links+Kontakte'),jdecode(''), jdecode('%2F66219.html'), 'true',[],'','']];
var siteelementCount=29;
theSitetree.topTemplateName='Fellow';
theSitetree.paletteFamily='FF9600';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10637';
theSitetree.graphicsetId='10694';
theSitetree.contentColor='666666';
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: 			'Fellow',
				paletteFamily: 	'FF9600',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10637',
				graphicsetId: 	'10694',
				contentColor: 	'666666',
				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:  '4596',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4596',
internalId:  '',
customField: '20111228-144357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115101',
internalId:  '',
customField: '20111211-213519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4653',
internalId:  '',
customField: '20090209-020951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4680',
internalId:  '',
customField: '20101215-182625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76214',
internalId:  '',
customField: '20090209-021429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4707',
internalId:  '',
customField: '20100327-151742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66138',
internalId:  '',
customField: '20111004-174119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75864',
internalId:  '',
customField: '20110312-152401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4734',
internalId:  '',
customField: '20110826-204037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66165',
internalId:  '',
customField: '20110825-135845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66192',
internalId:  '',
customField: '20110607-185956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56438',
internalId:  '',
customField: '20100323-212006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72393',
internalId:  '',
customField: '20110914-134728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4761',
internalId:  '',
customField: '20111211-212950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66219',
internalId:  '',
customField: '20110312-151722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118201',
internalId:  '',
customField: '20111004-173933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118222',
internalId:  '',
customField: '20110914-133807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118243',
internalId:  '',
customField: '20101019-141605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123101',
internalId:  '',
customField: '20100105-151038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '135301',
internalId:  '',
customField: '20090604-204402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '136201',
internalId:  '',
customField: '20101109-102659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '182101',
internalId:  '',
customField: '20111216-153220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '140201',
internalId:  '',
customField: '20111216-153025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '147501',
internalId:  '',
customField: '20110607-185610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '152501',
internalId:  '',
customField: '20111228-145716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '153501',
internalId:  '',
customField: '20110312-152546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '173101',
internalId:  '',
customField: '20110419-164512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '184701',
internalId:  '',
customField: '20111228-144321'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '196401',
internalId:  '-',
customField: '20120128-211212'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXX3H';
var companyName   = 'Appalachian%27s+Toller';
var htmlTitle	  = 'Appalachians+Nova+Scotia+Duck+Tolling+Retriever';
var metaKeywords  = 'Appalachians%2C+Nova+Scotia+Duck+Tolling+Retriever';
var metaContents  = 'Appalachians+Nova+Scotia+Duck+Tolling+Retriever%2C+famili%EF%BF%BDre+Toller+Zucht+in+der+Schweiz%2C+Unsere+Hunde%2C+Objibwas+Minwaa%2C++Tollartrollets+Onyx%2C+Casarrondo+Anarya%2C+Welpen%2C+Apportier-+und+Wasserhunde';
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();
};

