/* [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','1242',jdecode('Home'),jdecode(''), jdecode('%2F1242.html'), 'true',[],'',''],
	['PAGE','1299',jdecode('KOZARAC-S.MOST-KLJUC'),jdecode(''), jdecode('%2F1299.html'), 'false',[],'',''],
	['PAGE','170989',jdecode('LINIJA+BASEL-SARAJEVO'),jdecode(''), jdecode('%2F170989.html'), 'true',[],'',''],
	['PAGE','172133',jdecode('LINIJA+CIRIH+TUZLA'),jdecode(''), jdecode('%2F172133.html'), 'false',[],'',''],
	['PAGE','167634',jdecode('Bosnien+Rundreise'),jdecode(''), jdecode('%2F167634.html'), 'true',[],'',''],
	['PAGE','132235',jdecode('Info+Bosnien-Herzegowina'),jdecode(''), jdecode('%2F132235.html'), 'true',[],'',''],
	['PAGE','168441',jdecode('+Touristische+Attraktionen'),jdecode(''), jdecode('%2F168441.html'), 'true',[],'',''],
	['PAGE','169431',jdecode('Europapark'),jdecode(''), jdecode('%2F169431.html'), 'false',[],'',''],
	['PAGE','167579',jdecode('Partner+Agenturen'),jdecode(''), jdecode('%2F167579.html'), 'true',[],'',''],
	['PAGE','129849',jdecode('Reisen+mit+dem+Car'),jdecode(''), jdecode('%2F129849.html'), 'true',[],'',''],
	['PAGE','1326',jdecode('Kontakt'),jdecode(''), jdecode('%2F1326%2Findex.html'), 'true',[ 
		['PAGE','41615',jdecode('Kontakt%2FInformacije+%28Folgeseite%29'),jdecode(''), jdecode('%2F1326%2F41615.html'), 'false',[],'','']
	],'',''],
	['PAGE','173471',jdecode('Allgemeine+Bedingungen'),jdecode(''), jdecode('%2F173471.html'), 'true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10461';
theSitetree.graphicsetId='10892';
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: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10461',
				graphicsetId: 	'10892',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1242',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1233900']={
webappId:    '1501',
documentId:  '1242',
internalId:  '1233900',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1299',
internalId:  '',
customField: '20100718-123045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1242',
internalId:  '',
customField: '20120125-143747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1326',
internalId:  '',
customField: '20111223-235034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41615',
internalId:  '',
customField: '20030529-122630'
};
webappMappings['7008']=webappMappings['7008-3771']={
webappId:    '7008',
documentId:  '1326',
internalId:  '3771',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129849',
internalId:  '',
customField: '20111211-214925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '167579',
internalId:  '',
customField: '20111223-235448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '132235',
internalId:  '',
customField: '20110612-124258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '167634',
internalId:  '',
customField: '20110612-124348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '169431',
internalId:  '',
customField: '20100527-135620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '168441',
internalId:  '',
customField: '20090613-131137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '172133',
internalId:  '',
customField: '20100608-131238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '170989',
internalId:  '',
customField: '20120125-144125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '173471',
internalId:  '',
customField: '20111203-231618'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INX2T8';
var companyName   = 'BIHTOURS+GmbH+++';
var htmlTitle	  = '';
var metaKeywords  = 'autobuska+linija+bosna+svicarska%2C+mostar+sarajevo+zenica+www.bosnatours.com%2Cbosna+tours+ibrisimbegovic%2C+bihtours%2C+redovno+%2C+sigurno+%2C+povoljno+';
var metaContents  = 'autobuska+linija+bosna+i+hercegovina+svicarska.+mostar-+jablanica+-konjic-+sarajevo-+kakanj-+zenica-+zepce-+maglaj-+doboj-+bosanski+brod-+italija+-+lucern-+cirih-+bazel%2C+redovni+polasci%2C+povoljno+%2C+udobno+i+sigurno.red+voznje+na+www.bosna-tours.ch++ili+facebook%2C+vitez+%2C+travnik%2C+041+210+30+63%0D%0A%0D%0Acarunternehmen+welches+die+schweiz+und+bosnien-herzegowina+suisse+bihtours+gmbh%2C+agencija+bhtours+d.o.o.++sarajevo+033+265+085+';
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();
};

