function createopenwindow() {
	if(!document.getElementById("dvwindow")) {
		var dvwindow = document.createElement("dvwindow");
		dvwindow.id = "dvwindow";
		var bodys = document.body;
		bodys.appendChild(dvwindow);
	} else {
		var dvwindow = document.getElementById("dvwindow");
	}
	dvwindow.innerHTML="<img src='images/loading.gif' /> 数据正在加载中...";
    //获取登录数据
	dvwindow.style.top = document.documentElement.scrollTop + 300 + "px"; 
	var a=arguments;
	var url=a[0]||"dv_album.asp";
	var act=a[1]||"default";
	var arg0=a[2]||"1";
	var arg1=a[3]||"1";
	var arg2=a[4]||"1";
	var postStr="";
	switch(act){
		case "edit": postStr="action="+act;postStr+="&id="+arg0;break;
		case "prosecution": postStr="action="+act;postStr+="&albumid="+arg0+"&albumimgid="+arg1+"&page="+arg2;break;
	}
	var ajax1 = InitAjax();
	ajax1.open("post",url, true);
	ajax1.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	ajax1.send(postStr.replace("&&","&"));
	ajax1.onreadystatechange=function(){
		if(ajax1.readyState==4){
			if(ajax1.status==200){
				dvwindow.innerHTML=ajax1.responseText;
				try{
					var closeLink = document.createElement("a");
					closeLink.href = "#";
					closeLink.title = "关闭";
					closeLink.innerText = "关闭"
					closeLink.className = "down_pop_close";
					closeLink.onclick = closeDownBlock;
					dvwindow.appendChild(closeLink);
				}catch (er){	alert(er.message);}
			}else{
				//alert(ajax1.responseText);
				dvwindow.innerHTML+="<br /><h3>加载数据错误:"+ajax1.responseText+"</h3>";
			}
		}
	}
	
}
//setTimeout("closeDownBlock2()",5000);

function closeDownBlock() {
	var bodys = document.body;
	bodys.removeChild(this.parentNode);
	return false;
}
function closeDownBlock2() {
	try{
	var bodys = document.body;
	var e=document.getElementById("dvwindow");
	bodys.removeChild(e);
	return false;		
	}catch (er){
		alert(er.message);
	}
}
function InitAjax()
{
　var ajax1=false; 
　try { 
　　ajax1 = new ActiveXObject("Msxml2.XMLHTTP"); 
　} catch (e) { 
　　try { 
　　　ajax1 = new ActiveXObject("Microsoft.XMLHTTP"); 
　　} catch (E) { 
　　　ajax1 = false; 
　　} 
　}
　if (!ajax1 && typeof XMLHttpRequest!='undefined') { 
　　ajax1 = new XMLHttpRequest(); 
　} 
　return ajax1;
}
function del(id,imgid){
	var t=gid("table_"+id);
	var postStr="action=del";
　 postStr+="&id="+id+"&imgid="+imgid;
	var ajax1 = InitAjax();
	ajax1.open("post","dv_albumbbs.asp", true);
	ajax1.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	ajax1.send(postStr.replace("&&","&"));
	ajax1.onreadystatechange=function(){
		if(ajax1.readyState==4){
			if(ajax1.status==200){
				var s=ajax1.responseText;
				if (s.indexOf("suc!")!=-1)
				{
					t.style.display="none";
				}
			}else{
				alert("删除失败:"+ajax1.responseText);
			}
		}
	}
}