function fncSetCookie(vstrArg , vstrKey){
	var intDate = 0;  // 有効期限の日数を設定

  objDate = new Date();
  objDate.setTime(objDate.getTime()+(intDate*24*60*60*1000));
  
  strData = "@" + vstrKey + "=" + escape(vstrArg) + ";";

  document.cookie =  strData;
}

function fncGetCookie(vstrKey){
	var i = 0;
	var strKey      = '@' + vstrKey + '=';
	var strCookie   = '';
	var astrCookies = document.cookie.split(';');
	var strValue    = '';

	for (i = 0; i < astrCookies.length; i ++) {
		if (astrCookies[i].indexOf(strKey) >= 0) {
			strCookie = astrCookies[i].replace(/ /i,'');
		}
	}
	if (strCookie.indexOf(strKey) >= 0) {
		strValue = strCookie.substr(strCookie.indexOf(strKey) + strKey.length, strCookie.length);	
	}
	return strValue;
}


function fnccheck(){
	flag = fncGetCookie("nikkiso");
	if (flag == ""){
		try{
			var strID = "wrapper";
			var objElement = document.getElementById(strID);
			objElement.style.display = "block";
			objElement.style.position = "";
		}catch( e ){

		}
	}else{
		try{
			var strID = "wrapper";
			var objElement = document.getElementById(strID);
			objElement.style.display = "none";
			objElement.style.position = "absolute";
			flag = "/medical/index.html";
			location.href = flag;
		}catch( e ){

		}
	}
}



function fnccheck2(){
	flag = fncGetCookie("nikkiso");
	if (flag == ""){
		try{
			var strID = "wrapper";
			var objElement = document.getElementById(strID);
			objElement.style.display = "none";
			objElement.style.position = "absolute";
			flag = "/medical/checker.html";
			location.href = flag;
		}catch( e ){

		}
	}else{
		try{
			var strID = "wrapper";
			var objElement = document.getElementById(strID);
			objElement.style.display = "block";
			objElement.style.position = "";
		}catch( e ){

		}
	}
}


function fncset(){
	fncSetCookie('1','nikkiso')
	flag = "/medical/index.html";
	location.href = flag;
}
