// JavaScript Document
var Xcoord = 270;
var Ycoord;
var x = 1;

//returns the width of the browser

function GetWidth()
{
        var x = 0;
        if (self.innerHeight)
        {
                x = self.innerWidth;
        }
        else if (document.documentElement && document.documentElement.clientHeight)
        {
                x = document.documentElement.clientWidth;
        }
        else if (document.body)
        {
                x = document.body.clientWidth;
      	}
		return x;
};


function lectures(e){
	Ycoord = e.pageY - 60;
	MidWidth = GetWidth() / 2;
	Xcoord = ((window.Event) ? e.pageX : event.clientX) - MidWidth + 475; //position of event - MidWidth + 520(half of template width)
	//Xcoord = e.pageX / 2;
	obj = 'hover_box';
	document.getElementById(obj).style.top = Ycoord + "px";
	document.getElementById(obj).style.left = Xcoord + "px";
	//alert('fired' + Ycoord + ' ' + Xcoord + " X = " + x);
	//alert(x);
	$('#hover_heading').html('<span style="color:#66cc00">&#12524;&#12463;&#12481;&#12515;&#12540;</span>');
	$('#hover_text').html('&#26178;&#20107;&#21839;&#38988;&#12289;&#33521;&#22269;&#12398;&#26286;&#12425;&#12375;&#12539;&#25991;&#21270;&#12289;&#33521;&#35486;&#12395;&#38306;&#12377;&#12427;&#27096;&#12293;&#12394;&#35441;&#38988;&#12434;&#21462;&#12426;&#19978;&#12370;&#12414;&#12377;&#12290;');
	//if (x%2 == 0) {setYLVisible(obj);}
	if (document.getElementById(obj).style.visibility = 'hidden'){		
	setYLVisible(obj);
	};
	x= x+1;	
};

function one2one(e){
	Ycoord = e.pageY - 60;
	MidWidth = GetWidth() / 2;
	Xcoord = ((window.Event) ? e.pageX : event.clientX) - MidWidth + 475; //position of event - MidWidth + 520(half of template width)
	//Xcoord = e.pageX / 2;
	obj = 'hover_box';
	document.getElementById(obj).style.top = Ycoord + "px";
	document.getElementById(obj).style.left = Xcoord + "px";
	//alert('fired' + Ycoord + ' ' + Xcoord + " X = " + x);
	//alert(x);
	$('#hover_heading').html('<span style="color:#ffcc00">&#12510;&#12531;&#12484;&#12540;&#12510;&#12531;&#12539;&#12524;&#12483;&#12473;&#12531;</span>');
	$('#hover_text').html('&#12467;&#12531;&#12469;&#12523;&#12486;&#12540;&#12471;&#12519;&#12531;&#12395;&#22522;&#12389;&#12365;&#12289;&#25945;&#24107;&#12364;&#12354;&#12394;&#12383;&#12398;&#33521;&#35486;&#21147;&#12434;&#39640;&#12417;&#12427;&#12383;&#12417;&#12398;&#12486;&#12540;&#12521;&#12540;&#12513;&#12452;&#12489;&#12398;&#12503;&#12525;&#12464;&#12521;&#12512;&#12434;&#20316;&#25104;&#12375;&#12414;&#12377;');
	//if (x%2 == 0) {setYLVisible(obj);}
	if (document.getElementById(obj).style.visibility = 'hidden'){	
	setYLVisible(obj);
	};
	x= x+1;	
};

function dstudy(e){
	Ycoord = e.pageY - 60;
	MidWidth = GetWidth() / 2;
	Xcoord = ((window.Event) ? e.pageX : event.clientX) - MidWidth + 475; //position of event - MidWidth + 520(half of template width)
	//Xcoord = e.pageX / 2;
	obj = 'hover_box';
	document.getElementById(obj).style.top = Ycoord + "px";
	document.getElementById(obj).style.left = Xcoord + "px";
	//alert('fired' + Ycoord + ' ' + Xcoord + " X = " + x);
	//alert(x);
	$('#hover_heading').html('<span style="color:#ff0099">&#25351;&#23566;&#23398;&#32722;</span>');
	$('#hover_text').html('&#25945;&#24107;&#12399;&#27598;&#36913;&#12289;&#25480;&#26989;&#26178;&#38291;&#22806;&#12391;&#21462;&#12426;&#32068;&#12416;&#12383;&#12417;&#12398;&#20491;&#20154;&#21029;&#12398;&#23398;&#32722;&#35506;&#38988;&#12434;&#25552;&#20986;&#12375;&#12414;&#12377;&#12290;&#12371;&#12428;&#12425;&#12398;&#35506;&#38988;&#12399;&#12473;&#12479;&#12487;&#12451;&#12475;&#12531;&#12479;&#12540;&#12420;&#23478;&#12391;&#34892;&#12358;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#12354;&#12394;&#12383;&#12398;&#20986;&#24109;&#29575;&#12399;&#35352;&#37682;&#12373;&#12428;&#12289;&#12414;&#12383;&#23398;&#32722;&#36914;&#25431;&#24230;&#12418;&#28204;&#23450;&#12373;&#12428;&#12414;&#12377;&#12290;');
	//if (x%2 == 0) {setYLVisible(obj);}
	if (document.getElementById(obj).style.visibility = 'hidden'){	
	setYLVisible(obj);
	};
	x= x+1;
};

