/* [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','301',jdecode('Home'),jdecode(''),'/301.html','true',[],''],
	['PAGE','14001',jdecode('AYSO+AREA+1D'),jdecode(''),'/14001.html','true',[],''],
	['PAGE','14043',jdecode('AYSO+AREA+1P'),jdecode(''),'/14043.html','true',[],''],
	['PAGE','11501',jdecode('AYSO+69'),jdecode(''),'/11501.html','true',[],''],
	['PAGE','14106',jdecode('CULVER+ICE+HOCKEY'),jdecode(''),'/14106.html','true',[],''],
	['PAGE','14169',jdecode('HARVARD+-+WESTLAKE'),jdecode(''),'/14169.html','true',[],''],
	['PAGE','26615',jdecode('JR.+KINGS+HOCKEY'),jdecode(''),'/26615.html','true',[],''],
	['PAGE','19201',jdecode('LAS+VIRGENES+'),jdecode(''),'/19201.html','true',[],''],
	['PAGE','29627',jdecode('LOYOA+MARYMOUNT'),jdecode(''),'/29627.html','true',[],''],
	['PAGE','14022',jdecode('REAL+SOCAL'),jdecode(''),'/14022.html','true',[],''],
	['PAGE','32427',jdecode('RSC+ACTION+PHOTOS'),jdecode(''),'/32427.html','true',[],''],
	['PAGE','32448',jdecode('RSC+TEAM+PHOTOS'),jdecode(''),'/32448.html','true',[],''],
	['PAGE','14064',jdecode('SM+LITTLE+LEAGUE'),jdecode(''),'/14064.html','true',[],''],
	['PAGE','14127',jdecode('WHBB'),jdecode(''),'/14127.html','true',[],''],
	['PAGE','394',jdecode('WLA+LITTLE+LEAGUE'),jdecode(''),'/394.html','true',[],''],
	['PAGE','499',jdecode('Contact+Us'),jdecode(''),'/499.html','true',[],''],
	['PAGE','35655',jdecode('PHOTO+PRODUCTS'),jdecode(''),'/35655.html','false',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Round';
theSitetree.paletteFamily='CC3333';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='442';
theSitetree.graphicsetId='495';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='e47272';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Round',
				paletteFamily: 	'CC3333',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'442',
				graphicsetId: 	'495',
				contentColor: 	'FFFFFF',
				contentBGColor: 'e47272',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'e47272',
				b_color: 		'CC3333',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				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:  '301',
internalId:  '',
customField: '20100526-174427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14022',
internalId:  '',
customField: '20100526-174452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14001',
internalId:  '',
customField: '20100225-142616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '394',
internalId:  '',
customField: '20090714-125638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20090304-123340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14043',
internalId:  '',
customField: '20100303-091202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14064',
internalId:  '',
customField: '20090629-130417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26615',
internalId:  '',
customField: '20090303-125742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29627',
internalId:  '',
customField: '20090411-154908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14106',
internalId:  '',
customField: '20081227-173525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14127',
internalId:  '',
customField: '20100614-183720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14169',
internalId:  '',
customField: '20091130-123517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '499',
internalId:  '',
customField: '20071226-115804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19201',
internalId:  '',
customField: '20090408-183317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32427',
internalId:  '',
customField: '20100518-130728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32448',
internalId:  '',
customField: '20100526-174530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35655',
internalId:  '',
customField: '20100313-005316'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INXZNJ';
var companyName   = 'Free+Agent+Foto';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};
