﻿<!--hppage status="protected"-->
<!--HTML--><!--HEAD--><SCRIPT LANGUAGE="JavaScript"></SCRIPT>// 檢核輸入的日期是否為正確的日期
function isDate(theYear, theMonth, theDate) {
	// theYear: 四位數的西元年
	// theMonth: 從1到12的月份
	// theDate: 從1到31的日期
	if(theYear<=0)
		return false;
	if(theMonth < 1 || theMonth > 12)
		return false;
	if(theDate < 1 || theDate > 31)
		return false;
	if(theMonth == 2 && theDate > 28){
		if(theDate == 29 && theYear % 4 == 0 && theYear % 100 != 0) {
			return true;
		}
		if(theDate == 29 && theYear % 4 == 0 && theYear % 400 == 0) {
			return true;
		}
		return false;
	}
	if(theMonth == 1 || theMonth == 3 || theMonth == 5 ||
	   theMonth == 7 || theMonth == 8 || theMonth == 10 ||  theMonth == 12)
		if(theDate > 31 || theDate < 1)
			return false;
	if(theMonth == 4 || theMonth == 6 || theMonth == 9 || theMonth == 11)
		if(theDate > 30 || theDate < 1)
			return false;
	return true;
}
// 檢核輸入的日期是否晚於今天
function isFuture(theYear, theMonth, theDate){
	// theYear: 四位數的西元年
	// theMonth: 從1到12的月份
	// theDate: 從1到31的日期
	if(!checkDate(theYear, theMonth, theDate))
		return false;
	var today = new Date();
	today = new Date(today.getFullYear(), today.getMonth(), today.getDate());
	var theDay = new Date(theYear, theMonth-1, theDate);
	if(today >= theDay)
		return false;
	return true;
}
// 顯示當前的日期/時間 格式：yyyy/mm/dd hh:mm:ss(民國年)
function writeNow(){
	var d = new Date();
	document.write(( d.getFullYear() - 1911 ) + '/'
			+ ( d.getMonth() + 1 ) + '/'
			+ d.getDate() + ' '
			+ d.getHours() + ':'
			+ d.getMinutes() + ':'
			+ d.getSeconds()
			);
}
// 顯示當前的日期/時間 格式：yyyy/mm/dd hh:mm:ss(西元年)
function writeNowE(){
	var d = new Date();
	document.write( d.getFullYear() + '/'
			+ ( d.getMonth() + 1 ) + '/'
			+ d.getDate() + ' '
			+ d.getHours() + ':'
			+ d.getMinutes() + ':'
			+ d.getSeconds()
			);
}
// 顯示當前的日期/時間 格式：民國?年?月?日 ?時?分?秒
function writeNowC(){
	var d = new Date();
	document.write('民國' + ( d.getFullYear() - 1911 ) + '年'
			+ ( d.getMonth() + 1 ) + '月'
			+ d.getDate() + '日 '
			+ d.getHours() + '時'
			+ d.getMinutes() + '分'
			+ d.getSeconds() + '秒'
			);
}
// 檢查某個字串的每個字元是否都是英數文字
// 如： isAlphaNumber('rrr') 會回傳 true
// 如果提供第二個參數，則會被視為檢核的範圍
// 如： isAlphaNumber('rrr', 'abc') 會回傳 false
function isAlphaNumber(){

	var test = isAlphaNumber.arguments[0];

	var range = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
	if(isAlphaNumber.arguments.length==2)
		range = isAlphaNumber.arguments[1];
	for(var i=0; i<test.length; i++){
		if(range.indexOf(test.charAt(i))<0)
		return false;
		}
	return true;
}
// 檢查字串是否符合密碼的規則
function isPassword(src){
	if(src.length!=8)
		return false;
	if(!isAlphaNumber(src))
		return false;
	return true;
}
// 檢查字串是否符合暱稱的規則
function isNickname(src){
//	if(src.length<1)
//		return false;
	if(src.length>10)
		return false;
	if(!isAlphaNumber(src))
		return false;
	return true;
}
function isNicknameForFirstTime(src){
	if(src.length>10)
		return false;
	if(!isAlphaNumber(src, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 '))
		return false;
	return true;
}

// 將字串兩頭的空白字元包括' '、'\t'、'\n'去掉
// 如： trimString(' rrr') 會回傳 'rrr'
// 如果提供第二個參數，則會被視為檢核的範圍
// 如： trimString('rrrt ', 'r') 會回傳 't'
function trimString(){
	var bi = 0;
	var theSpace = ' \t\n　';
	var source = trimString.arguments[0];
	if(trimString.arguments.length==2)
		theSpace = trimString.arguments[1];
	while(theSpace.indexOf(source.charAt(bi)) >= 0 && bi < source.length)
		bi++;
	source = source.substring(bi);
	bi = source.length - 1;
	while(theSpace.indexOf(source.charAt(bi)) >= 0 && bi > 0)
		bi--;
	return source.substring(0, bi+1);
}
// 檢核指定的欄位是否為數字，如果有輸入上下限的話，檢核金額是否在範圍內
// 範例：isFieldNumber(document.forms[0].amt, 0, 20000) 會檢核amt這個欄位是否為數字且值在0和20000之間
function isFieldNumber(){
	var theField = isFieldNumber.arguments[0];
	if(trimString(theField.value).length <= 0)
		return false;
	if(isNaN(theField.value))
		return false;
	theField = isFieldNumber.arguments[0].value * 1.0;
	var theLowerLimit = null;
	var theUpperLimit = null;
	if(isFieldNumber.arguments.length == 3){
		theLowerLimit = isFieldNumber.arguments[1]*1.0;
		theUpperLimit = isFieldNumber.arguments[2]*1.0;
		if(!(theField >= theLowerLimit && theField <= theUpperLimit))
			return false;
	}
/*
	if(isFieldNumber.arguments.length == 2){
		if ( document.forms[0].AMT.value == '.0') {
			alert("AMT==0");
			return false;
			}
		theField      = isFieldNumber.arguments[0]*1.0;
		alert(isFieldNumber.arguments[0]);
		theLowerLimit = isFieldNumber.arguments[1]*1.0;
		if (theField.value <= theLowerLimit.value) 	return false;
	}
*/	
	return true;
}

// 取得固定位數的小數，並作四捨五入
function formatDecimal(){
	var src = formatDecimal.arguments[0];
	var dp = 2;
	if(formatDecimal.arguments.length > 1)
		dp = formatDecimal.arguments[1];
	if(dp<0)
		dp = 2;
	var isNegative = (src * 1.0 < 0);
	src = '' + Math.round(Math.abs(src) * Math.pow(10, dp));
	if(dp > 0)
		src = src.substring(0, src.length - dp) + '.' + src.substring(src.length-dp);
	if(isNegative)
		src = '-' + src;
	return src;
}

// Cheeven 的 DHTML lib
// 取得目前瀏覽器的種類
function getBrowser(){
	if(navigator.appName=='Netscape'){
		if(parseInt(navigator.appVersion) < 5)
			if(parseInt(navigator.appVersion) < 4)
				return "NN3"
			else
				return "NN4";
			return "NN6";
	} else if (navigator.appName=='Microsoft Internet Explorer'){
		if(parseInt(navigator.appVersion) < 5)
			if(parseInt(navigator.appVersion) < 4)
				return "IE3"
			else
				return "IE4";
		else
			return "IE5";
	} else {
		return "unknown browser";
	}
}
// 取得某個名稱的單元(這個function只能用在單層的dhtml)
function getDIV(name){
	var bs = getBrowser();
	if(bs == "NN4")
		// Netscape 的層疊
		return document.layers[name];

	else if(bs == "IE4" || bs == "IE5")
		// Microsoft Internet Explorer 的 Dynamic HTML
		if(eval('document.all.' + name))
			return eval('document.all.' + name + '.style');
		else
			return null;

	else
		// W3C 的 DOM 標準
		if(document.getElementById(name))
			return document.getElementById(name).style;
		else
			return null;
}
function showDIV(name){
	var div = getDIV(name);
	if(getBrowser() == "NN4")
		v = 'show';
	else
		v = 'visible';
	div.visibility = v;
}
function hideDIV(name){
	var div = getDIV(name);
	if(getBrowser() == "NN4")
		v = 'hide';
	else
		v = 'hidden';
	div.visibility = v;
}

// 指定最上層框架的url位置
function takeOverTop(target){
	var topdoc = top.location.href;
	var host = topdoc.substring(0, topdoc.indexOf('/', topdoc.indexOf('://')+3));
	var doclink = topdoc.substring(topdoc.indexOf('/', topdoc.indexOf('://')+3));
	if(doclink != target)
		top.location.href = host + target;
}


// add 2000/12/5 cookie.js
// var today = new Date();
// var expiry = new Date(today.getTime() + 365 * 24 * 60 * 60 * 1000);

function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1) { endstr = document.cookie.length; }
	return unescape(document.cookie.substring(offset, endstr));
	}

