/* [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','601',jdecode('Home'),jdecode(''), jdecode('%2F601.html'), 'true',[],'',''],
	['PAGE','652',jdecode('About+us'),jdecode(''), jdecode('%2F652.html'), 'true',[],'',''],
	['PAGE','673',jdecode('Contact'),jdecode(''), jdecode('%2F673.html'), 'true',[],'','']];
var siteelementCount=3;
theSitetree.topTemplateName='Padma';
theSitetree.paletteFamily='999999';
theSitetree.keyvisualId='1047';
theSitetree.keyvisualName='buero.jpg';
theSitetree.fontsetId='180';
theSitetree.graphicsetId='212';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='666666';
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: 			'Padma',
				paletteFamily: 	'999999',
				keyvisualId: 	'1047',
				keyvisualName: 	'buero.jpg',
				fontsetId: 		'180',
				graphicsetId: 	'212',
				contentColor: 	'FFFFFF',
				contentBGColor: '666666',
				a_color: 		'999999',
				b_color: 		'000000',
				c_color: 		'000000',
				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:  '601',
internalId:  '',
customField: '20110310-141021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20110310-141148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20110310-141208'
};
var webAppHostname = 'wsc.ehost-services.com:80';
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN010INV8BH';
var companyName   = 'UNITED+TRANSPORT+SERVICE%2C+INC.';
var htmlTitle	  = 'Ship+U.S.to+Korea%2C+Asia+%28ShipUStoKorea.com%29+UTS+Chicago+Warehouse%2C+Air+Ocean+freight+Door+Service';
var metaKeywords  = 'Ship+from+US+to+Korea%2C+Asia+%28ShipUStoKorea.com%29+UTS++Chicago+Warehouse+Bonded+CFS%2C+Air+Freight%2C+Ocean+LCL+Freight+Door+to+Door+Service.+Shipping+Serivice+to+Korea%2C+China%2C+Japan%2C+Vietnam%2C+Mongolia%2C+and+all+South+Asia.++OneStop+Service+%28OnestopSvc.com%29+Pick+up%2C+Export+Packing%2C+Chicago+Warehouse++Storage%2C+Import+Warehousing%2C+Custom+Brokerage%2C+Distribution.We+know+Korea.We+Speak%2C+write%2C+and+understand+the+culture+of+Korea++UTS+%EC%8B%9C%EC%B9%B4%EA%B3%A0+%ED%95%9C%EA%B5%AD%ED%83%9D%EB%B0%B0%2C+%EB%AF%B8%EA%B5%AD-%ED%95%9C%EA%B5%AD+%EC%9E%90%EB%8F%99%EC%B0%A8+%EA%B5%AD%EC%A0%9C%EC%9A%B4%EC%86%A1%2C+%EC%8B%9C%EC%B9%B4%EA%B3%A0%EC%B0%BD%EA%B3%A0%EB%B3%B4%EA%B4%80%2C%EC%8B%9C%EC%B9%B4%EA%B3%A0%EC%A0%84%EC%8B%9C%EA%B4%80%EC%9A%B4%EC%98%81%2C+%EC%8B%9C%EC%B9%B4%EA%B3%A0+%ED%8F%AC%EC%9E%A5%2C+%EB%B0%98%ED%92%88+%ED%95%98%EC%9E%90%EC%A0%9C%ED%92%88+%EC%88%98%EB%A6%AC%EC%8B%9C%EC%84%A4+%EB%B0%8F+%ED%98%91%EB%A0%A5';
var metaContents  = 'Ship+from+US+to+Korea%2C+Asia+%28ShipUStoKorea.com%29+UTS++Chicago+Warehouse+Bonded+CFS%2C+Air+Freight%2C+Ocean+LCL+Freight+Door+to+Door+Service.+Shipping+Serivice+to+Korea%2C+China%2C+Japan%2C+Vietnam%2C+Mongolia%2C+and+all+South+Asia.++OneStop+Service+%28OnestopSvc.com%29+Pick+up%2C+Export+Packing%2C+Chicago+Warehouse++Storage%2C+Import+Warehousing%2C+Custom+Brokerage%2C+Distribution.We+know+Korea.We+Speak%2C+write%2C+and+understand+the+culture+of+Korea++UTS+%EC%8B%9C%EC%B9%B4%EA%B3%A0+%ED%95%9C%EA%B5%AD%ED%83%9D%EB%B0%B0%2C+%EB%AF%B8%EA%B5%AD-%ED%95%9C%EA%B5%AD+%EC%9E%90%EB%8F%99%EC%B0%A8+%EA%B5%AD%EC%A0%9C%EC%9A%B4%EC%86%A1%2C+%EC%8B%9C%EC%B9%B4%EA%B3%A0%EC%B0%BD%EA%B3%A0%EB%B3%B4%EA%B4%80%2C%EC%8B%9C%EC%B9%B4%EA%B3%A0%EC%A0%84%EC%8B%9C%EA%B4%80%EC%9A%B4%EC%98%81%2C+%EC%8B%9C%EC%B9%B4%EA%B3%A0+%ED%8F%AC%EC%9E%A5%2C+%EB%B0%98%ED%92%88+%ED%95%98%EC%9E%90%EC%A0%9C%ED%92%88+%EC%88%98%EB%A6%AC%EC%8B%9C%EC%84%A4+%EB%B0%8F+%ED%98%91%EB%A0%A5';
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();
};

