/* [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','94',jdecode('Administration+Department'),jdecode(''),'/94/index.html','true',[ 
		['PAGE','103',jdecode('Active+Soldiers'),jdecode(''),'/94/103.html','true',[],'']
	],''],
	['PAGE','184',jdecode('Code+of+Conduct'),jdecode(''),'/184.html','true',[],''],
	['PAGE','73',jdecode('Headquarters'),jdecode(''),'/73.html','true',[],''],
	['PAGE','1437',jdecode('LOGISTICS+Division'),jdecode(''),'/1437.html','true',[],''],
	['PAGE','12083',jdecode('ELITE+SNIPERS+Division'),jdecode(''),'/12083.html','true',[],''],
	['PAGE','12012',jdecode('SPECIAL+FORCES+Division'),jdecode(''),'/12012.html','true',[],''],
	['PAGE','12071',jdecode('HEAVY+WEAPONS+Division'),jdecode(''),'/12071.html','true',[],''],
	['PAGE','6807',jdecode('AIRBORN+RANGERS+Division'),jdecode(''),'/6807.html','true',[],''],
	['PAGE','8308',jdecode('Join+ALPHA+Company%21'),jdecode(''),'/8308/index.html','true',[ 
		['PAGE','8368',jdecode('Application%21+%28follow+up+page%29'),jdecode(''),'/8308/8368.html','true',[],'']
	],''],
	['PAGE','112',jdecode('Signal+Corp.'),jdecode(''),'/112/index.html','true',[ 
		['PAGE','121',jdecode('Contact+Us'),jdecode(''),'/112/121.html','true',[],''],
		['PAGE','130',jdecode('Friendlies'),jdecode(''),'/112/130.html','true',[],'']
	],''],
	['PAGE','107101',jdecode('ALPHA+Company+Training'),jdecode(''),'/107101.html','true',[],''],
	['PAGE','37417',jdecode('Log+Book'),jdecode(''),'/37417/index.html','true',[ 
		['PAGE','37416',jdecode('Read+Log+Book'),jdecode(''),'/37417/37416.html','true',[],'']
	],''],
	['PAGE','110001',jdecode('News'),jdecode(''),'/110001.html','true',[],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='003390';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='293';
theSitetree.graphicsetId='353';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='003390';
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'003390',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'293',
				graphicsetId: 	'353',
				contentColor: 	'DDDDDD',
				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:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '73',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-116286']={
webappId:    '1501',
documentId:  '73',
internalId:  '116286',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-37416ahw050inx2t5']={
webappId:    '1002',
documentId:  '37416',
internalId:  '37416ahw050inx2t5',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110001',
internalId:  '',
customField: '20091206-164041'
};
webappMappings['7060']=webappMappings['7060-db267dd16d976a91dd59d8df8f4c759f']={
webappId:    '7060',
documentId:  '1437',
internalId:  'db267dd16d976a91dd59d8df8f4c759f',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107101',
internalId:  '',
customField: '20090928-215204'
};
webappMappings['1001']=webappMappings['1001-ahw050inx2t5d5b3915480a81c73']={
webappId:    '1001',
documentId:  '8308',
internalId:  'ahw050inx2t5d5b3915480a81c73',
customField: ''
};
webappMappings['1001']=webappMappings['1001-ahw050inx2t5d5b3915480a81c73']={
webappId:    '1001',
documentId:  '8368',
internalId:  'ahw050inx2t5d5b3915480a81c73',
customField: 'followUp'
};
webappMappings['7060']=webappMappings['7060-d65ad051b75bbb20ef8a02d8675141db']={
webappId:    '7060',
documentId:  '12083',
internalId:  'd65ad051b75bbb20ef8a02d8675141db',
customField: 'language:en;country:US;'
};
webappMappings['1003']=webappMappings['1003-ahw050inx2t5125d6edc1a7']={
webappId:    '1003',
documentId:  '107101',
internalId:  'ahw050inx2t5125d6edc1a7',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73',
internalId:  '',
customField: '20091228-153451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37417',
internalId:  '',
customField: '20090829-141055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37416',
internalId:  '',
customField: '20091219-134107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94',
internalId:  '',
customField: '20090516-010804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103',
internalId:  '',
customField: '20091228-125910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '184',
internalId:  '',
customField: '20091228-130151'
};
webappMappings['7060']=webappMappings['7060-44f9ab8c2581772f1f4bf7408ccace47']={
webappId:    '7060',
documentId:  '12012',
internalId:  '44f9ab8c2581772f1f4bf7408ccace47',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112',
internalId:  '',
customField: '20091228-134227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121',
internalId:  '',
customField: '20091228-134408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '130',
internalId:  '',
customField: '20091228-134525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6807',
internalId:  '',
customField: '20091020-221201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1437',
internalId:  '',
customField: '20091219-143250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12083',
internalId:  '',
customField: '20091228-133854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12012',
internalId:  '',
customField: '20091020-220952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12071',
internalId:  '',
customField: '20091020-221033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8308',
internalId:  '',
customField: '20090609-004256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8368',
internalId:  '',
customField: '20090609-004200'
};
webappMappings['7060']=webappMappings['7060-f3fd5e456b4041c89256a9da0e563fd6']={
webappId:    '7060',
documentId:  '12071',
internalId:  'f3fd5e456b4041c89256a9da0e563fd6',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-b6c1bf0dba582c6d4abe10ff60553f2c']={
webappId:    '7060',
documentId:  '6807',
internalId:  'b6c1bf0dba582c6d4abe10ff60553f2c',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INX2T5';
var companyName   = 'Defense+Intelligence+Agency';
var htmlTitle	  = 'OVIcomm';
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();
};
