/* iPhone、PCページへの切り替えCookie */
function getCookie(name) {
	if (!name || !document.cookie) return;

	var cookies = document.cookie.split("; ");
	for (var i = 0; i < cookies.length; i++) {
		var str = cookies[i].split("=");
		if (str[0] != name) continue;
		return unescape(str[1]);
	}
	return;
}

function setCookie( name, value, domain, path, expires, secure ) {
	if (!name) return;
	path ="/";
	var str = name + "=" + escape(value);

	if (domain) {
		if (domain == 1) domain = location.hostname.replace(/^[^\.]*/, "");
		str += "; domain=" + domain;
	}
	if (path) {
		if (path == 1) path = location.pathname;
		str += "; path=" + path;
	}
	if (expires) {
		var nowtime = new Date().getTime();
		expires = new Date(nowtime + (60 * 60 * 24 * 1000 * expires));
		expires = expires.toGMTString();
		str += "; expires=" + expires;
	}
	if (secure && location.protocol == "https:") {
		str += "; secure";
	}

	document.cookie = str;
}
var cookieValue;
if(getCookie("type_iphone")){
	cookieValue = getCookie("type_iphone");
}else {
	cookieValue = setCookie("type_iphone","iPhone");
	cookieValue = getCookie("type_iphone");
}

