/* [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','1001',jdecode('Home'),jdecode(''),'/1001.html','true',[],'',''],
	['PAGE','6401',jdecode('About+AIW'),jdecode(''),'/6401/index.html','true',[ 
		['PAGE','6464',jdecode('Company+Directory'),jdecode(''),'/6401/6464.html','true',[],'','']
	],'',''],
	['PAGE','6485',jdecode('Departments'),jdecode(''),'/6485/index.html','true',[ 
		['PAGE','6506',jdecode('Estimating'),jdecode(''),'/6485/6506.html','true',[],'',''],
		['PAGE','6527',jdecode('Engineering'),jdecode(''),'/6485/6527.html','true',[],'',''],
		['PAGE','6548',jdecode('Production'),jdecode(''),'/6485/6548.html','true',[],'',''],
		['PAGE','6569',jdecode('Field+Ops'),jdecode(''),'/6485/6569.html','true',[],'',''],
		['PAGE','18501',jdecode('Sales'),jdecode(''),'/6485/18501.html','true',[],'','']
	],'',''],
	['PAGE','6590',jdecode('Projects'),jdecode(''),'/6590.html','true',[],'',''],
	['PAGE','6611',jdecode('Pressroom'),jdecode(''),'/6611.html','true',[],'',''],
	['PAGE','6632',jdecode('Contact+Us'),jdecode(''),'/6632/index.html','true',[ 
		['PAGE','21201',jdecode('Feedback'),jdecode(''),'/6632/21201/index.html','true',[ 
			['PAGE','21901',jdecode('Feedback+%28follow+up+page%29'),jdecode(''),'/6632/21201/21901.html','false',[],'','']
		],'',''],
		['PAGE','20801',jdecode('Directions'),jdecode(''),'/6632/20801.html','true',[],'','']
	],'',''],
	['PAGE','38901',jdecode('Sub+Contractors'),jdecode(''),'/38901.html','true',[],'',''],
	['PAGE','42501',jdecode('Employment+Opportunities'),jdecode(''),'/42501.html','true',[],'',''],
	['PAGE','44901',jdecode('Inventory'),jdecode(''),'/44901.html','true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Kreis';
theSitetree.paletteFamily='D24C59';
theSitetree.keyvisualId='594';
theSitetree.keyvisualName='industrie.jpg';
theSitetree.fontsetId='125';
theSitetree.graphicsetId='143';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Kreis',
				paletteFamily: 	'D24C59',
				keyvisualId: 	'594',
				keyvisualName: 	'industrie.jpg',
				fontsetId: 		'125',
				graphicsetId: 	'143',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'D24C59',
				b_color: 		'F877A1',
				c_color: 		'000000',
				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:  '1001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1001',
internalId:  '',
customField: '20090227-071414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6485',
internalId:  '',
customField: '20061129-111019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6569',
internalId:  '',
customField: '20080722-141632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44901',
internalId:  '',
customField: '20090227-071525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6632',
internalId:  '',
customField: '20061129-112314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20070311-165028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6464',
internalId:  '',
customField: '20090827-073048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42501',
internalId:  '',
customField: '20100518-135936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6611',
internalId:  '',
customField: '20070321-190121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6506',
internalId:  '',
customField: '20080722-142307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6527',
internalId:  '',
customField: '20090827-073535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6548',
internalId:  '',
customField: '20061204-200427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18501',
internalId:  '',
customField: '20100518-134619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6590',
internalId:  '',
customField: '20100518-135838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21201',
internalId:  '',
customField: '20061129-150210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21901',
internalId:  '',
customField: '20061129-150046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20801',
internalId:  '',
customField: '20061203-203539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38901',
internalId:  '',
customField: '20100803-214816'
};
webappMappings['7008']=webappMappings['7008-8180']={
webappId:    '7008',
documentId:  '21201',
internalId:  '8180',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050IN2CNQ';
var companyName   = 'Arlington+Iron+Works%2C+Inc.';
var htmlTitle	  = 'Arlington+Iron+Works%2C+Inc.';
var metaKeywords  = 'Arlington+Iron+Works%2C+Inc.++Arlington+Iron+Works++Arlington+Iron++AIW++aiw++steel++steel+supply';
var metaContents  = 'Arlington+Iron+Works%2C+Inc.++located+in+Manassas%2C+VA.++Specializing+in+Steel+Fabricating%2C+and+Structural+Steel+Fabrication.++Call+%28703%29+368-3193';
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();
};
