// JavaScript Document


var param = {
	quality: 'high',
	bgcolor: '#FFFFFF',
	menu: 'false',
	allowFullScreen: 'false',
	allowScriptAccess: 'sameDomain'
};

var attributes = {
  id: 'relaxine',
  name: 'relaxine'
};


function init()
{
	//開きたい幅・高さ
	var contentW = 1024;
	var contentH = 693;
	
	var ua = navigator.userAgent;       // ユーザーエージェント
	var nWidth, nHeight;                   // Window内のサイズ
	var nHit = ua.indexOf("MSIE");     // 合致した部分の先頭文字の添え字
	var bIE = (nHit >=  0);                 // IE かどうか
	var bVer6 = (bIE && ua.substr(nHit+5, 1) == "6");  // バージョンが 6 かどうか
	var bStd = (document.compatMode && document.compatMode == "CSS1Compat"); // 標準モードかどうか
	
	if(bIE)
	{
		if (bVer6 && bStd)
		{
			nWidth = document.documentElement.clientWidth;
			nHeight = document.documentElement.clientHeight;
		}
		else
		{
			nWidth = document.body.clientWidth;
			nHeight = document.body.clientHeight;
		}
	}
	else
	{
		nWidth = window.innerWidth;
		nHeight = window.innerHeight;
	}
	
	
	if(bIE && bVer6)
	{
		var min_max_width = function(){
		
    	var w = document.body.clientWidth;
			var h = document.body.clientHeight;
			document.getElementById('wrapper').style.width = (w < contentW) ?  (contentW + 'px')  : '100%';
			document.getElementById('wrapper').style.height = (h < contentH) ?  (contentH + 'px')  : '100%';
		};

  		attachEvent('onresize', min_max_width);
	}
	else
	{
		document.getElementById('wrapper').style.minWidth = contentW + 'px';
		document.getElementById('wrapper').style.minHeight = contentH + 'px';
	}
	
	
	if (swfobject.hasFlashPlayerVersion("9.0.45")) {
		// has Flash
		swfobject.embedSWF('relaxine.swf', 'relaxine', '100%', '100%', '9.0.45', 'js/expressinstall.swf', flashvars, param, attributes);
	}
	else {
		// no Flash
		var iHTML = '';
		iHTML += '<p>In order to view this page you need Flash Player 9+ support!</p>';
		iHTML += '<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>';
		
		document.getElementById('relaxine').innerHTML = iHTML;
	}
}