/* [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 theSitetree=[ 
	['PAGE','10101',jdecode('Home'),jdecode(''),'/10101/index.html','true',[ 
		['PAGE','13401',jdecode('Arabic+Website'),jdecode(''),'/10101/13401.html','true',[],'']
	],''],
	['PAGE','10152',jdecode('News'),jdecode(''),'/10152.html','true',[],''],
	['PAGE','10173',jdecode('Courses+%26+Renting'),jdecode(''),'/10173.html','true',[],''],
	['PAGE','10194',jdecode('Links'),jdecode(''),'/10194.html','true',[],''],
	['PAGE','10215',jdecode('Contact'),jdecode(''),'/10215.html','true',[],''],
	['PAGE','10236',jdecode('About+us'),jdecode(''),'/10236/index.html','true',[ 
		['PAGE','10257',jdecode('Our+team'),jdecode(''),'/10236/10257.html','true',[],''],
		['PAGE','10278',jdecode('How+to+find+us'),jdecode(''),'/10236/10278.html','true',[],'']
	],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Metal';
theSitetree.paletteFamily='A3CAFE';
theSitetree.keyvisualId='807';
theSitetree.keyvisualName='astern.jpg';
theSitetree.fontsetId='142';
theSitetree.graphicsetId='161';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Metal',
				paletteFamily: 	'A3CAFE',
				keyvisualId: 	'807',
				keyvisualName: 	'astern.jpg',
				fontsetId: 		'142',
				graphicsetId: 	'161',
				contentColor: 	'DDDDDD',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'A3CAFE',
				b_color: 		'87A7D2',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7050']=webappMappings['7050-9651']={
webappId:    '7050',
documentId:  '10152',
internalId:  '9651',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-16745']={
webappId:    '7008',
documentId:  '10215',
internalId:  '16745',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10101',
internalId:  '',
customField: '20090518-043830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10152',
internalId:  '',
customField: '20090518-044903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10173',
internalId:  '',
customField: '20090518-051215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10194',
internalId:  '',
customField: '20090517-131957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10215',
internalId:  '',
customField: '20090518-042948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10236',
internalId:  '',
customField: '20090517-140129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10257',
internalId:  '',
customField: '20090518-033913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10278',
internalId:  '',
customField: '20090517-135629'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '10101',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-18017261']={
webappId:    '1501',
documentId:  '10101',
internalId:  '18017261',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13401',
internalId:  '',
customField: '20090518-052648'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN38T1';
var companyName   = 'Muharraq+Horse+Riding+School';
var htmlTitle	  = 'Muharraq+Horse+Riding+School';
var metaKeywords  = 'Muharraq+Riding+School+was+founded+in+1980%2C+and+was+previously+called+Smahij+Stables.+The+Stable+then+moved+to+Galaly+Garden+in+the+year+2000+to+its+new+location%2C+located+on+the+map%2C+It+was+renamed+to+Muharraq+Riding+School.+We+are+the+first+horse+riding+school+in+Muharraq+and+we+are+the+first+small+animal+park+in+Muharraq.++The+Park+has+various+types+of+animals%2C+such+as+birds%2C+ostriches%2C+crocodiles%2C+monkeys%2C+and+foxes+and+there+are+also+many+horses.+The+horses+are+in+stables%2C+which+enables+the+visitors+to+have+a+clear+vision+and+move+among+the+animals+easily.+When+you+visit+the+school+you+will+get+acquainted+with+the+habits+of+these+animals+and+see+how+they+live+their+daily+lives.+Also%2C+there+is+a+beautiful+area+with+a+waterfall+and+seats+for+all+the+visitors+to+sit+and+enjoy+the+surroundings.Muharraq+Riding+School+welcomes+group+visits+from+schools+and+kindergartens%2C+clubs+and+associations%2C+and+can+provide+horse+rides+at+a+token+price.+The+school+rents+out+horses+for+special+occasions+for+a+symbolic+amount.++We+also+have+horses+for+sale+-You+can+find+out+our+location+by+clicking+on+the+below+link.+-.+Press+here+to+see+map++Muharraq+Riding+School+is+ready+to+meet+all+your+requests+for+group+visits%2F+parties.We+also+have+camels%2C+Arabian+horses+and+Shetland+Ponies+for+rent.Bouncy+Castle+for+children.+';
var metaContents  = 'Muharraq+Horse+Riding+School+was+founded+in+1980%2C+and+was+previously+called+Smahij+Stables.+The+Stable+then+moved+to+Galaly+Garden+in+the+year+2000+to+its+new+location%2C+located+on+the+map%2C+It+was+renamed+to+Muharraq+Riding+School.+We+are+the+first+horse+riding+school+in+Muharraq+and+we+are+the+first+small+animal+park+in+Muharraq.++The+Park+has+various+types+of+animals%2C+such+as+birds%2C+ostriches%2C+crocodiles%2C+monkeys%2C+and+foxes+and+there+are+also+many+horses.+The+horses+are+in+stables%2C+which+enables+the+visitors+to+have+a+clear+vision+and+move+among+the+animals+easily.+When+you+visit+the+school+you+will+get+acquainted+with+the+habits+of+these+animals+and+see+how+they+live+their+daily+lives.+Also%2C+there+is+a+beautiful+area+with+a+waterfall+and+seats+for+all+the+visitors+to+sit+and+enjoy+the+surroundings.Muharraq+Riding+School+welcomes+group+visits+from+schools+and+kindergartens%2C+clubs+and+associations%2C+and+can+provide+horse+rides+at+a+token+price.+The+school+rents+out+horses+for+special+occasions+for+a+symbolic+amount.++We+also+have+horses+for+sale+-You+can+find+out+our+location+by+clicking+on+the+below+link.+-.+Press+here+to+see+map++Muharraq+Riding+School+is+ready+to+meet+all+your+requests+for+group+visits%2F+parties.We+also+have+camels%2C+Arabian+horses+and+Shetland+Ponies+for+rent.Bouncy+Castle+for+children.+';
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();
};
