<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}




function delconfirm(dbs_id)
    {  
	   var aaa;
       aaa=confirm("問卷結果會一併刪除，確定要刪除此資料庫嗎?");
       if(aaa)
     {window.location=pathOnly(location.href)+"process.php?check=deldbs&dbs_id="+dbs_id;}
     }


//-----------------加填其他項-----------------//

function show(divid){
	
		document.getElementById(divid).style.display='block';
		if(divid=='location1f'){
		document.form1.location1f.disabled=false;}
		else if(divid=='otherdbs_name'){
		document.form1.otherdbs_name.disabled=false;}

}

function hide(divid){
	
		document.getElementById(divid).style.display='none';
		if(divid=='location1f'){
		document.form1.location1f.disabled=true;}
		else if(divid=='otherdbs_name'){
		document.form1.otherdbs_name.disabled=true;}
	}
	
//清除填寫
function reset(form){
	 form.reset();
}

//送出表單
function chg(form)
{
  form.submit();
}

function checkdatadbs(){
	// 沒有填的部份
	var errormsg='';
	pass_check = 1;
	
   if(document.form3.dbs_name.value==''){errormsg=errormsg+' [資料庫名稱] '}
   
   // radio沒有填的部份
	var j=0;   
   for(var i=0;i<document.form3.istrial.length;i++){
   if(document.form3.istrial[i].checked){j++;}
	}
	if(j== 0){errormsg=errormsg+' [是否試用] '}
   
   if(errormsg != ''){alert('您忘了填下列欄位:'+ errormsg + '請補填,否則無法輸入!')}
   
	pass_check = 1;

 	// 沒錯才執行 
	if((errormsg == '') && (pass_check == 1))
	{
	document.form3.submit()
	}; 
}

//-----------------check進館帶包包意見各欄位有沒有填-----------------//
function checkdata_admit(){
	// 沒有填的部份
	var errormsg='';
	var d=document.form2;
	pass_check = 1;
	
	var j=0;   
   for(var i=0;i<d.ques1.length;i++){
   if(d.ques1[i].checked){j++;}
	}
	if(j== 0){errormsg=errormsg+' [意見1] '}
	
		var j=0;   
   for(var i=0;i<d.ques2.length;i++){
   if(d.ques2[i].checked){j++;}
	}
	if(j== 0){errormsg=errormsg+' [意見2] '}
	
		var j=0;   
   for(var i=0;i<d.ques3.length;i++){
   if(d.ques3[i].checked){j++;}
	}
	if(j== 0){errormsg=errormsg+' [意見3] '}
	
		var j=0;   
   for(var i=0;i<d.ques4.length;i++){
   if(d.ques4[i].checked){j++;}
	}
	if(j== 0){errormsg=errormsg+' [意見4] '}
	
    
   if(errormsg != ''){alert('您忘了填下列欄位:'+ errormsg + '請補填,否則無法輸入!')}
   
	pass_check = 1;

 	// 沒錯才執行 
	if((errormsg == '') && (pass_check == 1))
	{
	document.form2.submit()
	}; 
}


