/* [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','6901',jdecode('WSC+Homepage'),jdecode(''),'/6901/index.html','true',[ 
		['PAGE','7501',jdecode('WSC+Press+Release'),jdecode(''),'/6901/7501.html','true',[],'',''],
		['PAGE','7001',jdecode('Baseball'),jdecode(''),'/6901/7001.html','false',[],'',''],
		['PAGE','42201',jdecode('Basketball+%28M%29'),jdecode(''),'/6901/42201.html','false',[],'',''],
		['PAGE','42222',jdecode('Basketball+%28W%29'),jdecode(''),'/6901/42222.html','false',[],'',''],
		['PAGE','69501',jdecode('Golf+%28Men%29'),jdecode(''),'/6901/69501.html','false',[],'',''],
		['PAGE','32001',jdecode('Cross+Country'),jdecode(''),'/6901/32001.html','false',[],'',''],
		['PAGE','32022',jdecode('Golf+%28Women%29'),jdecode(''),'/6901/32022.html','false',[],'',''],
		['PAGE','34301',jdecode('Soccer+%28Men%29'),jdecode(''),'/6901/34301.html','false',[],'',''],
		['PAGE','34322',jdecode('Soccer+%28Women%29'),jdecode(''),'/6901/34322.html','false',[],'',''],
		['PAGE','69522',jdecode('Softball'),jdecode(''),'/6901/69522.html','false',[],'',''],
		['PAGE','53701',jdecode('Supremacy+Award+'),jdecode(''),'/6901/53701.html','true',[],'',''],
		['PAGE','69543',jdecode('Swimming'),jdecode(''),'/6901/69543.html','false',[],'',''],
		['PAGE','69564',jdecode('Tennis+%28Men%29'),jdecode(''),'/6901/69564.html','false',[],'',''],
		['PAGE','69585',jdecode('Tennis+%28Women%29'),jdecode(''),'/6901/69585.html','false',[],'',''],
		['PAGE','69606',jdecode('Track+%28Men%29'),jdecode(''),'/6901/69606.html','false',[],'',''],
		['PAGE','69627',jdecode('Track+%28Women%29'),jdecode(''),'/6901/69627.html','false',[],'',''],
		['PAGE','6501',jdecode('Volleyball+%28M%29'),jdecode(''),'/6901/6501.html','false',[],'',''],
		['PAGE','32064',jdecode('Volleyball+%28Women%29'),jdecode(''),'/6901/32064.html','false',[],'',''],
		['PAGE','32085',jdecode('Water+Polo'),jdecode(''),'/6901/32085.html','false',[],'',''],
		['PAGE','32106',jdecode('Wrestling'),jdecode(''),'/6901/32106.html','false',[],'',''],
		['PAGE','92201',jdecode('Football'),jdecode(''),'/6901/92201.html','false',[],'',''],
		['PAGE','96801',jdecode('WSC+Records'),jdecode(''),'/6901/96801.html','true',[],'','']
	],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Raster';
theSitetree.paletteFamily='ACC085';
theSitetree.keyvisualId='1287';
theSitetree.keyvisualName='basketball.jpg';
theSitetree.fontsetId='196';
theSitetree.graphicsetId='236';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E6E6E6';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Raster',
				paletteFamily: 	'ACC085',
				keyvisualId: 	'1287',
				keyvisualName: 	'basketball.jpg',
				fontsetId: 		'196',
				graphicsetId: 	'236',
				contentColor: 	'000000',
				contentBGColor: 'E6E6E6',
				a_color: 		'00007F',
				b_color: 		'2E49EE',
				c_color: 		'000000',
				d_color: 		'E6E6E6',
				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:  '7501',
internalId:  '',
customField: '20100829-000241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20100510-013137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20100319-013007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6901',
internalId:  '',
customField: '20100510-012133'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32001',
internalId:  '',
customField: '20081204-002022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32022',
internalId:  '',
customField: '20081204-002204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34301',
internalId:  '',
customField: '20081204-002351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32064',
internalId:  '',
customField: '20090424-225616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32085',
internalId:  '',
customField: '20081204-002905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32106',
internalId:  '',
customField: '20081201-023828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34322',
internalId:  '',
customField: '20081204-002529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42201',
internalId:  '',
customField: '20100311-020310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42222',
internalId:  '',
customField: '20100310-022510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53701',
internalId:  '',
customField: '20100510-012859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69501',
internalId:  '',
customField: '20090426-225937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69522',
internalId:  '',
customField: '20090426-230033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69543',
internalId:  '',
customField: '20090426-230226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69564',
internalId:  '',
customField: '20090426-230330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69585',
internalId:  '',
customField: '20090426-230418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69606',
internalId:  '',
customField: '20090426-230506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69627',
internalId:  '',
customField: '20090426-230649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92201',
internalId:  '',
customField: '20090909-110451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96801',
internalId:  '',
customField: '20100804-014113'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN24GV';
var companyName   = 'WESTERN+STATE+CONFERENCE';
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();
};
