/* [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','1301',jdecode('Home'),jdecode(''),'/1301.html','true',[],'',''],
	['PAGE','1394',jdecode('About+us'),jdecode(''),'/1394.html','true',[],'',''],
	['PAGE','3301',jdecode('Services'),jdecode(''),'/3301/index.html','true',[ 
		['PAGE','13101',jdecode('How+to+calculate+cubic+feet'),jdecode(''),'/3301/13101.html','true',[],'','']
	],'',''],
	['PAGE','1373',jdecode('Quote'),jdecode(''),'/1373.html','true',[],'',''],
	['PAGE','3343',jdecode('Testimonials'),jdecode(''),'/3343.html','true',[],'',''],
	['PAGE','17401',jdecode('Loading+%26+Packing+'),jdecode(''),'/17401.html','true',[],'',''],
	['PAGE','3364',jdecode('Contact'),jdecode(''),'/3364.html','true',[],'',''],
	['PAGE','11401',jdecode('Links'),jdecode(''),'/11401.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Delphi';
theSitetree.paletteFamily='2B3559';
theSitetree.keyvisualId='7579';
theSitetree.keyvisualName='kv_7579.jpg';
theSitetree.fontsetId='16657';
theSitetree.graphicsetId='12222';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='818181';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Delphi',
				paletteFamily: 	'2B3559',
				keyvisualId: 	'7579',
				keyvisualName: 	'kv_7579.jpg',
				fontsetId: 		'16657',
				graphicsetId: 	'12222',
				contentColor: 	'000000',
				contentBGColor: '818181',
				a_color: 		'424242',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1301',
internalId:  '',
customField: '20110127-105611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3301',
internalId:  '',
customField: '20110127-110144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1373',
internalId:  '',
customField: '20101109-090602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1394',
internalId:  '',
customField: '20110127-105832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3364',
internalId:  '',
customField: '20101109-091224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3343',
internalId:  '',
customField: '20090809-210024'
};
webappMappings['7008']=webappMappings['7008-19553']={
webappId:    '7008',
documentId:  '1373',
internalId:  '19553',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-3343aendu0in3hku']={
webappId:    '1002',
documentId:  '3343',
internalId:  '3343aendu0in3hku',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11401',
internalId:  '',
customField: '20101109-091606'
};
webappMappings['1501']=webappMappings['1501-21159813']={
webappId:    '1501',
documentId:  '1301',
internalId:  '21159813',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20090912-005214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17401',
internalId:  '',
customField: '20110127-110401'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN3HKU';
var companyName   = 'Tara+Shipping+-++International+Shipping+Service';
var htmlTitle	  = 'Tara+Shipping+-+International+Container+Shipping+Service';
var metaKeywords  = 'International%2C+Global+Shipping%2C+American+International+Shipping%2C+Worldwide+Shipping%2C+Overseas+Shipping%2C+Shipping%2C+Ship%2C+container%2C+FCL%2C+LCL%2C+full+container%2C+partial+container%2C+load%2C+small+loads%2C+boxes%2C+cars%2C+automobiles%2C+commercial%2C+cargo%2C+household%2C+goods%2C+personal+effects%2C+residential%2C+customs+clearance%2C++free%2C+rate%2C+quote%2C++door+to+door%2C+delivery%2C++USA%2C+Florida%2C+Boston%2C+New+York%2C+New+Jersey%2C+Chicago%2C+Connecticut%2C+Georgia%2C+South+Carolina%2C+North+Carolina%2C+Washington%2C+Northern+Europe%2C+UK%2C+England%2C+Scotland%2C+Wales%2C+Ireland%2C+Northern+Ireland%2C+France%2C+Italy%2C+Greece%2C+Spain%2C+Portugal%2C+Germany%2C+Netherlands%2C+Holland%2CAmsterdam%2C+Belgium%2C+Austria%2C+Sweden%2C+Denmark%2C+Switzerland%2C+Asia%2C++Australia%2C+Antigua%2C+Live+Help%2C+Skype%2C+Twitter%2C+Credit+Cards%2C+Mastercard%2C+Visa%2C+Discover%2C+Online+Payments%2C+Paypal%2C+Facebook%2C+';
var metaContents  = 'Tara+Shipping+-++International+Container+Shipping+Service';
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();
};

