/* [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','1601',jdecode('Home'),jdecode(''), jdecode('%2F1601.html'), 'true',[],'',''],
	['PAGE','34512',jdecode('The+Bristol+Clinic'),jdecode(''), jdecode('%2F34512.html'), 'true',[],'',''],
	['PAGE','39512',jdecode('The+Swindon+Clinic'),jdecode(''), jdecode('%2F39512.html'), 'true',[],'',''],
	['PAGE','1652',jdecode('Taxi+medicals'),jdecode(''), jdecode('%2F1652.html'), 'true',[],'',''],
	['PAGE','7001',jdecode('HGV+PSV+D4+medicals'),jdecode(''), jdecode('%2F7001.html'), 'true',[],'',''],
	['PAGE','38312',jdecode('Cruise+ship+medicals'),jdecode(''), jdecode('%2F38312.html'), 'true',[],'',''],
	['PAGE','46212',jdecode('Visa+medicals'),jdecode(''), jdecode('%2F46212.html'), 'true',[],'',''],
	['PAGE','9843',jdecode('Cabin+crew+medicals'),jdecode(''), jdecode('%2F9843.html'), 'true',[],'',''],
	['PAGE','1778',jdecode('Pre-employment+meds'),jdecode(''), jdecode('%2F1778.html'), 'true',[],'',''],
	['PAGE','39212',jdecode('CONDO+medical'),jdecode(''), jdecode('%2F39212.html'), 'true',[],'',''],
	['PAGE','7301',jdecode('Work+at+height+medicals'),jdecode(''), jdecode('%2F7301.html'), 'true',[],'',''],
	['PAGE','40412',jdecode('Insurance+medicals'),jdecode(''), jdecode('%2F40412.html'), 'true',[],'',''],
	['PAGE','9801',jdecode('Racing+driver+medicals'),jdecode(''), jdecode('%2F9801.html'), 'true',[],'',''],
	['PAGE','41812',jdecode('Race+medicals'),jdecode(''), jdecode('%2F41812.html'), 'true',[],'',''],
	['PAGE','1820',jdecode('Paintsprayers%2Fbodyshops'),jdecode(''), jdecode('%2F1820.html'), 'true',[],'',''],
	['PAGE','1673',jdecode('Nightworkers+medicals'),jdecode(''), jdecode('%2F1673.html'), 'true',[],'',''],
	['PAGE','19201',jdecode('Foodhandlers+medicals'),jdecode(''), jdecode('%2F19201.html'), 'true',[],'',''],
	['PAGE','16301',jdecode('Work+in+confined+spaces'),jdecode(''), jdecode('%2F16301.html'), 'true',[],'',''],
	['PAGE','43612',jdecode('Miscellaneous+meds'),jdecode(''), jdecode('%2F43612.html'), 'true',[],'',''],
	['PAGE','19901',jdecode('Resuscitation+training'),jdecode(''), jdecode('%2F19901.html'), 'true',[],'',''],
	['PAGE','1904',jdecode('Locations'),jdecode(''), jdecode('%2F1904.html'), 'true',[],'',''],
	['PAGE','30501',jdecode('Previous+clients'),jdecode(''), jdecode('%2F30501.html'), 'true',[],'',''],
	['PAGE','11601',jdecode('Useful+links'),jdecode(''), jdecode('%2F11601.html'), 'true',[],'',''],
	['PAGE','1799',jdecode('Contact'),jdecode(''), jdecode('%2F1799.html'), 'true',[],'',''],
	['PAGE','32701',jdecode('Same+Day+Medicals'),jdecode(''), jdecode('%2F32701.html'), 'true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Aeskulap';
theSitetree.paletteFamily='012253';
theSitetree.keyvisualId='2498';
theSitetree.keyvisualName='optiker.jpg';
theSitetree.fontsetId='433';
theSitetree.graphicsetId='483';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk',
  product: 'WSCSYSSSSLY0XVDH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Aeskulap',
				paletteFamily: 	'012253',
				keyvisualId: 	'2498',
				keyvisualName: 	'optiker.jpg',
				fontsetId: 		'433',
				graphicsetId: 	'483',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1601',
internalId:  '',
customField: '20111205-210621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1673',
internalId:  '',
customField: '20100908-194208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1652',
internalId:  '',
customField: '20111119-153523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1799',
internalId:  '',
customField: '20110526-152826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1778',
internalId:  '',
customField: '20080710-195006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20111204-170856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20080723-204833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1820',
internalId:  '',
customField: '20080201-185506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1904',
internalId:  '',
customField: '20090328-193135'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9801',
internalId:  '',
customField: '20110620-193154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32701',
internalId:  '',
customField: '20080710-200031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9843',
internalId:  '',
customField: '20120106-220020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11601',
internalId:  '',
customField: '20111205-205423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16301',
internalId:  '',
customField: '20080125-202220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30501',
internalId:  '',
customField: '20080518-182341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19201',
internalId:  '',
customField: '20100908-194912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19901',
internalId:  '',
customField: '20080129-160900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38312',
internalId:  '',
customField: '20111212-210438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34512',
internalId:  '',
customField: '20111204-162506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39212',
internalId:  '',
customField: '20111204-161753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39512',
internalId:  '',
customField: '20111204-172954'
};
webappMappings['1501']=webappMappings['1501-11989870']={
webappId:    '1501',
documentId:  '1601',
internalId:  '11989870',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40412',
internalId:  '',
customField: '20100930-085032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41812',
internalId:  '',
customField: '20110308-095621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43612',
internalId:  '',
customField: '20111009-181100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46212',
internalId:  '',
customField: '20111212-201343'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2RY3';
var companyName   = 'Wessex+Medicals';
var htmlTitle	  = 'Wessex+Medicals';
var metaKeywords  = 'medical+medicals+low+cost+cheap+taxi+HGV+PSV+PCV+nightworker+bath+bristol+swindon+newport+henley+on+thames+cheltenham+salisbury+paintsprayer+cabin+crew+CONDO+medicals+cruise+ship+medical';
var metaContents  = 'occupational+health+website';
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();
};

