if ((navigator.userAgent.indexOf('iPhone') > 0 && navigator.userAgent.indexOf('iPad') == -1) || navigator.userAgent.indexOf('iPod') > 0 || navigator.userAgent.indexOf('Android') > 0) {

	date = getCookie("Date");
	if (date == "pc") {
	    document.write('<a href="javascript:;" onclick="smart();" id="smart_view">スマートフォンサイトを表示する。</a> ');
	}else{
		document.write('<a href="javascript:;" onclick="pc();" id="smart_view">パソコンサイトを表示する。</a>');
		document.write('<link rel="stylesheet" href="/css/smart.css" type="text/css" />');
	}


	//setCookie("Date", date);

	//PCサイトを表示する
	function pc(){
		date = "pc";
		setCookie("Date", date);
		location.href = '';
	}
	
	//スマートフォンサイトを表示する
	function smart(){
		date = "";
		setCookie("Date", date);
		location.href = '';
	}
	
	function getCookie(key,  tmp1, tmp2, xx1, xx2, xx3) {
	    tmp1 = " " + document.cookie + ";";
	    xx1 = xx2 = 0;
	    len = tmp1.length;
	    while (xx1 < len) {
	        xx2 = tmp1.indexOf(";", xx1);
	        tmp2 = tmp1.substring(xx1 + 1, xx2);
	        xx3 = tmp2.indexOf("=");
	        if (tmp2.substring(0, xx3) == key) {
	            return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1)));
	        }
	        xx1 = xx2 + 1;
	    }
	    return("");
	}
	function setCookie(key, val, tmp) {
	    tmp = key + "=" + escape(val) + "; ";
	    // tmp += "path=" + location.pathname + "; ";
	    tmp += "expires=Tue, 31-Dec-2030 23:59:59; ";
	    document.cookie = tmp;
	}
	function clearCookie(key) {
	    document.cookie = key + "=" + "xx; expires=Tue, 1-Jan-1980 00:00:00;";
	}
    
}else{
	

	
}
