// 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">&#44053;&#51032;</span>');
	$('#hover_text').html('&#49884;&#49324;&#47928;&#51228;, &#50689;&#44397; &#49373;&#54876;&#44284; &#47928;&#54868;, &#50689;&#50612; &#46321; &#45796;&#50577;&#54620; &#51452;&#51228;&#47484; &#45459;&#44256; &#51652;&#54665;&#54616;&#45716; &#53664;&#51032;&#49884;&#44036;.');
	//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">1 &#45824; 1 &#49688;&#50629;</span>');
	$('#hover_text').html('&#54620; &#44053;&#49324;&#44032; &#54620; &#54617;&#49373;&#51012; &#49345;&#45824;&#47196; &#47582;&#52644;&#54805; &#54532;&#47196;&#44536;&#47016;&#51012; &#47560;&#47144;&#54616;&#50668; &#44536; &#54617;&#49373;&#51032; &#50689;&#50612; &#49892;&#47141;&#51012; &#48156;&#51204;&#49884;&#53020; &#45208;&#44049;&#45768;&#45796;.');
	//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">&#44053;&#49324; &#51648;&#46020; &#54616;&#50640; &#51652;&#54665;&#54616;&#45716; &#51088;&#49845;</span>');
	$('#hover_text').html('&#44053;&#49324;&#44032; &#44033; &#54617;&#49373;&#50640;&#44172; &#47582;&#45716; &#44060;&#48324; &#54532;&#47196;&#44536;&#47016;&#51012; &#47588;&#51452; &#51221;&#54644; &#45459;&#44256; &#54617;&#49373; &#54844;&#51088;&#49436; &#47560;&#52824;&#44172; &#54633;&#45768;&#45796;. &#51060; &#44284;&#51228;&#45716; &#49828;&#53552;&#46356; &#49468;&#53552;&#50640;&#49436; &#54624; &#49688;&#46020; &#51080;&#44256; &#51665;&#50640; &#44032;&#51256; &#44032;&#49436;&#46020; &#54624; &#49688; &#51080;&#49845;&#45768;&#45796;. &#54617;&#49373;&#51032; &#52636;&#49437; &#50668;&#48512;&#44032; &#44592;&#47197;&#46104;&#44256; &#51652;&#46020;&#44284;&#51221;&#51060; &#54217;&#44032;&#46121;&#45768;&#45796;.');
	//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">&#50504;&#45236;&#47484; &#48155;&#51004;&#47728; &#51652;&#54665;&#54616;&#45716; &#51088;&#49845;</span>');
	$('#hover_text').html('&#49828;&#53552;&#46356; &#49468;&#53552;&#50640; &#51080;&#45716; &#45796;&#50577;&#54620; &#54617;&#49845;&#51088;&#47308;&#47484; &#51060;&#50857;&#54624; &#49104; &#50500;&#45768;&#46972; &#44053;&#49324;&#46308;&#51032; &#50504;&#45236;&#47484; &#48155;&#51004;&#47728; &#44277;&#48512;&#54624; &#49688; &#51080;&#49845;&#45768;&#45796;. &#44033; &#44284;&#51221;&#47560;&#45796; &#50504;&#45236;&#47484; &#48155;&#51004;&#47728; &#51088;&#49845;&#54616;&#45716; &#49884;&#44036;&#51060; &#51221;&#54644;&#51256; &#51080;&#51648;&#47564;, &#51060; &#49884;&#44036; &#51060;&#50808;&#50640;&#46020; &#49828;&#53552;&#46356; &#49468;&#53552;&#47484; &#51060;&#50857;&#54624; &#49688; &#51080;&#49845;&#45768;&#45796;.');
	//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">&#45800;&#52404; &#49688;&#50629;</span>');
	$('#hover_text').html('&#54620; &#53364;&#47000;&#49828;&#51032; &#44053;&#49324;, &#46041;&#47308; &#54617;&#49373;&#46308;&#44284; &#54632;&#44760; &#48372;&#45236;&#45716; &#49884;&#44036;.');
	//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';
}
