/* [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'),jdecode(''), jdecode('%2F11.html'), 'true',[],'',''],
	['PAGE','41',jdecode('%E7%86%8A%E6%9C%AC%E7%B5%8C%E5%8D%94%E3%81%A8%E3%81%AF'),jdecode(''), jdecode('%2F41.html'), 'true',[],'',''],
	['PAGE','59',jdecode('%E4%BA%8B%E6%A5%AD%E5%86%85%E5%AE%B9'),jdecode(''), jdecode('%2F59%2Findex.html'), 'true',[ 
		['PAGE','415',jdecode('%E7%A0%94%E7%A9%B6%E4%BC%9A%E6%B4%BB%E5%8B%95'),jdecode(''), jdecode('%2F59%2F415.html'), 'true',[],'',''],
		['PAGE','424',jdecode('%E3%81%8A%E6%82%A9%E3%81%BF%E8%A7%A3%E6%B1%BA%E3%81%AE%E3%81%8A%E6%89%8B%E4%BC%9D%E3%81%84'),jdecode(''), jdecode('%2F59%2F424.html'), 'true',[],'','']
	],'',''],
	['PAGE','68',jdecode('%E3%81%8A%E7%9F%A5%E3%82%89%E3%81%9B'),jdecode(''), jdecode('%2F68.html'), 'true',[],'',''],
	['PAGE','77',jdecode('%E3%81%8A%E5%95%8F%E3%81%84%E5%90%88%E3%82%8F%E3%81%9B%EF%BC%86%E3%83%AA%E3%83%B3%E3%82%AF'),jdecode(''), jdecode('%2F77.html'), 'true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Animal';
theSitetree.paletteFamily='3468BD';
theSitetree.keyvisualId='4302';
theSitetree.keyvisualName='kv_4302.jpg';
theSitetree.fontsetId='15748';
theSitetree.graphicsetId='11209';
theSitetree.contentColor='313F73';
theSitetree.contentBGColor='D8E0ED';
var localeDef={
  language: 'ja',
  country: 'JP'
};
var prodDef={
  wl_name: 'ocn',
  product: 'WSCSYSSSSLYTC2JY'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Animal',
				paletteFamily: 	'3468BD',
				keyvisualId: 	'4302',
				keyvisualName: 	'kv_4302.jpg',
				fontsetId: 		'15748',
				graphicsetId: 	'11209',
				contentColor: 	'313F73',
				contentBGColor: 'D8E0ED',
				a_color: 		'3468BD',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'MS PGothic',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '11',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-4784061']={
webappId:    '1501',
documentId:  '11',
internalId:  '4784061',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '11',
internalId:  '-',
customField: '20120201-100500'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '68',
internalId:  '-',
customField: '20120201-100043'
};
var webAppHostname = 'diycgi.cluster.mlpsca01.us.diy-servers.net:80';
var canonHostname = 'diywk02.cluster.mlpsca01.us.diy-servers.net';
var accountId     = 'AVESJ0INETMN';
var companyName   = '%E7%86%8A%E6%9C%AC%E7%9C%8C%E7%B5%8C%E5%96%B6%E8%80%85%E5%8D%94%E4%BC%9A+Kumamoto+Employers%27+Association';
var htmlTitle	  = '%E7%86%8A%E6%9C%AC%E7%9C%8C%E7%B5%8C%E5%96%B6%E8%80%85%E5%8D%94%E4%BC%9A%E3%80%80Kumamoto+Employers+Association';
var metaKeywords  = '%E7%86%8A%E6%9C%AC%E7%9C%8C%E7%B5%8C%E5%96%B6%E8%80%85%E5%8D%94%E4%BC%9A%2C%E7%86%8A%E6%9C%AC%E7%B5%8C%E5%8D%94%2C%E7%B5%8C%E5%8D%94%2C%E7%86%8A%E6%9C%AC%2C%E6%97%A5%E6%9C%AC%E7%B5%8C%E6%B8%88%E5%9B%A3%E4%BD%93%E9%80%A3%E5%90%88%E4%BC%9A%2C%E3%81%8F%E3%81%BE%E3%82%82%E3%81%A8%2C%E7%B5%8C%E5%96%B6%E8%80%85%E5%8D%94%E4%BC%9A%2C%E6%97%A5%E6%9C%AC%E7%B5%8C%E5%9B%A3%E9%80%A3';
var metaContents  = '%E7%86%8A%E6%9C%AC%E7%9C%8C%E7%B5%8C%E5%96%B6%E8%80%85%E5%8D%94%E4%BC%9A%E3%81%AF%E4%BA%BA%E6%9D%90%E3%81%A5%E3%81%8F%E3%82%8A%E3%81%AE%E5%B0%82%E7%AE%A1%E5%9B%A3%E4%BD%93%E3%80%8D%E3%81%A8%E3%81%97%E3%81%A6%E3%80%81%E5%85%A8%E5%9B%BD%EF%BC%94%EF%BC%97%E9%83%BD%E9%81%93%E5%BA%9C%E7%9C%8C%E3%81%AE%E7%B5%8C%E5%96%B6%E8%80%85%E5%8D%94%E4%BC%9A%E3%81%A8%EF%BC%88%E7%A4%BE%EF%BC%89%E6%97%A5%E6%9C%AC%E7%B5%8C%E6%B8%88%E5%9B%A3%E4%BD%93%E9%80%A3%E5%90%88%E4%BC%9A%EF%BC%88%E6%97%A5%E6%9C%AC%E7%B5%8C%E5%9B%A3%E9%80%A3%EF%BC%89%E3%81%A8%E3%81%AE%E5%AF%86%E5%BA%A6%E3%81%AE%E9%AB%98%E3%81%84%E9%80%A3%E6%90%BA%E3%82%92%E5%9F%BA%E7%A4%8E%E3%81%AB%E7%A9%8D%E6%A5%B5%E7%9A%84%E3%81%AA%E6%B4%BB%E5%8B%95%E3%82%92%E8%A1%8C%E3%81%A3%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%E7%86%8A%E6%9C%AC%E5%B8%82%E4%B8%8B%E9%80%9A1-7-19';
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();
};