function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg) {
			return getCookieVal (j);
			}
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
		}
	return null;
	}

function DeleteCookie (name,path,domain) {
	if (GetCookie(name)) {
		document.cookie = name + "=" +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT";
		}
	}

function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
	}

// add 2000/12/5  cookie.js

// check USERID and company ID
//身份證字號TokenCheck
function TokenCheck_PersonUserID(value){
  var personUserIDToken=/^[A-Z]\d{9}$/;
  return personUserIDToken.test(value);
}

//統一編號＋2位授權碼TokenCheck
function TokenCheck_CompanyUserID(value){
  var companyUserIDToken=/^\d{10}$/;
  return companyUserIDToken.test(value);
}

//密碼TokenCheck
function TokenCheck_Passwd(value){
  var passwdToken=/^[a-zA-Z0-9]{8,8}$/;
  return passwdToken.test(value);
}

//身份證字號規則檢查
function RuleCheck_PersonUserID(value){
  var letterStr ='ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  var refArray = ['10','11','12','13','14','15','16','17',
                  '34','18','19','20','21','22','35','23',
                  '24','25','26','27','28','29','30','31',
                  '32','33'];
  var weightStr = '1987654321'; //加權數值字串
  var checkStr = refArray[letterStr.indexOf(value.charAt(0))]
                 + value.substring(1,9);
  var sum = 0;
  for (i=0;i<10;i++){
    sum = sum + checkStr.charAt(i) * weightStr.charAt(i);
  }
  if ((10-sum%10)!=value.charAt(9)){
    return false;
  }
  return true;
}

