if ( window.parent != window ) {	// #### iframe のときのみ実行

// 以下はヘッダー、サイドの各メニューで、現在のURLと一致するものをハイライト表示し、リンクを効かなくする
(function () {

  // header.htm のメニュー画像切り替え関数、その登録関数
  var swapHMimg_on = function () {
   var images=(this==window)?window.event.srcElement.getElementsByTagName('img'):this.getElementsByTagName('img');
   if (images.length==0) return;
   images[0].src=images[0].src.replace(/_off\.gif$/,'_on.gif');
  }
  var swapHMimg_off = function () {
   var images=(this==window)?window.event.srcElement.getElementsByTagName('img'):this.getElementsByTagName('img');
   if (images.length==0) return;
   images[0].src=images[0].src.replace(/_on\.gif$/,'_off.gif');
  }
  var swapimg_on = function () {
   var image=(this==window)?window.event.srcElement:this;
   image.src=image.src.replace(/_off\.gif$/,'_on.gif');
  }
  var swapimg_off = function () {
   var image=(this==window)?window.event.srcElement:this;
   image.src=image.src.replace(/_on\.gif$/,'_off.gif');
  }
  var attachHMimgswapper = function () {
   var anchors=document.getElementsByTagName('a');
   for (var i=0; i<anchors.length; i++) {
    if (anchors[i].parentNode.tagName=='TD'||
        anchors[i].parentNode.tagName=='td') {	// nav table ?
     var images=anchors[i].getElementsByTagName('img');
     if (window.addEventListener) {	// イベント登録
      anchors[i].addEventListener('mouseover', swapHMimg_on, false);
      anchors[i].addEventListener('mouseout', swapHMimg_off, false);
//    images[0].addEventListener('mouseover', swapimg_on, false);
//    images[0].addEventListener('mouseout', swapimg_off, false);
     } else {
      anchors[i].attachEvent('onmouseover', swapHMimg_on);
      anchors[i].attachEvent('onmouseout', swapHMimg_off);
      images[0].attachEvent('onmouseover', swapimg_on);
      images[0].attachEvent('onmouseout', swapimg_off);
     }
    }
   }
  }

  // header.htm のメニュー書き換え関数
  var modHmenu = function () {
   var current=window.parent.document.URL;	// 親のURLを正規化
   current=current.replace(/[#\?].*$/,'');
   current=current.replace(/\%20/g,' ');
   current=current.replace(/\\/g,'/');
   if (current.search(/\/$/)!=-1)
    current=current+'index.htm';
   // file:// を file:/// に正規化 (IEのbug)
   if (current.search(/^file:\/\/[A-Z]:/)!=-1) {
    current=current.replace(/^file:/,'file:/');
   }

   var anchors=document.getElementsByTagName('a');
   for (var i=0; i<anchors.length; i++) {
    if (anchors[i].parentNode.tagName=='TD'||
        anchors[i].parentNode.tagName=='td') {	// nav table ?
     var linkTo=anchors[i].href;
//   if (linkTo.search(/^mailto:/)==-1) {	// mailto: はスキップ
      if (linkTo.search(/\/$/)!=-1)
       linkTo=linkTo+'index.htm';
      if (current==linkTo) {	// 親のURLとhrefが一致したら span 挿入、a 削除
       var nn=document.createElement('span');
       var mom=anchors[i].parentNode;
       var ni=document.createElement('img');
       var images=anchors[i].getElementsByTagName('img');
       ni.src=images[0].src;
       ni.src=ni.src.replace(/_off\.gif$/,'_on.gif');
       ni.alt=images[0].alt;
       nn.appendChild(ni);
       anchors[i].removeChild(images[0]);
       mom.insertBefore(nn,anchors[i]);
       mom.removeChild(anchors[i]);
       i--;
      }
//   }
    }
   }
   /* Smartphone: adjust header size */
   var agent = navigator.userAgent;
   if (agent.indexOf('Linux; U; Android ') != -1 ||
       agent.indexOf('iPhone; U') != -1) {
    var objs, obj;
    if (obj = document.getElementById('head')) {
     if ((objs = obj.getElementsByTagName('img')) &&
         objs.length == 4) {
      objs[0].style.width = '100px';
      objs[1].style.width = '24px';
      objs[2].style.width = '70px';
      objs[3].style.width = '204px';
     }
    }
   }
  }

  // footer.htm のメニュー書き換え関数
  var modFmenu = function () {
   var current=window.parent.document.URL;	// 親のURLを正規化
   current=current.replace(/[#\?].*$/,'');
   current=current.replace(/\%20/g,' ');
   current=current.replace(/\\/g,'/');
   if (current.search(/\/$/)!=-1)
    current=current+'index.htm';
   // file:// を file:/// に正規化 (IEのbug)
   if (current.search(/^file:\/\/[A-Z]:/)!=-1) {
    current=current.replace(/^file:/,'file:/');
   }

   var anchors=document.getElementsByTagName('a');
   for (var i=0; i<anchors.length; i++) {
    if (anchors[i].parentNode.tagName=='NAV'||
        anchors[i].parentNode.tagName=='nav') {	// nav ?
     var linkTo=anchors[i].href;
//   if (linkTo.search(/^mailto:/)==-1) {	// mailto: はスキップ
      if (linkTo.search(/\/$/)!=-1)
       linkTo=linkTo+'index.htm';
      if (current==linkTo) {	// 親のURLとhrefが一致したら span 挿入、a 削除
       var nn=document.createElement('span');
       nn.innerHTML=anchors[i].innerHTML;
       var mom=anchors[i].parentNode;
       mom.insertBefore(nn,anchors[i]);
       mom.removeChild(anchors[i]);
       i--;
      }
//   }
    }
   }
   /* Smartphone: adjust footer size */
   var agent = navigator.userAgent;
   if (agent.indexOf('Linux; U; Android ') != -1 ||
       agent.indexOf('iPhone; U') != -1) {
    var obj;
    if (obj = document.getElementById('globalnav-container')) {
      obj.style.height = '52px';
      obj.style.backgroundRepeat = 'repeat';
    }
    if (obj = document.getElementById('copyright'))
      obj.style.height = '92px';
   }
  }

  // sidemenu.htm のメニュー書き換え関数
  var modSmenu = function () {
   var current=window.parent.document.URL;	// 親のURLを正規化
   current=current.replace(/[#\?].*$/,'');
   current=current.replace(/\%20/g,' ');
   current=current.replace(/\\/g,'/');
   if (current.search(/\/$/)!=-1)
    current=current+'index.htm';
   // file:// を file:/// に正規化 (IEのbug)
   if (current.search(/^file:\/\/[A-Z]:/)!=-1) {
    current=current.replace(/^file:/,'file:/');
   }

   var anchors=document.getElementsByTagName('a');
   for (var i=0; i<anchors.length; i++) {
    if (anchors[i].parentNode.tagName=='LI'||
        anchors[i].parentNode.tagName=='li') {	// smenu ?
     var linkTo=anchors[i].href;
//   if (linkTo.search(/^mailto:/)==-1) {	// mailto: はスキップ
      if (linkTo.search(/\/$/)!=-1)
       linkTo=linkTo+'index.htm';
      if (current==linkTo) {	// 親のURLとhrefが一致したら span 挿入、a 削除
       var nn=document.createElement('span');
       nn.innerHTML=anchors[i].innerHTML;
       var mom=anchors[i].parentNode;
       mom.insertBefore(nn,anchors[i]);
       mom.removeChild(anchors[i]);
       i--;
      }
//   }
    }
   }
  }

  var re;
  var iframeurl=document.URL;	// 自分のURL

  if ((re=/header\.htm$/i) && iframeurl.search(re)!=-1) {
   // header.htm
   window.swapHMimg_on  = swapHMimg_on;
   window.swapHMimg_off = swapHMimg_off;
   window.swapimg_on  = swapimg_on;
   window.swapimg_off = swapimg_off;
   window.attachHMimgswapper = attachHMimgswapper;
   window.modHmenu = modHmenu;
   if (window.addEventListener) {	// イベント登録
    window.addEventListener('load', attachHMimgswapper, false);
    window.addEventListener('load', modHmenu, false);
   } else {
    window.attachEvent('onload', attachHMimgswapper);
    window.attachEvent('onload', modHmenu);
   }
  } else if ((re=/footer\.htm$/i) && iframeurl.search(re)!=-1) {
   // footer.htm
   window.modFmenu = modFmenu;
   if (window.addEventListener) {	// イベント登録
    window.addEventListener('load', modFmenu, false);
   } else {
    window.attachEvent('onload', modFmenu);
   }
  } else if ((re=/sidemenu\.htm$/i) && iframeurl.search(re)!=-1) {
   // sidemenu.htm
   window.modSmenu = modSmenu;
   if (window.addEventListener) {	// イベント登録
    window.addEventListener('load', modSmenu, false);
   } else {
    window.attachEvent('onload', modSmenu);
   }
  }
})();

} else {	// #### iframe でないときのみ実行

(function() {

 // 以下はcontents-inのdivをリサイズする (Smartphoneではやらない、IE7以下はバグ)
var agent = navigator.userAgent;
var objs;
if (agent.indexOf('Linux; U; Android ') == -1 &&
    agent.indexOf('iPhone; U') == -1 &&
    agent.search(/MSIE [34567]/i) == -1 &&
    (!document.documentMode || document.documentMode > 7)) {
 var resizecontents = function() {
  var objC, objF, newH;
  if ((objC = document.getElementById('contents-in')) &&
      (objF = document.getElementById('footer'))){
   newH = objF.offsetTop - objC.offsetTop - 20;
   if (objC.clientHeight < newH){
    objC.style.height = newH + 'px';
   }
  }
 }
 window.resizecontents = resizecontents;
// if( window.addEventListener ) {	// do it in fitIfr
// window.addEventListener( 'load', resizecontents, false );
// } else {
// window.attachEvent( 'onload', resizecontents );
// }
}

// Add Twitter and Facebook Like buttons
 var addTWFB = function (d) {
  var p, nd, nch;

  // Feb-2012 KAZ: added Open Graph Protocol and Facebook metatags
  p = document.getElementsByTagName('script')[0];
  var mom = p.parentNode;

  nd = document.createElement('meta');
  nd.setAttribute('property', 'og:title');
  nch = document.getElementsByTagName('title')[0];
  nd.setAttribute('content', nch.innerHTML);
  mom.insertBefore(nd,p);
  nd = document.createElement('meta');
  nd.setAttribute('property', 'og:type');
  nd.setAttribute('content', 'article');
  mom.insertBefore(nd,p);
  nd = document.createElement('meta');
  nd.setAttribute('property', 'og:locale');
  nd.setAttribute('content', 'ja_JP');
  mom.insertBefore(nd,p);
  nd = document.createElement('meta');
  nd.setAttribute('property', 'og:image');
  nd.setAttribute('content', 'http://www.mtlabs.co.jp/image/logomark.gif');
  mom.insertBefore(nd,p);
  nd = document.createElement('meta');
  nd.setAttribute('property', 'og:url');
  nd.setAttribute('content', document.URL);
  mom.insertBefore(nd,p);
  nd = document.createElement('meta');
  nd.setAttribute('property', 'og:site_name');
  nd.setAttribute('content', 'エム ティ ラボ(株)');
  mom.insertBefore(nd,p);
  nd = document.createElement('meta');
  nd.setAttribute('property', 'og:description');
  nch = document.getElementsByTagName('meta');
  for (var i=0; i<nch.length; i++) {
   if (nch[0].name=='description') {
    nd.setAttribute('content', nch[0].content);
   }
  }
  mom.insertBefore(nd,p);
  nd = document.createElement('meta');
  nd.setAttribute('property', 'fb:admins');
  nd.setAttribute('content', '100001870829243');
  mom.insertBefore(nd,p);
  nd = document.createElement('meta');
  nd.setAttribute('property', 'fb:admins');
  nd.setAttribute('content', '100002218011212');
  mom.insertBefore(nd,p);
  nd = document.createElement('meta');
  nd.setAttribute('property', 'fb:app_id');
  nd.setAttribute('content', '285151504882482');
  mom.insertBefore(nd,p);

  if (d.getElementsByClassName) {
   p = d.getElementsByClassName('content-m')[0];
  } else {
   var t = d.getElementById('contents-in');
   if (!t) return;
   var s = t.getElementsByTagName('td');
   for (var i=0; i<s.length; i++) {
    if (s[i].className == 'content-m') {
     p = s[i];
     break;
    }
   }
  }

  nd = d.createElement('div');
  nd.style.textAlign = 'right';
  nd.style.margin = '5px 0px';
  nch = d.createElement('div');
  nch.className = 'fb-like';
  nch.setAttribute('data-href', d.URL);
  nch.setAttribute('data-send', 'false');
  nch.setAttribute('data-layout', 'button_count');
  nch.setAttribute('data-width', '120');
  nch.setAttribute('data-show-faces', 'false');
  nch.style.display = 'inline';
  nd.appendChild(nch);
  nch = d.createElement('a');
  nch.href = 'https://twitter.com/share';
  nch.className = 'twitter-share-button';
  nch.setAttribute('data-count', 'horizontal');
  nch.setAttribute('data-via', 'mtlabs');
  nch.setAttribute('data-lang', 'ja');
  nch.innerHTML = 'ツイート';
  nd.appendChild(nch);
//nch = d.createElement('script');
//nch.src = '//platform.twitter.com/widgets.js';
//nd.appendChild(nch);
  p.appendChild(nd);

  if (p = d.getElementsByTagName('body')[0]) {
   nch = d.createElement('script');
// nch.text = '(function(d,s,id) {var js,fjs = d.getElementsByTagName(s)[0]; if(d.getElementById(id)){return;} js=d.createElement(s); js.id=id; js.src="//connect.facebook.net/ja_JP/all.js#xfbml=1"; fjs.parentNode.insertBefore(js,fjs); }(document,"script","facebook-jssdk"));';
   nch.text = '(function(d,s,id1,id2){var js,fjs=d.getElementsByTagName(s)[0]; if(!d.getElementById(id1)){js=d.createElement(s); js.id=id1; js.src="//connect.facebook.net/ja_JP/all.js#xfbml=1&appId=285151504882482"; fjs.parentNode.insertBefore(js,fjs);} if(!d.getElementById(id2)){js=d.createElement(s); js.id=id2; js.src="//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js,fjs);}}(document,"script","facebook-jssdk","twitter-wjs"));';
   p.insertBefore(nch, p.firstChild);
   nch = d.createElement('div');
   nch.id = 'fb-root';
   p.insertBefore(nch, p.firstChild);
   nch = d.createElement('script');
   nch.text = 'var _gaq=[["_setAccount","UA-339768-1"],["_trackPageview"]]; (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0]; g.async=1; if("file:"==location.protocol)return; g.src=("https:"==location.protocol?"//ssl":"//www")+".google-analytics.com/ga.js"; s.parentNode.insertBefore(g,s)}(document,"script"));';	// UA-XXXXX-X is our site's ID
   p.appendChild(nch);
  }
 }
 window.addTWFB = addTWFB;

})();

// アフィリエイト
function epsondr() {
 document.write('<div align="center"><table style="background:#e0e8f0;border:1px solid #102088;margin:1em"><tr>');
 document.write('<td style="font:90%;padding:0.5em 0.5em 0 0.5em">弊社では、<a href="http://click.linksynergy.com/fs-bin/click?id=yfnkYVQZIfk&offerid=43443.10000024&type=3&subid=0" target="new">エプソンダイレクト</a><img src="http://ad.linksynergy.com/fs-bin/show?id=yfnkYVQZIfk&bids=43443.10000024&type=3&subid=0" height="1" width="1">のパソコンを使用しています。<br>OSやソフト・パーツまでカスタマイズできるので、無駄のないパソコンが購入できます。</td>');
 document.write('</tr><tr>');
 document.write('<td style="font:90%;padding:0 0.5em 0 0"><ul style="margin:0.2em 0 0.5em 2em">');
 document.write('<li><a href="http://storefront.linksynergy.com/fs-bin/store?eid=yfnkYVQZIfk&offerid=43443&stid=6&subid=" target="new">おすすめ商品一覧</a>');
 document.write('<li><a href="http://click.linksynergy.com/fs-bin/click?id=yfnkYVQZIfk&offerid=43443.10000106&type=3&subid=0" target="new">お得なキャンペーン実施中！</a><img src="http://ad.linksynergy.com/fs-bin/show?id=yfnkYVQZIfk&bids=43443.10000106&type=3&subid=0" height="1" width="1">');
 document.write('</ul></td>');
 document.write('</tr></table></div>');
}

/* ---------------------------------------------------------------
*	Fit Iframe JavaScript Library Ver.2.0
*	
*	from 2009, created by edo.
*	http://css-eblog.com/
*	Ver.2.1, Nov 2011, revised by KAZ, MT Labs
* --------------------------------------------------------------- */

(function() {

var isMSIE = /*@cc_on!@*/false;
var params = {};
var scripts = document.getElementsByTagName( 'script' );
var fn = 'fit_ifr';		//This script file name.

var fitIfr = function() {
	// KAZ: Add Twitter and Facebook Like buttons
	if (document.URL.indexOf('file:') == -1)
		window.addTWFB(document);

	if( !arguments[0] || arguments[0].type === 'load' ) {
		var ifrObjs = document.getElementsByTagName( 'iframe' );
		for( var i=0; i<ifrObjs.length; i++) {
			var ifrObj = ifrObjs[i];
			// KAZ: moved into try for facebook/twitter iframes
//			var doc = ifrObj.contentWindow.document.documentElement;
//			var body = ifrObj.contentWindow.document.body;

			try {
				var doc = ifrObj.contentWindow.document.documentElement;
				var body = ifrObj.contentWindow.document.body;
				var fitHeight = 0;
				if( isMSIE ) {
					if( navigator.userAgent.toLowerCase().replace( /\s/g, '' ).indexOf( 'msie6' ) > -1 ||
					    document.documentMode && document.documentMode == 5 ) {
						fitHeight = body.scrollHeight;
//					} else {
//						fitHeight = doc.scrollHeight;
					// KAZ: revised as follows
					} else if( navigator.userAgent.toLowerCase().replace( /\s/g, '' ).indexOf( 'msie7' ) > -1 ) {
						fitHeight = doc.scrollHeight;
					} else {
						fitHeight = body.offsetHeight;
					}
				} else {
					doc.style.overflowY = 'visible';	// KAZ: added for Safari
					fitHeight = doc.offsetHeight;
				}
				
				ifrObj.style.height = fitHeight + 'px';
			} catch( e ) {
				/* skip process */
			}
		}
	} else if( arguments[0].charAt(0) == '-' ) {
		var ifrObjs = document.getElementsByTagName( 'iframe' );
		var chkFlg;
		for( var i=0; i<ifrObjs.length; i++) {
			var ifrObj = ifrObjs[i];
			var doc = ifrObj.contentWindow.document.documentElement;
			var body = ifrObj.contentWindow.document.body;
			chkFlg = false;
			
			for( var k=0; k<arguments.length; k++ ) {
				if( ifrObj.id == arguments[k].substring( 1, arguments[k].length ) ) {
					if ( arguments[k].charAt( 0 ) == '-' ) {
						chkFlg = true;
					}
				}
			}
			
			if ( !chkFlg ) {
				try {
					var fitHeight = 0;
					if( isMSIE ) {
						if( navigator.userAgent.toLowerCase().replace( /\s/g, '' ).indexOf( 'msie6' ) > -1 ||
						    document.documentMode && document.documentMode == 5 ) {
							fitHeight = body.scrollHeight;
						} else {
							fitHeight = doc.scrollHeight;
						}
					} else {
						fitHeight = doc.offsetHeight;
					}
					
					ifrObj.style.height = fitHeight + 'px';
				} catch( e ) {
					/* skip process */
				}
			}
		}
	} else {
		for( var i=0; i<arguments.length; i++ ) {
			var ifrObj;
			if( document.getElementById( arguments[i] ) ) {
				ifrObj = document.getElementById( arguments[i] );
			} else {
				continue;
			}
			
			var doc = ifrObj.contentWindow.document.documentElement;
			var body = ifrObj.contentWindow.document.body;
			
			try {
				var fitHeight = 0;
				if( isMSIE ) {
					if( navigator.userAgent.toLowerCase().replace( /\s/g, '' ).indexOf( 'msie6' ) > -1 ||
					    document.documentMode && document.documentMode == 5 ) {
						fitHeight = body.scrollHeight;
					} else {
						fitHeight = doc.scrollHeight;
					}
				} else {
					fitHeight = doc.offsetHeight;
				}
				
				ifrObj.style.height = fitHeight + 'px';
			} catch( e ) {
				/* skip process */
			}
		}
	}
	/* KAZ: Smartphone: move the sidebar menu to the bottom */
	var agent = navigator.userAgent;
	if (agent.indexOf('Linux; U; Android ') != -1 ||
	    agent.indexOf('iPhone; U') != -1) {
	  var objMA, objs, obj;
	  if ((objMA = document.getElementById('main')) &&
	      (objs = objMA.getElementsByTagName('aside')) &&
	      objs.length) {
	    if (obj = document.getElementById('rsidebar'))
	      obj.style.float = 'none';
	    if (obj = document.getElementById('contents'))
	      obj.style.marginRight = '0';
	    objMA.appendChild(objs[0]);
//	    objMA.removeChild(objs[0]); /* moved to [2] auto */
	    objMA.style.minWidth = '440px';
	    if (obj = document.getElementById('header'))
	      obj.style.minWidth = '480px';
	    if ((objs = document.getElementsByClassName('ifhead')) &&
	        objs.length)
	      objs[0].style.height = '100px';
	    if (obj = document.getElementById('footer'))
	      obj.style.minWidth = '480px';
	    if ((objs = document.getElementsByClassName('iffoot')) &&
	        objs.length)
	      objs[0].style.height = '169px';
	  }
	} else {
	/* KAZ: PC: find the maximum image and calc the page width */
	  var objMA, objs, obj;
	  /* delete max-width for IE6 */
	  if ((agent.search(/MSIE [3456]/i) > -1 ||
	       document.documentMode && document.documentMode == 5) &&
	      (objs = document.getElementsByTagName('img'))) {
	    for ( var i = 0; i < objs.length; i++ ) {
	      if ( objs[i].className == 'mqresize' ) {
		objs[i].className = '';
		objs[i].style.width = '100%';
		objs[i].style.height = '100%';
		objs[i].src = objs[i].src;	/* for redraw */
	      }
	    }
	  }
	  if (objMA = document.getElementById('main')) {
	    if (document.getElementById('homepage')) {	/* homepage */
	      if (agent.search(/MSIE [3456]/i) > -1 ||
		  document.documentMode && document.documentMode == 5) {
		if (agent.search(/MSIE [3456]/i) > -1)
		  objMA.style.width = '956px';
		else
		  objMA.style.width = '996px';
		if (obj = document.getElementById('header'))
		  obj.style.width = '996px';
		if (obj = document.getElementById('footer'))
		  obj.style.width = '996px';
	      }
	    } else if (document.getElementById('trantop')) { /* tran/index */
	      if (agent.search(/MSIE [3456]/i) > -1 ||
		  document.documentMode && document.documentMode == 5) {
		if (agent.search(/MSIE [3456]/i) > -1)
		  objMA.style.width = '876px';
		else
		  objMA.style.width = '916px';
		if (obj = document.getElementById('header'))
		  obj.style.width = '916px';
		if (obj = document.getElementById('footer'))
		  obj.style.width = '916px';
	      }
	    } else if (document.getElementById('tourism')) { /* tran/tourism */
	      if (agent.search(/MSIE [3456]/i) > -1 ||
		  document.documentMode && document.documentMode == 5) {
		if (agent.search(/MSIE [3456]/i) > -1)
		  objMA.style.width = '857px';
		else
		  objMA.style.width = '897px';
		if (obj = document.getElementById('header'))
		  obj.style.width = '897px';
		if (obj = document.getElementById('footer'))
		  obj.style.width = '897px';
	      }
	    } else {
	      var maxCW = (agent.search(/MSIE [34567]/i) > -1 ||
			   document.documentMode && document.documentMode <= 7) ? 398 : 412;
	      if (objs = objMA.getElementsByTagName('img')) {
		for ( i = 0; i < objs.length; i++ ) {
		  if ( objs[i].clientWidth > maxCW )
		    maxCW = objs[i].clientWidth;
		}
	      }
	      if (maxCW != ((agent.search(/MSIE [34567]/i) > -1 ||
		      document.documentMode && document.documentMode <= 7) ? 398 : 412)) {
		maxCW += ((agent.search(/MSIE [34567]/i) > -1 ||
		      document.documentMode && document.documentMode <= 7) ? 328 : 314);
		if (agent.search(/MSIE [3456]/i) > -1 ||
		    document.documentMode && document.documentMode == 5)
		  objMA.style.width = maxCW + 'px';
		else
		  objMA.style.minWidth = maxCW + 'px';
		maxCW += 40;
		if (obj = document.getElementById('header'))
		  if (agent.search(/MSIE [3456]/i) > -1 ||
		      document.documentMode && document.documentMode == 5)
		    obj.style.width = maxCW + 'px';
		  else
		    obj.style.minWidth = maxCW + 'px';
		if (obj = document.getElementById('footer'))
		  if (agent.search(/MSIE [3456]/i) > -1 ||
		      document.documentMode && document.documentMode == 5)
		    obj.style.width = maxCW + 'px';
		  else
		    obj.style.minWidth = maxCW + 'px';
	      } else if (agent.search(/MSIE [3456]/i) > -1 ||
			 document.documentMode && document.documentMode == 5) {
		objMA.style.width = '726px';
		if (obj = document.getElementById('header'))
		  obj.style.width = '766px';
		if (obj = document.getElementById('footer'))
		  obj.style.width = '766px';
	      }
	    }
	  }
	  if (agent.search(/MSIE [3456]/i) == -1 &&
	      (!document.documentMode || document.documentMode != 5) &&
	      (obj = document.getElementById('contents-in'))) {
	    obj.style.width = '100%';
	  }
	  if (agent.search(/MSIE [34567]/i) == -1 &&
	      (!document.documentMode || document.documentMode > 7)) {
	    window.resizecontents();	/* KAZ: added here */
	  }
	}
}

//get script URL parameter.
for ( var i=0; i<scripts.length; i++ ) {
	if( scripts[i].src.indexOf( fn ) != -1 ) {
		scripts[i].src.match( /(?:.*)(?:\?)(.*)/ );
		if( RegExp.$1 ) {
			var a = RegExp.$1.split( '&' );
			for( var k=0; k<a.length; k++ ) {
				var p = a[k].split( '=' );
				params[p[0]] = p[1];
			}
		}
		
		break;
	}
}

//set function to window object.
window.fitIfr = fitIfr;
if( !params.hasOwnProperty( 'auto' ) || params.auto == 1 ) {
	if( window.addEventListener ) {
		window.addEventListener( 'load', fitIfr, false );
	} else {
		window.attachEvent( 'onload', fitIfr );
	}
}

})();

}	// #### END OF #### iframe でないときのみ実行


 // 以下はNewアイコン表示スクリプト
 // 書式「<script>newicon(開始日(YY/MM/DD),[掲載期間(DD)]);</script>」
 // 例「<script>newicon("06/01/10",60);</script>」
 // 2番目の引数を省略すると掲載期間15日となる
function newicon(start, valid) {
 var defvalid = 15; // 省略時の掲載期間(日)
 var imgfile = 'http://www.mtlabs.co.jp/image/new.gif'; // 画像ファイル

//if (valid == undefined) valid = defvalid; doesn't work on Mac IE
 if (valid == null) valid = defvalid;
 start = "20" + start;
 var strstart = start.split("/");
 var strdate = new Date(strstart[0],strstart[1]-1,strstart[2]);
 var strtime = strdate.getTime();
 var valtime = strtime + valid * 1000 * 60 * 60 * 24;
 var curdate = new Date();
 var curtime = curdate.getTime();
 if (curtime < valtime) {
  document.write('<img class=withintext src="'+imgfile+'" alt="" >');
 }
}

if (navigator.userAgent.indexOf('MSIE 7') == -1) {
/* Modernizr 2.0 (Custom Build) | MIT & BSD
 * Contains: fontface | backgroundsize | borderimage | borderradius | boxshadow | flexbox | hsla | multiplebgs | opacity | rgba | textshadow | cssanimations | csscolumns | generatedcontent | cssgradients | cssreflections | csstransforms | csstransforms3d | csstransitions | applicationcache | canvas | canvastext | draganddrop | hashchange | history | audio | video | indexeddb | input | inputtypes | localstorage | postmessage | sessionstorage | websockets | websqldatabase | webworkers | geolocation | inlinesvg | smil | svg | svgclippaths | touch | webgl | iepp | mq | cssclasses | teststyles | testprop | testallprops | hasevent | prefixes | domprefixes | load
 */
;window.Modernizr=function(a,b,c){function I(){e.input=function(a){for(var b=0,c=a.length;b<c;b++)t[a[b]]=a[b]in l;return t}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)l.setAttribute("type",f=a[d]),e=l.type!=="text",e&&(l.value=m,l.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&l.style.WebkitAppearance!==c?(g.appendChild(l),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(l,null).WebkitAppearance!=="textfield"&&l.offsetHeight!==0,g.removeChild(l)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=l.checkValidity&&l.checkValidity()===!1:/^color$/.test(f)?(g.appendChild(l),g.offsetWidth,e=l.value!=m,g.removeChild(l)):e=l.value!=m)),s[a[d]]=!!e;return s}("search tel url email datetime date month week time datetime-local number range color".split(" "))}function G(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1),d=(a+" "+p.join(c+" ")+c).split(" ");return F(d,b)}function F(a,b){for(var d in a)if(k[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function E(a,b){return!!~(""+a).indexOf(b)}function D(a,b){return typeof a===b}function C(a,b){return B(o.join(a+";")+(b||""))}function B(a){k.cssText=a}var d="2.0",e={},f=!0,g=b.documentElement,h=b.head||b.getElementsByTagName("head")[0],i="modernizr",j=b.createElement(i),k=j.style,l=b.createElement("input"),m=":)",n=Object.prototype.toString,o=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),p="Webkit Moz O ms Khtml".split(" "),q={svg:"http://www.w3.org/2000/svg"},r={},s={},t={},u=[],v=function(a,c,d,e){var f,h,j,k=b.createElement("div");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:i+(d+1),k.appendChild(j);f=["&shy;","<style>",a,"</style>"].join(""),k.id=i,k.innerHTML+=f,g.appendChild(k),h=c(k,a),k.parentNode.removeChild(k);return!!h},w=function(b){if(a.matchMedia)return matchMedia(b).matches;var c;v("@media "+b+" { #"+i+" { position: absolute; } }",function(b){c=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).position=="absolute"});return c},x=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=D(e[d],"function"),D(e[d],c)||(e[d]=c),e.removeAttribute(d))),e=null;return f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),y,z={}.hasOwnProperty,A;!D(z,c)&&!D(z.call,c)?A=function(a,b){return z.call(a,b)}:A=function(a,b){return b in a&&D(a.constructor.prototype[b],c)};var H=function(c,d){var f=c.join(""),g=d.length;v(f,function(c,d){var f=b.styleSheets[b.styleSheets.length-1],h=f.cssText||f.cssRules[0].cssText,i=c.childNodes,j={};while(g--)j[i[g].id]=i[g];e.touch="ontouchstart"in a||j.touch.offsetTop===9,e.csstransforms3d=j.csstransforms3d.offsetLeft===9,e.generatedcontent=j.generatedcontent.offsetHeight>=1,e.fontface=/src/i.test(h)&&h.indexOf(d.split(" ")[0])===0},g,d)}(['@font-face {font-family:"font";src:url("//:")}',["@media (",o.join("touch-enabled),("),i,")","{#touch{top:9px;position:absolute}}"].join(""),["@media (",o.join("transform-3d),("),i,")","{#csstransforms3d{left:9px;position:absolute}}"].join(""),['#generatedcontent:after{content:"',m,'"}'].join("")],["fontface","touch","csstransforms3d","generatedcontent"]);r.flexbox=function(){function c(a,b,c,d){a.style.cssText=o.join(b+":"+c+";")+(d||"")}function a(a,b,c,d){b+=":",a.style.cssText=(b+o.join(c+";"+b)).slice(0,-b.length)+(d||"")}var d=b.createElement("div"),e=b.createElement("div");a(d,"display","box","width:42px;padding:0;"),c(e,"box-flex","1","width:10px;"),d.appendChild(e),g.appendChild(d);var f=e.offsetWidth===42;d.removeChild(e),g.removeChild(d);return f},r.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},r.canvastext=function(){return!!e.canvas&&!!D(b.createElement("canvas").getContext("2d").fillText,"function")},r.webgl=function(){return!!a.WebGLRenderingContext},r.touch=function(){return e.touch},r.geolocation=function(){return!!navigator.geolocation},r.postmessage=function(){return!!a.postMessage},r.websqldatabase=function(){var b=!!a.openDatabase;return b},r.indexedDB=function(){for(var b=-1,c=p.length;++b<c;)if(a[p[b].toLowerCase()+"IndexedDB"])return!0;return!!a.indexedDB},r.hashchange=function(){return x("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},r.history=function(){return!!a.history&&!!history.pushState},r.draganddrop=function(){return x("dragstart")&&x("drop")},r.websockets=function(){for(var b=-1,c=p.length;++b<c;)if(a[p[b]+"WebSocket"])return!0;return"WebSocket"in a},r.rgba=function(){B("background-color:rgba(150,255,150,.5)");return E(k.backgroundColor,"rgba")},r.hsla=function(){B("background-color:hsla(120,40%,100%,.5)");return E(k.backgroundColor,"rgba")||E(k.backgroundColor,"hsla")},r.multiplebgs=function(){B("background:url(//:),url(//:),red url(//:)");return/(url\s*\(.*?){3}/.test(k.background)},r.backgroundsize=function(){return G("backgroundSize")},r.borderimage=function(){return G("borderImage")},r.borderradius=function(){return G("borderRadius")},r.boxshadow=function(){return G("boxShadow")},r.textshadow=function(){return b.createElement("div").style.textShadow===""},r.opacity=function(){C("opacity:.55");return/^0.55$/.test(k.opacity)},r.cssanimations=function(){return G("animationName")},r.csscolumns=function(){return G("columnCount")},r.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";B((a+o.join(b+a)+o.join(c+a)).slice(0,-a.length));return E(k.backgroundImage,"gradient")},r.cssreflections=function(){return G("boxReflect")},r.csstransforms=function(){return!!F(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},r.csstransforms3d=function(){var a=!!F(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);a&&"webkitPerspective"in g.style&&(a=e.csstransforms3d);return a},r.csstransitions=function(){return G("transitionProperty")},r.fontface=function(){return e.fontface},r.generatedcontent=function(){return e.generatedcontent},r.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType){c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"');var d='video/mp4; codecs="avc1.42E01E';c.h264=a.canPlayType(d+'"')||a.canPlayType(d+', mp4a.40.2"'),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}}catch(e){}return c},r.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),c.mp3=a.canPlayType("audio/mpeg;"),c.wav=a.canPlayType('audio/wav; codecs="1"'),c.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")}catch(d){}return c},r.localstorage=function(){try{return!!localStorage.getItem}catch(a){return!1}},r.sessionstorage=function(){try{return!!sessionStorage.getItem}catch(a){return!1}},r.webworkers=function(){return!!a.Worker},r.applicationcache=function(){return!!a.applicationCache},r.svg=function(){return!!b.createElementNS&&!!b.createElementNS(q.svg,"svg").createSVGRect},r.inlinesvg=function(){var a=b.createElement("div");a.innerHTML="<svg/>";return(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.smil=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"animate")))},r.svgclippaths=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"clipPath")))};for(var J in r)A(r,J)&&(y=J.toLowerCase(),e[y]=r[J](),u.push((e[y]?"":"no-")+y));e.input||I(),B(""),j=l=null,a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1}()&&function(a,b){function s(a){var b=-1;while(++b<g)a.createElement(f[b])}a.iepp=a.iepp||{};var d=a.iepp,e=d.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",f=e.split("|"),g=f.length,h=new RegExp("(^|\\s)("+e+")","gi"),i=new RegExp("<(/*)("+e+")","gi"),j=/^\s*[\{\}]\s*$/,k=new RegExp("(^|[^\\n]*?\\s)("+e+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),l=b.createDocumentFragment(),m=b.documentElement,n=m.firstChild,o=b.createElement("body"),p=b.createElement("style"),q=/print|all/,r;d.getCSS=function(a,b){if(a+""===c)return"";var e=-1,f=a.length,g,h=[];while(++e<f){g=a[e];if(g.disabled)continue;b=g.media||b,q.test(b)&&h.push(d.getCSS(g.imports,b),g.cssText),b="all"}return h.join("")},d.parseCSS=function(a){var b=[],c;while((c=k.exec(a))!=null)b.push(((j.exec(c[1])?"\n":c[1])+c[2]+c[3]).replace(h,"$1.iepp_$2")+c[4]);return b.join("\n")},d.writeHTML=function(){var a=-1;r=r||b.body;while(++a<g){var c=b.getElementsByTagName(f[a]),d=c.length,e=-1;while(++e<d)c[e].className.indexOf("iepp_")<0&&(c[e].className+=" iepp_"+f[a])}l.appendChild(r),m.appendChild(o),o.className=r.className,o.id=r.id,o.innerHTML=r.innerHTML.replace(i,"<$1font")},d._beforePrint=function(){p.styleSheet.cssText=d.parseCSS(d.getCSS(b.styleSheets,"all")),d.writeHTML()},d.restoreHTML=function(){o.innerHTML="",m.removeChild(o),m.appendChild(r)},d._afterPrint=function(){d.restoreHTML(),p.styleSheet.cssText=""},s(b),s(l);d.disablePP||(n.insertBefore(p,n.firstChild),p.media="print",p.className="iepp-printshim",a.attachEvent("onbeforeprint",d._beforePrint),a.attachEvent("onafterprint",d._afterPrint))}(a,b),e._version=d,e._prefixes=o,e._domPrefixes=p,e.mq=w,e.hasEvent=x,e.testProp=function(a){return F([a])},e.testAllProps=G,e.testStyles=v,g.className=g.className.replace(/\bno-js\b/,"")+(f?" js "+u.join(" "):"");return e}(this,this.document),function(a,b,c){function k(a){return!a||a=="loaded"||a=="complete"}function j(){var a=1,b=-1;while(p.length- ++b)if(p[b].s&&!(a=p[b].r))break;a&&g()}function i(a){var c=b.createElement("script"),d;c.src=a.s,c.onreadystatechange=c.onload=function(){!d&&k(c.readyState)&&(d=1,j(),c.onload=c.onreadystatechange=null)},m(function(){d||(d=1,j())},H.errorTimeout),a.e?c.onload():n.parentNode.insertBefore(c,n)}function h(a){var c=b.createElement("link"),d;c.href=a.s,c.rel="stylesheet",c.type="text/css",!a.e&&(w||r)?function a(b){m(function(){if(!d)try{b.sheet.cssRules.length?(d=1,j()):a(b)}catch(c){c.code==1e3||c.message=="security"||c.message=="denied"?(d=1,m(function(){j()},0)):a(b)}},0)}(c):(c.onload=function(){d||(d=1,m(function(){j()},0))},a.e&&c.onload()),m(function(){d||(d=1,j())},H.errorTimeout),!a.e&&n.parentNode.insertBefore(c,n)}function g(){var a=p.shift();q=1,a?a.t?m(function(){a.t=="c"?h(a):i(a)},0):(a(),j()):q=0}function f(a,c,d,e,f,h){function i(){!o&&k(l.readyState)&&(r.r=o=1,!q&&j(),l.onload=l.onreadystatechange=null,m(function(){u.removeChild(l)},0))}var l=b.createElement(a),o=0,r={t:d,s:c,e:h};l.src=l.data=c,!s&&(l.style.display="none"),l.width=l.height="0",a!="object"&&(l.type=d),l.onload=l.onreadystatechange=i,a=="img"?l.onerror=i:a=="script"&&(l.onerror=function(){r.e=r.r=1,g()}),p.splice(e,0,r),u.insertBefore(l,s?null:n),m(function(){o||(u.removeChild(l),r.r=r.e=o=1,j())},H.errorTimeout)}function e(a,b,c){var d=b=="c"?z:y;q=0,b=b||"j",C(a)?f(d,a,b,this.i++,l,c):(p.splice(this.i++,0,a),p.length==1&&g());return this}function d(){var a=H;a.loader={load:e,i:0};return a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=r&&!s,u=s?l:n.parentNode,v=a.opera&&o.call(a.opera)=="[object Opera]",w="webkitAppearance"in l.style,x=w&&"async"in b.createElement("script"),y=r?"object":v||x?"img":"script",z=w?"img":y,A=Array.isArray||function(a){return o.call(a)=="[object Array]"},B=function(a){return typeof a=="object"},C=function(a){return typeof a=="string"},D=function(a){return o.call(a)=="[object Function]"},E=[],F={},G,H;H=function(a){function f(a){var b=a.split("!"),c=E.length,d=b.pop(),e=b.length,f={url:d,origUrl:d,prefixes:b},g,h;for(h=0;h<e;h++)g=F[b[h]],g&&(f=g(f));for(h=0;h<c;h++)f=E[h](f);return f}function e(a,b,e,g,h){var i=f(a),j=i.autoCallback;if(!i.bypass){b&&(b=D(b)?b:b[a]||b[g]||b[a.split("/").pop().split("?")[0]]);if(i.instead)return i.instead(a,b,e,g,h);e.load(i.url,i.forceCSS||!i.forceJS&&/css$/.test(i.url)?"c":c,i.noexec),(D(b)||D(j))&&e.load(function(){d(),b&&b(i.origUrl,h,g),j&&j(i.origUrl,h,g)})}}function b(a,b){function c(a){if(C(a))e(a,h,b,0,d);else if(B(a))for(i in a)a.hasOwnProperty(i)&&e(a[i],h,b,i,d)}var d=!!a.test,f=d?a.yep:a.nope,g=a.load||a.both,h=a.callback,i;c(f),c(g),a.complete&&b.load(a.complete)}var g,h,i=this.yepnope.loader;if(C(a))e(a,0,i,0);else if(A(a))for(g=0;g<a.length;g++)h=a[g],C(h)?e(h,0,i,0):A(h)?H(h):B(h)&&b(h,i);else B(a)&&b(a,i)},H.addPrefix=function(a,b){F[a]=b},H.addFilter=function(a){E.push(a)},H.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",G=function(){b.removeEventListener("DOMContentLoaded",G,0),b.readyState="complete"},0)),a.yepnope=d()}(this,this.document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};

}


