/* [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','501',jdecode('Home'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','15201',jdecode('Drug+Testing+Services'),jdecode(''), jdecode('%2F15201%2Findex.html'), 'true',[ 
		['PAGE','15501',jdecode('Employer+Solutions'),jdecode(''), jdecode('%2F15201%2F15501.html'), 'true',[],'',''],
		['PAGE','16701',jdecode('Mandated+Testing'),jdecode(''), jdecode('%2F15201%2F16701.html'), 'true',[],'',''],
		['PAGE','15543',jdecode('Court+Ordered'),jdecode(''), jdecode('%2F15201%2F15543.html'), 'true',[],'','']
	],'',''],
	['PAGE','37745',jdecode('TestCollect'),jdecode(''), jdecode('%2F37745.html'), 'true',[],'',''],
	['PAGE','42880',jdecode('eScreen'),jdecode(''), jdecode('%2F42880.html'), 'true',[],'',''],
	['PAGE','615',jdecode('On-Line+Access'),jdecode(''), jdecode('%2F615.html'), 'true',[],'',''],
	['PAGE','41480',jdecode('Substance+Analysis'),jdecode(''), jdecode('%2F41480.html'), 'true',[],'',''],
	['PAGE','26501',jdecode('Expert+Testimony'),jdecode(''), jdecode('%2F26501.html'), 'true',[],'',''],
	['PAGE','10601',jdecode('Background+Checks'),jdecode(''), jdecode('%2F10601.html'), 'true',[],'',''],
	['PAGE','11801',jdecode('Regulations'),jdecode(''), jdecode('%2F11801.html'), 'true',[],'',''],
	['PAGE','573',jdecode('About+us'),jdecode(''), jdecode('%2F573%2Findex.html'), 'true',[ 
		['PAGE','552',jdecode('The+Team'),jdecode(''), jdecode('%2F573%2F552.html'), 'true',[],'',''],
		['PAGE','22501',jdecode('Sign+Up+Now'),jdecode(''), jdecode('%2F573%2F22501.html'), 'true',[],'','']
	],'',''],
	['PAGE','678',jdecode('Contact+Us'),jdecode(''), jdecode('%2F678%2Findex.html'), 'true',[ 
		['PAGE','43401',jdecode('Fremont'),jdecode(''), jdecode('%2F678%2F43401.html'), 'true',[],'',''],
		['PAGE','46180',jdecode('Fremont+Hours'),jdecode(''), jdecode('%2F678%2F46180.html'), 'false',[],'',''],
		['PAGE','43380',jdecode('Lakeport'),jdecode(''), jdecode('%2F678%2F43380.html'), 'true',[],'',''],
		['PAGE','46201',jdecode('Lakeport+Hours'),jdecode(''), jdecode('%2F678%2F46201.html'), 'false',[],'',''],
		['PAGE','44380',jdecode('Martinez'),jdecode(''), jdecode('%2F678%2F44380.html'), 'true',[],'',''],
		['PAGE','46222',jdecode('Martinez+Hours'),jdecode(''), jdecode('%2F678%2F46222.html'), 'false',[],'','']
	],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='AC2323';
theSitetree.keyvisualId='1757';
theSitetree.keyvisualName='medizin.jpg';
theSitetree.fontsetId='291';
theSitetree.graphicsetId='356';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='AC2323';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLY0X9RC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'AC2323',
				keyvisualId: 	'1757',
				keyvisualName: 	'medizin.jpg',
				fontsetId: 		'291',
				graphicsetId: 	'356',
				contentColor: 	'FFFFFF',
				contentBGColor: 'AC2323',
				a_color: 		'AC2323',
				b_color: 		'480F0F',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41480',
internalId:  '',
customField: '20110429-145257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37745',
internalId:  '',
customField: '20111025-013505'
};
webappMappings['7008']=webappMappings['7008-5982']={
webappId:    '7008',
documentId:  '678',
internalId:  '5982',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20120119-222740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20110307-163532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15501',
internalId:  '',
customField: '20100928-071515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16701',
internalId:  '',
customField: '20111019-174712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15543',
internalId:  '',
customField: '20120119-231027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20111019-173733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26501',
internalId:  '',
customField: '20100928-072255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10601',
internalId:  '',
customField: '20120119-230747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11801',
internalId:  '',
customField: '20110613-120736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20111117-160249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20111014-152730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22501',
internalId:  '',
customField: '20070724-132039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '678',
internalId:  '',
customField: '20120119-222834'
};
webappMappings['1501']=webappMappings['1501-5549720']={
webappId:    '1501',
documentId:  '501',
internalId:  '5549720',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42880',
internalId:  '',
customField: '20111019-172533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43380',
internalId:  '',
customField: '20111118-135657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43401',
internalId:  '',
customField: '20111118-135443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44380',
internalId:  '',
customField: '20120119-223004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46180',
internalId:  '',
customField: '20120119-225859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46201',
internalId:  '',
customField: '20120119-230054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46222',
internalId:  '',
customField: '20120119-225952'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INL1B5';
var companyName   = 'No+Drugs+Incorporated';
var htmlTitle	  = 'California+Drug+Testing+Taxi+DOT+Hair+Urine+Breath+Alcohol+Family+Court';
var metaKeywords  = 'California+Drug+Test%2C+Drug+%26+Alcohol+Testing%2C+Drug+Testing+Services%2C+hair+testing%2C+Taxi+Drug+test%2C+PUC+Drug+Testing%2C+DOT+Drug+Testing%2C+Drug+test+Collection%2C+specimen+collection%2C+Fremont+Drug+Test%2C+On-site+testing%2C+Controlled+substance+abuse+testing%2C+Random+consortium%2C+DNA+Paternity+Testing%2C+Urine+Test%2C+Hair+Analysis';
var metaContents  = 'No+Drugs%2C+Inc.+Drug+%26+Alcohol+testing+services+';
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();
};

