var os, ua = navigator.userAgent;
if (ua.indexOf('iPhone') > -1 || ua.indexOf('iPad') > -1 || ua.indexOf('iPod') > -1) {
	if($.cookie("check")===null){
	 var now = new Date();
	 now.setTime(now.getTime()+ 3600 * 1000000000); //1時間(3600秒)後
	 $.cookie("check","ok",{expires:now});
		$(window).load(function () {
			$('html').css({overflow:'hidden'});
			if(document.getElementById("MDL_overlay") === null){
				$('body').append('<div id="MDL_overlay"></div>');
				if($.browser.msie && $.browser.version < 7){
					$('body','html').css({height: '100%', width: '100%'});
					$('#MDL_overlay').css('position','absolute');
					$('#MDL_overlay').css('top',$(document).scrollTop());
				}
			}
			if(document.getElementById("MDL_window") === null){
				$('body').append(
					'<div id="MDL_window">' +
					'<html xmlns="http://www.w3.org/1999/xhtml">' +
					'<head>' +
					'<title>iPhone</title>' +
					'<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' +
					'</head>' +
					'<body bgcolor="#000000">' +
					'<img name="iPhone" src="../tmp_img/iPhone.jpg" width="560" height="560" border="0" id="iPhone" usemap="#m_iPhone" alt="" /><map name="m_iPhone" id="m_iPhone">' +
					'<area shape="rect" coords="194,355,488,417" href="http://itunes.apple.com/jp/app/id420366855/" alt="" />' +
					'<area shape="rect" coords="109,465,446,503" href="http://www.nba.co.jp/" alt="" />' +
					'</map>' +
					'</body>' +
					'</html>' +
					'</div>'
				);
				if($.browser.msie && $.browser.version < 7){
					$('#MDL_window').css('position','absolute');
					$('#MDL_window').css('top',($(document).scrollTop() + $(window).height()/2) + "px");
				}
			}
			$('#MDL_overlay').show();
			$('#MDL_window').fadeIn('slow');
			$('#md_ok').click(function () {
				MDL_eliminate();
			});
			return false;
		});
	}
} 

function MDL_eliminate() {
	$('html').css({overflow:''});
	$('#MDL_overlay').fadeOut('fast');
	$('#MDL_window').fadeOut('fast');
	if($.browser.msie && $.browser.version < 7){
		$("body","html").css({height: "auto", width: "auto"});
	};
	setTimeout('MDL_remove()',500);
}
function MDL_remove() {
	$('#MDL_overlay').remove();
	$('#MDL_window').remove();
}


