﻿function show_dialoginfo(title,content,width,height){
    
    
    
    if(document.getElementById("show_bg")!=null)
    {
        return;
    }
    
    var wt=(document.documentElement.clientHeight-height)/2;   
    var wl=(document.body.clientWidth-width)/2;
    
    var wh = document.documentElement.scrollTop;   
   
    
	var body_width=document.body.scrollWidth+'px';	
	var body_height=document.documentElement.scrollHeight+wh+'px';
	
	
	var bg_obj = createDiv("show_bg","#D5D5D5","0px","0px","absolute",body_width,body_height,"999");
	bg_obj.style.filter='alpha(opacity=20)';
	bg_obj.style.top = '0px';
	bg_obj.style.left = '0px';
	document.body.appendChild(bg_obj);
	
	
	
	
	
	dvs = createDiv("show_dialog","#ffffff","0px","0px","absolute","0px","0px","10000");
	dvs.style.top=wt+wh+'px';	
	dvs.style.left = wl+'px';
	dvs.style.border="2px solid #cccccc";
	
	dvs.style.width = width+10;
	dvs.style.height = height;
	
	dvs.style.textAlign="center";
		
	document.body.appendChild(dvs);	
	
	
	
	
	dvs.innerHTML='<div style="background-color:#3366bb;width:'+width+'px;padding:10px 5px 5px 5px;height:20px;"><div style="float:left;color:#FFFFFF;overflow:hidden;text-align:left;font-weight:bold;font-size:14px;">'+title+'</div>'

	+'</div>'
	
	+'<div style="clear:both;background-color:#ffffff;width:'+width+'px;overflow:hidden;text-align:left;padding:5px; border:0px solid #000000;color:#333;height:'+(height-80)+'px;font-size:14px;">'+content+'</div>'
	
	+'<div style="background-color:#ffffff;width:'+width+'px;padding:5px;"><input type="button" value="返回" onclick="history.back(-1)" style="border:1px solid #cccccc;background-color:#ffffff;width:80px;"></div>';
	
}
function close_dialog(){

    try
    {
        var bg_obj=document.getElementById("show_bg");
	    var dvs = document.getElementById("show_dialog");
	    document.body.removeChild(bg_obj);
	    document.body.removeChild(dvs);
    }
    catch(e)
    {

    }
	
}

function createDiv(dvid,bgcolor,lft,tp,pos,wdth,hgt,zindex){
	var newdv = document.createElement("div");
	if(dvid!=""){
		newdv.id = dvid;
	}
	if(bgcolor!=""){
		newdv.style.backgroundColor=bgcolor;
	}
	if(lft!=""){
		newdv.style.left = lft;
	}
	if(tp!=""){
		newdv.style.top = tp;
	}
	if(pos!=""){
		newdv.style.position = pos;
	}
	if(wdth!=""){
		newdv.style.width = wdth;
	}
	if(hgt!=""){
		newdv.style.height = hgt;
	}
	if(zindex!=""){
		newdv.style.zIndex = zindex;
	}
	return newdv;
}