function gstudy(e){
	Ycoord = e.pageY - 60;
	MidWidth = GetWidth() / 2;
	Xcoord = ((window.Event) ? e.pageX : event.clientX) - MidWidth + 475; //position of event - MidWidth + 520(half of template width)
	//Xcoord = e.pageX / 2;
	obj = 'hover_box';
	document.getElementById(obj).style.top = Ycoord + "px";
	document.getElementById(obj).style.left = Xcoord + "px";
	//alert('fired' + Ycoord + ' ' + Xcoord + " X = " + x);
	//alert(x);
	$('#hover_heading').html('<span style="color:#339966">&#33258;&#20027;&#23398;&#32722;</span>');
	$('#hover_text').html('&#12473;&#12479;&#12487;&#12451;&#12475;&#12531;&#12479;&#12540;&#12391;&#12289;&#25945;&#24107;&#12398;&#12450;&#12489;&#12496;&#12452;&#12473;&#12392;&#21508;&#31278;&#12398;&#23398;&#32722;&#25945;&#26448;&#12434;&#12372;&#27963;&#29992;&#12367;&#12384;&#12373;&#12356;&#12290;&#21508;&#12467;&#12540;&#12473;&#12398;&#33258;&#20027;&#23398;&#32722;&#26178;&#38291;&#12399;&#12505;&#12523;&#12364;&#25512;&#34214;&#12377;&#12427;&#12418;&#12398;&#12391;&#12377;&#12364;&#12289;&#12473;&#12479;&#12487;&#12451;&#12475;&#12531;&#12479;&#12540;&#12408;&#12399;&#12381;&#12398;&#20182;&#12398;&#26178;&#38291;&#12391;&#12418;&#12450;&#12463;&#12475;&#12473;&#12391;&#12365;&#12414;&#12377;&#12290;');
	//if (x%2 == 0) {setYLVisible(obj);}
	if (document.getElementById(obj).style.visibility = 'hidden'){	
	setYLVisible(obj);
	};
	x= x+1;
};

function group(e){
	Ycoord = e.pageY - 60;
	MidWidth = GetWidth() / 2;
	Xcoord = ((window.Event) ? e.pageX : event.clientX) - MidWidth + 475; //position of event - MidWidth + 520(half of template width)
	//Xcoord = e.pageX / 2;
	obj = 'hover_box';
	document.getElementById(obj).style.top = Ycoord + "px";
	document.getElementById(obj).style.left = Xcoord + "px";
	//alert('fired' + Ycoord + ' ' + Xcoord + " X = " + x);
	//alert(x);
	$('#hover_heading').html('<span style="color:#ff6600">&#12464;&#12523;&#12540;&#12503;&#12539;&#12524;&#12483;&#12473;&#12531;</span>');
	$('#hover_text').html('&#12463;&#12521;&#12473;&#12513;&#12540;&#12488;&#12392;&#20849;&#12395;&#25945;&#24107;&#12363;&#12425;&#21463;&#12369;&#12427;&#25480;&#26989;&#12290;');
	//if (x%2 == 0) {setYLVisible(obj);}
	if (document.getElementById(obj).style.visibility = 'hidden'){	
	setYLVisible(obj);
	};
	x= x+1;
	};






function setDim (id_d, h) {  
document.getElementById(id_d).style.height=h + "px";
//alert("setDim Fired");
}

function getDim (id) {  
document.getElementById(id).style.height="auto";
// match box models
if (document.all) {
gh = document.getElementById(id).offsetHeight+10;
}
else {
gh = document.getElementById(id).offsetHeight;
}

if (/msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent)){
	//alert("isIE");
	h = gh-30;
}
else {	
h = gh-20;
}

//alert ("getDim fired h = " + h);


switch (id)
{
	case "hover_box":
	setDim("hover_box_l", h);
	setDim("hover_box_r", h);
	break;
	
}

}



function setYLVisible(obj)
{
	getDim(obj);
	obj = document.getElementById(obj);
	obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';
}
