<!--
/**
 *    
 *  功能：Div 提示框
 */ 

 function DivDialog()
 {

    var msgBorderColor = "#73B9FA";
    var msgBackGdColor = "#FFFFFF";
    var titleBackGdColor = "#B5D9E1";
    var titleTextColor = "#000000";
    var closeButtonColor = "#FFFFFF"
    var fontColor = "#000000";
    this.msgDivWidth = 400;
    this.titleHeight = 25;
    this.top = 500;
     function isIE()
     {
        is_opera = /opera/i.test(navigator.userAgent); 
        var is_ie = (/msie/i.test(navigator.userAgent) && !is_opera)
        return is_ie;      
     }
     
     function _sBody()
     {
        var h1 = document.body.clientHeight;
        var h2 = document.documentElement.clientHeight;
        var isXhtml = (h2 >= h1 && h2 != 0) ? true : false;    // 判断当前页面的Doctype是否为Xhtml    
        var htmlBody = isXhtml ? document.documentElement : document.body;    
        var sHeight = htmlBody.clientHeight;
        var sWidth = htmlBody.clientWidth;    
        return {_w:sWidth, _h:sHeight};
     }
        
     function _HiddenBackGD(bgColor)
     {
        var bgObj=document.createElement("div"); 
        bgObj.setAttribute('id','_bgDiv'); 
        bgObj.style.position = "absolute"; 
        bgObj.style.top = "0"; 
        bgObj.style.background = bgColor; 
        bgObj.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75)"; 
        bgObj.style.opacity = "0.6"; 
        bgObj.style.left = "0"; 
        bgObj.style.width = _sBody()._w + "px"; 
        bgObj.style.height = _sBody()._h + "px"; 
        bgObj.style.zIndex = "10000";     
        document.body.appendChild(bgObj);    
     }
     
     //创建提示框
     function _MsgBoxDiv(width, borderColor, backgroundColor,top)
     {
     
        var msgObj=document.createElement("div") 
        msgObj.setAttribute("id","_msgDiv"); 
        //msgObj.setAttribute("align","center"); 
        msgObj.style.background = backgroundColor; 
        msgObj.style.border = "1px solid " + borderColor; 
        
        msgObj.style.position = "absolute"; 
        msgObj.style.left = Math.round((_sBody()._w/2) - (width/2)) + "px"; 
        msgObj.style.top = top;     
        
        msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";      
        msgObj.style.width = width + "px";
        
        msgObj.style.zIndex = "10001"; 
        
        document.body.appendChild(msgObj); 
    
     }
     //提示框标题
     function _TitleDiv(width, height, backgroundColor, textColor, closeButtonColor, titleTxt)
     {
        var titleObj=document.createElement("div") 
        titleObj.setAttribute("id","_msgTitle");  
        titleObj.style.background = backgroundColor; 
        titleObj.style.width = width + "px";
        titleObj.style.height = height + "px";
        document.getElementById("_msgDiv").appendChild(titleObj);    
    
        var titleTxtObj=document.createElement("div") 
        titleTxtObj.setAttribute("id","_msgTitle");  
        titleTxtObj.style.width = width - 25 + "px";
        titleTxtObj.style.lineHeight = height + "px";     
        titleTxtObj.style.height = height + "px";
        titleTxtObj.style.textAlign = "left";
        titleTxtObj.style.color = textColor;
        if (isIE())
        {
            titleTxtObj.style.styleFloat = "left";
        }
        else
        {
            titleTxtObj.style.cssFloat = "left";
        }
        titleTxtObj.innerHTML = "&nbsp;<strong>" + titleTxt + "</strong>";
        document.getElementById("_msgTitle").appendChild(titleTxtObj);    
        
        var titleCloseObj=document.createElement("div") 
        titleCloseObj.setAttribute("id","_msgTitle");  
        titleCloseObj.style.width = 25 + "px";
        titleCloseObj.style.lineHeight = height + "px";     
        titleCloseObj.style.height = height + "px";
        titleCloseObj.style.textAlign = "center";
        titleCloseObj.style.color = closeButtonColor;
        titleCloseObj.style.fontWeight = "bolder";
        if (isIE())
        {
            titleCloseObj.style.styleFloat = "left";
        }
        else
        {
            titleCloseObj.style.cssFloat = "left";
        }
        titleCloseObj.style.cursor = "pointer";
        titleCloseObj.innerHTML = "×";
        titleCloseObj.onclick = function()
        {
            if (typeof(closeAction) != "undefined")
            {
                eval(closeAction);
            }
           // document.body.removeChild(document.getElementById("_bgDiv")); 
            document.body.removeChild(document.getElementById("_msgDiv")); 
            
        }
        document.getElementById("_msgTitle").appendChild(titleCloseObj);        
     }
     
     //提示内容
     function _MsgDiv(width, msgtext ,link ,linkkey)
     {

        var msgObj=document.createElement("div") 
        msgObj.setAttribute("id","_msgText");  
        //msgObj.style.background = "#FFFFFF"; 
        msgObj.style.color = fontColor;
        msgObj.style.width = width - 16 + "px";
        msgObj.style.padding = "8px 8px 8px 8px";
        msgObj.style.lineHeight = "30px";
        msgObj.innerHTML = msgtext+"</br>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<a href="+link+">"+linkkey+"</a>";
        document.getElementById("_msgDiv").appendChild(msgObj);         
     }
     
     this.Close = function ()
     {
        if (typeof(closeAction) != "undefined")
        {
            eval(closeAction);
        }
        //document.body.removeChild(document.getElementById("_bgDiv"));
        document.body.removeChild(document.getElementById("_msgDiv")); 
              
     }
     
     this.Alert = function (title, msg , link　,linkkey,usePage)
     {        
         
       if(usePage=="index")
       this.top = 650;
       if(usePage=="movie_detail")
       this.top = 300;
       if(usePage=="movie_order")
       this.top = 500;

        _MsgBoxDiv(this.msgDivWidth, msgBorderColor, msgBackGdColor,this.top);
        _TitleDiv(this.msgDivWidth, this.titleHeight, titleBackGdColor, titleTextColor, closeButtonColor, title);
        _MsgDiv(this.msgDivWidth, msg , link ,linkkey); 
        //document.getElementById('_msgTitle').focus();    
     }     

    
 }
    function hiddenDiv()
    {
        if (typeof(closeAction) != "undefined")
        {
            eval(closeAction);
        }
        //document.body.removeChild(document.getElementById("_bgDiv"));
        document.body.removeChild(document.getElementById("_msgDiv")); 
    }
    
	function setDisplayTime(timelmt, countdiv, outdiv){
	
	if(timelmt >=1){
	if(countdiv !== 'none'){document.getElementById(countdiv).innerHTML = timelmt; }
	   var ctdiv = countdiv;
	   var otdiv = outdiv;
	   var timelmt2 = timelmt-1;
	   var c = function(){setDisplayTime(timelmt2,ctdiv,otdiv);}
	   setTimeout(c, 1000);
	}else{
	if(outdiv !=='none'){
	document.getElementById(outdiv).style.display = 'none';
	return false;
	}
	}
	}
	//初始化弹出提示框
    function initialize(buyResult,type,link,usePage)
    {

     var dialog = new DivDialog();
     dialog.msgDivWidth = 300;   //设置div的宽度.
     dialog.titleHeight = 25 //设置title标题栏的高度.
     if(type=="0")
     {
     dialog.Alert("操作提示",buyResult,link,"进入电影专区",usePage);
     setTimeout('hiddenDiv()',5000);
     return false;
     }
     if(type=="2")
     {
     dialog.Alert("操作提示",buyResult,link,"进入移币冲值",usePage);
     setTimeout('hiddenDiv()',5000);
     return false;
     }
     if(type=="3")
     {

     dialog.Alert("操作提示",buyResult,link,"现金到付",usePage);
     setTimeout('hiddenDiv()',5000);
     return false;
     }
    }


-->