<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

ie4 = (document.all) ? true : false; ns4 = (document.layers) ? true : false;
function keyDown(){
if(ns4){if(event.which==13){window.open("javascript:CheckLogin()","_self");}}
if(ie4){if(event.keyCode==13){window.open("javascript:CheckLogin()","_self");}}}


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.0
  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 && document.getElementById) x=document.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 pathOnly (InString)  {
  LastSlash=InString.lastIndexOf ('/', InString.length-1)
  OutString=InString.substring  (0, LastSlash+1)
  return (OutString);	
}

//管理介面登入check-------------------------------------------------------------------------------
function CheckLogin()
{	 	
  var pass = true;
  while (true) 
{	
  if(document.login.AccName.value == "")
  { pass = false;
    alert("請輸入使用者帳號。");
    document.login.AccName.focus();
     break;
  }
   if(document.login.AccPwd.value == "")
   {pass = false;
    alert("請輸入密碼。");
    document.login.AccPwd.focus();
     break;
  } 
   break;
 }
if (pass) {
      login.submit();}	
}//End

//後台系統帳號新增check-----------------------------------------------------------------------
function AccFormChk(){
	var pass = true;
	while (true) {
	  if(document.form1.AccName.value == "")
	  { pass = false;
		alert("請輸入使用者帳號。");
		document.form1.AccName.focus();
		 break;
	  }
	  if((document.form1.AccPwd.value == "") || (document.form1.AccPwd.value != document.form1.AccPwd2.value))
	  { pass = false;
		alert("您輸入的確認密碼與原密碼不符")
		document.form1.AccPwd.value="";
		document.form1.AccPwd2.value="";
		document.form1.AccPwd.focus();
		 break;
	  } 
	  if(document.form1.AccRealName.value == "")
	  { pass = false;
		alert("請輸入使用者真實姓名。");
		document.form1.AccRealName.focus();
		 break;
	  }
	  if(document.form1.AccMail.value != "")
	  { 
		 if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.form1.AccMail.value))){  
			pass = false;
			alert("e-mail地址不正確。");
			document.form1.AccMail.focus();
			 break;
		 }
	  }
	   break;
	}

	if (pass) {
		  form1.submit();
    }	
}//End

//最新消息新增check------------------------------------------------
function NewsFormChk(){
	
	var pass = true;
	while(true){
		if(document.form1.NTitle.value == ""){
			pass = false;
			alert("請輸入標題。");
			document.form1.NTitle.focus();
			break;
		}
		if(document.form1.NContent.value == ""){
			pass = false;
			alert("請輸入內容。");
			document.form1.NContent.focus();
			break;
		} 
		break;
	}

	if(pass){
		form1.submit();
	}	
}//End

//最新消息新增檔案---------------------------------------
function NewsForm2Chk(){
	
	var pass = true;
	while(true){
	   
		if(document.form1.NFName.value == ""){
			pass = false;
			alert("請選擇檔案。");
			document.form1.NFName.focus();
			break;
		}
		break;
	}

	if(pass){
		form1.submit();
	}	
}//End

//後台文件新增--------------------------------------------------------------------------------------------
function ArchiveAddFormChk(){
	
	var pass = true;
	while(true){
		if(document.form1.pg_type.value == ""){
			pass = false;
			alert("請選擇產品類別。");
			document.form1.pg_type.focus();
			break;
		}
		if(document.form1.pg_id.value == ""){
			pass = false;
			alert("請選擇產品機型。");
			document.form1.pg_id.focus();
			break;
		}
		if(document.form1.pm_id.value == ""){
			pass = false;
			alert("請選擇產品型號。");
			document.form1.pm_id.focus();
			break;
		}
		if(document.form1.AFMemo.value == ""){
			pass = false;
			alert("請輸入文件說明。");
			document.form1.AFMemo.focus();
			break;
		}
		if(document.form1.AFName.value == ""){
			pass = false;
			alert("請輸入檔案名稱位置。");
			document.form1.AFName.focus();
			break;
		} 
		break;
	}
	if(pass){
		form1.submit();
	}	
}//end 

