function LawList() 
{
    var _this = this;
    
    this.InitializeLawList = function()
    {
        this.InitializeTooltip();
    }   
    
    this.InitializeTooltip = function()
    {
        var form = "<div style='display: none;'class='popupContainer' id='detailedSummaryBG'></div>"+
                   "<div style='display: none;z-index: 201;' id='detailedSummaryBox' class='popup'>"+
                   "<table width='450px' cellspacing='0' cellpadding='0' border='0' id='tlpInnerBox'>"+
                   "<tbody>"+
                   "<tr>"+
                        "<td width='435' style='padding-bottom: 5px;' >"+
                            "<div style='overflow: hidden; width: 430px;text-align=left'>"+
                               "<span id='lblPop_Title' style='font-size:16px'></span>  <span id='lblTooltip'></span>"+
                            "</div>"+
                        "</td>"+
                        "<td align='right' style='padding-bottom: 5px;'>"+
                            "<a id='btnCloseTootip' href='javascript:void(0);'>"+
                                "<img border='0' id='imgTooltip' src='" + window.__httpURL + "images/close_normal.gif' alt='关闭' />&nbsp;"+
                            "</a>"+
                        "</td>"+
                    "</tr>"+
                    "<tr>"+
                        "<td style='border-top: 1px solid rgb(170, 168, 168); padding-top: 5px;' colspan='2'>"+
                            "<iframe src='" + window.__httpURL + "Blank.htm' id='ifTootip' frameborder='0' width='100%' height='220px' ></iframe>"+
                        "</td>"+
                    "</tr>"+
                    "</tbody>"+
                    "</table>"+
                    "</div>";
        $("#Form1").append(form);
		$("#btnCloseTootip").click(function(e)
		{
		    _this.TooltipVisible(false);
		});
		$("#imgTooltip").mouseout(function(e)
		{
		    $("#imgTooltip").attr("src",window.__httpURL + "images/close_normal.gif");
		});
		$("#imgTooltip").mouseover(function(e)
		{
		    $("#imgTooltip").attr("src",window.__httpURL + "images/close_float.gif");
		});
		$(".tooltiplink").click(function(e)
		{
		    $("#ifTootip").attr("src",window.__httpURL + "LawContent.aspx?id="+$(this).attr("key") + "&destType=" + $(this).attr("destType") + "&ts=" + Math.random() );
		   // $("#lblTooltip").text($(this).attr("key"));
		    _this.TooltipPosition($(this).offset().top, e.clientY, e.clientX );
		    
		    $("#lblPop_Title").text("法规内容");
		    _this.TooltipVisible(true);
		    
		});
		$(".tooltiplink").dblclick(function(e)
		{
			_this.TooltipVisible(false);
		});
		
		$(".posterrorlaw").click(function(e)
		{
		    $("#ifTootip").attr("src",window.__httpURL + "LawErrorPost.aspx?LawID="+ $(this).attr("LawID") + "&ts=" + Math.random() );
		   
		    _this.TooltipPosition($(this).offset().top, e.clientY, e.clientX );
		    $("#lblPop_Title").text("法规纠错");
		    _this.TooltipVisible(true);
		    
		});
		$(".posterrorlaw").dblclick(function(e)
		{
			_this.TooltipVisible(false);
		});
		
		$(".postnotfoundlaw").click(function(e)
		{
		    $("#ifTootip").attr("src",window.__httpURL + "NotFoundLawPost.aspx?ts=" + Math.random());
		   
		    _this.TooltipPosition($(this).offset().top, e.clientY, e.clientX );
		    $("#lblPop_Title").text("提交未收录法规");
		    _this.TooltipVisible(true);
		    
		});
		$(".postnotfoundlaw").dblclick(function(e)
		{
			_this.TooltipVisible(false);
		});
		
		$(".bookhotpoint").click(function(e)
		{		    
		    $("#ifTootip").attr("src",window.__httpURL + "redian/redianbook.aspx?TypeID="+ $(this).attr("typeid")  + "&ts=" + Math.random() );
		   
		    _this.TooltipPosition($(this).offset().top, e.clientY, e.clientX );
		    $("#lblPop_Title").text("订阅热点直击");
		    _this.TooltipVisible(true);
		    
		});
		$(".bookhotpoint").dblclick(function(e)
		{
			_this.TooltipVisible(false);
		});		
		
		$(".cancelhotpoint").click(function(e)
		{		
		    $("#ifTootip").attr("src",window.__httpURL + "redian/redianbook.aspx?TypeID="+ $(this).attr("typeid") + "&ts=" + Math.random() );		   
		    _this.TooltipPosition($(this).offset().top, e.clientY, e.clientX );
		    $("#lblPop_Title").text("取消订阅热点直击");
		    _this.TooltipVisible(true);
		    
		});
		$(".setarea").click(function(e)
		{		
		    $("#ifTootip").attr("src",window.__httpURL + "SetArea.aspx?dest="+ $(this).attr("dest") + "&ts=" + Math.random() );		   
		    _this.TooltipPosition($(this).offset().top, e.clientY, e.clientX );
		    $("#lblPop_Title").text("设置地区");
		    _this.TooltipVisible(true);
		    
		});
		$(".cancelhotpoint").dblclick(function(e)
		{
			_this.TooltipVisible(false);
		});
		
    }
    
    this.TooltipVisible = function(flag)
    {
        if ( flag == true )
        {
             $("#detailedSummaryBG").css("display","block");
             $("#detailedSummaryBox").css("display","block");
        }
        else
        {
            $("#detailedSummaryBG").css("display","none");
            $("#detailedSummaryBox").css("display","none");
        }
    }
    
    this.TooltipPosition = function(top, cy, cx)
    {
        var itop = 0;
        var cxAdd = 0;
        var contentLeft = "20px";
        if (cy < 338 )
        {
			if( cx < 550 )
			{
				$("#detailedSummaryBG").attr("class","popupContainerDown");
            }
            else
            {
				$("#detailedSummaryBG").attr("class","popupContainerDown2");		
				cxAdd = -500;
				contentLeft = "0px";					
            }
            
            $("#tlpInnerBox").css("margin","63px 0pt 0pt " + contentLeft);
            itop = top + 10;
        }
        else
        {
			if( cx < 550 )
			{
				$("#detailedSummaryBG").attr("class","popupContainer");
            }
            else
            {
				$("#detailedSummaryBG").attr("class","popupContainer2");
				cxAdd = -500;	
				contentLeft = "0px";
            }
            
            $("#tlpInnerBox").css("margin","18px 0pt 0pt " + contentLeft);
            itop = top-334 - 10;
        }
        $("#detailedSummaryBG").css("left",cx + cxAdd);
        $("#detailedSummaryBox").css("left",cx + cxAdd);
        
        $("#detailedSummaryBG").css("top",itop);
        $("#detailedSummaryBox").css("top",itop);
    }
}


