/* [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','8301',jdecode('Home'),jdecode(''),'/8301.html','true',[],'',''],
	['PAGE','8352',jdecode('Afterski'),jdecode(''),'/8352.html','true',[],'',''],
	['PAGE','8378',jdecode('Summer'),jdecode(''),'/8378.html','true',[],'',''],
	['PAGE','8404',jdecode('Opening+Hours'),jdecode(''),'/8404.html','true',[],'',''],
	['PAGE','8430',jdecode('What%26%23x27%3Bs+On%3F'),jdecode(''),'/8430.html','true',[],'',''],
	['PAGE','8456',jdecode('Drinks+Menu'),jdecode(''),'/8456.html','true',[],'',''],
	['PAGE','8482',jdecode('Food+Menu'),jdecode(''),'/8482.html','true',[],'',''],
	['PAGE','8508',jdecode('Photo+Gallery'),jdecode(''),'/8508.html','true',[],'',''],
	['PAGE','8534',jdecode('Live+Music'),jdecode(''),'/8534.html','true',[],'',''],
	['PAGE','8560',jdecode('Our+Staff%21'),jdecode(''),'/8560/index.html','true',[ 
		['PAGE','16501',jdecode('08%2F09+Team+Woodys%21'),jdecode(''),'/8560/16501.html','true',[],'','']
	],'',''],
	['PAGE','8586',jdecode('Job+Vacancies'),jdecode(''),'/8586.html','true',[],'',''],
	['PAGE','8612',jdecode('Contact+Us'),jdecode(''),'/8612.html','true',[],'',''],
	['PAGE','8638',jdecode('Enquiry+Form'),jdecode(''),'/8638.html','true',[],'',''],
	['PAGE','8664',jdecode('Our+Facebook+Group'),jdecode(''),'/8664.html','true',[],'',''],
	['PAGE','8690',jdecode('How+to+find+us'),jdecode(''),'/8690.html','true',[],'',''],
	['PAGE','17501',jdecode('Winter+Holidays+Hafjell'),jdecode(''),'/17501.html','true',[],'',''],
	['PAGE','17701',jdecode('Our+English+Friends%21'),jdecode(''),'/17701.html','true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Metal';
theSitetree.paletteFamily='A3CAFE';
theSitetree.keyvisualId='720';
theSitetree.keyvisualName='mixgetraenk.jpg';
theSitetree.fontsetId='142';
theSitetree.graphicsetId='161';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Metal',
				paletteFamily: 	'A3CAFE',
				keyvisualId: 	'720',
				keyvisualName: 	'mixgetraenk.jpg',
				fontsetId: 		'142',
				graphicsetId: 	'161',
				contentColor: 	'DDDDDD',
				contentBGColor: '000000',
				a_color: 		'A3CAFE',
				b_color: 		'87A7D2',
				c_color: 		'000000',
				d_color: 		'000000',
				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:  '8301',
internalId:  '',
customField: '20110715-103330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8638',
internalId:  '',
customField: '20080523-200145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8352',
internalId:  '',
customField: '20080523-155512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8378',
internalId:  '',
customField: '20090513-133726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8404',
internalId:  '',
customField: '20110715-103543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8430',
internalId:  '',
customField: '20110308-153207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8456',
internalId:  '',
customField: '20091127-152433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8482',
internalId:  '',
customField: '20090513-134104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8508',
internalId:  '',
customField: '20091127-152902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8534',
internalId:  '',
customField: '20091127-153132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8560',
internalId:  '',
customField: '20091127-153245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8586',
internalId:  '',
customField: '20110715-103133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8612',
internalId:  '',
customField: '20091127-153655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8664',
internalId:  '',
customField: '20080930-220357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8690',
internalId:  '',
customField: '20080930-220656'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '8301',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-6112172']={
webappId:    '1501',
documentId:  '8301',
internalId:  '6112172',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-ab5673a6d3d0c67c5fcb4b848767cb7d']={
webappId:    '7060',
documentId:  '16501',
internalId:  'ab5673a6d3d0c67c5fcb4b848767cb7d',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16501',
internalId:  '',
customField: '20090112-142843'
};
webappMappings['7008']=webappMappings['7008-2648']={
webappId:    '7008',
documentId:  '8638',
internalId:  '2648',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17501',
internalId:  '',
customField: '20080930-221034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20080930-221256'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20IN2E1R';
var companyName   = 'Woodys+Bar%2C+Hafjell.+Norway';
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();
};