//後台常見問題新增--------------------------------------------------------------------------------------------
function QuestionAddFormChk(){
	
	var pass = true;
	while(true){
		if(document.form1.q_title.value == ""){
			pass = false;
			alert("請輸入問題。");
			document.form1.q_title.focus();
			break;
		}
		if(document.form1.q_ans.value == ""){
			pass = false;
			alert("請輸入回答。");
			document.form1.q_ans.focus();
			break;
		} 
		break;
	}
	if(pass){
		form1.submit();
	}	
}//end 

//後台類別新增-----------------------------------------------------------------------
function GroupFormChk(){
	var pass = true;
	while(true){
	   if(document.form1.ATName.value == ""){
		pass = false;
		alert("請輸入類別名稱。");
		document.form1.ATName.focus();
		break;
	   } 
	  break;
    }

	if(pass){
		form1.submit();
	}	
}//End

//後台產品資訊新增----------------------------------------------------------------------------
function ActionForm1Chk(){
	
	var pass = true;
	while(true){
	   if(document.form1.pg_id.value == ""){
			pass = false;
			alert("請選擇類別。");
			document.form1.pg_id.focus();
			break;
		}
		if(document.form1.p_model.value == ""){
			pass = false;
			alert("請輸入型號。");
			document.form1.p_model.focus();
			break;
		}
		if(document.form1.p_Content.value == ""){
			pass = false;
			alert("請輸入簡介內容。");
			document.form1.p_Content.focus();
			break;
		} 
		break;
	}
	if(pass){
		form1.submit();
	}	
}//End 

//後台產品資訊檔案-----------------------------
function ActionForm2Chk(){
	
	var pass = true;
	while(true){
	   
		if(document.form1.ActFName.value == ""){
			pass = false;
			alert("請選擇檔案。");
			document.form1.ActFName.focus();
			break;
		}
		break;
	}

	if(pass){
		form1.submit();
	}	
}//end

//報修處理狀況新增check--------------------------------------------------------------------------------------------
function FixReplyFormChk(){
	
	var pass = true;
	while(true){
	  
		if(document.form1.FR_Content.value == ""){
			pass = false;
			alert("請輸入處理狀況。");
			document.form1.FR_Content.focus();
			break;
		}
		break;
	}

	if(pass){
		form1.submit();
	}	

}//end 

//服務據點--------------------------------------------------------------------------------------------
function ServiceFormChk(){
	
	var pass = true;
	while(true){
	  	if(document.form1.area_id.value == ""){
			pass = false;
			alert("請選擇地區。");
			document.form1.area_id.focus();
			break;
		}
		if(document.form1.c_name.value == ""){
			pass = false;
			alert("請輸入公司名稱。");
			document.form1.c_name.focus();
			break;
		}
		if(document.form1.c_manager.value == ""){
			pass = false;
			alert("請輸入負責人。");
			document.form1.c_manager.focus();
			break;
		}
		if(document.form1.c_tel.value == ""){
			pass = false;
			alert("請輸入服務電話。");
			document.form1.c_tel.focus();
			break;
		}
		if(document.form1.c_add.value == ""){
			pass = false;
			alert("請輸入服務地址。");
			document.form1.c_add.focus();
			break;
		}
		break;
	}
	if(pass){
		form1.submit();
	}	
}//end

//產品型號--------------------------------------------------------------------------------------------
function ModelFormChk(){
	
	var pass = true;
	while(true){
	  	if(document.form1.pg_type.value == ""){
			pass = false;
			alert("請選擇類別。");
			document.form1.pg_type.focus();
			break;
		}
		if(document.form1.pg_id.value == ""){
			pass = false;
			alert("請選擇機型。");
			document.form1.pg_id.focus();
			break;
		}
		if(document.form1.pm_name.value == ""){
			pass = false;
			alert("請輸入型號。");
			document.form1.pm_name.focus();
			break;
		}
		break;
	}
	if(pass){
		form1.submit();
	}	
}//end
//系統帳號刪除--------------------------------------------------------------
function AccDelConfirm(id){
  var aaa;
  aaa=confirm("確定要刪除該筆資料嗎?");
  if(aaa){window.location=pathOnly(location.href)+"main_01.php?page=SYS10100d&AccID="+id;}
}//end

//最新消息刪除-----------------------------------
function NewsDelConfirm(NID,NType){
  var aaa;
  aaa=confirm("確定要刪除該筆資料嗎?");
  if(aaa){window.location=pathOnly(location.href)+"main_01.php?page=A10"+NType+"00d&NID="+NID+"&NType="+NType;}
}//end

