function changeDynaList( listname, source, key, orig_key, orig_val ) {
	var list = eval( 'document.theForm.' + listname );

	// empty the list
	for (i in list.options.length) {
		list.options[i] = null;
	}
	i = 0;
	for (x in source) {
		if (source[x][0] == key) {
			opt = new Option();
			opt.value = source[x][1];
			opt.text = source[x][2];

			if ((orig_key == key && orig_val == opt.value) || i == 0) {
				opt.selected = true;
			}
			list.options[i++] = opt;
		}
	}
	list.length = i;
}


function changeDynaList2( listname, source, key, orig_key, orig_val ) {
	var list = eval( 'document.theFormz.' + listname );

	// empty the list
	for (i in list.options.length) {
		list.options[i] = null;
	}
	i = 0;
	for (x in source) {
		if (source[x][0] == key) {
			opt = new Option();
			opt.value = source[x][1];
			opt.text = source[x][2];

			if ((orig_key == key && orig_val == opt.value) || i == 0) {
				opt.selected = true;
			}
			list.options[i++] = opt;
		}
	}
	list.length = i;
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// 清除關鍵字
function Clear(obj){
   eval("document."+obj+".value=''");
}

// 廣告
scrollheight = 160 ;
lineNum = 1; 
boardheight=scrollheight * lineNum;
scrollwidth=600;
scrollTimeOut = 20;	
scrollStopTime = 200

doScroll = true
scrollCountTime = 0;
offSet = scrollheight;
startSetp = 0;

function ScrollBluezz() {
	var thisSc=document.getElementById('scArea');
	thisSc.style.width = scrollwidth+"px";
	thisSc.style.height = boardheight+"px";
	thisSc.style.overflowX = "hidden";
	thisSc.style.overflowY = "hidden";
	thisSc.scrollTop = 0
	setInterval("scrollUpBluezz()",scrollTimeOut)
}

function scrollUpBluezz() {
	var thisSc=document.getElementById('scArea');
	if (doScroll == false) return	//]
	offSet ++ 
	if (offSet == scrollheight + 1) {
	  scrollCountTime ++ 
	  offSet -- 
	   if (scrollCountTime == scrollStopTime) {
		 offSet = 0
		 scrollCountTime = 0
	   }
	 }else {
	  startSetp = thisSc.scrollTop + (scrollheight * lineNum);
	  thisSc.scrollTop ++
	  if (startSetp == thisSc.scrollTop + (scrollheight * lineNum)) {
		thisSc.scrollTop = scrollheight * (lineNum-1)
		thisSc.scrollTop ++ 
	  }
	 }
}