//-----------------check各欄位有沒有填-----------------//
function checkdata(){
	// 沒有填的部份
	var errormsg='';
	var d=document.form1;
	pass_check = 1;
	
   if(document.form1.name.value==''){errormsg=errormsg+' [姓名] '}
   if(document.form1.position.value==''){errormsg=errormsg+' [身份別] '} 
   if(document.form1.subtype.value==''){errormsg=errormsg+' [單位] '} 
   if(document.form1.s_id.value==''){errormsg=errormsg+' [學號或教職員證號] '} 
   if(document.form1.email.value==''){errormsg=errormsg+' [E-mail] '}
   if(document.form1.phone.value==''){errormsg=errormsg+' [電話] '}
   if(document.form1.dbs_id.value==''){errormsg=errormsg+' [資料庫名稱] '}

// checkbox沒有填的部份
	var j=0;   
   for(var i=0;i<d.elements["purpose_id[]"].length;i++){
   if(d.elements["purpose_id[]"][i].checked ){j++;}
	}
	if(j== 0){errormsg=errormsg+' [使用目的] '}


// radio沒有填的部份
	var j=0;   
   for(var i=0;i<d.locate.length;i++){
   if(d.locate[i].checked){j++;}
	}
	if(j== 0){errormsg=errormsg+' [使用地點] '}

	var j=0;   
   for(var i=0;i<d.speed.length;i++){
   if(d.speed[i].checked){j++;}
	}
	if(j== 0){errormsg=errormsg+' [查詢速度] '}

	var j=0;   
   for(var i=0;i<d.appearance.length;i++){
   if(d.appearance[i].checked){j++;}
	}
	if(j== 0){errormsg=errormsg+' [查詢畫面] '}

	var j=0;   
   for(var i=0;i<d.way.length;i++){
   if(d.way[i].checked){j++;}
	}
	if(j== 0){errormsg=errormsg+' [查詢方法] '}

	var j=0;   
   for(var i=0;i<d.embody.length;i++){
   if(d.embody[i].checked){j++;}
	}
	if(j== 0){errormsg=errormsg+' [收錄範圍] '}

	var j=0;   
   for(var i=0;i<d.entire.length;i++){
   if(d.entire[i].checked){j++;}
	}
	if(j== 0){errormsg=errormsg+' [整體滿意度] '}

	var j=0;   
   for(var i=0;i<d.others.length;i++){
   if(d.others[i].checked){j++;}
	}
	if(j== 0){errormsg=errormsg+' [其他相關資料庫] '}

	var j=0;   
   for(var i=0;i<d.suggest.length;i++){
   if(d.suggest[i].checked){j++;}
	}
	if(j== 0){errormsg=errormsg+' [建議訂購] '}

	//if(document.form1.reason.value==''){errormsg=errormsg+' [主要原因] '}
		
   if(errormsg != ''){alert('您忘了填下列欄位:'+ errormsg + '請補填,否則無法輸入!')}
   
	pass_check = 1;

 	// 沒錯才執行 
	if((errormsg == '') && (pass_check == 1))
	{
	document.form1.submit()
	}; 
}


//-----------------定義二階選單內容-----------------//

