
//For Active Frame
function gE(id){return document.getElementById(id);}

function _frameCreate(){
    var activeFrameDIV = document.createElement("div"); 
    activeFrameDIV.id="_activeFrameDIV";
    activeFrameDIV.name="_activeFrameDIV";
    var divStyle = activeFrameDIV.style;	
	divStyle.visibility="hidden";
	divStyle.position="absolute";	
	divStyle.left=0;
	divStyle.top= 0;
	divStyle.width = 0;
	divStyle.height= 0;
	document.body.appendChild(activeFrameDIV);
}

function frameOpen(url,ww,hh){
    var d = gE("_activeFrameDIV");
	if(!d){
		_frameCreate();//第一次运行openFrame,自动调用createActiveFrame();
		d= gE("_activeFrameDIV");
	}
	var  w = 600;
	if(ww)w = ww;
    var  h = 300;
	if(hh)h = hh;
	d.style.left = (screen.availWidth-w)/2;
	d.style.top = document.body.scrollTop + (screen.availHeight - h)/2;
	d.style.width = w;
	d.style.height= h;
	
    var s="<table width='100%' border=0 class='activeTitle' ";
	s+=" style='BORDER-RIGHT: 0px; BORDER-TOP: 0px; MARGIN: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px; BACKGROUND-COLOR: #4169e0'><tr>";
	s+="<td><span id='_activeTitle'></span></td>";
	s+="<td align=right><a href='JavaScript:frameClose();' class=activeTitle><font color=#f0f0f0>关闭</font></a></td></tr></table>";
	s+="<iframe id='_childFrame' name='_childFrame' class=activeLayer frameborder=0 ";
	s+=" width=" + w + " height="+h+" src='"+ url +"'></iframe>"; 	
    d.innerHTML= s;
	d.style.visibility="visible";
}

function frameClose(){
    var d = gE("_activeFrameDIV");
    d.style.visibility="hidden";
    d.innerHTML = "";
}


