/**************************************************************************************************
* Goldfish Curtain JavaScript (works only with jQuery)
* This javascript is created by Goldfish from Fishbeam Software: http://www.fishbeam.com
* All rights reserved. © 2008 Yves Pellot
**************************************************************************************************/

//Opens the curtain
function openCurtain(htmlContent, overlayClass, callBack) {
	var pageSizes=getPageSize();
	var pageScroll=getPageScroll();
	$('body').append('<div id="overlay" class="'+overlayClass+'"></div><table id="curtain" border="0" cellspacing="0" cellpadding="0"><tr><td id="container">'+htmlContent+'</td></tr></table>');
	repositionCurtain();
	$(window).resize(repositionCurtain);
	$('#overlay').show("slide", {direction: "up", easing: "easeOutExpo"}, 1000, callBack);  
}

//Close curtain and remove code
function closeCurtain(callback) {
  $('#container').fadeOut('1000', function(){
  	$('#overlay').hide("slide", {direction: "up", easing: "easeInExpo"}, 1000, function(){
      $('#container').remove();
      $('#curtain').remove();
    });
  });
}

//reposition curtain
function repositionCurtain() {
	$('#overlay').css({
		height: $(document).height()
	});
	$('#container').css({
		height: $(window).height()
	});
	$('#curtain').css({
		top: $(document).scrollTop()
	});
}
