/* [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','2001',jdecode('Home'),jdecode(''), jdecode('%2F2001.html'), 'true',[],'',''],
	['PAGE','2052',jdecode('About+us.'),jdecode(''), jdecode('%2F2052%2Findex.html'), 'true',[ 
		['PAGE','14101',jdecode('History'),jdecode(''), jdecode('%2F2052%2F14101.html'), 'true',[],'',''],
		['PAGE','14122',jdecode('Our+team'),jdecode(''), jdecode('%2F2052%2F14122.html'), 'true',[],'',''],
		['PAGE','14301',jdecode('Contact'),jdecode(''), jdecode('%2F2052%2F14301.html'), 'true',[],'','']
	],'',''],
	['PAGE','14164',jdecode('Team+news+%21'),jdecode(''), jdecode('%2F14164%2Findex.html'), 'true',[ 
		['PAGE','30201',jdecode('THE+FOYLE+CUP+2010'),jdecode(''), jdecode('%2F14164%2F30201.html'), 'true',[],'',''],
		['PAGE','30222',jdecode('RVSC+Past+Teams'),jdecode(''), jdecode('%2F14164%2F30222.html'), 'true',[],'',''],
		['PAGE','35301',jdecode('RVSC+U17+Boys+Red'),jdecode(''), jdecode('%2F14164%2F35301.html'), 'true',[],'',''],
		['PAGE','35322',jdecode('RVSC+U17+Boys%2C++White'),jdecode(''), jdecode('%2F14164%2F35322.html'), 'true',[],'',''],
		['PAGE','30243',jdecode('RVSC+1993+boys%2C+Red'),jdecode(''), jdecode('%2F14164%2F30243.html'), 'true',[],'',''],
		['PAGE','30264',jdecode('RVSC+1992+boys%2C+red'),jdecode(''), jdecode('%2F14164%2F30264.html'), 'true',[],'','']
	],'',''],
	['PAGE','2094',jdecode('News+%2F+archives'),jdecode(''), jdecode('%2F2094%2Findex.html'), 'true',[ 
		['PAGE','30285',jdecode('Awards+and+success+'),jdecode(''), jdecode('%2F2094%2F30285.html'), 'true',[],'',''],
		['PAGE','30306',jdecode('The+College+Pages'),jdecode(''), jdecode('%2F2094%2F30306.html'), 'true',[],'',''],
		['PAGE','30327',jdecode('Our+players+in+college+ball'),jdecode(''), jdecode('%2F2094%2F30327.html'), 'true',[],'','']
	],'',''],
	['PAGE','33701',jdecode('camps+and+clinics.'),jdecode(''), jdecode('%2F33701.html'), 'true',[],'',''],
	['PAGE','2073',jdecode('Our+Photos'),jdecode(''), jdecode('%2F2073.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Cuy';
theSitetree.paletteFamily='F7FDFD';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='385';
theSitetree.graphicsetId='438';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F7FDFD';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hps_testtown',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Cuy',
				paletteFamily: 	'F7FDFD',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'385',
				graphicsetId: 	'438',
				contentColor: 	'000000',
				contentBGColor: 'F7FDFD',
				a_color: 		'F7FDFD',
				b_color: 		'E4E5C0',
				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['7060']=webappMappings['7060-9c31f9aa72c23bcfdeeddbddf2968687']={
webappId:    '7060',
documentId:  '2073',
internalId:  '9c31f9aa72c23bcfdeeddbddf2968687',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20111110-235906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2052',
internalId:  '',
customField: '20110207-105123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2073',
internalId:  '',
customField: '20110207-133618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14101',
internalId:  '',
customField: '20110207-031411'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2094',
internalId:  '',
customField: '20110207-182951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14122',
internalId:  '',
customField: '20110720-164929'
};
webappMappings['1501']=webappMappings['1501-8986049']={
webappId:    '1501',
documentId:  '2001',
internalId:  '8986049',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14164',
internalId:  '',
customField: '20110207-122502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30201',
internalId:  '',
customField: '20110207-152200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14301',
internalId:  '',
customField: '20110207-115033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30222',
internalId:  '',
customField: '20110207-182138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30243',
internalId:  '',
customField: '20110207-100623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30264',
internalId:  '',
customField: '20110207-100623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30285',
internalId:  '',
customField: '20110207-130245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30306',
internalId:  '',
customField: '20111019-205605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30327',
internalId:  '',
customField: '20110207-123609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33701',
internalId:  '',
customField: '20110720-223326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35301',
internalId:  '',
customField: '20110207-131639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35322',
internalId:  '',
customField: '20110207-131639'
};
webappMappings['7060']=webappMappings['7060-de7167d5dd479a07c72b420febc2b46f']={
webappId:    '7060',
documentId:  '30201',
internalId:  'de7167d5dd479a07c72b420febc2b46f',
customField: 'language:en;country:US;'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INF9FF';
var companyName   = 'GB+Soccer%2C+professional+training.';
var htmlTitle	  = 'gb+soccer';
var metaKeywords  = 'coaching+soccer+training';
var metaContents  = 'soccer+training';
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();
};

