	

	function hidePopin(in_divid)
	{
        jQuery("#" + in_divid).fadeOut(300, function()
        {
            jQuery("#popin_coverDiv").fadeOut(300, function()
            {
		        if(document.getElementById(in_divid) != null)
		        {
			        document.body.removeChild(document.getElementById(in_divid));
                }
		        
                jQuery(".flash_content").show();
            });
        });
	}
	
	var l_popinDiv
	
	function showCover(in_width, in_height, in_divid)
	{
		var l_coverDiv = document.getElementById("popin_coverDiv")
		
		//jQuery(".flash_content").hide();
		if(l_coverDiv == null)
		{
			l_coverDiv = document.createElement("DIV");
			l_coverDiv.id = "popin_coverDiv";
			document.body.appendChild(l_coverDiv);
			l_coverDiv.style.height = jQuery(document).height() + "px";
			l_coverDiv.style.width = jQuery(document).width() + "px";
			l_coverDiv.style.zIndex = 1000;
			jQuery("#popin_coverDiv").css("opacity", ".65");
		}

        jQuery("#popin_coverDiv").show();
        l_popinDiv = document.getElementById(in_divid)
	    if(l_popinDiv == null) l_popinDiv = document.createElement("DIV");
	    
		l_popinDiv.id = in_divid
		l_popinDiv.style.display = "none";
		l_popinDiv.style.zIndex = 1001;
		jQuery(l_popinDiv).css("position", "absolute");
		jQuery(l_popinDiv).css("margin", "0 auto");
        jQuery(l_popinDiv).css("height", in_height + "px");
        jQuery(l_popinDiv).css("width", in_width + "px");

		document.body.appendChild(l_popinDiv);
	}
	
	function showPopinAjax(in_page, in_width, in_height, in_divid)
	{
	    showCover(in_width, in_height, in_divid);
			jQuery("#" + in_divid).load(in_page, function(){
			  jQuery(this).css({top: document.body.scrollTop + 20, left: (document.body.scrollWidth / 2) - (in_width / 2)});
              jQuery(this).fadeIn(300);
              loadEffects();

			});
	}
	
	function showPopinAjaxWithPosition(in_page, in_width, in_height, in_divid, top, left)
	{
	    showCover(in_width, in_height, in_divid);
        
        jQuery("#" + in_divid).load(in_page, function()
        {
		    //jQuery(this).css({top: document.body.scrollTop + 20, left: (document.body.scrollWidth / 2) - (in_width / 2)});
		    var offset = jQuery("#MainBodyContentDiv").offset();
		    offset =  modifyOffset(offset, top, left);
            jQuery(this).css(offset)
            jQuery(this).fadeIn(300);
            loadEffects();
        });
	}
	
	function modifyOffset(obj,t,l)
	{
	    obj.top += t;
	    obj.left += l;
	    
	    return obj;
	}
	
	
	function showPopin(in_page, in_width, in_height, in_divid)
	{
            showCover(in_width, in_height, in_divid);

			jQuery(l_popinDiv).append('<iframe id="idFrame" scrolling="no" src="' + in_page + '" width="100%" height="100%" allowtransparency="true" frameborder="0" scrolling="no"></iframe>');
			jQuery(l_popinDiv).css({top: document.body.scrollTop + 20, left: (document.body.scrollWidth / 2) - (in_width / 2)});

// FIREFOX Having issues Validating this document and then calling the embedded function			
//            jQuery("#idFrame".document).ready(function(){
                jQuery(l_popinDiv).fadeIn(900);
//            });

	}
	
