const CONFIRM_MESSAGE = "スマートフォン専用ページへアクセスしますか？";
const DEBUG = false;

// PC TOP用
$(document).ready(function() {
	var agent = navigator.userAgent;

	if(DEBUG || agent.indexOf('iPhone') != -1 ||
		// agent.indexOf('Android') != -1 ||
		agent.indexOf('iPad') != -1){

		cookie_use_smart = $.cookie('use_smart');

		confirm_check = false;
		if(cookie_use_smart != null) {
			confirm_check = (cookie_use_smart == "on");
		} else {
			confirm_check = confirm(CONFIRM_MESSAGE);
		}

		if(confirm_check) {
			// リダイレクト
			location.href = 'smart/';
		} else {
			$.cookie('use_smart', 'off', { expires: get_expires(), path: '/dora/' });
		}
	}

	function get_expires(){
		return 1;
		var dt = new Date();
		dt.setSeconds(dt.getSeconds() + (60*30));
		return dt;
	}
});

