function get_code(n) {
	document.forms["MyForm_"+n].elements["dob_code_"+n].select();
	var
	hv=document.forms["MyForm_"+n].elements["dob_code_"+n].createTextRange();
	hv.execCommand("Copy");
}

function OpenWindow(page,s,a,b,c){
  window.status = "";
  strFeatures = "top=100,left=100,width=450,height=305,toolbar=0,menubar=0,location=0,directories=0,status=1,scrollbars=1";
  objNewWindow = window.open(page+"?s="+s+"&authorSerial="+a+"&demoStyle="+b+"&setDemoInFrame="+c , "demowin"+s, strFeatures);
  window.status = "範例視窗";
  window.event.cancelBubble = true;
  window.event.returnValue = false;   
}

function upwin(page,s,a){
  window.status = "";
  strFeatures = "top=100,left=100,width=650,height=405,toolbar=0,menubar=0,location=0,directories=0,status=1,scrollbars=1";
  objNewWindow = window.open(page+"?s="+s+"&authorSerial="+a , "upwin"+s, strFeatures);
  window.status = "DOB檔案管理員";
  window.event.cancelBubble = true;
  window.event.returnValue = false; 
}

function imgWin(page,w,h){
  window.status = "";
  strFeatures = "top=100,left=100,width=" + w + ",height=" + h + ",toolbar=0,menubar=0,location=0,directories=0,status=0,scrollbars=0";
  objNewWindow = window.open(page , "imgwin" , strFeatures);
  window.status = "DOB圖檔預視";
  window.event.cancelBubble = true;
  window.event.returnValue = false;   
}

function PntWin(page)	{
	  window.status = "";
	  strFeatures = "top=0,left=0,width="+screen.width+",height="+screen.height+",toolbar=0,menubar=1,location=0,directories=0,status=1,scrollbars=1";
	  objNewWindow = window.open(page , "NewWindow", strFeatures);
	  window.status = "友善列印視窗";
	  window.event.cancelBubble = true;
	  window.event.returnValue = false;   
}

function chk_mail() {
 
if ( mail_form.user_mail.value == "" ||  mail_form.user_mail.value.indexOf == -1 ){
		alert("「Email」欄不可為空白！");
		mail_form.user_mail.focus();
	} else  if ( mail_form.user_mail.value == "" || ( mail_form.user_mail.value.indexOf('@',0) == -1 ||	mail_form.user_mail.value.indexOf('.',0) == -1 )) {
		alert("你所輸入的電子郵件不合法！");
		mail_form.user_mail.focus();
	}  else  {
		return true;
	}
	return false;
 
} 
