function PopUp(){
		if(window.opera){
			var H	= window.pageYOffset;
		}else if(document.all){
			var b	= document.getElementsByTagName('BODY');
			var H	= b[0].scrollTop;
		}else if(document.layers||document.getElementById){
			var H	= window.pageYOffset;
		}
		document.getElementById('Layer1').style.left=ww()+'px';
		document.getElementById('Layer1').style.top=H+200+'px';
}
function PopOff(){
	document.getElementById('Layer1').style.top='-999px';
}
function cCkk(num){
	if(window.navigator.cookieEnabled){
		var port=window.location.port
		var myCookie	=document.cookie;
		if((myCookie.match(/SESSIONID/)&&myCookie.match(/BIGipServerpool_https/))||(port>0)){
			location.href = gtURI[num]+'?i=gt';
		}else{
			PopUp();
		}
	}else{
	alert('cookieを有効にしてください');
	}
}

function tk_setCookie(key, value, period) {
	var	nowtime	= new Date().getTime();
	var	limit	= new Date(nowtime + (60 * 60 * 24 * 1000 * period));
	var	expires = limit.toGMTString();
	// クッキーの発行（書き込み）
	document.cookie = key + "=" + escape(value) + "; expires=" + expires +";path=/";
}

(function(){
window.onload=function(){
	getCookie();
	makeCookies();
}

var	expires		= new Date();
var	expiresNum	= expires.getTime()
var	exNowDate	= Math.floor(expiresNum/(1000 * 60 * 60 * 24));
var	exHash		= exNowDate%30
var	values		={
		myArray1	: false,
		myArray2	: false,
		difference	: false
	}

function setCookie(value,_expires_){
	var	_expires = expires;
		_expires.setTime(expiresNum + (_expires_ * 1000 * 60 * 60 * 24));
	var	expiresGMT 	= _expires.toGMTString();
	if(cookies.arg.difference){
		var _Difference	= expiresNum-cookies.arg.difference;
		Difference = Math.floor(_Difference/(1000*60*10))
	}else{
		var	Difference	= 1;
	}
	for(var i in value){
		if(Difference>0){
			document.cookie = i+'=' + escape(value[i]) + '; expires=' + expiresGMT +";path=/";
		}
	}
	getCookie();
	var	myArray	= cookies.arg.myArray2.split('-');
	var	total	= new Number();
	var day		= new Number();
	for(var i = 0;myArray.length>i;i++){
		total	+=myArray[i]*1;
		day		+=(myArray[i]*1)? 1:0;
	}
	var file	= '/img/count.html?i=count_total-'+total+'-/-count_day-'+day+'-/-'+cookies.arg.myArray2;
	requestFile(file,'count');
}

function getCookie(){
	cookies={
		"myCookie"	: document.cookie,
		"arg"		: new Array()
	}
	var	_arg	= cookies.myCookie.split(';')
	for (i in _arg){
		var temp=_arg[i].split('=');
		temp[1]	= temp[1]||false;
		temp[0]	= temp[0].toString().replace(/ /ig,'')
		cookies.arg[temp[0]]=temp[1];
	}
}
function makeCookies(){
	var	myArray1	= (cookies.arg.myArray1)? cookies.arg.myArray1.split('-'):new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
	var	myArray2	= (cookies.arg.myArray2)? cookies.arg.myArray2.split('-'):new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
		temp	= new Array()
	for(var i=0 ;myArray1.length>i; i++){
		if(isNaN(myArray1[i])){
			myArray1[i]=0
		}
		if(exHash==i){
			if(exNowDate==myArray1[i]){
				myArray2[i]=myArray2[i]*1+1;
			}else{
				myArray1[i]=exNowDate;
				myArray2[i]=1;
			}
		}else if(exNowDate-myArray1[i]>=30){
			myArray1[i]=0;
			myArray2[i]=0;
		}
		temp[i]=exNowDate-myArray1[i]
	}
	values.myArray1		= myArray1.join('-');
	values.myArray2		= myArray2.join('-');
	values.difference	= expiresNum;
	setCookie(values,30);
}
})();

function func_count(){
}
