/* [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','201',jdecode('Home'),jdecode(''), jdecode('%2F201.html'), 'true',[],'',''],
	['PAGE','21701',jdecode('Ballast+Tank+Surveys'),jdecode(''), jdecode('%2F21701.html'), 'true',[],'',''],
	['PAGE','21706',jdecode('Ballast+Line+Repairs'),jdecode(''), jdecode('%2F21706.html'), 'true',[],'',''],
	['PAGE','46701',jdecode('Cargo+Tank+Repairs'),jdecode(''), jdecode('%2F46701.html'), 'true',[],'',''],
	['PAGE','21711',jdecode('Guarantee+Surveys'),jdecode(''), jdecode('%2F21711.html'), 'true',[],'',''],
	['PAGE','34501',jdecode('Maintenance+Planning'),jdecode(''), jdecode('%2F34501.html'), 'true',[],'',''],
	['PAGE','25201',jdecode('Failure+Investigation'),jdecode(''), jdecode('%2F25201.html'), 'true',[],'',''],
	['PAGE','27801',jdecode('Drydock+Attendance'),jdecode(''), jdecode('%2F27801.html'), 'true',[],'',''],
	['PAGE','212',jdecode('Cathodic+Protection'),jdecode(''), jdecode('%2F212.html'), 'true',[],'',''],
	['PAGE','217',jdecode('Onboard+Maintenance'),jdecode(''), jdecode('%2F217.html'), 'true',[],'',''],
	['PAGE','31301',jdecode('Recent+Projects'),jdecode(''), jdecode('%2F31301.html'), 'true',[],'',''],
	['PAGE','33001',jdecode('Contact+Details'),jdecode(''), jdecode('%2F33001.html'), 'true',[],'',''],
	['PAGE','24402',jdecode('Guestbook'),jdecode(''), jdecode('%2F24402%2Findex.html'), 'true',[ 
		['PAGE','24403',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F24402%2F24403.html'), 'false',[],'','']
	],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Time';
theSitetree.paletteFamily='272740';
theSitetree.keyvisualId='2301';
theSitetree.keyvisualName='industrie.jpg';
theSitetree.fontsetId='270';
theSitetree.graphicsetId='336';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'enom',
  product: 'WSCENOSSSLYTC21T'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Time',
				paletteFamily: 	'272740',
				keyvisualId: 	'2301',
				keyvisualName: 	'industrie.jpg',
				fontsetId: 		'270',
				graphicsetId: 	'336',
				contentColor: 	'000066',
				contentBGColor: 'FFFFFF',
				a_color: 		'272740',
				b_color: 		'6D6DA7',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-1531158']={
webappId:    '1501',
documentId:  '201',
internalId:  '1531158',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '201',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-24402aen010']={
webappId:    '1002',
documentId:  '24402',
internalId:  '24402aen010',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '201',
internalId:  '',
customField: '20111025-033221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31301',
internalId:  '',
customField: '20111025-035930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24402',
internalId:  '',
customField: '20051012-011327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21701',
internalId:  '',
customField: '20051021-131446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21706',
internalId:  '',
customField: '20051013-032640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21711',
internalId:  '',
customField: '20060207-121034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34501',
internalId:  '',
customField: '20060207-121345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25201',
internalId:  '',
customField: '20051020-122351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27801',
internalId:  '',
customField: '20051016-135636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '212',
internalId:  '',
customField: '20051021-132145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '217',
internalId:  '',
customField: '20051017-115101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33001',
internalId:  '',
customField: '20070705-013758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24403',
internalId:  '',
customField: '20051012-011327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46701',
internalId:  '',
customField: '20090704-031953'
};
var webAppHostname = 'wsc.ehost-services.com:80';
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN010IN2D3O';
var companyName   = 'RITESPEC+Marine+Coating+Consultants';
var htmlTitle	  = 'Ritespec+Marine+Coating+Consultants-....paint++coating+consultants++inspectors%2C+undertake+coating+surveys%2C+guarantee+surveys%2C+ballast+tank+inspection%2C+internal+pipe+inspection%2C+prepare+specifications%2C+attend+dry-docks%2C+new-buildings.+Specialise+in+LNG+++C';
var metaKeywords  = 'Ritespec%2C+paint+inspection%2C+coating+surveys%2C+marine%2C+LNG%2C+ballast+line%2C+maintenance+surveys%2C+paint+guarantee+surveys%2C+paint+specialists%2C+blasting+and+painting+specialists%2C+coating+engineers%2C+paint+inspectors%2C+marine+paint+inspectors%2C+paint+specifications%2C+paint+specifications';
var metaContents  = 'Ritespec....Marine+coating+consultants%2C++paint+inspectors%2C+specialise+in+ballast+tank+and+ballast+line+surveys+of+LNG+and+Crude+Oil+Tankers';
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();
};