//最新消息刪除檔案-------------------------------------------------------------
function NewsFileDelConfirm(NID,NFID,NType){
  var aaa;
  aaa=confirm("確定要刪除該筆資料嗎?");
  if(aaa){window.location=pathOnly(location.href)+"main_01.php?page=A10"+NType+"01a&NID="+NID+"&NFID="+NFID+"&action=delfile";}
}//end

//文件刪除-----------------------------------------
function ArchiveDelConfirm(AFID,LType){
  var aaa;
  aaa=confirm("確定要刪除該筆資料嗎?");
  if(aaa){window.location=pathOnly(location.href)+"main_01.php?page=E10"+LType+"00d&AFID="+AFID+"&AType="+LType;}
}//end 

//文件檔案刪除---------------------------------------------------------------
function ArchiveFiledel(id,LType){  
  var aaa;
  aaa=confirm("確定要刪除該筆資料嗎?");
  if(aaa){window.location=pathOnly(location.href)+"main_01.php?page=E10"+LType+"01d&type="+LType+"&AFID="+id;}
}//end 

//常見問題刪除-----------------------------------------
function QuestionDelConfirm(id,NType){
  var aaa;
  aaa=confirm("確定要刪除該筆資料嗎?");
  if(aaa){window.location=pathOnly(location.href)+"main_01.php?page=D10"+NType+"00d&q_id="+id;}
}//end 

//產品類別刪除-----------------------------------------------------------------
function GroupDelConfirm(Type,agid){
  var aaa;
  aaa=confirm("確定要刪除該筆資料嗎?如果刪除相關型號將一併刪除");
  if(aaa){window.location=pathOnly(location.href)+"main_01.php?page=G10"+Type+"00d&&pg_id="+agid;}
}//end 

//產品類別刪除檔案--------------------------------------------------
function ActionFileDelConfirm(p_id,pf_id,ActType,pg_id){
  var aaa;
  aaa=confirm("確定要刪除該筆資料嗎?");
  if(aaa){window.location=pathOnly(location.href)+"main_01.php?page=B10"+ActType+"01a&p_id="+p_id+"&pf_id="+pf_id+"&pg_id="+pg_id+"&action=delfile";}
}
//end 

//產品資訊刪除-----------------------------------------
function ProductDelConfirm(p_id,p_type){
  var aaa;
  aaa=confirm("確定要刪除該筆資料嗎?");
  if(aaa){window.location=pathOnly(location.href)+"main_01.php?page=B10"+p_type+"00d&p_id="+p_id+"&p_type="+p_type;}
}//end 

//線上報修刪除-------------------------------------------------------------------------------
function FixDelConfirm(id){
  var aaa;
  aaa=confirm("確定要刪除該筆資料嗎?");
  if(aaa){window.location=pathOnly(location.href)+"main_01.php?page=F10100d&&FID="+id;}
}//end

//服務據點刪除-------------------------------------------------------------------------------
function ServiceDel(id){
  var aaa;
  aaa=confirm("確定要刪除該筆資料嗎?");
  if(aaa){window.location=pathOnly(location.href)+"main_01.php?page=C10100d&&c_id="+id;}
}//end

//會員刪除-------------------------------------------------------------------------------
function AssociatorDel(id){
  var aaa;
  aaa=confirm("確定要刪除該筆資料嗎?");
  if(aaa){window.location=pathOnly(location.href)+"main_01.php?page=F10200d&&a_id="+id;}
}//end

//保證卡刪除-------------------------------------------------------------------------------
function CardDel(id){
  var aaa;
  aaa=confirm("確定要刪除此保證卡資料嗎,如刪除相關報修紀錄將一併刪除?");
  if(aaa){window.location=pathOnly(location.href)+"main_01.php?page=F10300d&&FC_ID="+id;}
}//end

//產品樣式刪除-------------------------------------------------------------------------------
function ModelDelConfirm(id){
  var aaa;
  aaa=confirm("確定要刪除該筆資料嗎?");
  if(aaa){window.location=pathOnly(location.href)+"main_01.php?page=G10300d&&pm_id="+id;}
}//end
//-->