/* [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','3501',jdecode('Home'),jdecode(''),'/3501.html','true',[],'',''],
	['PAGE','50012',jdecode('Registration+Info'),jdecode(''),'/50012.html','true',[],'',''],
	['PAGE','17801',jdecode('About+us%21'),jdecode(''),'/17801.html','true',[],'',''],
	['PAGE','18001',jdecode('Fees+and+Modules'),jdecode(''),'/18001/index.html','true',[ 
		['PAGE','52012',jdecode('Study+Packs+Pricelist'),jdecode(''),'/18001/52012.html','true',[],'','']
	],'',''],
	['PAGE','30512',jdecode('Exam+Timetable'),jdecode(''),'/30512.html','false',[],'',''],
	['PAGE','36812',jdecode('Exam+Revision+Classes'),jdecode(''),'/36812/index.html','false',[ 
		['PAGE','32912',jdecode('REVISION+TIMETABLE'),jdecode(''),'/36812/32912.html','true',[],'',''],
		['PAGE','36233',jdecode('Full-time+CLS+students'),jdecode(''),'/36812/36233.html','true',[],'',''],
		['PAGE','36254',jdecode('Part-time+CLS+students'),jdecode(''),'/36812/36254.html','true',[],'','']
	],'',''],
	['PAGE','25701',jdecode('Full-time+timetable'),jdecode(''),'/25701.html','true',[],'',''],
	['PAGE','8401',jdecode('Part-time+timetable'),jdecode(''),'/8401.html','true',[],'',''],
	['PAGE','17401',jdecode('Contact+Us'),jdecode(''),'/17401.html','true',[],'',''],
	['PAGE','8422',jdecode('Our+Graduates'),jdecode(''),'/8422.html','true',[],'',''],
	['PAGE','33512',jdecode('Student+Feedback'),jdecode(''),'/33512.html','true',[],'',''],
	['PAGE','17822',jdecode('Photo+Album'),jdecode(''),'/17822.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='NewYork';
theSitetree.paletteFamily='660000';
theSitetree.keyvisualId='978';
theSitetree.keyvisualName='adresskartei.jpg';
theSitetree.fontsetId='169';
theSitetree.graphicsetId='197';
theSitetree.contentColor='A00000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'NewYork',
				paletteFamily: 	'660000',
				keyvisualId: 	'978',
				keyvisualName: 	'adresskartei.jpg',
				fontsetId: 		'169',
				graphicsetId: 	'197',
				contentColor: 	'A00000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'660000',
				c_color: 		'000000',
				d_color: 		'990000',
				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:  '3501',
internalId:  '',
customField: '20100718-184218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8422',
internalId:  '',
customField: '20100719-115227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8401',
internalId:  '',
customField: '20100718-144803'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3501',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-303']={
webappId:    '7008',
documentId:  '17401',
internalId:  '303',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-379005']={
webappId:    '1501',
documentId:  '3501',
internalId:  '379005',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30512',
internalId:  '',
customField: '20100115-183859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17401',
internalId:  '',
customField: '20090222-223747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25701',
internalId:  '',
customField: '20100719-115346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17801',
internalId:  '',
customField: '20100718-144348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18001',
internalId:  '',
customField: '20100718-144607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17822',
internalId:  '',
customField: '20100718-145333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32912',
internalId:  '',
customField: '20100518-102722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33512',
internalId:  '',
customField: '20100527-111652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36233',
internalId:  '',
customField: '20090325-195159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36254',
internalId:  '',
customField: '20090327-123546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36812',
internalId:  '',
customField: '20100501-141633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50012',
internalId:  '',
customField: '20100718-143732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52012',
internalId:  '',
customField: '20100626-223618'
};
var canonHostname = 'sitebuilder1.nur4.host-h.net';
var accountId     = 'AHZGE0INXXKN';
var companyName   = 'Critical+Law+Studies+cc';
var htmlTitle	  = 'C.L.S.+Private+Tutors+in+Law';
var metaKeywords  = 'UNISA%2C+tuition%2C+law%2C+LLB%2C+studies%2C+revision%2C+lectures%2C+classes%2C+notes%2C+past+papers%2C+question+packs%2C+revision+classes%2C+unisa%2C+registration%2C+exams';
var metaContents  = 'Law+school+offering+private+tuition+in+UNISA+LLB+modules+to+students.+Critical+Law+Studies+provides+lectures%2C+revision+classes%2C+notes+and+question+packs+in+a+great+environment.';
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();
};
