
var divalert_menu_bg=new Image();
var divalert_close=new Image();
var divalert_closeon=new Image();
var divalert_icon=new Image();
var divalert_accept=new Image();
var divalert_cancel=new Image();

    divalert_menu_bg.src="images/divalert_menu_bg.gif"
    divalert_close.src="images/divalert_close.gif"
    divalert_closeon.src="images/divalert_closeon.gif"
    divalert_icon.src="images/divalert_icon.gif"
    divalert_accept.src="images/accept.gif"
    divalert_cancel.src="images/cancel.gif"






    
function divAlert(id,title,str,accept)
	{
    if (document.readyState == "complete")
    {
    if(accept=="")
        accept="callback('"+id+"')"
	var msgw,msgh,bordercolor;
	    msgw=400;
	    msgh=200;
	var space="";
	if(str.length<=8)
	{
		space="&nbsp;&nbsp;"
		msgw=300;
	}
	var isconfirm = false;
	var sWidth,vHeight,sHeight;
        sWidth=document.documentElement.clientWidth>0?document.documentElement.clientWidth:document.body.clientWidth;
        vHeight=document.documentElement.clientHeight>document.body.scrollHeight?document.documentElement.clientHeight:document.body.scrollHeight;
        //alert(sWidth+"/"+sHeight);
        sHeight=vHeight+50;
	var divBg=document.createElement("div");
		divBg.setAttribute('id',id+'_divBg');
		divBg.style.position="absolute";
		divBg.style.top="0";
		divBg.style.background="#000000";
		divBg.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=60)";
		divBg.style.opacity="0.6";
		divBg.style.left="0";
		divBg.style.width=sWidth + "px";
		divBg.style.height=sHeight + "px";

	var divMsg=document.createElement("div");
		divMsg.setAttribute('id',id+'_divMsg');

	var html="<table class=\"divalert\" width=\""+msgw+"\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\" style=\"border:1px solid #FF6600;z-index:101;position:absolute; background-color:#FFFFFF;top:"+((document.documentElement.clientHeight-msgh)/2)+"px; left:"+((sWidth-msgw)/2)+"px;\"> <tr > <td style=\" border-bottom:1px solid #CC0000; background-image:url(images/divalert_menu_bg.gif)\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td style=\"font-weight:bold; color:#FFFFFF; font-size:12px;padding:0px;\">"+title+"</td> <td width=\"11\" style=\"padding:0px;\"><a href=\"javascript:void(0)\"  onclick=\"callback('"+id+"')\"><img src=\"images/divalert_close.gif\" width=\"11\" height=\"11\" border=\"0\" onmouseout=\"this.src='images/divalert_close.gif'\" onmouseover=\"this.src='images/divalert_closeon.gif'\"/></a></td> </tr> </table></td> </tr> <tr> <td style=\"padding:20px 20px 20px 20px;hight:"+msgh+";\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\"> <tr> <td width=\"46\" rowspan=\"3\"><img src=\"images/divalert_icon.gif\" width=\"46\" height=\"46\" /></td> <td style=\"font-size:12px;padding-bottom:2px;\">"+title+"</td> </tr> <tr> <td style=\"font-size:12px;\">"+space+str+"</td> </tr> <tr> <td><input type=\"image\" name=\"imageField\" src=\"images/accept.gif\" onclick=\""+accept+"\"/>";
	if(isconfirm)
		html+="<input type=\"image\" name=\"imageField\" src=\"images/cancel.gif\" onclick=\"\"/>";
	html+="</td> </tr> </table></td> </tr></table>"
		divMsg.innerHTML=html;
		
		document.body.appendChild(divBg);
		document.body.appendChild(divMsg);
    }
	}
	function callback(id)
	{
	    document.body.removeChild(document.getElementById(id+'_divMsg'));
	    document.body.removeChild(document.getElementById(id+'_divBg'));
	}
function divConfirm(id,title,str,accept,cancel)
	{
    if(accept=="")
        accept="callback('"+id+"')"
    if(cancel=="")
        cancel="callback('"+id+"')"
    var msgw,msgh,bordercolor;
	    msgw=400;
	    msgh=200;
	var space="";
	if(str.length<=8)
	{
		space="&nbsp;&nbsp;"
		msgw=300;
	}
	var isconfirm = true;
	var sWidth,vHeight,sHeight;
        sWidth=document.documentElement.clientWidth>0?document.documentElement.clientWidth:document.body.clientWidth;
        vHeight=document.documentElement.clientHeight>document.body.scrollHeight?document.documentElement.clientHeight:document.body.scrollHeight;
        //alert(sWidth+"/"+sHeight);
        sHeight=vHeight+50;
	var divBg=document.createElement("div");
		divBg.setAttribute('id',id+'_divBg');
		divBg.style.position="absolute";
		divBg.style.top="0";
		divBg.style.background="#000000";
		divBg.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=60)";
		divBg.style.opacity="0.6";
		divBg.style.left="0";
		divBg.style.width=sWidth + "px";
		divBg.style.height=sHeight + "px";

	var divMsg=document.createElement("div");
		divMsg.setAttribute('id',id+'_divMsg');

	var html="<table class=\"divalert\" width=\""+msgw+"\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\" style=\"border:1px solid #FF6600;z-index:101;position:absolute; background-color:#FFFFFF;top:"+((document.documentElement.clientHeight-msgh)/2)+"px; left:"+((sWidth-msgw)/2)+"px;\"> <tr > <td style=\" border-bottom:1px solid #CC0000; background-image:url(images/divalert_menu_bg.gif)\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td style=\"font-weight:bold; color:#FFFFFF; font-size:12px;padding:0px;\">"+title+"</td> <td width=\"11\" style=\"padding:0px;\"><a href=\"javascript:void(0)\"  onclick=\"callback('"+id+"')\"><img src=\"images/divalert_close.gif\" width=\"11\" height=\"11\" border=\"0\" onmouseout=\"this.src='images/divalert_close.gif'\" onmouseover=\"this.src='images/divalert_closeon.gif'\"/></a></td> </tr> </table></td> </tr> <tr> <td style=\"padding:20px 20px 20px 20px;hight:"+msgh+";\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\"> <tr> <td width=\"46\" rowspan=\"3\"><img src=\"images/divalert_icon.gif\" width=\"46\" height=\"46\" /></td> <td style=\"font-size:12px;padding-bottom:2px;\">"+title+"</td> </tr> <tr> <td style=\"font-size:12px;\">"+space+str+"</td> </tr> <tr> <td><input type=\"image\" name=\"imageField\" src=\"images/accept.gif\" onclick=\""+accept+"\"/>";
	if(isconfirm)
		html+="&nbsp;<input type=\"image\" name=\"imageField\" src=\"images/cancel.gif\" onclick=\""+cancel+"\"/>";
	html+="</td> </tr> </table></td> </tr></table>"
		divMsg.innerHTML=html;
		
		document.body.appendChild(divBg);
		document.body.appendChild(divMsg);
	}