/* [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','4601',jdecode('Home'),jdecode(''),'/4601.html','true',[],''],
	['PAGE','4715',jdecode('About+Us'),jdecode(''),'/4715.html','true',[],''],
	['PAGE','4673',jdecode('Consulting'),jdecode(''),'/4673.html','true',[],''],
	['PAGE','4694',jdecode('Training'),jdecode(''),'/4694.html','true',[],''],
	['PAGE','4652',jdecode('Articles'),jdecode(''),'/4652/index.html','true',[ 
		['PAGE','10301',jdecode('Preplanning+a+crime+scene'),jdecode(''),'/4652/10301.html','false',[],'']
	],''],
	['PAGE','9901',jdecode('Associates'),jdecode(''),'/9901.html','true',[],''],
	['PAGE','9922',jdecode('Quik-Grid'),jdecode(''),'/9922.html','true',[],''],
	['PAGE','19101',jdecode('Contact+us'),jdecode(''),'/19101.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4601',
internalId:  '',
customField: '20100219-154019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4652',
internalId:  '',
customField: '20100219-124212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4673',
internalId:  '',
customField: '20100219-070142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4694',
internalId:  '',
customField: '20100219-133348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4715',
internalId:  '',
customField: '20100219-062350'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20100219-050312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20100220-102635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9922',
internalId:  '',
customField: '20100220-102334'
};
webappMappings['7008']=webappMappings['7008-25982']={
webappId:    '7008',
documentId:  '19101',
internalId:  '25982',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20100219-063030'
};
webappMappings['1501']=webappMappings['1501-27651307']={
webappId:    '1501',
documentId:  '4601',
internalId:  '27651307',
customField: '1501'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INLKWN';
var companyName   = 'Crime+Scene+Specialists%2C+Inc.+';
var htmlTitle	  = 'Forensic+Consulting+and+Training';
var metaKeywords  = 'Accident+reconstruction%2C+crime+scene%2C+latent+print+examiner%2C+fingerprint%2C+fire+investigator%2C+arson%2C+hoarding%2C+expert+witness%2C+bloodstain%2C+evidence+processing%2C+crime+clean+up%2C+bio+hazard%2C+consulting%2C+consultant%2C+police%2C+forensic%2C+quick+grid%2C+Quik-Grid%2C+crime+scene+grid%2C+investigation%2C+attorney%2C+case+review%2C+IAI%2C+accident%2C+accidents%2C+reconstructions%2C+reconstructionists%2Cgrid%2C+grids%2C+quik%2C+blood%2C+stain%2C+bloody%2C+stains%2C+law%2C+law+enforce%2C+law+enforcement%2C+forensics%2C+crime%2C+scene%2C+scenes%2C+fire%2C+investigations%2C+investigate%2C+investigators%2C+investigator%2C+clean-up%2C+clean%2C+crime%2C+training%2C+court+testimony%2C+spatter%2C+stain%2C+bloodspatter%2C+bio-hazard%2C+bio-hazardous%2C+hazardous%2C+court%2C+expert%2C+expert+witness%2C+witness%2C+testify%2C+testimony%2C+expert+testimony%2C+crime+consultant%2C+crash%2C+crash+reconstruction%2C+accident%2C+accidents%2C+investigation%2C+expert+witness+testimony%2C+articles%2C+forensic+articles%2C+crime+scene+articles%2C+membership%2C+associations%2C+associates%2C+criminal%2C+criminalistics%2C+specialists%2C+crime+scene+specialists%2C+trajectory%2C+trajectory+analysis%2C+analysis%2C+analize%2C+medical%2C+examiner%2C+medical+examiner%2C+shoot%2C+shooting%2C+shooting+scene%2C+shooting+scene+reconstruction%2C+writer%2C+publish%2C+published%2C+written%2C+buried%2C+bodies%2C+body%2C+buried+bodies%2C+skeletons%2C+skeleton%2C+skeletal%2C+skeletal+remains%2C+remains%2C+grave%2C+graves%2C+surface+skeletons%2C+scattered+remains%2C+scattered+skeletal+remains%2C+FDIAI%2C+IAI%2C+FACS%2C+theFACS%2C+CBDIAI%2C+CSI%2C+gizmos%2C+csigizmos%2C+laser%2C+lasers%2C+laser+trajectory%2C+laser+trajectory+analysis%2C+arson+investigation%2C+arson+reconstruction%2C+fluids%2C+body+fluids%2C+gun%2C+guns%2C+gunshot%2C+gunshots%2C+residue%2C+gunshot+residue%2C+forensic+training%2C+crime+trainer%2C+crime+scene+training%2C+';
var metaContents  = 'Forensic+Consulting+and+Training%2C+crime+scene+training%2C+crime+scene+consulting%2C+forensic+consulting%2C+forensic+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();
};
