/* [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','701',jdecode('Home'),jdecode(''),'/701.html','true',[],''],
	['PAGE','773',jdecode('-Gracie+Jiu-Jitsu'),jdecode(''),'/773.html','true',[],''],
	['PAGE','752',jdecode('-Boxing'),jdecode(''),'/752.html','true',[],''],
	['PAGE','794',jdecode('-Karate'),jdecode(''),'/794.html','true',[],''],
	['PAGE','14901',jdecode('-Kali'),jdecode(''),'/14901.html','true',[],''],
	['PAGE','37601',jdecode('-MMA+BootCamp'),jdecode(''),'/37601.html','true',[],''],
	['PAGE','836',jdecode('Contact+Us'),jdecode(''),'/836/index.html','true',[ 
		['PAGE','8801',jdecode('Contact+Information+%28follow+up+page%29'),jdecode(''),'/836/8801.html','false',[],'']
	],''],
	['PAGE','7106',jdecode('Guestbook'),jdecode(''),'/7106/index.html','true',[ 
		['PAGE','7101',jdecode('Read+Guestbook'),jdecode(''),'/7106/7101.html','false',[],'']
	],''],
	['PAGE','7201',jdecode('Map'),jdecode(''),'/7201.html','true',[],''],
	['PAGE','857',jdecode('Links'),jdecode(''),'/857.html','true',[],'']];
var siteelementCount=12;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='003390';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='353';
theSitetree.contentColor='70A3FF';
theSitetree.contentBGColor='003390';
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'003390',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'353',
				contentColor: 	'70A3FF',
				contentBGColor: '003390',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'003390',
				b_color: 		'000000',
				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['1001']=webappMappings['1001-ahw050in3khq11b31ef6435']={
webappId:    '1001',
documentId:  '836',
internalId:  'ahw050in3khq11b31ef6435',
customField: ''
};
webappMappings['1001']=webappMappings['1001-ahw050in3khq11b31ef6435']={
webappId:    '1001',
documentId:  '8801',
internalId:  'ahw050in3khq11b31ef6435',
customField: 'followUp'
};
webappMappings['1501']=webappMappings['1501-1251367']={
webappId:    '1501',
documentId:  '701',
internalId:  '1251367',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-7106ahw050in3khq']={
webappId:    '1002',
documentId:  '7106',
internalId:  '7106ahw050in3khq',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20091113-181209'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '7201',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14901',
internalId:  '',
customField: '20100107-213930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20100107-213655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '794',
internalId:  '',
customField: '20100107-213829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20100107-213624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37601',
internalId:  '',
customField: '20091120-223013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '836',
internalId:  '',
customField: '20080717-115343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7106',
internalId:  '',
customField: '20080717-115431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7201',
internalId:  '',
customField: '20080717-004250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '857',
internalId:  '',
customField: '20091214-082812'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8801',
internalId:  '',
customField: '20080717-115157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7101',
internalId:  '',
customField: '20080717-002718'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3KHQ';
var companyName   = 'Railside+Mixed+Martial+Arts';
var htmlTitle	  = 'Railside+Mixed+Martial+Arts+Club';
var metaKeywords  = 'boxing+brazilian+jiu-jitsu+bjj+grappling+karate+kuroshi-do+jiu-jitsu+japanes+jiu-jitsu+ju-jutsu+brazilian+ju-jutsu+ju-jitsu+brazilian+ju-jitsu+fitness+work+out+club+gym+rockland+county+ny+new+york+congers+kali+philippino+martial+arts+gracie+jiu-jitsu+gracie+jiu+jitsu';
var metaContents  = 'Gracie+Jiu-Jitsu%2C+Kuroshi-Do+Karate%2C+Kali+and+Boxing+all+in+one+mixed+martial+arts+school+right+here+in+Congers%2C+NY%21++Gracie+Jiu-Jitsu+is+the+Heart+of+MMA%21+Kuroshi-Do+is+a+full+contact+Karate%21+Kali+is+an+edged+and+impact+weapon+style%21+';
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();
};
