/* [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','2201',jdecode('Home'),jdecode(''),'/2201/index.html','true',[ 
		['PAGE','2385',jdecode('Valerie+McCaffrey'),jdecode(''),'/2201/2385.html','true',[],''],
		['PAGE','2322',jdecode('Heather+Hale'),jdecode(''),'/2201/2322.html','true',[],''],
		['PAGE','2343',jdecode('Milton+Justice'),jdecode(''),'/2201/2343.html','true',[],'']
	],''],
	['PAGE','2406',jdecode('What+will+I+learn%3F'),jdecode(''),'/2406.html','true',[],''],
	['PAGE','20901',jdecode('What+is+my+investment%3F'),jdecode(''),'/20901.html','true',[],''],
	['PAGE','10101',jdecode('Part+Scholarship+Opportunity'),jdecode(''),'/10101.html','true',[],''],
	['PAGE','2427',jdecode('Enrol+Now'),jdecode(''),'/2427.html','true',[],''],
	['PAGE','20301',jdecode('Terms+and+Conditions'),jdecode(''),'/20301.html','false',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='990000';
theSitetree.keyvisualId='1278';
theSitetree.keyvisualName='auge.jpg';
theSitetree.fontsetId='193';
theSitetree.graphicsetId='232';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Profile',
				paletteFamily: 	'990000',
				keyvisualId: 	'1278',
				keyvisualName: 	'auge.jpg',
				fontsetId: 		'193',
				graphicsetId: 	'232',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'990000',
				b_color: 		'333333',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20100209-191719'
};
webappMappings['7008']=webappMappings['7008-24513']={
webappId:    '7008',
documentId:  '2427',
internalId:  '24513',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10101',
internalId:  '',
customField: '20100209-192119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2406',
internalId:  '',
customField: '20100128-055614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2322',
internalId:  '',
customField: '20100130-210808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2343',
internalId:  '',
customField: '20100128-055525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20901',
internalId:  '',
customField: '20100316-234946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2385',
internalId:  '',
customField: '20100127-050939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2427',
internalId:  '',
customField: '20100317-074744'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20301',
internalId:  '',
customField: '20100209-185919'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INVEGZ';
var companyName   = 'Hollywood+Intensive+Retreat';
var htmlTitle	  = 'Hollywood+Intensive+Retreat';
var metaKeywords  = 'acting%2C+directing%2C+producing%2C+training%2C+screenwriting%2C+screenwriter%2C+screenwriters%2C+acting+training%2C+hollywood%2C+hollywood+acting%2C+acting+in+hollywood%2C+hollywood+acting+training%2C+hollywood+screenwriter%2C+producing+in+hollywood%2C+producers%2C+directors%2C+training+for+directors%2C+directing+in+hollywood%2C+hollywood+director%2C+networking+in+hollywood%2C+great+tutors%2C+teachers%2C+casting+directors%2C+casting+in+hollywood%2C+actor+casting%2C+actors+in+hollywood%2C+how+do+i+make+it+in+hollywood%2C+business+plans%2C+planning%2C+classes%2C+sessions%2C+acting+classes%2C+writing+classes%2C+screenwriting+classes%2C+director+training%2C+learning+how+to%2C+learning+how+to+direct%2C+learn+how+to+act%2C+learn+how+to+write%2C+getaway%2C+sydney+training%2C+sydney+actors%2C+sydney+directors%2C+sydney+producers%2C+acting+in+sydney%2C+acting+in+auckland%2C+writing+in+auckland%2C+training+in+auckland%2C+actors+training+in+auckland%2C+screenwriting+opportunities%2C+acting+opportunities%2C+drama%2C+drama+school%2C+drama+schools+in+sydney%2C+drama+schools+in+sydney%2C+drama+schools+in+australia%2C+drama+schools+in+new+zealand%2C+acting+training+in+new+zealand%2C+scripts%2C+scriptwork%2C+power+networking+in+hollywood%2C+whos+who+in+hollywood%2C+insiders+guide+to+hollywood%2C+inside+hollywood%2C+casting+director%2C+casting+training';
var metaContents  = 'Intensive+Training+for+Actors%2C+Screenwriters+and+Directors+with+Hollywood+Tutors+coming+to+Australia.++Retreat+training+onsite+for+5+days+and+5+nights%21++Limited+spaces+available.++Book+now+to+avoid+disappointment.';
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();
};
