/* [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','10201',jdecode('Home'),jdecode(''),'/10201.html','true',[],'',''],
	['PAGE','33201',jdecode('New+and+Upcoming%21'),jdecode(''),'/33201.html','true',[],'',''],
	['PAGE','15101',jdecode('English+Workshops+for+Youth'),jdecode(''),'/15101/index.html','true',[ 
		['PAGE','22801',jdecode('Adv+Elementary%3A+Eng+045'),jdecode(''),'/15101/22801.html','true',[],'',''],
		['PAGE','41701',jdecode('Elementary%3A+Eng+025%2C+Eng+035'),jdecode(''),'/15101/41701.html','true',[],'','']
	],'',''],
	['PAGE','22822',jdecode('English+Workshops+for+Young+Adults'),jdecode(''),'/22822/index.html','true',[ 
		['PAGE','15143',jdecode('Adv+Middle+School%3A+Eng+055'),jdecode(''),'/22822/15143.html','true',[],'',''],
		['PAGE','15164',jdecode('High+School%3A+Eng+101%2C+Eng+102'),jdecode(''),'/22822/15164.html','true',[],'',''],
		['PAGE','22843',jdecode('College+Prep'),jdecode(''),'/22822/22843.html','true',[],'','']
	],'',''],
	['PAGE','32501',jdecode('Physics+Workshop'),jdecode(''),'/32501.html','true',[],'',''],
	['PAGE','17101',jdecode('Schedule+for+2010-2011'),jdecode(''),'/17101.html','true',[],'',''],
	['PAGE','28601',jdecode('Fees'),jdecode(''),'/28601.html','true',[],'',''],
	['PAGE','42101',jdecode('Swayam+Loyalty+Program'),jdecode(''),'/42101.html','true',[],'',''],
	['PAGE','34601',jdecode('Take+Action%3A+Contact+Us'),jdecode(''),'/34601.html','true',[],'',''],
	['PAGE','39301',jdecode('Affiliations'),jdecode(''),'/39301.html','true',[],'',''],
	['PAGE','10399',jdecode('About+Us'),jdecode(''),'/10399.html','true',[],'',''],
	['PAGE','40001',jdecode('What+Makes+Us+Different%3F'),jdecode(''),'/40001.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Display';
theSitetree.paletteFamily='580D02';
theSitetree.keyvisualId='11379';
theSitetree.keyvisualName='kv_11379.jpg';
theSitetree.fontsetId='31965';
theSitetree.graphicsetId='13803';
theSitetree.contentColor='1F1D1C';
theSitetree.contentBGColor='FBE5C3';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Display',
				paletteFamily: 	'580D02',
				keyvisualId: 	'11379',
				keyvisualName: 	'kv_11379.jpg',
				fontsetId: 		'31965',
				graphicsetId: 	'13803',
				contentColor: 	'1F1D1C',
				contentBGColor: 'FBE5C3',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20100731-231913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15101',
internalId:  '',
customField: '20090614-220443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15143',
internalId:  '',
customField: '20090622-194112'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15164',
internalId:  '',
customField: '20090622-194213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40001',
internalId:  '',
customField: '20100130-182922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17101',
internalId:  '',
customField: '20100731-021650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10399',
internalId:  '',
customField: '20100731-024431'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '10201',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-9810285']={
webappId:    '1501',
documentId:  '10201',
internalId:  '9810285',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22822',
internalId:  '',
customField: '20090614-221143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22801',
internalId:  '',
customField: '20090622-194005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22843',
internalId:  '',
customField: '20090622-194532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39301',
internalId:  '',
customField: '20100411-231532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28601',
internalId:  '',
customField: '20100731-022406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32501',
internalId:  '',
customField: '20090719-005330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33201',
internalId:  '',
customField: '20100731-023029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34601',
internalId:  '',
customField: '20100318-214207'
};
webappMappings['7008']=webappMappings['7008-14168']={
webappId:    '7008',
documentId:  '34601',
internalId:  '14168',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-10399aendu0in22g7']={
webappId:    '1002',
documentId:  '10399',
internalId:  '10399aendu0in22g7',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41701',
internalId:  '',
customField: '20100130-180813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42101',
internalId:  '',
customField: '20100411-225521'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN22G7';
var companyName   = 'Swayam+Learning';
var htmlTitle	  = 'Swayam+Learning';
var metaKeywords  = 'home+learning%2C+independent+education%2C+teaching%2C+study%2C+education%2C+exams%2C+elementary%2C+middle+school%2C+high+school%2C+ACT%2C+SAT%2C+college+preparation%2C+speech%2C+communication%2C+interview%2C+presentation%2C+Physics%2C+Calculus%2C+Pre-Calculus%2C+algebra%2C+geometry%2C+mathematics%2C+math%2C+accelerated+math%2C+advanced+math%2C+SAT+Prep%2C+SAT+Workshop%2C+ACT+Workshop%2C+High+School+SAT%2C+Middle+School+ACT%2C++Speaking+and+Presentation%2C+Homework+help%2C+Schoolwork+help%2C+Writing+Lab%2C+English+Skills+Lab%2C+Math+lab%2C+Physics+Lab%2C+Math+help%2C+Science+help%2C+English+help%2C+Chemistry+tutoring%2C+Physics+tutoring';
var metaContents  = 'Intensive+workshops%2C+accelerated+workshops%2C+self-study%2C+progressive+study%2C+advanced+learning%2C+accelerated+learning%2C+communication+skills%2C+language+arts%2C+interview+skills%2C+presentations%2C+teaching+certification+prep%2C+college+prep%2C+SAT+prep%2C+ACT+prep%2C+Pre-Calculus+Training%2C+Calculus+Tutoring%2C+Physics+Tutoring%2C+Math+tutoring%2C+Math+Training%2C+Math+Workshops%2C+Accelerated+Math%2C+Speech%2C+Communication+Skills%2C+Writing+Lab%2C+Math+Lab%2C+Science+Lab%2C+Homework+tutoring%2C+Schoolwork+tutoring%2C+Homework+help%2C+Schoolwork+help%2C+Chemistry+Tutor%2C+Tutoring+Lab%2C+Physics+Tutor';
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();
};
