/* [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 POS_TARGET=8;
var theSitetree=[ 
	['PAGE','701',jdecode('Home'),jdecode(''),'/701.html','true',[],'',''],
	['PAGE','51812',jdecode('Weather+News'),jdecode(''),'/51812.html','true',[],'',''],
	['PAGE','42912',jdecode('Gift+Certificates'),jdecode(''),'/42912.html','true',[],'',''],
	['PAGE','39612',jdecode('NEWS....NEWS...NEWS++'),jdecode(''),'/39612.html','true',[],'',''],
	['PAGE','18701',jdecode('BLOOD+DRIVE++'),jdecode(''),'/18701.html','true',[],'',''],
	['PAGE','30901',jdecode('DONATIONS'),jdecode(''),'/30901.html','true',[],'',''],
	['PAGE','18722',jdecode('Phlebotomy+Schedule'),jdecode(''),'/18722.html','true',[],'',''],
	['PAGE','752',jdecode('About+us'),jdecode(''),'/752.html','true',[],'',''],
	['PAGE','57423',jdecode('Training+Classes'),jdecode(''),'/57423/index.html','true',[ 
		['PAGE','57723',jdecode('Training%2FPhlebotomy'),jdecode(''),'/57423/57723.html','true',[],'',''],
		['PAGE','57744',jdecode('Training%2FEKG'),jdecode(''),'/57423/57744.html','true',[],'','']
	],'',''],
	['PAGE','773',jdecode('Services'),jdecode(''),'/773/index.html','true',[ 
		['PAGE','836',jdecode('DNA+Parentage'),jdecode(''),'/773/836.html','true',[],'',''],
		['PAGE','6601',jdecode('Drug%2FAlcohol+Testing'),jdecode(''),'/773/6601.html','true',[],'','']
	],'',''],
	['PAGE','94123',jdecode('Externships%2FPhlebotomy'),jdecode(''),'/94123.html','true',[],'',''],
	['PAGE','857',jdecode('Tee+Shirts+%26+Monthly+Specials'),jdecode(''),'/857/index.html','true',[ 
		['PAGE','11501',jdecode('DNA+Special'),jdecode(''),'/857/11501.html','true',[],'','']
	],'',''],
	['PAGE','878',jdecode('Jobs'),jdecode(''),'/878.html','true',[],'',''],
	['PAGE','47712',jdecode('Volunteer+Services'),jdecode(''),'/47712.html','true',[],'',''],
	['PAGE','48912',jdecode('Textbook'),jdecode(''),'/48912.html','true',[],'',''],
	['PAGE','899',jdecode('Contact'),jdecode(''),'/899.html','true',[],'',''],
	['PAGE','42933',jdecode('NHA'),jdecode(''),'/42933.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1760';
theSitetree.keyvisualName='student.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1760',
				keyvisualName: 	'student.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51812',
internalId:  '',
customField: '20100713-202006'
};
webappMappings['1501']=webappMappings['1501-113476']={
webappId:    '1501',
documentId:  '701',
internalId:  '113476',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20100306-161151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42912',
internalId:  '',
customField: '20080103-124650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39612',
internalId:  '',
customField: '20100713-202316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18701',
internalId:  '',
customField: '20100306-163014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30901',
internalId:  '',
customField: '20100313-144344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18722',
internalId:  '',
customField: '20100613-131229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20100519-181049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57423',
internalId:  '',
customField: '20100430-221401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57723',
internalId:  '',
customField: '20100601-211857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57744',
internalId:  '',
customField: '20100508-131435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20091229-095922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '836',
internalId:  '',
customField: '20090522-082402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20070625-113545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94123',
internalId:  '',
customField: '20100508-163248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '857',
internalId:  '',
customField: '20070810-213042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20100713-202513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '878',
internalId:  '',
customField: '20070620-012040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47712',
internalId:  '',
customField: '20080518-014437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48912',
internalId:  '',
customField: '20100104-140116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '899',
internalId:  '',
customField: '20100601-211954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42933',
internalId:  '',
customField: '20100601-212336'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INX27W';
var companyName   = 'TRI-STATE+MEDICAL';
var htmlTitle	  = 'Tri-State+Training+Testing+Service';
var metaKeywords  = 'phlebotomy%2C+Phlebotomist%2C+blood+drawing.+DNA%2C+paternity%2C+drug+testing%2C+alcohol+testing%2C+medical%2C+training%2C+testing%2C+Port+Jervis%2C+New+York%2C+EKG%2C+analysis';
var metaContents  = 'phlebotomy+training%2C+dna+analysis%2C+EKG+training%2C+drugs%2C+drug+testing%2C+DOT%2C+NON+DOT%2C+alcohol+testing%2C+urine+test%2C+blood+drawing%2C+training%2C+certified%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();
};
