

var win = null;

function NewWindow(mypage,myname,w,h,scroll){

LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;

TopPosition = (screen.height) ? (screen.height-h)/2 : 0;

settings =

'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'

win = window.open(mypage,myname,settings)

}

function writeCookie() {
	t = new Date();
	t.setTime(t.getTime() + 365 * 24 * 60 * 60 * 1000);
	document.cookie = 'iAgree=iAgreeNewE_pharma; path=/; expires=' + t.toGMTString();
}

function myGetCookie(myCookie){
   myCookie = myCookie + "=";
   myValue = null;
   myStr = document.cookie + ";" ;
   myOfst = myStr.indexOf(myCookie);
   if (myOfst != -1){
      myStart = myOfst + myCookie.length;
      myEnd   = myStr.indexOf(";" , myStart);
      myValue = unescape(myStr.substring(myStart,myEnd));
   }
   return myValue;
}

function myGetCookie(myCookie){
   myCookie = myCookie + "=";
   myValue = null;
   myStr = document.cookie + ";" ;
   myOfst = myStr.indexOf(myCookie);
   if (myOfst != -1){
      myStart = myOfst + myCookie.length;
      myEnd   = myStr.indexOf(";" , myStart);
      myValue = unescape(myStr.substring(myStart,myEnd));
   }
   return myValue;
}

iAgree = myGetCookie('iAgree');						// クッキーを読込


var iVisitCnt = myGetCookie('iVisitCnt');			// クッキーを読込
var iQuesDsp  = myGetCookie('iQuesDsp');			// クッキーを読込




var iDisp 		   = myGetCookie('iDisp');
var noLimitCookie  = myGetCookie('noLimitCookie');
var iAgree2  = myGetCookie('iAgree2');

if(iAgree != null){
	t = new Date();
	t.setTime(t.getTime() + 365 * 24 * 60 * 60 * 1000);
	document.cookie = 'iDisp=1; path=/; expires=' + t.toGMTString();
	
	iDisp = myGetCookie('iDisp'); 
}

if(iAgree2 == null && iDisp == 1 && noLimitCookie == null){
	//window.open("./html/contents/docscript/question.php", "question", "width=620, height=600, resizable=yes, scrollbars=yes");
	//window.open("http://211.133.243.197/~matsunaga-dic/e-pharma/html/contents/docscript/question.php", "question", "width=620, height=600, resizable=yes, scrollbars=yes");
	window.open("http://www.e-pharma.jp/html/contents/docscript/question.php", "question", "width=620, height=600, resizable=yes, scrollbars=yes");

}

if(iDisp == null){
	t = new Date();
	t.setTime(t.getTime() + 365 * 24 * 60 * 60 * 1000);
	document.cookie = 'iDisp=1; path=/; expires=' + t.toGMTString();
}

document.cookie = "noLimitCookie=1; path=/";
