
//for Ask an Expert tabbox
function HighlightBubble ( i ) {
	document.getElementById('highlight_bubble_'+i).style.display = 'block';
}
function UnHighlightBubble ( i ) {
	document.getElementById('highlight_bubble_'+i).style.display = 'none';
}

function closePopup()
{
	$('#flashbox').show();

//	document.feedbackreport.ignore.value=0;
	$('#mask, #dialog').hide();
}

$(document).ready(function() { 
	
	//select all the a tag with name equal to modal
	$('a.modal').click(function(event)
	{
		$('#flashbox').hide();
		//document.feedbackreport.ignore.value=1;
		event.preventDefault();
		var link = $(this).attr('href');

		//Get the screen height and width
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();

		//Set heigth and width to mask to fill up the whole screen
		$('#mask').css({'width':maskWidth,'height':maskHeight,});

		//transition effect
		$('#mask').fadeIn(1000);
		$('#mask').fadeTo("slow",0.8);

		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();
		
		$("#dialog iframe").attr("src", $(this).attr("href"));

		var ScrollTop = document.body.scrollTop;


	if (ScrollTop == 0)
	{
		if (window.pageYOffset)
			ScrollTop = window.pageYOffset;
		else
			ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
	}


		$("#dialog").css('top',  winH/2-$("#dialog").height()/2 +ScrollTop );
		$("#dialog").css('left', winW/2-$("#dialog").width()/2);

		$("#dialog").fadeIn(2000);
	});

	$('#mask').click(function (event)
	{
		event.preventDefault();
		closePopup();
	});
});
