
function add_cookie(cookie_name_type,id){
	document.location = "http://www.pachinkovillage.ne.jp/pv/pc/machine/machine_comparison_table.php?type=p";
	return false;
}

function getCookie(cookie_name){
	
	var cookie_name = cookie_name + "=";
	var cookie      = document.cookie + ";";
	var start       = cookie.indexOf(cookie_name);
	if(start != -1){
		var end = cookie.indexOf(";",start);
		return unescape(cookie.substring(start + cookie_name.length, end));
	}
	
	return("");
}

function getCookieDate(addMonths){
	
	if(addMonths==undefined) addMonths = 0;
	
	var now     = new Date();
	
	var day     = now.getDate();
	var month   = now.getMonth() + addMonths;
	var year    = now.getFullYear();
	var hours   = now.getHours()
	var minutes = now.getMinutes();
	var seconds = now.getSeconds()
	
	var endDay = new Date(year, month, 0);
	if(day > endDay.getDate()) day = endDay.getDate();
    
	var date = new Date(year, month, day ,hours ,minutes ,seconds);
	
	var week_array  = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
	var month_array = new Array("Jan","Feb","Mar","Apl","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	var week        = date.getDay();
	var month       = date.getMonth();
	
	var cdate =
	week_array[week] + ", " + 
	date.getDate() + "-" + 
	month_array[month] + "-" + 
	date.getFullYear() + " " + 
	date.getHours() + ":" + 
	date.getMinutes() + ":" + 
	date.getSeconds() + " JST";
	
	return cdate;
}

