/* [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','1411',jdecode('Home'),jdecode(''),'/1411.html','true',[],'',''],
	['PAGE','19901',jdecode('Workshops'),jdecode(''),'/19901.html','true',[],'',''],
	['PAGE','156301',jdecode('Dance+events'),jdecode(''),'/156301/index.html','true',[ 
		['PAGE','3022',jdecode('Where%26%23x27%3Bs+Candi'),jdecode(''),'/156301/3022.html','true',[],'',''],
		['PAGE','156327',jdecode('Regular+Dance+Nights'),jdecode(''),'/156301/156327.html','true',[],'',''],
		['PAGE','156401',jdecode('Other+dance+events'),jdecode(''),'/156301/156401.html','true',[],'','']
	],'',''],
	['PAGE','25401',jdecode('Dancing+on+the+net'),jdecode(''),'/25401.html','true',[],'',''],
	['PAGE','21501',jdecode('Timeline'),jdecode(''),'/21501.html','true',[],'',''],
	['PAGE','35222',jdecode('Classic+songs+%26+composers'),jdecode(''),'/35222.html','true',[],'',''],
	['PAGE','153801',jdecode('Pick+a+Magency'),jdecode(''),'/153801.html','true',[],'',''],
	['PAGE','35243',jdecode('Om+Kalthoum'),jdecode(''),'/35243.html','true',[],'',''],
	['PAGE','32801',jdecode('Folkloric+dance+%26+music'),jdecode(''),'/32801.html','true',[],'',''],
	['PAGE','35285',jdecode('shaabi+music+%26+singers'),jdecode(''),'/35285.html','true',[],'',''],
	['PAGE','94401',jdecode('Translations+and+links'),jdecode(''),'/94401.html','true',[],'',''],
	['PAGE','21901',jdecode('Egyptian+Dancers'),jdecode(''),'/21901.html','true',[],'',''],
	['PAGE','17422',jdecode('Shamadan'),jdecode(''),'/17422.html','true',[],'',''],
	['PAGE','74101',jdecode('Props'),jdecode(''),'/74101.html','true',[],'',''],
	['PAGE','3001',jdecode('Travel+tips+for+Cairo'),jdecode(''),'/3001.html','true',[],'',''],
	['PAGE','118001',jdecode('Cairo+Diary+2009'),jdecode(''),'/118001.html','true',[],'',''],
	['PAGE','110701',jdecode('Costumiers'),jdecode(''),'/110701.html','true',[],'',''],
	['PAGE','147201',jdecode('Who%26%23x27%3Bs+that+with+Candi%3F'),jdecode(''),'/147201.html','true',[],'',''],
	['PAGE','58901',jdecode('Sale'),jdecode(''),'/58901.html','true',[],'',''],
	['PAGE','138927',jdecode('Book+a+wedding+zeffa'),jdecode(''),'/138927.html','true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Photograph3';
theSitetree.paletteFamily='FF9AE9';
theSitetree.keyvisualId='9970';
theSitetree.keyvisualName='kv_9970.jpg';
theSitetree.fontsetId='17777';
theSitetree.graphicsetId='13142';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FF9AE9';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Photograph3',
				paletteFamily: 	'FF9AE9',
				keyvisualId: 	'9970',
				keyvisualName: 	'kv_9970.jpg',
				fontsetId: 		'17777',
				graphicsetId: 	'13142',
				contentColor: 	'000000',
				contentBGColor: 'FF9AE9',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19901',
internalId:  '',
customField: '20100215-114447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21501',
internalId:  '',
customField: '20080117-155226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21901',
internalId:  '',
customField: '20100203-161803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1411',
internalId:  '',
customField: '20100220-203319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156327',
internalId:  '',
customField: '20100121-092706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118001',
internalId:  '',
customField: '20090308-164724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17422',
internalId:  '',
customField: '20091217-160606'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1411',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-4477508']={
webappId:    '1501',
documentId:  '1411',
internalId:  '4477508',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3022',
internalId:  '',
customField: '20100220-203024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20091222-124829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25401',
internalId:  '',
customField: '20100204-102730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156301',
internalId:  '',
customField: '20091212-113659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138927',
internalId:  '',
customField: '20090713-141730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110701',
internalId:  '',
customField: '20090305-141743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94401',
internalId:  '',
customField: '20100121-122237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '147201',
internalId:  '',
customField: '20090817-005336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32801',
internalId:  '',
customField: '20091218-121903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58901',
internalId:  '',
customField: '20100220-203217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35243',
internalId:  '',
customField: '20091218-115303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35222',
internalId:  '',
customField: '20090813-183111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35285',
internalId:  '',
customField: '20100121-122117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74101',
internalId:  '',
customField: '20090129-232553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156401',
internalId:  '',
customField: '20100215-160918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '153801',
internalId:  '',
customField: '20091218-102051'
};
webappMappings['7008']=webappMappings['7008-5117']={
webappId:    '7008',
documentId:  '138927',
internalId:  '5117',
customField: 'language:en;country:GB;'
};
webappMappings['7008']=webappMappings['7008-5119']={
webappId:    '7008',
documentId:  '1411',
internalId:  '5119',
customField: 'language:en;country:GB;'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2R5Q';
var companyName   = 'Rakscandi';
var htmlTitle	  = 'Rakscandi';
var metaKeywords  = 'belly+dance%2C+raks+sharki%2Coriental+dance%2CCandi+Colgrave-Bell%2C+classes%2Cdancers%2Cegyptian+dance%2C+egypt%2Ccostume%2C+workshop%2Cbellydancing%2Cperformance%2Crestaurant%2Cteaching%2Cshamadan%2Cwedding%2C+bellydancer%2Czeffa%2Cperformer%2C+hire+a+bellydancer';
var metaContents  = 'An+information+for+Egyptian+style+bellydance.+Classes%2C+workshops+and+events.+famous+dancers+music+and+costumes.+';
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();
};
