
var dialogFirst=true;
function dialog(content,width,height,cssName){

if(dialogFirst==true){
  var _floatBoxBg=document.createElement("div");
  _floatBoxBg.setAttribute("id","floatBoxBg");
  if(window.ActiveXObject)
  {
	   _floatBoxBg.onclick= function(){cloas();};
  }
  else
  {
	   _floatBoxBg.setAttribute("onclick","cloas()");
  }
  document.body.appendChild(_floatBoxBg);
  var _floatBox=document.createElement("div");
  _floatBox.setAttribute("id","floatBox");
  if(window.ActiveXObject)
  {
	  _floatBox.setAttribute("className","floatBox");
  }
  else
  {
	   _floatBox.setAttribute("class","floatBox");
  }
  _floatBox.innerHTML="<div id=\"content_f\" class=\"content_f\"></div>";  
  document.body.appendChild(_floatBox);
  dialogFirst=false;
  
 
}

contentType=content.substring(0,content.indexOf(":"));
content=content.substring(content.indexOf(":")+1,content.length);
switch(contentType){
  case "iframe":
  document.getElementById("content_f").innerHTML="<iframe src=\""+content+"\" width=\"100%\" height=\""+(parseInt(height)-30)+"px"+"\" scrolling=\"no\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\"></iframe>";
}

 document.getElementById("floatBoxBg").style.display="block";
 document.getElementById("floatBoxBg").style.height= parseInt(document.documentElement.scrollHeight)+"px";
 if(window.ActiveXObject)
  {
	 document.getElementById("floatBox").removeAttribute("className");
	 document.getElementById("floatBox").setAttribute("className","floatBox "+cssName);
  }
else
  {
	document.getElementById("floatBox").removeAttribute("class");
	document.getElementById("floatBox").setAttribute("class","floatBox "+cssName);
  }
 
document.getElementById("floatBox").style.display="block";
document.getElementById("floatBox").style.left=(( document.documentElement.scrollWidth)/2-(parseInt(width)/2))+"px";
document.getElementById("floatBox").style.top=(document.documentElement.scrollTop+200)+"px";
document.getElementById("floatBox").style.width=width;
document.getElementById("floatBox").style.height=height;


}

function cloas()
{
	document.getElementById("floatBoxBg").style.display="none";
    document.getElementById("floatBox").style.display="none";
}
