$(document).ready(function(){

$("span.EConlink").hover
(
	function(){$ (this).css("color","#FF9900")},
	function(){$ (this).css("color","#0066FF")}
);
$("span.CConlink").hover
(
	function(){$ (this).css("color","#FF9900")},
	function(){$ (this).css("color","#0066FF")}
);


function ResizeIt() 
{
	var x=($(window).width()-$("#MessageBox").width())/2;
	var y=($(document).scrollTop())+80;
	$("#MessageBox").offset({ top:y, left:x});
	if ($("#MessageBox").offset().left<0)
	{
		$("#MessageBox").offset({ top:y, left:0});
	}
};

$("span.EConlink").click
(
	function () 
	{
		var str="program/"+$(this).attr("id")+"_e.htm";
		$("#FRM").attr("src",str);
		$("#FTitle").text($(this).attr("id"));
		$("#Mask").fadeTo(200,0.3).height($(document).height()).width($(window).width());
		$("#MessageBox").slideDown(500);
		ResizeIt();
	}
);

$("span.CConlink").click
(
	function () 
	{
		var str="program/"+$(this).attr("id")+"_c.htm";
		$("#FRM").attr("src",str);
		$("#FTitle").text($(this).attr("id"));
		$("#Mask").fadeTo(200,0.3).height($(document).height()).width($(window).width());
		$("#MessageBox").slideDown(500);
		ResizeIt();
	}
);

$(window).resize
(
	function()
	{   
		if ($("#MessageBox").is(":visible"))
		{
			$("#Mask").width($(window).width());
			ResizeIt();
		}
	}
);

function CloseIt()
{

	$("#Mask").fadeOut(100);
	$("#MessageBox").css("display","none");
};

$("#Close").hover
(
	function(){$ (this).css("color","#FF9900")},
	function(){$ (this).css("color","#FFFFFF")}
)


$("#Close").click(CloseIt);

});

