function newWindow(mypage, myname, w, h, features){
  if (screen.width){
    var winl = (screen.width-w)/2;
    var wint = (screen.height-h)/2;
  }
  else{
    winl = 0;
    wint = 0;
  }
  if (winl < 0)
    winl = 0;
  if (wint < 0)
    wint = 0;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += features;
  win = window.open(mypage, myname, settings);
  win.window.focus();
}
// Kiểm tra tính hợp lệ của email
function isEmail(s)
	{
	var str=s;
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(str))
		{
		return (true);
		}
	return (false);
}
// Mở một của sổ mới
function new_window(url,width, height){
		window.open (url, "new_window", "width="+ width + ", height="+ height +", resizable=1,scrollbars=yes");
	}
function viewsign(id){
		window.open ("viewsign.php?id="+id, "new_window", "width=350,height=300,resizable=1,scrollbars=yes");
	}

function openLarge(URL,W,H){
		hWindow=window.open("popup.php?"+URL,"Large","toolbar=no,width="+W+",height="+H+",status=no,scrollbars=auto,resize=yes,menubars=no");
 }

function display(file){
  document.getElementById("display_img").src = file;
}
