
function getToday (){
	var ex = new Date();
　　ex.setHours(ex.getHours() + 3);
	ex = ex.toGMTString();//変換
	return ex;
}

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

function setCookie(theValue){
	document.cookie = "fontsize=" + theValue + ";expires=" + getToday();
}


function setCurrentFontSize (prop) {
	var cflag	= setCookie(prop);
	location.reload();
}

function getCurrentSize () {
	var currentFontSize	= "";
	currentFontSize		= getCookie("fontsize");
	switch (currentFontSize) {
		case "":	currentFontSize	= "small";	break;
		case false:	currentFontSize	= "small";	break;
	}
	setCookie(currentFontSize);
	var styles	= "<link media='all' href='css/style-" + currentFontSize + ".css' rel='stylesheet' type='text/css' />\n";
	document.write(styles);
}


function openbox(){
	if($("#hidden").is(":hidden")){
		$("#hidden").slideDown("slow");
		$("#btn").attr("src","imgs/courses/close.gif");
	} else {
		$("#hidden").slideUp("slow");
		$("#btn").attr("src","imgs/courses/readmore.gif");
	}
}



function openWin(file,w,h){
	window.open(file,"","width=" + w + ",height=" + h);
}


function setPagetop(){
	var name = "#pagetopbtn";
	var menuYloc = null;
	$(document).ready(function(){
		menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")))
		$(window).scroll(function () { 
		offset = menuYloc+$(document).scrollTop()+"px";
			$(name).animate({top:offset},{duration:0,queue:false});
		});
	}); 
}










