/* [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','7801',jdecode('Home'),jdecode(''), jdecode('%2F7801.html'), 'true',[],'',''],
	['PAGE','8001',jdecode('Assembly'),jdecode(''), jdecode('%2F8001.html'), 'true',[],'',''],
	['PAGE','8043',jdecode('Converting'),jdecode(''), jdecode('%2F8043.html'), 'true',[],'',''],
	['PAGE','8085',jdecode('Fabricating'),jdecode(''), jdecode('%2F8085.html'), 'true',[],'',''],
	['PAGE','8127',jdecode('Fixtures'),jdecode(''), jdecode('%2F8127.html'), 'true',[],'',''],
	['PAGE','8169',jdecode('Motion+Control'),jdecode(''), jdecode('%2F8169.html'), 'true',[],'',''],
	['PAGE','8211',jdecode('Packaging'),jdecode(''), jdecode('%2F8211.html'), 'true',[],'',''],
	['PAGE','8253',jdecode('Special+Machines'),jdecode(''), jdecode('%2F8253.html'), 'true',[],'',''],
	['PAGE','8295',jdecode('About+us'),jdecode(''), jdecode('%2F8295.html'), 'true',[],'',''],
	['PAGE','8358',jdecode('Contact'),jdecode(''), jdecode('%2F8358.html'), 'true',[],'',''],
	['PAGE','9101',jdecode('References'),jdecode(''), jdecode('%2F9101.html'), 'true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Madison';
theSitetree.paletteFamily='9E81E2';
theSitetree.keyvisualId='3477';
theSitetree.keyvisualName='kv_3477.jpg';
theSitetree.fontsetId='10699';
theSitetree.graphicsetId='10779';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
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: 			'Madison',
				paletteFamily: 	'9E81E2',
				keyvisualId: 	'3477',
				keyvisualName: 	'kv_3477.jpg',
				fontsetId: 		'10699',
				graphicsetId: 	'10779',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'9e81e2',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'9E81E2',
				e_color: 		'ACABAB',
				f_color: 		'626161',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20111228-115544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7801',
internalId:  '',
customField: '20111214-112742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8043',
internalId:  '',
customField: '20111221-130957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8085',
internalId:  '',
customField: '20111228-124434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8127',
internalId:  '',
customField: '20111228-115001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8169',
internalId:  '',
customField: '20111221-131249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8211',
internalId:  '',
customField: '20111228-124706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8253',
internalId:  '',
customField: '20111228-114119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9101',
internalId:  '',
customField: '20111228-125142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8295',
internalId:  '',
customField: '20111228-113259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8358',
internalId:  '',
customField: '20111228-112946'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '7801',
internalId:  '1006',
customField: '1006'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I7CXKI';
var companyName   = 'Pro+Techmation%2C+Inc';
var htmlTitle	  = 'Pro+Techmation%2C+Inc.-Custom+Machines+and+Automation+Control+Integration';
var metaKeywords  = 'adhesive%2C+applicator%2C+assembly%2C+automation%2C+build%2C+consulting%2C+control+systems%2C+design%2C+dispenser%2C+drilling+machine%2C+engineer%2C+engineered%2C+equipment%2C+fabricating%2C+fixtures%2C+heater%2C+industrial%2C+infrared%2C+integration%2C+jigs%2C+machines%2C+assembly+machine%2C+automation+machine%2C+coating+machine%2C+converting+machine%2C+folding+machine%2C+gluing+machine%2C+labeling+machine%2C+material+handling+machine%2C+packaging+machine%2C+paper+board+machine%2C+processing+machine%2C+special+machine%2C+mechanical%2C+metering%2C+motion+control%2C+drying+oven%2C+PLC+control%2C+pneumatic%2C+postioning%2C+hydraulic+press%2C+process%2C+programmable%2C+prototype%2C+sealer%2C+servo%2C+servomechanism%2C+system%2C+system+integration%2C+rotary+index+table%2C+lift+table%2C+turntable%2C+ultraviolet';
var metaContents  = 'Innovative+engineering+creations+to+solve+your+manufacturing+and+converting+needs+by+efficiently+delivering+you+quality+products.';
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();
};

