/* [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','119',jdecode('Home'),jdecode(''),'/119.html','true',[],''],
	['PAGE','140',jdecode('About+us'),jdecode(''),'/140/index.html','true',[ 
		['PAGE','149',jdecode('The+team'),jdecode(''),'/140/149.html','true',[],'']
	],''],
	['PAGE','158',jdecode('Products'),jdecode(''),'/158/index.html','true',[ 
		['PAGE','167',jdecode('BASKETBALL+'),jdecode(''),'/158/167.html','true',[],''],
		['PAGE','12154',jdecode('BASKETBALL+SHOOTER%2FWARMUPS'),jdecode(''),'/158/12154.html','true',[],''],
		['PAGE','176',jdecode('FOOTBALL+'),jdecode(''),'/158/176.html','true',[],''],
		['PAGE','185',jdecode('BASEBALL+'),jdecode(''),'/158/185.html','true',[],''],
		['PAGE','1260',jdecode('VOLLEYBALL'),jdecode(''),'/158/1260.html','true',[],''],
		['PAGE','1269',jdecode('SOCCER'),jdecode(''),'/158/1269.html','true',[],''],
		['PAGE','6940',jdecode('CHEERLEADING'),jdecode(''),'/158/6940.html','true',[],''],
		['PAGE','12334',jdecode('HOCKEY'),jdecode(''),'/158/12334.html','true',[],''],
		['PAGE','12343',jdecode('SOFTBALL'),jdecode(''),'/158/12343.html','true',[],''],
		['PAGE','12352',jdecode('TRACK'),jdecode(''),'/158/12352.html','true',[],''],
		['PAGE','12514',jdecode('UNIFORM+DESIGN+SAMPLES'),jdecode(''),'/158/12514.html','true',[],''],
		['PAGE','1278',jdecode('+LOGO+DESIGNS'),jdecode(''),'/158/1278.html','true',[],''],
		['PAGE','12361',jdecode('SIZE+CHART'),jdecode(''),'/158/12361.html','true',[],'']
	],''],
	['PAGE','194',jdecode('CONTACT'),jdecode(''),'/194/index.html','true',[ 
		['PAGE','203',jdecode('ADRESSES'),jdecode(''),'/194/203.html','true',[],'']
	],''],
	['PAGE','221',jdecode('SATISFIED+CUSTOMERS'),jdecode(''),'/221.html','true',[],''],
	['PAGE','230',jdecode('Offers'),jdecode(''),'/230.html','true',[],'']];
var siteelementCount=21;
theSitetree.topTemplateName='Blossom';
theSitetree.paletteFamily='364EB6';
theSitetree.keyvisualId='7111';
theSitetree.keyvisualName='kv_7111.jpg';
theSitetree.fontsetId='16394';
theSitetree.graphicsetId='12129';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E5E2E2';
var theTemplate={
				name: 			'Blossom',
				paletteFamily: 	'364EB6',
				keyvisualId: 	'7111',
				keyvisualName: 	'kv_7111.jpg',
				fontsetId: 		'16394',
				graphicsetId: 	'12129',
				contentColor: 	'000000',
				contentBGColor: 'E5E2E2',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-2030566']={
webappId:    '1501',
documentId:  '119',
internalId:  '2030566',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '119',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119',
internalId:  '',
customField: '20090405-174648'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '119',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '158',
internalId:  '',
customField: '20071105-020609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '140',
internalId:  '',
customField: '20071029-174431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '149',
internalId:  '',
customField: '20071028-013617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '167',
internalId:  '',
customField: '20071101-041600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12154',
internalId:  '',
customField: '20071101-010921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '176',
internalId:  '',
customField: '20071101-011113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '185',
internalId:  '',
customField: '20071101-015159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1260',
internalId:  '',
customField: '20071101-011332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1269',
internalId:  '',
customField: '20071101-011517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6940',
internalId:  '',
customField: '20071101-011703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12334',
internalId:  '',
customField: '20071101-011834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12343',
internalId:  '',
customField: '20071101-012014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12352',
internalId:  '',
customField: '20071101-013758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12514',
internalId:  '',
customField: '20071107-181911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1278',
internalId:  '',
customField: '20071105-052002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12361',
internalId:  '',
customField: '20071101-012240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '194',
internalId:  '',
customField: '20071029-175124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '203',
internalId:  '',
customField: '20071027-223313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '221',
internalId:  '',
customField: '20080212-190920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '230',
internalId:  '',
customField: '20071029-174813'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3V1Y';
var companyName   = 'MORGAN+ATHLETICS+SPORT+UNIFORMS';
var htmlTitle	  = 'MORGAN+ATHLETICS';
var metaKeywords  = 'SPORTS+UNIFORMS';
var metaContents  = 'BASKETBALL+UNIFORMS';
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();
};
