// クッキーの期限決定
var expdate = new Date();
expdate.setTime(expdate.getTime() +(365*24*60*60*1000*10));	//クッキーは10年
var expiryDate = expdate.toGMTString();

// クッキー設定関数
function setCookie(name,value){
	document.cookie = name + "=" + escape(value) + ";expires=" + expiryDate + ";path=/";
}

// クッキー読出関数
function getCookie(name){
var search = name + "=";
if(document.cookie.length>0){
	offset = document.cookie.indexOf(search);
	if(offset !=-1){
	offset += search.length;
	end = document.cookie.indexOf(";",offset);
	if(end == -1) end = document.cookie.length;
	return unescape(document.cookie.substring(offset,end));
	}
	}
}

function slctCss(name){
	var cookieValue = getCookie(name);
	if(getCookie(name)!=null){
	document.write("<link rel='stylesheet' href='/common/css/"+cookieValue+".css' type='text/css'>");}
	else {
	document.write("<link rel='stylesheet' href='/common/css/type_b.css' type='text/css'>");}
	}
slctCss('style');

function slctUrl(name){
	var cookieValue = getCookie(name);
	document.write("<map name='Map'>");
	document.write("<area shape='rect' coords='21,15,274,55' href='/index.html'>");
	if(cookieValue == "type_a"){
	document.write("<area shape='circle' coords='708,49,49' href='/type01/index.html'>");}
	if(cookieValue == "type_c"){
	document.write("<area shape='circle' coords='708,49,49' href='/type03/index.html'>");}
	else {
	document.write("<area shape='circle' coords='708,49,49' href='/type02/index.html'>");}
	document.write("</map> ");
	}
