﻿
var AjaxJQueryPopDialogFlag=true;
var AjaxJQueryPopDialog={
    Show:function(tit,width,height,url){
        function setPoint(){
            var windowHeight=0;
            if (self.innerHeight) {
                windowHeight = self.innerHeight;   
            } else if (document.documentElement && document.documentElement.clientHeight) {
                windowHeight = document.documentElement.clientHeight;   
            } else if (document.body) {
                windowHeight = document.body.clientHeight;
            }
            var lx=($(window).width()-width)/2;
            if(lx<10){
                lx=10;
            }
            
            var ly=(windowHeight-height)/2;
            if(ly<10){
                ly=10;
            }
            ly+=document.documentElement.scrollTop;
            $(".JQueryPopDialog").css("left",lx+"px");
            $(".JQueryPopDialog").css("top",ly+"px");
        }
        $(".JQueryPopDialog .tit span").html(tit);
        $(".JQueryPopDialog").width(width);
        setPoint();
        $(".JQueryPopDialog .txt iframe").height(height);
        $(".JQueryPopDialog").show("slow");
        $(".JQueryPopDialogBg").height($(document).height());
        $(".JQueryPopDialogBg").show();
        
        if(AjaxJQueryPopDialogFlag){
            AjaxJQueryPopDialogFlag=false;
            $(".JQueryPopDialog .tit a").click(function(){
                $(".JQueryPopDialog,.JQueryPopDialogBg").hide();
            });
            $(window).resize(function() {
                setPoint();
            });
            $(window).resize(function() {
                setPoint();
            });
        }
        $(".JQueryPopDialog .txt iframe").attr("src",url);
    },
    GoTo:function(url){
        
    },
    Hide:function(){
        $(".JQueryPopDialog,.JQueryPopDialogBg").hide();
        $(".JQueryPopDialog .txt iframe").attr("src","");
    }
}
