var docEle = function() { 
return document.getElementById(arguments[0]) || false; 
} 
function openNewDiv(_id,url) { 

var m = "mask"; 
if (docEle(_id)) document.removeChild(docEle(_id)); 
if (docEle(m)) document.removeChild(docEle(m)); 
// 新激活图层 
var newDiv = document.createElement("div"); 
newDiv.id = _id; 
newDiv.style.position = "absolute"; 
newDiv.style.zIndex = "9999"; 
newDiv.style.width = "350px"; 
newDiv.style.height = "400px"; 
newDiv.style.top = event.clientY+document.documentElement.scrollTop+20;
newDiv.style.left = event.clientX - 20 ;  
newDiv.style.background = "#666"; 
newDiv.style.border = "1px solid #000"; 
newDiv.style.padding = "5px"; 
newDiv.innerHTML = '<iframe src="'+url+'" width="100%" height="100%" scrolling="no" frameborder="0" marginwidth="0" marginheight="0"></iframe>'; 
document.body.appendChild(newDiv); 
// mask图层 
var newMask = document.createElement("div"); 
newMask.id = m; 
newMask.style.position = "absolute"; 
newMask.style.zIndex = "1"; 
newMask.style.width = document.body.scrollWidth + "px"; 
newMask.style.height = document.body.scrollHeight + "px"; 
newMask.style.top = "0px"; 
newMask.style.left = "0px"; 
newMask.style.background = "#000";
newMask.style.filter = "alpha(opacity=20)"; 
newMask.style.opacity = "0.40"; 
document.body.appendChild(newMask); 
// 关闭mask和新图层 
var newA = document.createElement("a"); 
newA.href = "#"; 
newA.innerHTML = "<div style='width:auto; float:right; margin-top:-1.2em; cursor:hand; color:#999; text-decoration:none;'>[Close]</div>"; 
newA.onclick = function() { 
  document.body.removeChild(docEle(_id)); 
  document.body.removeChild(docEle(m)); 
  return false; 
} 
newDiv.appendChild(newA); 
} 