// JavaScript Document
function DivAlert(messageDiv){
this.messageDIV=messageDiv;
    this.bottomDIV = document.createElement("div");
    var x=document.body.scrollWidth/2,y=window.screen.availHeight/2;
    this.bottomDIV.style.opacity="0.50";
this.bottomDIV.style.filter="Alpha(opacity=50);";
this.bottomDIV.style.backgroundColor="#CCCCCC";
this.bottomDIV.style.height=document.body.scrollHeight+"px";
this.bottomDIV.style.width="100%";
this.bottomDIV.style.marginTop="0px";
this.bottomDIV.style.marginLeft="0px";
this.bottomDIV.style.position="absolute";
this.bottomDIV.style.top="0px";
this.bottomDIV.style.left="0px";
this.bottomDIV.style.zIndex=100;
this.show = function(){ 
	document.body.appendChild(this.bottomDIV);
	document.body.appendChild(this.messageDIV);
	this.messageDIV.style.position="absolute";
	x=x-this.messageDIV.scrollWidth/2;
	y=this.messageDIV.scrollHeight-200;
	this.messageDIV.style.top=y+"px";
	this.messageDIV.style.left=x+"px";
	this.messageDIV.style.zIndex=101;
}
this.remove = function(){
	document.body.removeChild(this.bottomDIV);
	document.body.removeChild(this.messageDIV);
	}
}

var dc;
function test(str,sun){
	var d = document.createElement("div");
	d.style.width="405px";
	d.style.height="319px";
	d.style.backgroundColor="#f7f7f7";
	d.style.padding="0px";
     d.innerHTML="<div class=\"jf_Title\"><span><a href=\"javascript:test2()\"><img src=\"/templets/images/Close_img.gif\" width=\"21\" height=\"24\" align=\"absmiddle\" /></a>　</span>　"+str+"兑奖</div><iframe border=\"0\" marginwidth=\"0\" src=\"/Gifts.php?showid="+sun+"\" frameborder=\"No\" width=\"405\" scrolling=\"No\" height=\"294\" ></iframe>";
     dc = new DivAlert(d);
     dc.show();
}
function test2(){
    dc.remove();
}