/* [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','2073',jdecode('Franchise+Ownership'),jdecode(''),'/2073.html','true',[],''],
	['PAGE','2094',jdecode('Action+Plan'),jdecode(''),'/2094.html','true',[],''],
	['PAGE','2115',jdecode('Unique+Facts'),jdecode(''),'/2115.html','true',[],''],
	['PAGE','2136',jdecode('Marketing'),jdecode(''),'/2136.html','true',[],''],
	['PAGE','2157',jdecode('Community+Audience'),jdecode(''),'/2157.html','true',[],''],
	['PAGE','2001',jdecode('Advisory+Council'),jdecode(''),'/2001.html','true',[],''],
	['PAGE','2199',jdecode('Application+Form'),jdecode(''),'/2199.html','true',[],''],
	['PAGE','2052',jdecode('The+Beginning'),jdecode(''),'/2052.html','true',[],''],
	['PAGE','2178',jdecode('IIS+Staff'),jdecode(''),'/2178.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Grace';
theSitetree.paletteFamily='80B3EC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32051';
theSitetree.graphicsetId='13871';
theSitetree.contentColor='484848';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Grace',
				paletteFamily: 	'80B3EC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32051',
				graphicsetId: 	'13871',
				contentColor: 	'484848',
				contentBGColor: 'FFFFFF',
				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:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20090504-145252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2073',
internalId:  '',
customField: '20090918-114357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2094',
internalId:  '',
customField: '20090807-112452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2115',
internalId:  '',
customField: '20090918-114824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2136',
internalId:  '',
customField: '20090514-081621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2157',
internalId:  '',
customField: '20090512-112332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2199',
internalId:  '',
customField: '20090918-115915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2052',
internalId:  '',
customField: '20090504-133936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2178',
internalId:  '',
customField: '20090918-115148'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN3RJD';
var companyName   = 'Creating+Hometown+Heroes+with+Professional+Indoor+Soccer';
var htmlTitle	  = 'internationalindoorsoccer';
var metaKeywords  = 'indoor%2C+soccer%2C+Graham+Tutt%2C+Jerry+Wilson%2C+indoor+soccer+franchise%2C+arena%2C+Atlanta%2C+Marietta%2C+Jago%2CFimani%2C+Cobb+County%2C+Gwinnett+Arena%2C+USA+All+Stars%2C+International+All+Stars%2C+All+Stars%2C+Ownership%2C+Action%2C+Action+Plan%2C+Unique%2C+Unique+Facts%2C+Marketing%2C+Community%2C+IIS%2C+Application%2C+Beginning%2C+Advisory%2C+Council%2C+Staff%2C+Initial%2C+Purpose%2C+Hometown%2C+Heroes%2C+Friends%2C+league%2C+indoor+soccer+league%2C+professional+soccer%2C+professional+indoor+soccer%2C+professional+indoor+soccer+league%2C+heroes%2C+hometown+heroes%2C+hometown%2C+Action+Pro+Indoor+soccer%2C+Indoor+Soccer+Franchise%2C+International+Indoor+Soccer%2C+';
var metaContents  = 'indoor%2C+soccer%2C+Graham+Tutt%2C+Jerry+Wilson%2C+indoor+soccer+franchise%2C+arena%2C+Atlanta%2C+Marietta%2C+Jago%2CFimani%2C+Cobb+County%2C+Gwinnett+Arena%2C+USA+All+Stars%2C+International+All+Stars%2C+All+Stars%2C+Ownership%2C+Action%2C+Action+Plan%2C+Unique%2C+Unique+Facts%2C+Marketing%2C+Community%2C+IIS%2C+Application%2C+Beginning%2C+Advisory%2C+Council%2C+Staff%2C+Initial%2C+Purpose%2C+Hometown%2C+Heroes%2C+Friends%2C+league%2C+indoor+soccer+league%2C+professional+soccer%2C+professional+indoor+soccer%2C+professional+indoor+soccer+league%2C+heroes%2C+hometown+heroes%2C+hometown%2C+Action+Pro+Indoor+soccer%2C+Indoor+Soccer+Franchise%2C+International+Indoor+Soccer%2C+';
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();
};
