/* [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','801',jdecode('Home'),jdecode(''), jdecode('%2F801.html'), 'true',[],'',''],
	['PAGE','852',jdecode('About+us'),jdecode(''), jdecode('%2F852.html'), 'true',[],'',''],
	['PAGE','873',jdecode('Contact'),jdecode(''), jdecode('%2F873.html'), 'true',[],'','']];
var siteelementCount=3;
theSitetree.topTemplateName='Success';
theSitetree.paletteFamily='0F3D78';
theSitetree.keyvisualId='1645';
theSitetree.keyvisualName='transport.jpg';
theSitetree.fontsetId='265';
theSitetree.graphicsetId='331';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F1F1F1';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'enom',
  product: 'WSCENOSSSLYTC21A'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Success',
				paletteFamily: 	'0F3D78',
				keyvisualId: 	'1645',
				keyvisualName: 	'transport.jpg',
				fontsetId: 		'265',
				graphicsetId: 	'331',
				contentColor: 	'000000',
				contentBGColor: 'F1F1F1',
				a_color: 		'0F3D78',
				b_color: 		'F9AC26',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20110312-164659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '852',
internalId:  '',
customField: '20100503-154028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '873',
internalId:  '',
customField: '20081231-124756'
};
var webAppHostname = 'wsc.ehost-services.com:80';
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN010INLWRE';
var companyName   = '+C+H+I+C+A+G+O+.+.++ENTER';
var htmlTitle	  = 'CHICAGO+ENTER+%21+%28ChicagoEnter.com%29++UTS+-+%3F%3F+%3F%3F%3F+%3F%3F%3F%3F';
var metaKeywords  = '%EC%8B%9C%EC%B9%B4%EA%B3%A0+%EC%B5%9C%EA%B3%A0%EC%9D%98+%EB%AC%BC%EB%A5%98+%ED%8F%AC%ED%84%B8%EC%84%9C%EB%B9%84%EC%8A%A4+%28+ChicagoEnter.com%29++UTS+%EC%8B%9C%EC%B9%B4%EA%B3%A0+%ED%95%9C%EA%B5%AD%ED%83%9D%EB%B0%B0++++%EB%A9%8B%EC%9E%88%EB%8A%94+%EB%8F%84%EC%8B%9C%2C+%ED%9B%8C%EB%A5%AD%ED%95%9C+%EB%8F%84%EC%8B%9C+%EC%8B%9C%EC%B9%B4%EA%B3%A0%EB%A5%BC+%EA%B0%84%EB%9E%B5%ED%95%98%EA%B2%8C+%EC%95%88%EB%82%B4+%ED%95%A9%EB%8B%88%EB%8B%A4++UTS+EXPRESS+Chicago%2C++Bonded+CFS+Warehouse+%26+Storage+Service%2C++Air+%26+Ocean+Freight+Forwarder%2C++Asia+Consol%2C+Asia+FAK%2C+Asia+Co-Load%2C+Asia+LCL%0D%0A%EC%B0%BD%EA%B3%A0%EB%B3%B4%EA%B4%80%2C++%EC%9E%A5%EB%8B%A8%EA%B8%B0+%EC%82%AC%EB%AC%B4%EC%8B%A4+%ED%95%AD%EC%8B%9C+%EC%9E%84%EB%8C%80++10+%ED%8F%89+%7E+7000+%ED%8F%89%2C+%EB%AC%B4%EC%97%AD%EC%A0%84%EC%8B%9C%EA%B4%80%2C+%EB%B0%98%ED%92%88%EC%88%98%EB%A6%AC%2C+%ED%8F%AC%EC%9E%A5+%EC%9E%AC%ED%8F%AC%EC%9E%A5.+%EC%8B%9C%EC%B9%B4%EA%B3%A0+%EC%B5%9C%EB%8C%80%EC%9D%98+%ED%95%9C%EC%9D%B8%EC%9A%B4%EC%98%81+%EC%A2%85%ED%95%A9%EB%AC%BC%EB%A5%98+%EB%8B%A8%EC%A7%80+%EC%9E%85%EB%8B%88%EB%8B%A4';
var metaContents  = '%EC%8B%9C%EC%B9%B4%EA%B3%A0+%EC%B5%9C%EA%B3%A0%EC%9D%98+%EB%AC%BC%EB%A5%98+%ED%8F%AC%ED%84%B8%EC%84%9C%EB%B9%84%EC%8A%A4+%28+ChicagoEnter.com%29++UTS+%EC%8B%9C%EC%B9%B4%EA%B3%A0+%ED%95%9C%EA%B5%AD%ED%83%9D%EB%B0%B0++++%EB%A9%8B%EC%9E%88%EB%8A%94+%EB%8F%84%EC%8B%9C%2C+%ED%9B%8C%EB%A5%AD%ED%95%9C+%EB%8F%84%EC%8B%9C+%EC%8B%9C%EC%B9%B4%EA%B3%A0%EB%A5%BC+%EA%B0%84%EB%9E%B5%ED%95%98%EA%B2%8C+%EC%95%88%EB%82%B4+%ED%95%A9%EB%8B%88%EB%8B%A4++UTS+EXPRESS+Chicago%2C++Bonded+CFS+Warehouse+%26+Storage+Service%2C+Air+%26+Ocean+Freight+Forwarder%2C++Asia+Consol%2C+Asia+FAK%2C+Asia+Co-Load%2C+Asia+LCL%0D%0A%EC%B0%BD%EA%B3%A0%EB%B3%B4%EA%B4%80%2C++%EC%9E%A5%EB%8B%A8%EA%B8%B0+%EC%82%AC%EB%AC%B4%EC%8B%A4+%ED%95%AD%EC%8B%9C+%EC%9E%84%EB%8C%80++10+%ED%8F%89+%7E+7000+%ED%8F%89%2C+%EB%AC%B4%EC%97%AD%EC%A0%84%EC%8B%9C%EA%B4%80%2C+%EB%B0%98%ED%92%88%EC%88%98%EB%A6%AC%2C+%ED%8F%AC%EC%9E%A5+%EC%9E%AC%ED%8F%AC%EC%9E%A5.+%EC%8B%9C%EC%B9%B4%EA%B3%A0+%EC%B5%9C%EB%8C%80%EC%9D%98+%ED%95%9C%EC%9D%B8%EC%9A%B4%EC%98%81+%EC%A2%85%ED%95%A9%EB%AC%BC%EB%A5%98+%EB%8B%A8%EC%A7%80+%EC%9E%85%EB%8B%88%EB%8B%A4';
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();
};

