// 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">&#1605;&#1581;&#1575;&#1590;&#1585;&#1575;&#1578;</span>');
	$('#hover_text').html('&#1578;&#1588;&#1605;&#1604; &#1607;&#1584;&#1607; &#1605;&#1608;&#1575;&#1590;&#1610;&#1593; &#1605;&#1582;&#1578;&#1604;&#1601;&#1577; &#1605;&#1579;&#1604; &#1575;&#1604;&#1581;&#1608;&#1575;&#1585; &#1581;&#1608;&#1604; &#1575;&#1604;&#1588;&#1574;&#1608;&#1606;  &#1575;&#1604;&#1581;&#1575;&#1604;&#1610;&#1577; &#1608; &#1575;&#1604;&#1581;&#1610;&#1575;&#1577; &#1608;&#1575;&#1604;&#1579;&#1602;&#1575;&#1601;&#1577;.');
	//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">&#1605;&#1583;&#1585;&#1617;&#1587; &#1608;&#1575;&#1581;&#1583; &#1604;&#1591;&#1575;&#1604;&#1576; &#1608;&#1575;&#1581;&#1583;</span>');
	$('#hover_text').html('&#1576;&#1575;&#1604;&#1578;&#1588;&#1575;&#1608;&#1585; &#1605;&#1593;&#1603; , &#1587;&#1608;&#1601; &#1610;&#1602;&#1608;&#1605; &#1575;&#1604;&#1605;&#1583;&#1585;&#1617;&#1587; &#1576;&#1571;&#1606;&#1588;&#1575;&#1569; &#1576;&#1585;&#1606;&#1575;&#1605;&#1580;  &#1582;&#1575;&#1589; &#1576;&#1603;&#1614; &#1604;&#1603;&#1610;.');
	//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">&#1583;&#1585;&#1575;&#1587;&#1577; &#1605;&#1608;&#1580;&#1607;&#1577;</span>');
	$('#hover_text').html('&#1610;&#1602;&#1608;&#1605;  &#1605;&#1583;&#1585;&#1617;&#1587;&#1603; &#1576;&#1608;&#1590;&#1593; &#1576;&#1585;&#1606;&#1575;&#1605;&#1580; &#1578;&#1583;&#1585;&#1610;&#1587;&#1610; &#1605;&#1582;&#1589;&#1589; &#1604;&#1603; &#1610;&#1580;&#1576; &#1575;&#1603;&#1605;&#1575;&#1604;&#1607; &#1603;&#1604; &#1575;&#1587;&#1576;&#1608;&#1593; &#1601;&#1610; &#1575;&#1604;&#1608;&#1602;&#1578; &#1575;&#1604;&#1582;&#1575;&#1589; &#1576;&#1603; .  &#1578;&#1587;&#1578;&#1591;&#1610;&#1593; &#1575;&#1604;&#1602;&#1610;&#1575;&#1605; &#1576;&#1607;&#1584;&#1575; &#1575;&#1604;&#1608;&#1575;&#1580;&#1576; &#1601;&#1610; &#1575;&#1604;&#1605;&#1585;&#1603;&#1586; &#1575;&#1604;&#1578;&#1593;&#1604;&#1610;&#1605;&#1610; &#1575;&#1608; &#1601;&#1610; &#1575;&#1604;&#1576;&#1610;&#1578; . &#1587;&#1608;&#1601; &#1610;&#1615;&#1587;&#1580;&#1614;&#1604; &#1581;&#1590;&#1608;&#1585;&#1603;  &#1608;&#1610;&#1602;&#1575;&#1587; &#1605;&#1602;&#1583;&#1575;&#1585; &#1578;&#1602;&#1583;&#1605;&#1603;.');
	//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">&#1583;&#1585;&#1575;&#1587;&#1577; &#1575;&#1585;&#1588;&#1575;&#1583;&#1610;&#1577;</span>');
	$('#hover_text').html('&#1575;&#1587;&#1578;&#1601;&#1583; &#1605;&#1606; &#1605;&#1580;&#1605;&#1608;&#1593;&#1577; &#1605;&#1582;&#1578;&#1604;&#1601;&#1577; &#1605;&#1606; &#1605;&#1608;&#1575;&#1583; &#1578;&#1593;&#1604;&#1610;&#1605;&#1610;&#1577; &#1608; &#1606;&#1589;&#1575;&#1574;&#1581;  &#1605;&#1606; &#1575;&#1604;&#1605;&#1583;&#1585;&#1587;&#1610;&#1606; &#1601;&#1610; &#1575;&#1604;&#1605;&#1585;&#1603;&#1586; &#1575;&#1604;&#1578;&#1593;&#1604;&#1610;&#1605;&#1610;. &#1606;&#1606;&#1589;&#1581; &#1576;&#1575;&#1604;&#1575;&#1604;&#1578;&#1586;&#1575;&#1605; &#1576;&#1593;&#1583;&#1583; &#1575;&#1604;&#1587;&#1575;&#1593;&#1575;&#1578; &#1575;&#1604;&#1605;&#1602;&#1578;&#1585;&#1581;&#1577; &nbsp;&#1604;&#1604;&#1583;&#1585;&#1575;&#1587;&#1577; &#1575;&#1604;&#1575;&#1585;&#1588;&#1575;&#1583;&#1610;&#1577; &#1604;&#1603;&#1604; &#1583;&#1608;&#1585;&#1577; , &#1594;&#1610;&#1585; &#1575;&#1606;&#1603; &#1576;&#1575;&#1604;&#1575;&#1590;&#1575;&#1601;&#1577;  &#1604;&#1584;&#1604;&#1603; &#1578;&#1587;&#1578;&#1591;&#1610;&#1593; &#1575;&#1604;&#1584;&#1607;&#1575;&#1576; &#1575;&#1604;&#1609; &#1575;&#1604;&#1605;&#1585;&#1603;&#1586; &#1575;&#1604;&#1578;&#1593;&#1604;&#1610;&#1605;&#1610; &#1601;&#1610; &#1575;&#1608;&#1602;&#1575;&#1578; &#1575;&#1582;&#1585;&#1609;.');
	//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">&#1578;&#1583;&#1585;&#1610;&#1587; &#1575;&#1604;&#1605;&#1580;&#1605;&#1608;&#1593;&#1575;&#1578;</span>');
	$('#hover_text').html('&#1575;&#1604;&#1608;&#1602;&#1578; &#1575;&#1604;&#1605;&#1602;&#1590;&#1610; &#1601;&#1610; &#1575;&#1604;&#1589;&#1601;  &#1605;&#1593; &#1575;&#1587;&#1578;&#1575;&#1584;&#1603; &#1608;&#1575;&#1604;&#1591;&#1604;&#1576;&#1577;.');
	//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';
}
