// 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">&#1051;&#1077;&#1082;&#1094;&#1080;&#1080;</span>');
	$('#hover_text').html('&#1051;&#1077;&#1082;&#1094;&#1080;&#1080; &#1086;&#1093;&#1074;&#1072;&#1090;&#1099;&#1074;&#1072;&#1102;&#1090;  &#1088;&#1072;&#1079;&#1085;&#1086;&#1086;&#1073;&#1088;&#1072;&#1079;&#1085;&#1099;&#1081; &#1088;&#1103;&#1076; &#1090;&#1077;&#1084;, &#1074;&#1082;&#1083;&#1102;&#1095;&#1072;&#1103; &#1086;&#1073;&#1089;&#1091;&#1078;&#1076;&#1077;&#1085;&#1080;&#1077; &#1090;&#1077;&#1082;&#1091;&#1097;&#1080;&#1093; &#1089;&#1086;&#1073;&#1099;&#1090;&#1080;&#1081;, &#1078;&#1080;&#1079;&#1085;&#1100; &#1074;  &#1042;&#1077;&#1083;&#1080;&#1082;&#1086;&#1073;&#1088;&#1080;&#1090;&#1072;&#1085;&#1080;&#1080; &#1080; &#1072;&#1085;&#1075;&#1083;&#1080;&#1081;&#1089;&#1082;&#1080;&#1081; &#1103;&#1079;&#1099;&#1082;.');
	//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">&#1054;&#1073;&#1091;&#1095;&#1077;&#1085;&#1080;&#1077; &laquo;&#1086;&#1076;&#1080;&#1085; &#1085;&#1072; &#1086;&#1076;&#1080;&#1085;&raquo;</span>');
	$('#hover_text').html('&#1050;&#1086;&#1085;&#1089;&#1091;&#1083;&#1100;&#1090;&#1080;&#1088;&#1091;&#1103;&#1089;&#1100; &#1089;       &#1042;&#1072;&#1084;&#1080;, &#1074;&#1072;&#1096; &#1091;&#1095;&#1080;&#1090;&#1077;&#1083;&#1100; &#1089;&#1086;&#1089;&#1090;&#1072;&#1074;&#1083;&#1103;&#1077;&#1090; &#1080;&#1085;&#1076;&#1080;&#1074;&#1080;&#1076;&#1091;&#1072;&#1083;&#1100;&#1085;&#1099;&#1081; &#1082;&#1091;&#1088;&#1089; &#1076;&#1083;&#1103; &#1088;&#1072;&#1079;&#1074;&#1080;&#1090;&#1080;&#1103; &#1042;&#1072;&#1096;&#1080;&#1093;       &#1085;&#1072;&#1074;&#1099;&#1082;&#1086;&#1074; &#1072;&#1085;&#1075;&#1083;&#1080;&#1081;&#1089;&#1082;&#1086;&#1075;&#1086; &#1103;&#1079;&#1099;&#1082;&#1072;.');
	//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">&#1062;&#1077;&#1083;&#1077;&#1074;&#1086;&#1077; &#1086;&#1073;&#1091;&#1095;&#1077;&#1085;&#1080;&#1077;</span>');
	$('#hover_text').html('&#1042;&#1072;&#1096; &#1087;&#1088;&#1077;&#1087;&#1086;&#1076;&#1072;&#1074;&#1072;&#1090;&#1077;&#1083;&#1100; &#1085;&#1072;&#1079;&#1085;&#1072;&#1095;&#1080;&#1090; &#1080;&#1085;&#1076;&#1080;&#1074;&#1080;&#1076;&#1091;&#1072;&#1083;&#1100;&#1085;&#1091;&#1102; &#1087;&#1088;&#1086;&#1075;&#1088;&#1072;&#1084;&#1084;&#1091;  &#1086;&#1073;&#1091;&#1095;&#1077;&#1085;&#1080;&#1103; &#1076;&#1083;&#1103; &#1042;&#1072;&#1089;, &#1082;&#1086;&#1090;&#1086;&#1088;&#1086;&#1081; &#1042;&#1099; &#1073;&#1091;&#1076;&#1077;&#1090;&#1077; &#1089;&#1083;&#1077;&#1076;&#1086;&#1074;&#1072;&#1090;&#1100; &#1077;&#1078;&#1077;&#1085;&#1077;&#1076;&#1077;&#1083;&#1100;&#1085;&#1086; &#1087;&#1086; &#1091;&#1076;&#1086;&#1073;&#1085;&#1086;&#1084;&#1091; &#1076;&#1083;&#1103; &#1042;&#1072;&#1089;  &#1075;&#1088;&#1072;&#1092;&#1080;&#1082;&#1091;. &#1042;&#1099; &#1084;&#1086;&#1078;&#1077;&#1090;&#1077; &#1089;&#1083;&#1077;&#1076;&#1086;&#1074;&#1072;&#1090;&#1100; &#1087;&#1088;&#1086;&#1075;&#1088;&#1072;&#1084;&#1084;&#1077; &#1074; &#1091;&#1095;&#1077;&#1073;&#1085;&#1086;&#1084; &#1094;&#1077;&#1085;&#1090;&#1088;&#1077; &#1080;&#1083;&#1080; &#1076;&#1086;&#1084;&#1072;. &#1042;&#1072;&#1096;&#1072;  &#1087;&#1086;&#1089;&#1077;&#1097;&#1072;&#1077;&#1084;&#1086;&#1089;&#1090;&#1100; &#1073;&#1091;&#1076;&#1077;&#1090; &#1086;&#1090;&#1084;&#1077;&#1095;&#1072;&#1090;&#1100;&#1089;&#1103; &#1080; &#1084;&#1099; &#1073;&#1091;&#1076;&#1077;&#1084; &#1086;&#1094;&#1077;&#1085;&#1080;&#1074;&#1072;&#1090;&#1100; &#1042;&#1072;&#1096; &#1087;&#1088;&#1086;&#1075;&#1088;&#1077;&#1089;&#1089;.');
	//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">&#1053;&#1072;&#1087;&#1088;&#1072;&#1074;&#1083;&#1077;&#1085;&#1085;&#1086;&#1077; &#1086;&#1073;&#1091;&#1095;&#1077;&#1085;&#1080;&#1077;</span>');
	$('#hover_text').html('&#1042;&#1086;&#1089;&#1087;&#1086;&#1083;&#1100;&#1079;&#1091;&#1081;&#1090;&#1077;&#1089;&#1100; &#1088;&#1103;&#1076;&#1086;&#1084;  &#1091;&#1095;&#1077;&#1073;&#1085;&#1099;&#1093; &#1084;&#1072;&#1090;&#1077;&#1088;&#1080;&#1072;&#1083;&#1086;&#1074; &#1080; &#1089;&#1086;&#1074;&#1077;&#1090;&#1072;&#1084;&#1080; &#1087;&#1088;&#1077;&#1087;&#1086;&#1076;&#1072;&#1074;&#1072;&#1090;&#1077;&#1083;&#1077;&#1081; &#1074; &#1091;&#1095;&#1077;&#1073;&#1085;&#1086;&#1084; &#1094;&#1077;&#1085;&#1090;&#1088;&#1077;. &#1063;&#1080;&#1089;&#1083;&#1086; &#1095;&#1072;&#1089;&#1086;&#1074;  &#1085;&#1072;&#1087;&#1088;&#1072;&#1074;&#1083;&#1077;&#1085;&#1085;&#1086;&#1075;&#1086; &#1086;&#1073;&#1091;&#1095;&#1077;&#1085;&#1080;&#1103; &#1085;&#1072; &#1082;&#1072;&#1078;&#1076;&#1086;&#1084; &#1082;&#1091;&#1088;&#1089;&#1077; &ndash; &#1101;&#1090;&#1086; &#1074;&#1089;&#1077;&#1075;&#1086; &#1083;&#1080;&#1096;&#1100; &#1085;&#1072;&#1096;&#1072; &#1088;&#1077;&#1082;&#1086;&#1084;&#1077;&#1085;&#1076;&#1072;&#1094;&#1080;&#1103;. &#1042;&#1099;  &#1084;&#1086;&#1078;&#1077;&#1090;&#1077; &#1087;&#1086;&#1083;&#1100;&#1079;&#1086;&#1074;&#1072;&#1090;&#1100;&#1089;&#1103; &#1091;&#1095;&#1077;&#1073;&#1085;&#1099;&#1084; &#1094;&#1077;&#1085;&#1090;&#1088;&#1086;&#1084; &#1076;&#1086;&#1087;&#1086;&#1083;&#1085;&#1080;&#1090;&#1077;&#1083;&#1100;&#1085;&#1086; &#1074; &#1076;&#1088;&#1091;&#1075;&#1086;&#1077; &#1074;&#1088;&#1077;&#1084;&#1103;.');
	//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">&#1054;&#1073;&#1091;&#1095;&#1077;&#1085;&#1080;&#1077; &#1074; &#1075;&#1088;&#1091;&#1087;&#1087;&#1072;&#1093;</span>');
	$('#hover_text').html('&#1042;&#1088;&#1077;&#1084;&#1103;, &#1087;&#1088;&#1086;&#1074;&#1077;&#1076;&#1077;&#1085;&#1085;&#1086;&#1077; &#1074;  &#1082;&#1083;&#1072;&#1089;&#1089;&#1077; &#1089; &#1074;&#1072;&#1096;&#1080;&#1084; &#1091;&#1095;&#1080;&#1090;&#1077;&#1083;&#1077;&#1084; &#1080; &#1089;&#1086;&#1082;&#1091;&#1088;&#1089;&#1085;&#1080;&#1082;&#1072;&#1084;&#1080;.');
	//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';
}
