/* [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','11',jdecode('%E3%83%9B%E3%83%BC%E3%83%A0%28Top%29'),jdecode(''), jdecode('%2F11.html'), 'true',[],'',''],
	['PAGE','18101',jdecode('%E4%BA%8B%E6%A5%AD%E5%86%85%E5%AE%B9%28Our+services%29'),jdecode(''), jdecode('%2F18101.html'), 'true',[],'',''],
	['PAGE','2757',jdecode('%E4%BC%9A%E7%A4%BE%E6%A6%82%E8%A6%81%28About+Us%29'),jdecode(''), jdecode('%2F2757.html'), 'true',[],'',''],
	['PAGE','39101',jdecode('English+Page'),jdecode(''), jdecode('%2F39101.html'), 'true',[],'',''],
	['PAGE','18122',jdecode('%E3%83%A1%E3%83%87%E3%82%A3%E3%82%A2%E6%8E%B2%E8%BC%89%28Press%29'),jdecode(''), jdecode('%2F18122.html'), 'true',[],'',''],
	['PAGE','76101',jdecode('%E6%8E%A1%E7%94%A8%E6%83%85%E5%A0%B1'),jdecode(''), jdecode('%2F76101.html'), 'true',[],'',''],
	['PAGE','59',jdecode('%E3%81%8A%E5%95%8F%E3%81%84%E5%90%88%E3%82%8F%E3%81%9B%28Contact+Us%29'),jdecode(''), jdecode('%2F59.html'), 'true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='003399';
theSitetree.keyvisualId='1241';
theSitetree.keyvisualName='team.jpg';
theSitetree.fontsetId='13969';
theSitetree.graphicsetId='228';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'ja',
  country: 'JP'
};
var prodDef={
  wl_name: 'pageon',
  product: 'WSCSYSSSSLYTCP86'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Profile',
				paletteFamily: 	'003399',
				keyvisualId: 	'1241',
				keyvisualName: 	'team.jpg',
				fontsetId: 		'13969',
				graphicsetId: 	'228',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'003399',
				b_color: 		'000066',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'MS PGothic',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-409']={
webappId:    '7008',
documentId:  '59',
internalId:  '409',
customField: 'language:ja;country:JP;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18101',
internalId:  '',
customField: '20110823-015813'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '11',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11',
internalId:  '',
customField: '20110820-014303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18122',
internalId:  '',
customField: '20101128-041505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2757',
internalId:  '',
customField: '20110827-190718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39101',
internalId:  '',
customField: '20110624-220933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59',
internalId:  '',
customField: '20110607-201742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76101',
internalId:  '',
customField: '20110823-015118'
};
var webAppHostname = 'diycgi.cluster.mlpsca01.us.diy-servers.net:80';
var canonHostname = 'diywk02.cluster.mlpsca01.us.diy-servers.net';
var accountId     = 'AVESJ0INX2PD';
var companyName   = '%E3%82%A4%E3%83%B3%E3%82%B5%E3%82%A4%E3%83%88%E3%83%9E%E3%83%8D%E3%82%B8%E3%83%A1%E3%83%B3%E3%83%88%E6%A0%AA%E5%BC%8F%E4%BC%9A%E7%A4%BE';
var htmlTitle	  = '%E8%BC%B8%E5%87%BA%2C%E8%BC%B8%E5%85%A5%E3%80%81%E5%9B%BD%E9%9A%9B%E5%8D%94%E5%8A%9B-Insight+Management';
var metaKeywords  = '%E8%BC%B8%E5%87%BA%E4%BB%A3%E8%A1%8C%2C%E8%BC%B8%E5%85%A5%E4%BB%A3%E8%A1%8C%2C%E6%B5%B7%E5%A4%96%E8%AA%BF%E6%9F%BB%2C%E8%BC%B8%E5%87%BA%2C%E8%BC%B8%E5%85%A5%2C%E7%BF%BB%E8%A8%B3%2C%E7%B5%8C%E5%96%B6%E8%80%85%E8%82%B2%E6%88%90%2C%E5%8C%97%E6%B5%B7%E9%81%93%2C%E7%94%A3%E5%AD%A6%E9%80%A3%E6%90%BA%2C%E5%A4%A7%E5%AD%A6%E7%99%BA%E3%83%99%E3%83%B3%E3%83%81%E3%83%A3%E3%83%BC%2C%E4%BA%8B%E6%A5%AD%E8%A8%88%E7%94%BB%E4%BD%9C%E6%88%90%2C%E5%BE%8C%E7%B6%99%E8%80%85%E8%82%B2%E6%88%90%2C%E7%B5%8C%E5%96%B6%E3%82%B3%E3%83%B3%E3%82%B5%E3%83%AB%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0%2C%E4%BC%81%E6%A5%AD%E6%88%A6%E7%95%A5%2C%E4%BC%81%E6%A5%AD%E7%A0%94%E4%BF%AE%2C%E3%83%9E%E3%83%8D%E3%82%B8%E3%83%A1%E3%83%B3%E3%83%88%E7%A0%94%E4%BF%AE%2C';
var metaContents  = '%E8%BC%B8%E5%87%BA%E3%80%81%E6%B5%B7%E5%A4%96%E9%80%B2%E5%87%BA%E3%80%81%E6%B5%B7%E5%A4%96%E8%AA%BF%E6%9F%BB%E3%80%81%E8%BC%B8%E5%85%A5%E3%80%81%E5%9B%BD%E9%9A%9B%E5%8D%94%E5%8A%9B%E3%80%80%E7%B5%8C%E5%96%B6%E3%82%B3%E3%83%B3%E3%82%B5%E3%83%AB%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0%2C+Insight+Manaegment';
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();
};