function Buildkey(num) {
	var ctr=1;
	document.form1.subtype.selectedIndex=0;
	document.form1.dep_id.value="";  
	document.form1.subtype.options[0]=new Option("請選擇您所屬的單位","");
	/*
	定義二階選單內容
	if(num=="第一階下拉選單的值") {	document.form1.subtype.options[ctr]=new Option("第二階下拉選單的顯示名稱","第二階

下拉選單的值");	ctr=ctr+1;	}
	*/	
	/*行政單位*/  
	if(num=="1") {	document.form1.subtype.options[ctr]=new Option("教務處","101");	ctr=ctr+1;	}
	if(num=="1") {	document.form1.subtype.options[ctr]=new Option("學生事務處","102");	ctr=ctr+1;	}
	if(num=="1") {	document.form1.subtype.options[ctr]=new Option("總務處","103");	ctr=ctr+1;	}
	if(num=="1") {	document.form1.subtype.options[ctr]=new Option("會計室","104");	ctr=ctr+1;	}
	if(num=="1") {	document.form1.subtype.options[ctr]=new Option("人事室","105");	ctr=ctr+1;	}
	if(num=="1") {	document.form1.subtype.options[ctr]=new Option("軍訓室","106");	ctr=ctr+1;	}
	if(num=="1") {	document.form1.subtype.options[ctr]=new Option("進修部","107");	ctr=ctr+1;	}
	if(num=="1") {	document.form1.subtype.options[ctr]=new Option("圖書資訊館","108");	ctr=ctr+1;	}
	if(num=="1") {	document.form1.subtype.options[ctr]=new Option("研究發展處","109");	ctr=ctr+1;	}
	if(num=="1") {	document.form1.subtype.options[ctr]=new Option("環安衛中心","110");	ctr=ctr+1;	}
	if(num=="1") {	document.form1.subtype.options[ctr]=new Option("創新育成中心","111");	ctr=ctr+1;	}
	if(num=="1") {	document.form1.subtype.options[ctr]=new Option("學生輔導中心","112");	ctr=ctr+1;	}
	/*藥理學院*/  
	if(num=="2") {	document.form1.subtype.options[ctr]=new Option("藥學系","201");	ctr=ctr+1;	}
	if(num=="2") {	document.form1.subtype.options[ctr]=new Option("醫藥化學系","202");	ctr=ctr+1;	}
	if(num=="2") {	document.form1.subtype.options[ctr]=new Option("食品科技系","203");	ctr=ctr+1;	}
	if(num=="2") {	document.form1.subtype.options[ctr]=new Option("生物科技系(所)","204");	ctr=ctr+1;	}
	if(num=="2") {	document.form1.subtype.options[ctr]=new Option("藥物科技研究所","205");	ctr=ctr+1;	}
	/*民生學院*/  
	if(num=="3") {	document.form1.subtype.options[ctr]=new Option("化粧品科技研究所","301");	ctr=ctr+1;	}
	if(num=="3") {	document.form1.subtype.options[ctr]=new Option("化粧品應用與管理系","302");	ctr=ctr+1;	}
	if(num=="3") {	document.form1.subtype.options[ctr]=new Option("嬰幼兒保育系","303");	ctr=ctr+1;	}
	if(num=="3") {	document.form1.subtype.options[ctr]=new Option("保健營養系","304");	ctr=ctr+1;	}
	if(num=="3") {	document.form1.subtype.options[ctr]=new Option("生活應用與保健系","305");	ctr=ctr+1;	}
	if(num=="3") {	document.form1.subtype.options[ctr]=new Option("餐旅管理系","306");	ctr=ctr+1;	}
	if(num=="3") {	document.form1.subtype.options[ctr]=new Option("民生保健發展中心","307");	ctr=ctr+1;	}
	if(num=="3") {	document.form1.subtype.options[ctr]=new Option("健康促進中心","308");	ctr=ctr+1;	}
	/*社會科學暨管理學院*/  
	if(num=="4") {	document.form1.subtype.options[ctr]=new Option("醫療資訊管理研究所","401");	ctr=ctr+1;	}
	if(num=="4") {	document.form1.subtype.options[ctr]=new Option("醫務管理系","404");	ctr=ctr+1;	}
	if(num=="4") {	document.form1.subtype.options[ctr]=new Option("資訊管理系","403");	ctr=ctr+1;	}
	if(num=="4") {	document.form1.subtype.options[ctr]=new Option("應用外語系","404");	ctr=ctr+1;	}
	if(num=="4") {	document.form1.subtype.options[ctr]=new Option("社會工作系","405");	ctr=ctr+1;	}
	if(num=="4") {	document.form1.subtype.options[ctr]=new Option("文化事業發展系","406");	ctr=ctr+1;	}
	if(num=="4") {	document.form1.subtype.options[ctr]=new Option("通識教育中心","407");	ctr=ctr+1;	}
	if(num=="4") {	document.form1.subtype.options[ctr]=new Option("師資培育中心","408");	ctr=ctr+1;	}
	/*環境學院*/  
	if(num=="5") {	document.form1.subtype.options[ctr]=new Option("職業安全衛生系","501");	ctr=ctr+1;	}
	if(num=="5") {	document.form1.subtype.options[ctr]=new Option("環境工程與科學系(所)","505");	ctr=ctr+1;	}
	if(num=="5") {	document.form1.subtype.options[ctr]=new Option("環境資源管理系","503");	ctr=ctr+1;	}
	if(num=="5") {	document.form1.subtype.options[ctr]=new Option("休閒保健管理系","504");	ctr=ctr+1;	}
	if(num=="5") {	document.form1.subtype.options[ctr]=new Option("觀光事業管理系","505");	ctr=ctr+1;	}
	/*研究中心*/  
	if(num=="6") {	document.form1.subtype.options[ctr]=new Option("台灣溫泉研究發展中心","601");	ctr=ctr+1;	}
	if(num=="6") {	document.form1.subtype.options[ctr]=new Option("生態工程技術研發中心","606");	ctr=ctr+1;	}
	if(num=="6") {	document.form1.subtype.options[ctr]=new Option("文化藝術中心","603");	ctr=ctr+1;	}
	if(num=="6") {	document.form1.subtype.options[ctr]=new Option("台灣休閒產業研究發展中心","604");	ctr=ctr+1;	}

document.form1.subtype.length=ctr;
	document.form1.subtype.options[0].selected=true;
} 


//-----------－－－－－－－－－－－-----checkemail-----------------------------//

function checkEmail(myEmail)
{
   if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myEmail.value))
   {
     return (true)
   }
   alert("E-mail地址不正確")
   return (false)
}

//------------------------


// -->
