/* [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','1101',jdecode('Home'),jdecode(''),'/1101.html','true',[],''],
	['PAGE','1152',jdecode('SportsRing+Products'),jdecode(''),'/1152/index.html','true',[ 
		['PAGE','64001',jdecode('SportsRings'),jdecode(''),'/1152/64001.html','true',[],''],
		['PAGE','1173',jdecode('SR+SportsHoops'),jdecode(''),'/1152/1173.html','true',[],''],
		['PAGE','1215',jdecode('SR+Design+Series'),jdecode(''),'/1152/1215.html','true',[],''],
		['PAGE','1194',jdecode('SR+Dart+Games+'),jdecode(''),'/1152/1194.html','true',[],''],
		['PAGE','55101',jdecode('SR+FunRing++Promotions'),jdecode(''),'/1152/55101.html','true',[],''],
		['PAGE','1236',jdecode('Product+Reviews'),jdecode(''),'/1152/1236.html','true',[],'']
	],''],
	['PAGE','82401',jdecode('Tie-In-Place+Products'),jdecode(''),'/82401/index.html','true',[ 
		['PAGE','84101',jdecode('Customized+Tie+In+Place'),jdecode(''),'/82401/84101.html','true',[],'']
	],''],
	['PAGE','82422',jdecode('Guru+Design++Products'),jdecode(''),'/82422/index.html','true',[ 
		['PAGE','82701',jdecode('TranAD+Overview'),jdecode(''),'/82422/82701.html','true',[],'']
	],''],
	['PAGE','71101',jdecode('New+Solutions+FP'),jdecode(''),'/71101.html','true',[],''],
	['PAGE','1257',jdecode('About+Next+Step+'),jdecode(''),'/1257.html','true',[],'']];
var siteelementCount=14;
theSitetree.topTemplateName='Comic';
theSitetree.paletteFamily='1B4082';
theSitetree.keyvisualId='9983';
theSitetree.keyvisualName='kv2.swf';
theSitetree.fontsetId='17761';
theSitetree.graphicsetId='13129';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Comic',
				paletteFamily: 	'1B4082',
				keyvisualId: 	'9983',
				keyvisualName: 	'kv2.swf',
				fontsetId: 		'17761',
				graphicsetId: 	'13129',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71101',
internalId:  '',
customField: '20090221-190219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1101',
internalId:  '',
customField: '20090315-093725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1152',
internalId:  '',
customField: '20090221-154328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1173',
internalId:  '',
customField: '20090220-181244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1215',
internalId:  '',
customField: '20090220-181450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1194',
internalId:  '',
customField: '20090220-181609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1236',
internalId:  '',
customField: '20090221-153008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1257',
internalId:  '',
customField: '20090315-093946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82401',
internalId:  '',
customField: '20090222-071952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55101',
internalId:  '',
customField: '20081119-170014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64001',
internalId:  '',
customField: '20090220-174047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82422',
internalId:  '',
customField: '20090222-072123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82701',
internalId:  '',
customField: '20090222-072232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84101',
internalId:  '',
customField: '20090222-072033'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN207L';
var companyName   = 'Leadership+By+Design+';
var htmlTitle	  = 'NSFP+Next+Step+Family+of+Products';
var metaKeywords  = 'sports+toys%2C+sports+games%2C+outdoor+sports+toys%2C+indor+sports+games%2C+basketball+toys%2C+football+toys%2C+soccer+toys%2C+baseball+games%2C+baseball+toys%2C+basketball+games%2C+sports+crafts%2C+football+games%2Cbasketball+games%2C+kids+games%2C+family+games%2C+office+games%2C+office+toys%2C+dorm+room+games%2C+dorm+room+toys';
var metaContents  = 'Sports+toys+for+all+ages+play+anytime+and+place+with+the+SportsRing%2C+SportsHoop+and+SR+Dart+Game+products';
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();
};
