/* [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','5201',jdecode('Home'),jdecode(''),'/5201.html','true',[],'',''],
	['PAGE','5252',jdecode('Carriage+Lessons+Itineraries'),jdecode(''),'/5252.html','true',[],'',''],
	['PAGE','33012',jdecode('Gift+Vouchers+Carriage+Driving'),jdecode(''),'/33012.html','true',[],'',''],
	['PAGE','5278',jdecode('Weddings+Special+Occasions'),jdecode(''),'/5278.html','true',[],'',''],
	['PAGE','13901',jdecode('Meet+The+Horses+%26+Trainer'),jdecode(''),'/13901.html','true',[],'',''],
	['PAGE','5356',jdecode('A+Student%26%23x27%3Bs+Experience+'),jdecode(''),'/5356.html','true',[],'',''],
	['PAGE','5330',jdecode('Health%2C+Safety+%26+What+To+Wear'),jdecode(''),'/5330.html','true',[],'',''],
	['PAGE','5382',jdecode('Internships%2C+Work+Experience'),jdecode(''),'/5382.html','true',[],'',''],
	['PAGE','5408',jdecode('Prices%2C+Terms+%26+Conditions'),jdecode(''),'/5408.html','true',[],'',''],
	['PAGE','5434',jdecode('Contact+Us+%26+Booking+Form'),jdecode(''),'/5434.html','true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Gaudy';
theSitetree.paletteFamily='5C5D96';
theSitetree.keyvisualId='5937';
theSitetree.keyvisualName='kv_5937.jpg';
theSitetree.fontsetId='11113';
theSitetree.graphicsetId='11905';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='6E8BCE';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Gaudy',
				paletteFamily: 	'5C5D96',
				keyvisualId: 	'5937',
				keyvisualName: 	'kv_5937.jpg',
				fontsetId: 		'11113',
				graphicsetId: 	'11905',
				contentColor: 	'000000',
				contentBGColor: '6E8BCE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20100209-201532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5356',
internalId:  '',
customField: '20090910-194259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5252',
internalId:  '',
customField: '20100209-202803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5278',
internalId:  '',
customField: '20090715-192914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33012',
internalId:  '',
customField: '20100209-202418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5434',
internalId:  '',
customField: '20100119-150645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5408',
internalId:  '',
customField: '20100209-202200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5330',
internalId:  '',
customField: '20091218-133138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20100217-095538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5382',
internalId:  '',
customField: '20100123-141044'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5201',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEGBZ';
var companyName   = 'Learn+To+Carriage+Drive.co.uk';
var htmlTitle	  = 'Cotswold+Carriage+Driving+and+Learn+To+Carriage+Drive%2C+weddings+horse+drawn+carriage+hire+in+Gloucestershire%2C+Wiltshire%2C+Somerset%2C+Oxfordshire%2C+Bristol%2C+Bath%2C+Cheltenham%2C+Gloucester%2C+Swindon+tel%3A+01666+505051+GL8+8RP+Unusual+Gift+Vouchers+and+horse+holida';
var metaKeywords  = 'Learn+to+carriage+drive+horse+drawn+carriage+hire+wedding+weddings+special+occasions+horse+activity+holidays+weekend+breaks+half+a+day+to+five+days+of+lessons+unusual+gift+vouchers+experiences+Weddings+in+Cotswolds+Gloucestershire+Wiltshire+Oxfordshire+Somerset+Bristol+Bath+Swindon+Cheltenham+Gloucester+Chippenham+Tetbury+Malmesbury+tourist+activities+Clydesdale+harness+horses+two+and+four+wheel+carriages+historical+horse+drawn+drives+natural+horsemanship+eco-tourism+eco-holidays+eco-friendly+equines+Cotswold+Carriage+Driving.co.uk+cotswolds+breaks+%2Ccotswolds+accommodation+%2Ccotswolds+holidays+%2Cwedding+services+cheltenham+%2Chorse+drawn+carriages+tetbury+%2Ccarriage+tours+malmesbury+%2Ccarriage+driving+lessons+bristol+%2Coxford+carriage+company+%2Coxford+horse+carriage+%2Cwedding+carriages+tetbury+%2Cbath+carriage+company+%2Ccarriage+driving+instruction+%2Ccarriage+driving+tuition+%2Cenglish+carriage+driving+%2Ccarriage+driving+lessons+%2Ccarriage+driving+holidays+in+uk+%2Ccarriage+driving+holidays+%2Chorse+drawn+wedding+%2Cwedding+carriage+%2Chorse+drawn+wedding+carriage+%2Cclassic+wedding+carriages+%2Chorse+drawn+carriage+hire+%2Ccarriage+driving+horses+%2Ccarriage+makers+%2Cwagon+hire+%2C+www.learntocarriagedrive.co.uk';
var metaContents  = 'Cotswold+Carriage+Driving.co.uk+Learn+to+carriage+drive+and+weddings%2C+proms+and+special+occasion+horse+drawn+carriage+hire+07977+480144+covering+Cotswolds%2C+Gloucestershire%2C+Wiltshire%2C+Oxfordshire%2C+Somerset%2C+Bristol%2C+Bath%2C+Swindon%2C+Cheltenham%2C+Gloucester%2C+Chippenham.+Go+back+in+time+to+learn+a+slower+pace+of+travel.+Unusual+Surrey+carriage+with+fringed+roof++to+arrive+at+your+wedding+in+style.+Unusual+gift+vouchers.+Horse+activity+holidays+and+weekend+breaks.+Carriage+driving+lessons+from+a+two+hour+taster%2C+half+day%2C+weekends+to+five+days+from+beginner+to+advanced+carriage+driving+using+experienced+Clydesdale+cross+horses.++++Lifetime+memory+making+carriage+drives+along+the+Roman+built+Fosse+Way+track.+Natural+horsemanship+approach+to+handling+horses.+Friendly+horses+and+staff.+Great+tourist+activity+near+Tetbury+and+Malmesbury.+English+carriage+driving+instruction.';
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();
};
