﻿var docEle = function() {
return document.getElementById(arguments[0]) || false;
}
function openNewDiv(_id,msgw,msgh,_src) {
var msgw,msgh,bordercolor;
	bordercolor="#336699";
	var sWidth,sHeight;
	//sWidth=document.body.offsetWidth-20;
	///sHeight=screen.height*2;
sWidth=document.documentElement.clientWidth;
///sHeight=document.body.clientHeight ;
sHeight=screen.height*2;
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 = "25";
newDiv.style.width = msgw + "px";
newDiv.style.height = msgh + "px";
var vieww = msgw - 1+"px";
var viewh = msgh - 1+"px";
newDiv.style.top = (document.documentElement.clientHeight-msgh)/2+document.documentElement.scrollTop+"px";
///newDiv.style.top = "30px";
if(sWidth > msgw){
		newDiv.style.left= (sWidth-msgw)/2-130+"px";
	}else{
		newDiv.style.left= 50+"px";
	}
	
newDiv.style.background = "#EFEFEF";
newDiv.style.border = "0px solid " + bordercolor;
newDiv.style.padding = "5px";
newDiv.innerHTML ="<iframe  src='"+_src+"' width='"+vieww+"' height='"+viewh+"' frameborder='0' scrolling='no' border='0'  frameborder='0'></iframe>";
document.getElementById('view').appendChild(newDiv);
var newMask = document.createElement("div");
newMask.id = m;
newMask.style.position = "absolute";
newMask.style.zIndex = "7";
newMask.style.width = sWidth +130+ "px";
newMask.style.height = sHeight + "px";
newMask.style.top = "0px";
newMask.style.left = "-260px";
newMask.style.background = "#000";
newMask.style.filter = "alpha(opacity=45)";
newMask.style.opacity = "0.6";

document.getElementById('view').appendChild(newMask);
hide();
}

function closea() {
 parent.document.getElementById('view').onclick;
 parent.window.location.reload();
return false;
}
function   hide(){   
  var   selects   =   window.document.all.tags("select");             
  for   (i=0;   i<selects.length;i++)   
  {     
  selects[i].style.display="none"?"none":"";   
  }   
  } 
  
function CreateBox(dtitle,dwidth,dheight,durl) {
  var iTop = (window.screen.availHeight-30-dheight)/2; 
  var iLeft = (window.screen.availWidth-10-dwidth)/2; 	
//window.showModelessDialog(durl,window, 'dialogWidth='+dwidth+'px; dialogHeight='+dheight+'px; resizable=no; center=yes;help=no; scroll=1; status=no;');
newwindow=window.open(durl,'study'+dtitle,'left='+iLeft+',top='+iTop+',width='+dwidth+',height='+dheight+',toolbar=no,menubar=no,scrollbars=no,resizable=yes,location=no,status=no');	
//window.showModalDialog('Url_Server.asp?id=',window, 'dialogWidth=455px; dialogHeight=350px; resizable=no; help=no; scroll=no; status=no;');
}