//統一編號規則檢查

function RuleCheck_CompanyUserID(value){
  var companyNo = value.substring(0,8);  //統一編號
  var weightStr = '12121241'; //加權數值字串
  var sum = 0;
  for (i=0;i<7;i+=2){
    if (i==6)  {i=7;}
    sum = sum + companyNo.charAt(i) * weightStr.charAt(i);
  }
  var tempNum,tempStr;
  for (j=1;j<8;j+=2){
    if (j==7)  {j=6;}
    tempNum = companyNo.charAt(j) * weightStr.charAt(j);
    tempStr = '00' + tempNum;
    tempStr = tempStr.substring(tempStr.length-3,tempStr.length);
    sum = sum + parseInt(tempStr.substring(0,2)) + tempStr.charAt(2)*1;
  //alert('j='+j+'tempStr='+tempStr+'sum='+sum);
  }
  if ((sum%10)!=0){
    return false;
  }
  return true;
}


// 以下是Dream Weaver的函式庫，請勿修改
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

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_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 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_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_nbGroup(event, grpName) { //v3.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : args[i+1];
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    if ((nbArr = document[grpName]) != null)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = args[i+1];
      nbArr[nbArr.length] = img;
  } }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


//縣市與行政區(下拉式動態選單)
function update_zip(Name, nForm)
{
	nForm.length = 0;

	switch( Name ){
		case "台北市":
    			nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("信義區", "001");
			nForm.options[2] = new Option("北投區", "002");
			nForm.options[3] = new Option("大同區", "004");
			nForm.options[4] = new Option("中山區中北所", "005");
			nForm.options[5] = new Option("中山區中南所", "012");
			nForm.options[6] = new Option("萬華區", "006");
			nForm.options[7] = new Option("中正區", "007");
			nForm.options[8] = new Option("松山區", "008");
			nForm.options[9] = new Option("南港區", "009");
			nForm.options[10] = new Option("文山區", "010");
			nForm.options[11] = new Option("大安區", "011");
			nForm.options[12] = new Option("士林區", "013");
			nForm.options[13] = new Option("內湖區", "014");
			break;

		case "基隆市":
			nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("仁愛區", "111");
			nForm.options[2] = new Option("中山區", "111");
			nForm.options[3] = new Option("安樂區", "111");
			nForm.options[4] = new Option("七堵區", "114");
			nForm.options[5] = new Option("暖暖區", "114");
			nForm.options[6] = new Option("中正區", "116");
			nForm.options[7] = new Option("信義區", "116");
			break;

		case "台北縣":
    			nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("板橋市", "251");
			nForm.options[2] = new Option("三峽鎮", "251");
			nForm.options[3] = new Option("鶯歌鎮", "251");
			nForm.options[4] = new Option("樹林鎮", "251");
			nForm.options[5] = new Option("土城市", "251");
			nForm.options[6] = new Option("蘆洲鄉", "256");
			nForm.options[7] = new Option("三重市", "256");
			nForm.options[8] = new Option("金山鄉", "258");
			nForm.options[9] = new Option("萬里鄉", "258");
			nForm.options[10] = new Option("淡水鎮", "258");
			nForm.options[11] = new Option("三芝鄉", "258");
			nForm.options[12] = new Option("石門鄉", "258");
			nForm.options[13] = new Option("八里鄉", "258");
			nForm.options[14] = new Option("新店市", "264");
			nForm.options[15] = new Option("石碇鄉", "264");
			nForm.options[16] = new Option("深坑鄉", "264");
			nForm.options[17] = new Option("坪林鄉", "264");
			nForm.options[18] = new Option("烏來鄉", "264");
			nForm.options[19] = new Option("瑞芳鎮", "269");
			nForm.options[20] = new Option("平溪鄉", "269");
			nForm.options[21] = new Option("雙溪鄉", "269");
			nForm.options[22] = new Option("貢寮鄉", "269");
			nForm.options[23] = new Option("汐止鎮", "269");
			nForm.options[24] = new Option("中和市", "274");
			nForm.options[25] = new Option("永和市", "274");
			nForm.options[26] = new Option("新莊市", "276");
			nForm.options[27] = new Option("林口鄉", "276");
			nForm.options[28] = new Option("五股鄉", "276");
			nForm.options[29] = new Option("泰山鄉", "276");
			break;
			
		case "宜蘭縣":
    			nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("宜蘭市", "321" );
			nForm.options[2] = new Option("頭城鎮", "321");
			nForm.options[3] = new Option("礁溪鄉", "321");
			nForm.options[4] = new Option("壯圍鄉", "321");
			nForm.options[5] = new Option("員山鄉", "321");
			nForm.options[6] = new Option("羅東鎮", "326");
			nForm.options[7] = new Option("五結鄉", "326");
			nForm.options[8] = new Option("冬山鄉", "326");
			nForm.options[9] = new Option("蘇澳鎮", "326");
			nForm.options[10] = new Option("三星鄉", "326");
			nForm.options[11] = new Option("大同鄉", "326");
			nForm.options[12] = new Option("南澳鄉", "326");
			break;
			
		case "新竹市":
 			nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("東區", "601");
			nForm.options[2] = new Option("北區", "601");
			nForm.options[3] = new Option("香山區", "601");
			break;
			
		case "新竹縣":
			nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("關西鎮", "391");
			nForm.options[2] = new Option("新埔鄉", "391");
			nForm.options[3] = new Option("竹北市", "391");
			nForm.options[4] = new Option("湖口鄉", "391");
			nForm.options[5] = new Option("新豐鄉", "391");
			nForm.options[6] = new Option("竹東鎮", "396");
			nForm.options[7] = new Option("橫山鄉", "396");
			nForm.options[8] = new Option("芎林鄉", "396");
			nForm.options[9] = new Option("寶山鄉", "396");
			nForm.options[10] = new Option("北埔鄉", "396");
			nForm.options[11] = new Option("峨眉鄉", "396");
			nForm.options[12] = new Option("尖石鄉", "396");
			nForm.options[13] = new Option("五峰鄉", "396");
  			break;
  			
		case "桃園縣":
			nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("楊梅鎮", "352");
			nForm.options[2] = new Option("新屋鄉", "352");
			nForm.options[3] = new Option("桃園市", "354");
			nForm.options[4] = new Option("蘆竹鄉", "354");
			nForm.options[5] = new Option("大園鄉", "354");
			nForm.options[6] = new Option("龜山鄉", "354");
			nForm.options[7] = new Option("八德市", "354");
			nForm.options[8] = new Option("中壢市", "359");
			nForm.options[9] = new Option("平鎮市", "359");
			nForm.options[10] = new Option("觀音鄉", "359");
			nForm.options[11] = new Option("大溪鎮", "362");
			nForm.options[12] = new Option("龍潭鄉", "362");
			nForm.options[13] = new Option("復興鄉", "362");
  			break;
  			
		case "苗栗縣":
  			nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("苗栗市", "421");
			nForm.options[2] = new Option("苑裡鎮", "422");
			nForm.options[3] = new Option("通宵鎮", "423");
			nForm.options[4] = new Option("公館鄉", "424");
			nForm.options[5] = new Option("銅鑼鄉", "425");
			nForm.options[6] = new Option("三義鄉", "426");
			nForm.options[7] = new Option("西湖鄉", "427");
			nForm.options[8] = new Option("頭屋鄉", "428");
			nForm.options[9] = new Option("後龍鎮", "429");
			nForm.options[10] = new Option("大湖鄉", "430");
			nForm.options[11] = new Option("卓蘭鎮", "431");
			nForm.options[12] = new Option("獅潭鄉", "432");
			nForm.options[13] = new Option("泰安鄉", "433");
			nForm.options[14] = new Option("竹南鎮", "434");
			nForm.options[15] = new Option("頭份鎮", "435");
			nForm.options[16] = new Option("造橋鄉", "436");
			nForm.options[17] = new Option("三灣鄉", "437");
			nForm.options[18] = new Option("南庄鄉", "438");
  			break;
		
		case "台中市":
   			nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("中區", "083");
			nForm.options[2] = new Option("西區", "084");
			nForm.options[3] = new Option("北區", "085");
			nForm.options[4] = new Option("東區", "088");
                        nForm.options[5] = new Option("南區", "089");
			nForm.options[6] = new Option("北屯區", "082");
			nForm.options[7] = new Option("西屯區", "086");
			nForm.options[8] = new Option("南屯區", "087");
			break;
		
		case "台中縣":
			nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("豐原市", "461");
			nForm.options[2] = new Option("神岡鄉", "462");
			nForm.options[3] = new Option("后里鄉", "463");
			nForm.options[4] = new Option("大雅鄉", "464");
			nForm.options[5] = new Option("潭子鄉", "465");
			nForm.options[6] = new Option("大甲鎮", "466");
			nForm.options[7] = new Option("清水鎮", "467");
			nForm.options[8] = new Option("沙鹿鎮", "468");
			nForm.options[9] = new Option("梧棲鎮", "469");
			nForm.options[10] = new Option("外埔鄉", "470");
			nForm.options[11] = new Option("大安鄉", "471");
			nForm.options[12] = new Option("大肚鄉", "472");
			nForm.options[13] = new Option("龍井鄉", "473");
			nForm.options[14] = new Option("烏日鄉", "474");
			nForm.options[15] = new Option("霧峰鄉", "475");
			nForm.options[16] = new Option("太平市", "476");
			nForm.options[17] = new Option("大里市", "477");
			nForm.options[18] = new Option("東勢鎮", "478");
			nForm.options[19] = new Option("新社鄉", "479");
            		nForm.options[20] = new Option("石岡鄉", "480");				
			nForm.options[21] = new Option("和平鄉", "481");  			
                        break;
                        
		case "彰化縣":
		        nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("彰化市", "541");
			nForm.options[2] = new Option("鹿港鎮", "542");
			nForm.options[3] = new Option("和美鎮", "543");
			nForm.options[4] = new Option("線西鄉", "544");
			nForm.options[5] = new Option("伸港鄉", "545");
			nForm.options[6] = new Option("福興鄉", "546");
			nForm.options[7] = new Option("秀水鄉", "547");
			nForm.options[8] = new Option("花壇鄉", "548");
			nForm.options[9] = new Option("芬園鄉", "549");
			nForm.options[10] = new Option("員林鎮", "550");
			nForm.options[11] = new Option("溪湖鎮", "551");
			nForm.options[12] = new Option("田中鎮", "552");
			nForm.options[13] = new Option("大村鄉", "553");
			nForm.options[14] = new Option("埔鹽鄉", "554");
			nForm.options[15] = new Option("埔心鄉", "555");
			nForm.options[16] = new Option("永靖鄉", "556");
			nForm.options[17] = new Option("社頭鄉", "557");
			nForm.options[18] = new Option("二水鄉", "558");
			nForm.options[19] = new Option("北斗鎮", "559");
            		nForm.options[20] = new Option("二林鎮", "560");
			nForm.options[21] = new Option("田尾鄉", "561");
			nForm.options[22] = new Option("埤頭鄉", "562");
			nForm.options[23] = new Option("芳苑鄉", "563");
			nForm.options[24] = new Option("大城鄉", "564");
			nForm.options[25] = new Option("竹塘鄉", "565");
			nForm.options[26] = new Option("溪州鄉", "566");
			break;
			
		case "南投縣":
			nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("南投市", "511");
			nForm.options[2] = new Option("草屯鎮", "512");
			nForm.options[3] = new Option("集集鎮", "513");
			nForm.options[4] = new Option("名間鄉", "514");
			nForm.options[5] = new Option("中寮鄉", "515");
			nForm.options[6] = new Option("水里鄉", "516");
			nForm.options[7] = new Option("信義鄉", "517");
			nForm.options[8] = new Option("埔里鎮", "518");
			nForm.options[9] = new Option("魚池鄉", "519");
			nForm.options[10] = new Option("國姓鄉", "520");
			nForm.options[11] = new Option("仁愛鄉", "521");
			nForm.options[12] = new Option("竹山鎮", "522");
			nForm.options[13] = new Option("鹿谷鄉", "523");
			break;
			
		case "嘉義市":
  			nForm.options[0] = new Option("請選擇","");
		    	nForm.options[1] = new Option("東區", "382");
			nForm.options[2] = new Option("西區", "382");
			nForm.options[3] = new Option("嘉義市", "382");
			break;
			
		case "嘉義縣":
  			nForm.options[0] = new Option("請選擇","");
		    	nForm.options[1] = new Option("大林鎮", "665");
			nForm.options[2] = new Option("民雄鄉", "665");
			nForm.options[3] = new Option("溪口鄉", "665");
			nForm.options[4] = new Option("新港鄉", "658");
			nForm.options[5] = new Option("太保市", "658");
			nForm.options[6] = new Option("水上鄉", "658");
			nForm.options[7] = new Option("中埔鄉", "658");
			nForm.options[8] = new Option("竹崎鄉", "665");
			nForm.options[9] = new Option("梅山鄉", "665");
			nForm.options[10] = new Option("番路鄉", "658");
			nForm.options[11] = new Option("大埔鄉", "658");
			nForm.options[12] = new Option("阿里山鄉", "658");
			nForm.options[13] = new Option("朴子市", "658");
			nForm.options[14] = new Option("布袋鎮", "658");
			nForm.options[15] = new Option("六腳鄉", "658");
			nForm.options[16] = new Option("東石鄉", "658");
			nForm.options[17] = new Option("義竹鄉", "658");
			nForm.options[18] = new Option("鹿草鄉", "658");
			break;
			
		case "雲林縣":
			nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("斗六市", "611");
			nForm.options[2] = new Option("斗南鎮", "612");
			nForm.options[3] = new Option("西螺鎮", "613");
			nForm.options[4] = new Option("古坑鄉", "614");
			nForm.options[5] = new Option("大埤鄉", "615");
			nForm.options[6] = new Option("莿桐鄉", "616");
			nForm.options[7] = new Option("林內鄉", "617");
			nForm.options[8] = new Option("北港鎮", "618");
			nForm.options[9] = new Option("元長鄉", "619");
			nForm.options[10] = new Option("四湖鄉", "620");
			nForm.options[11] = new Option("口湖鄉", "621");
			nForm.options[12] = new Option("水林鄉", "622");
			nForm.options[13] = new Option("虎尾鎮", "623");
			nForm.options[14] = new Option("土庫鎮", "624");
			nForm.options[15] = new Option("二崙鄉", "625");
			nForm.options[16] = new Option("崙背鄉", "626");
			nForm.options[17] = new Option("麥寮鄉", "627");
			nForm.options[18] = new Option("東勢鄉", "628");
			nForm.options[19] = new Option("褒忠鄉", "629");
            		nForm.options[20] = new Option("臺西鄉", "630");
			break;
			
		case "台南市":
          		nForm.options[0] = new Option("請選擇","");
 			nForm.options[1] = new Option("東區", "145");
			nForm.options[2] = new Option("南區", "145");
			nForm.options[3] = new Option("西區", "145");
			nForm.options[4] = new Option("北區", "145");
			nForm.options[5] = new Option("中區", "145");
			nForm.options[6] = new Option("安平區", "145");
                        nForm.options[7] = new Option("安南區", "148");
			break;
			
		case "台南縣":
		    	nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("新營市", "691");
			nForm.options[2] = new Option("鹽水鎮", "691");
			nForm.options[3] = new Option("白河鎮", "691");
			nForm.options[4] = new Option("柳營鄉", "691");
			nForm.options[5] = new Option("後壁鄉", "691");
			nForm.options[6] = new Option("東山鄉", "691");
			nForm.options[7] = new Option("下營鄉", "691");
			nForm.options[8] = new Option("六甲鄉", "691");
			nForm.options[9] = new Option("官田鄉", "691");
			nForm.options[10] = new Option("大內鄉", "691");
			nForm.options[11] = new Option("善化鎮", "691");
			nForm.options[12] = new Option("新化鎮", "702");
			nForm.options[13] = new Option("新市鄉", "702");
			nForm.options[14] = new Option("山上鄉", "702");
			nForm.options[15] = new Option("玉井鄉", "702");
			nForm.options[16] = new Option("楠西鄉", "702");
			nForm.options[17] = new Option("南化鄉", "702");
			nForm.options[18] = new Option("左鎮鄉", "702");
			nForm.options[19] = new Option("仁德鄉", "702");
            		nForm.options[20] = new Option("歸仁鄉", "702");				
			nForm.options[21] = new Option("關廟鄉", "702");
			nForm.options[22] = new Option("龍崎鄉", "702");
			nForm.options[23] = new Option("永康市", "702");
			nForm.options[24] = new Option("麻豆鎮", "715");
			nForm.options[25] = new Option("佳里鎮", "715");
			nForm.options[26] = new Option("西港鄉", "715");
			nForm.options[27] = new Option("七股鄉", "715");
			nForm.options[28] = new Option("將軍鄉", "715");
			nForm.options[29] = new Option("北門鄉", "715");
			nForm.options[30] = new Option("學甲鎮", "715");
			nForm.options[31] = new Option("安定鄉", "715");
			break;
			
		case "高雄市":
			nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("新興區", "172");
			nForm.options[2] = new Option("鹽埕區", "173");
			nForm.options[3] = new Option("前金區", "173");
			nForm.options[4] = new Option("苓雅區", "174");
			nForm.options[5] = new Option("鼓山區", "176");
			nForm.options[6] = new Option("旗津區", "176");
			nForm.options[7] = new Option("楠梓區", "177");
			nForm.options[8] = new Option("前鎮區", "178");
			nForm.options[9] = new Option("三民區", "180");
			nForm.options[10] = new Option("小港區", "181");
			nForm.options[11] = new Option("左營區", "182");
			break;
			
		case "高雄縣":
		 	nForm.options[0] = new Option("請選擇","");
 			nForm.options[1] = new Option("鳳山市", "761");
			nForm.options[2] = new Option("鳥松鄉", "761");
			nForm.options[3] = new Option("仁武鄉", "761");
			nForm.options[4] = new Option("大社鄉", "761");
			nForm.options[5] = new Option("大樹鄉", "761");
			nForm.options[6] = new Option("大寮鄉", "761");
			nForm.options[7] = new Option("林園鄉", "761");
			nForm.options[8] = new Option("旗山鎮", "768");
			nForm.options[9] = new Option("六龜鄉", "768");
			nForm.options[10] = new Option("內門鄉", "768");
			nForm.options[11] = new Option("美濃鎮", "768");
			nForm.options[12] = new Option("杉林鄉", "768");
			nForm.options[13] = new Option("甲仙鄉", "768");
			nForm.options[14] = new Option("茂林鄉", "768");
			nForm.options[15] = new Option("桃源鄉", "768");
			nForm.options[16] = new Option("三民鄉", "768");
			nForm.options[17] = new Option("岡山鎮", "777");
			nForm.options[18] = new Option("茄萣鄉", "777");
			nForm.options[19] = new Option("永安鄉", "777");
            		nForm.options[20] = new Option("橋頭鄉", "777");				
			nForm.options[21] = new Option("梓官鄉", "777");
			nForm.options[22] = new Option("田寮鄉", "777");
			nForm.options[23] = new Option("阿蓮鄉", "777");
			nForm.options[24] = new Option("路竹鄉", "777");
			nForm.options[25] = new Option("燕巢鄉", "777");
			nForm.options[26] = new Option("彌陀鄉", "777");
			nForm.options[27] = new Option("湖內鄉", "777");
			break;
			
		case "屏東縣":
		    	nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("屏東市", "821");
			nForm.options[2] = new Option("萬丹鄉", "821");
			nForm.options[3] = new Option("長治鄉", "821");
			nForm.options[4] = new Option("麟洛鄉", "821");
			nForm.options[5] = new Option("九如鄉", "821");
			nForm.options[6] = new Option("里港鄉", "821");
			nForm.options[7] = new Option("鹽埔鄉", "821");
			nForm.options[8] = new Option("高樹鄉", "821");
			nForm.options[9] = new Option("三地門鄉", "821");
			nForm.options[10] = new Option("霧台鄉", "821");
			nForm.options[11] = new Option("瑪家鄉", "821");
			nForm.options[12] = new Option("東港鎮", "832");
			nForm.options[13] = new Option("新園鄉", "832");
			nForm.options[14] = new Option("崁頂鄉", "832");
			nForm.options[15] = new Option("林邊鄉", "832");
			nForm.options[16] = new Option("南州鄉", "832");
			nForm.options[17] = new Option("佳冬鄉", "832");
			nForm.options[18] = new Option("琉球鄉", "832");
			nForm.options[19] = new Option("潮州鎮", "839");
            		nForm.options[20] = new Option("萬巒鄉", "839");
			nForm.options[21] = new Option("內埔鄉", "839");
			nForm.options[22] = new Option("竹田鄉", "839");
			nForm.options[23] = new Option("新埤鄉", "839");
			nForm.options[24] = new Option("枋寮鄉", "839");
			nForm.options[25] = new Option("泰武鄉", "839");
			nForm.options[26] = new Option("來義鄉", "839");
			nForm.options[27] = new Option("春日鄉", "839");
			nForm.options[28] = new Option("恆春鎮", "848");
			nForm.options[29] = new Option("車城鄉", "848");
			nForm.options[30] = new Option("滿州鄉", "848");
			nForm.options[31] = new Option("枋山鄉", "848");
			nForm.options[32] = new Option("獅子鄉", "848");
			nForm.options[33] = new Option("牡丹鄉", "848");
			break;
			
		case "花蓮縣":
		     	nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("花蓮市", "891");
			nForm.options[2] = new Option("光復鄉", "891");
			nForm.options[3] = new Option("新城鄉", "891");
			nForm.options[4] = new Option("吉安鄉", "891");
			nForm.options[5] = new Option("壽豐鄉", "891");
			nForm.options[6] = new Option("鳳林鎮", "891");
			nForm.options[7] = new Option("豐濱鄉", "891");
			nForm.options[8] = new Option("秀林鄉", "891");
			nForm.options[9] = new Option("萬榮鄉", "891");
			nForm.options[10] = new Option("玉里鎮", "900");
			nForm.options[11] = new Option("瑞穗鄉", "900");
			nForm.options[12] = new Option("富里鄉", "900");
                        nForm.options[13] = new Option("卓溪鄉", "900");
			break;
			
		case "澎湖縣":
			nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("馬公市", "971");
			nForm.options[2] = new Option("湖西鄉", "971");
			nForm.options[3] = new Option("白沙鄉", "971");
			nForm.options[4] = new Option("西嶼鄉", "971");
			nForm.options[5] = new Option("望安鄉", "971");
			nForm.options[6] = new Option("七美鄉", "971");
			break;
			
		case "金門":
		    	nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("金城鎮", "951");
			nForm.options[2] = new Option("金寧鄉", "951");
			nForm.options[3] = new Option("烏坵鄉", "951");
			nForm.options[4] = new Option("金沙鎮", "951");
			nForm.options[5] = new Option("金湖鎮", "951");
			nForm.options[6] = new Option("烈嶼鄉", "951");
			break;	
		case "馬祖":
		    	nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("連江縣稅處南竿鄉", "981");
			nForm.options[2] = new Option("連江縣稅處北竿鄉", "982");
			nForm.options[3] = new Option("連江縣稅處莒光鄉", "983");
			nForm.options[4] = new Option("連江縣稅處東引鄉", "984");
			break;
			
		case "台東縣":
		    	nForm.options[0] = new Option("請選擇","");
			nForm.options[1] = new Option("台東市", "921");
			nForm.options[2] = new Option("成功鎮", "921");
			nForm.options[3] = new Option("關山鎮", "921");
			nForm.options[4] = new Option("卑南鄉", "921");
			nForm.options[5] = new Option("大武鄉", "921");
			nForm.options[6] = new Option("太麻里鄉", "921");
			nForm.options[7] = new Option("東河鄉", "921");
			nForm.options[8] = new Option("長濱鄉", "921");
			nForm.options[9] = new Option("鹿野鄉", "921");
			nForm.options[10] = new Option("池上鄉", "921");
			nForm.options[11] = new Option("綠島鄉", "921");
			nForm.options[12] = new Option("延平鄉", "921");
			nForm.options[13] = new Option("海瑞鄉", "921");
			nForm.options[14] = new Option("達仁鄉", "921");
			nForm.options[15] = new Option("金峰鄉", "921");
			nForm.options[16] = new Option("蘭嶼鄉", "921");
			break;

		default:
			nForm.options[0] = new Option("請選擇");
			break;
	}
}

//消除空字串
function Trim(Str){
if(Str==null){
return Str;
}

for(var i=1;i<=Str.length;i++){
if(Str.indexOf(" ")==0){
Str=Str.substr(1);
}
else{
break;
}
} 

for(var i=1;i<=Str.length;i++){ 
if(Str.lastIndexOf(" ")==Str.length-1){
Str=Str.substr(0,Str.length-1);
}
else{
break;
}
}
return Str;
}<!--/HEAD--><!--BODY--><NOSCRIPT>To display this page you need a browser with JavaScript support.</NOSCRIPT><!--/BODY--><!--/HTML-->