/* [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','1912',jdecode('Home'),jdecode(''), jdecode('%2F1912.html'), 'true',[],'',''],
	['PAGE','2012',jdecode('News'),jdecode(''), jdecode('%2F2012.html'), 'true',[],'',''],
	['PAGE','2033',jdecode('Services'),jdecode(''), jdecode('%2F2033.html'), 'true',[],'',''],
	['PAGE','2054',jdecode('FAQS'),jdecode(''), jdecode('%2F2054.html'), 'true',[],'',''],
	['PAGE','2075',jdecode('About+us'),jdecode(''), jdecode('%2F2075%2Findex.html'), 'true',[ 
		['PAGE','2096',jdecode('Our+team'),jdecode(''), jdecode('%2F2075%2F2096.html'), 'true',[],'',''],
		['PAGE','2117',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F2075%2F2117.html'), 'true',[],'','']
	],'',''],
	['PAGE','2138',jdecode('Feedback'),jdecode(''), jdecode('%2F2138.html'), 'true',[],'',''],
	['PAGE','2912',jdecode('Links'),jdecode(''), jdecode('%2F2912.html'), 'true',[],'',''],
	['PAGE','4312',jdecode('Downloads'),jdecode(''), jdecode('%2F4312.html'), 'true',[],'',''],
	['PAGE','8112',jdecode('Products'),jdecode(''), jdecode('%2F8112.html'), 'true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Grace';
theSitetree.paletteFamily='FBB044';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32049';
theSitetree.graphicsetId='13869';
theSitetree.contentColor='484848';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp19-dulles',
  product: 'WSCSYSSSSLYTCPI5'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Grace',
				paletteFamily: 	'FBB044',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32049',
				graphicsetId: 	'13869',
				contentColor: 	'484848',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-28879']={
webappId:    '7008',
documentId:  '2138',
internalId:  '28879',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1912',
internalId:  '',
customField: '20120121-160805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2912',
internalId:  '',
customField: '20120206-084302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2012',
internalId:  '',
customField: '20120208-111115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2033',
internalId:  '',
customField: '20120208-233645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2054',
internalId:  '',
customField: '20120208-233710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2075',
internalId:  '',
customField: '20120121-140136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2096',
internalId:  '',
customField: '20120121-202530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2117',
internalId:  '',
customField: '20120121-161143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2138',
internalId:  '',
customField: '20120121-140528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4312',
internalId:  '',
customField: '20120209-205543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8112',
internalId:  '',
customField: '20120208-162026'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1912',
internalId:  '1006',
customField: '1006'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I79RTL';
var companyName   = 'Cleanroom+Consulting%2C+LLC';
var htmlTitle	  = 'Cleanroom+Consulting';
var metaKeywords  = 'Dallas%2C+Texas%2C+Fort+Worth%2C+FMEA%2C+PFMEA%2C+DFMEA%2C+CSEA%2C+DETECTION%2C+SEVERITY%2C+clean%2C+OCCURANCE%2C+FAILURE%2C+FAILURE+MODE%2C+RPN%2C+KAIZEN%2C+RISK+PRIORITY+NUMBER%2C+CLESTRA%2C+CLEANROOMS%2C+CLEANROOM%2C+contract+services%2C+CONTAMINATION%2C+CONTROL%2C+DESIGN%2C+CONCEPTUAL%2C+IEST%2C+ISPE%2C+PHARMACEUTICAL%2C+BIOTECH%2C+HIGH+TECH+FACILITIES%2C+SEMICONDUCTOR%2C+VALUE+STREAM%2C+ACTION+LOG%2C+ACTION+REGISTER%2C+MICROELECTRONICS%2C+MODULAR%2C+PORTABLE%2C+PARTICLES%2C+PARTICULATE%2C+LAMINAR+FLOW%2C+UNIDIRECTIONAL+FLOW%2C+CONSULTING%2C+CONSULTANTS%2C+OUTSOURCING%2C+CONTRACT+MANUFACTURING%2C+NANOTECHNOLOGY%2C+NANOFABRICATION%2C+FOD%2C+FOE%2C+Foreign+Object+%2C+medical+device%2C+biotechnology%2C+nano-bio%2C+optics%2C+electronics%2C+packaging%2C+cleanliness%2C+verification%2C+certification%2C+testing';
var metaContents  = 'WWW.CLEANROOM-CONSULTING.COM%2C+Contamination+Control+Audits%2C+New+Cleanroom+Products%2C+Project+Planning%2C+Basis+of+Design%2C+Cleanroom+Conceptual+Designs%2C+Applications+Engineering%2C+Process+Isolation%2C+Mini+Environments%2C+Construction+Claims+Arbitration';
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();
};

