//document.write ("<base href=http://202.3.173.241:8080/>")
//alert(screen.width)
today=new Date()
var getFromYear,getFromMonth,getFromDay,getToYear,getToMonth,getToDay,getKeyWord,getDBID,getNewsFilter,getShowLogout
//modify by anson 2005/08/02 for keep搜尋日期
function getSrhCookie(name) {
  var cookiename = name + "=";
  var dc = document.cookie;
  var begin, end;
	//alert(cookiename);
  if (dc.length > 0) {
      begin = dc.indexOf(cookiename);
      if (begin != -1) {
          begin += cookiename.length;
          end = dc.indexOf(";", begin);
          if (end == -1) {
              end = dc.length;
          }

          return unescape(dc.substring(begin, end));
      } 
  }
  return '';
}

getFromYear   = getSrhCookie('setFromYear')
getFromMonth  = getSrhCookie('setFromMonth')
getFromDay    = getSrhCookie('setFromDay')
getToYear     = getSrhCookie('setToYear')
getToMonth    = getSrhCookie('setToMonth')
getToDay      = getSrhCookie('setToDay')
getKeyWord    = getSrhCookie('setKeyWord')
getDBID       = getSrhCookie('setDBID')
getNewsFilter = getSrhCookie('setNewsFilter')
getShowLogout = getSrhCookie('setShowLogout')

getHPCookie 	= getSrhCookie('HPCookie')
//alert(getShowLogout)
//alert(getSrhCookie('HPCookie'))
if(getToYear==''){
	today_year = today.getYear();
}
else{
	today_year = getToYear
}
if (today_year<1900) today_year=today_year+1900;

if(getToMonth==''){
	today_month=today.getMonth()+1;
}
else{
	today_month=getToMonth;
}

if(getToDay==''){
	today_day=today.getDate();
}
else{
	today_day=getToDay;
}

if (today_month<10) today_month='0'+today_month;
if (today_day<10) today_day='0'+today_day;
today_date=today_year+'/'+today_month+'/'+today_day

if(getNewsFilter==''){
	getNewsFilter = 'all'
}

searchBarDateSelect="<select name=from_year style='font-size:8pt'></select>年<select name=from_month style='font-size:8pt'></select>月<select name=from_day style='font-size:8pt'></select>日<a href=javascript:OpenDate('from_','Y','Y')><img src=/img/calendar.gif border=0 align=absmiddle></a>~<select name=to_year style='font-size:8pt'></select>年<select name=to_month style='font-size:8pt'></select>月<select name=to_day style='font-size:8pt'></select>日<a href=javascript:OpenDate('to_','Y','')><img src=/img/calendar.gif border=0 align=absmiddle></a>"
searchBarDateSelect+="<input onkeydown='if(event.keyCode==13) {ckSH();return false;}' type=text onfocus=\"if(this.value=='搜尋關鍵字')this.value='';\" onblur=\"if(this.value=='')this.value='搜尋關鍵字';\" value=搜尋關鍵字 name=p size=8 style='font-size:8pt'>&nbsp;<img onmouseover=\"this.src='/img/go-down.gif'\" onmouseout=\"this.src='/img/go-up.gif'\" src=/img/go-up.gif align=absMiddle border=0 name=go onclick=ckSH() style='cursor:pointer'>"

if (screen.width<=800){
  searchBar="<table border=0 cellpadding=0 cellspacing=0 width=100% bgcolor=#D7E5F2 style='border-left:1px solid rgb(192,192,192);border-right:1px solid rgb(192,192,192);border-bottom:1px solid rgb(192,192,192)'>"
  searchBar+="<tr>"
  searchBar+="<td rowspan=3 width=10% >&nbsp;</td>"
  searchBar+="<td align=center>"
  searchBar+="	<table border=0 width=570><tr><td>"
  //alert(RDBID)
  if(getDBID==''){
  	searchBar+="	<nobr><input type=checkbox name=s value=1  checked>新聞(<input type=radio name=news_filter value=all "
  	if(getNewsFilter=='all'){
  		searchBar+="checked"
  	}
  	searchBar+=">標題+內文<input type=radio name=news_filter value=sub "
  	if(getNewsFilter=='sub'){
  		searchBar+="checked"
  	}
  	searchBar+=">標題)</nobr>"
  	searchBar+="	<nobr><input type=checkbox name=s value=11 checked>產業分析&nbsp;<input type=checkbox name=s value=13 checked>圖表&nbsp;<input type=checkbox name=s value=15 checked>CEO </nobr>"
  	searchBar+="	<nobr><input type=checkbox name=s value=19 checked>ICT&nbsp;<input type=checkbox name=s value=21 checked>FPD&nbsp;<input type=checkbox name=s value=23 checked>專輯 </nobr>"	
  }
  else{
  	var getDBIDs = getDBID.split(", ")
  	var check_s1 = false;
  	var check_s11 = false;
  	var check_s13 = false;
  	var check_s15 = false;
  	var check_s19 = false;
  	var check_s21 = false;
  	var check_s23 = false;
  	
  	for(var i=0;i<getDBIDs.length;i++){
  		switch (getDBIDs[i]){
  			case "1":
  				check_s1 = true;
  				break;
  			case "11":
  				check_s11 = true;
  				break;
  			case "13":
  				check_s13 = true;
  				break;
  			case "15":
  				check_s15 = true;
  				break;
  			case "19":
  				check_s19 = true;
  				break;
  			case "21":
  				check_s21 = true;
  				break;
  			case "23":
  				check_s23 = true;
  				break;
  			}
  	}
  	searchBar+="	<nobr><input type=checkbox name=s value=1  "
  	if(check_s1){
  		searchBar+="checked"
  	}
  	searchBar+=">新聞(<input type=radio name=news_filter value=all "
  	if(getNewsFilter=='all'){
  		searchBar+="checked"
  	}
  	searchBar+=">標題+內文<input type=radio name=news_filter value=sub "
  	if(getNewsFilter=='sub'){
  		searchBar+="checked"
  	}
  	searchBar+=">標題)</nobr>"
  	searchBar+="	<nobr><input type=checkbox name=s value=11 "
  	if(check_s11){
  		searchBar+="checked"
  	}
  	searchBar+=">產業分析&nbsp;<input type=checkbox name=s value=13 "
  	if(check_s13){
  		searchBar+="checked"
  	}
  	searchBar+=">圖表&nbsp;<input type=checkbox name=s value=15 "
  	if(check_s15){
  		searchBar+="checked"
  	}
  	searchBar+=">CEO </nobr>"
  	searchBar+=" <nobr><input type=checkbox name=s value=19 "
  	if(check_s19){
  		searchBar+="checked"
  	}
  	searchBar+=">ICT <input type=checkbox name=s value=21 "
  	if(check_s21){
  		searchBar+="checked"
  	}
  	searchBar+=">FPD <input type=checkbox name=s value=23 "
  	if(check_s23){
  		searchBar+="checked"
  	}
  	searchBar+=">專輯</nobr>"
  }
  searchBar+="	</td></tr></table>"
  searchBar+="	</td>"
  searchBar+="<td rowspan=3 width=10% >&nbsp;</td>"
  searchBar+="</tr>"
  searchBar+="<tr>"
  searchBar+="<td valign=middle align=center>"
  searchBar+="	<table border=0 width=570><tr><td>"
  
  searchBar+="	<nobr>"+searchBarDateSelect+"</nobr>"
  searchBar+="	</td></tr></table>"
  searchBar+="	</td></tr>"
  searchBar+="	<tr><td valign=middle align=center>"
  searchBar+="	<table border=0 width=570><tr><td>"
  
  try {
  	if (sHotKeyLink != '') searchBar+="<nobr>熱門查詢詞: "+sHotKeyLink+"</nobr>";
  } catch(e) {
  }
  //searchBar+="	</td><td width=1% style='font-size:11px'>"
  searchBar+="	</td><td align=right><nobr><a href=/Srch/SrhUI.asp>[進階搜尋]</a>&nbsp;<a href=/Srch/useway.swf target=_blank>[使用說明]</a>&nbsp;</nobr>"
  searchBar+="	</td></tr></table>"
  searchBar+="</td></tr>"
  searchBar+="</table>"
}
else{
  searchBar="<table border=0 cellpadding=0 cellspacing=0 width=100% bgcolor=#D7E5F2 style='border-left:1px solid rgb(192,192,192);border-right:1px solid rgb(192,192,192);border-bottom:1px solid rgb(192,192,192)'>"
  searchBar+="<tr>"
  searchBar+="<td rowspan=2 width=10% >&nbsp;</td>"
  searchBar+="<td align=center>"
  searchBar+="	<table border=0 width=100% ><tr><td width=65% >"
  //alert(RDBID)
  if(getDBID==''){
  	searchBar+="	<nobr><input type=checkbox name=s value=1  checked>新聞(<input type=radio name=news_filter value=all "
  	if(getNewsFilter=='all'){
  		searchBar+="checked"
  	}
  	searchBar+=">標題+內文<input type=radio name=news_filter value=sub "
  	if(getNewsFilter=='sub'){
  		searchBar+="checked"
  	}
  	searchBar+=">標題)</nobr>"
  	searchBar+="	<nobr><input type=checkbox name=s value=11 checked>產業分析&nbsp;<input type=checkbox name=s value=13 checked>圖表&nbsp;<input type=checkbox name=s value=15 checked>CEO </nobr>"
  	searchBar+="	<nobr><input type=checkbox name=s value=19 checked>ICT&nbsp;<input type=checkbox name=s value=21 checked>FPD&nbsp;<input type=checkbox name=s value=23 checked>專輯 </nobr>"	
  }
  else{
  	var getDBIDs = getDBID.split(", ")
  	var check_s1 = false;
  	var check_s11 = false;
  	var check_s13 = false;
  	var check_s15 = false;
  	var check_s19 = false;
  	var check_s21 = false;
  	var check_s23 = false;
  	
  	for(var i=0;i<getDBIDs.length;i++){
  		switch (getDBIDs[i]){
  			case "1":
  				check_s1 = true;
  				break;
  			case "11":
  				check_s11 = true;
  				break;
  			case "13":
  				check_s13 = true;
  				break;
  			case "15":
  				check_s15 = true;
  				break;
  			case "19":
  				check_s19 = true;
  				break;
  			case "21":
  				check_s21 = true;
  				break;
  			case "23":
  				check_s23 = true;
  				break;
  			}
  	}
  	searchBar+="	<nobr><input type=checkbox name=s value=1  "
  	if(check_s1){
  		searchBar+="checked"
  	}
  	searchBar+=">新聞(<input type=radio name=news_filter value=all "
  	if(getNewsFilter=='all'){
  		searchBar+="checked"
  	}
  	searchBar+=">標題+內文<input type=radio name=news_filter value=sub "
  	if(getNewsFilter=='sub'){
  		searchBar+="checked"
  	}
  	searchBar+=">標題)</nobr>"
  	searchBar+="	<nobr><input type=checkbox name=s value=11 "
  	if(check_s11){
  		searchBar+="checked"
  	}
  	searchBar+=">產業分析&nbsp;<input type=checkbox name=s value=13 "
  	if(check_s13){
  		searchBar+="checked"
  	}
  	searchBar+=">圖表&nbsp;<input type=checkbox name=s value=15 "
  	if(check_s15){
  		searchBar+="checked"
  	}
  	searchBar+=">CEO </nobr>"
  	searchBar+=" <nobr><input type=checkbox name=s value=19 "
  	if(check_s19){
  		searchBar+="checked"
  	}
  	searchBar+=">ICT <input type=checkbox name=s value=21 "
  	if(check_s21){
  		searchBar+="checked"
  	}
  	searchBar+=">FPD <input type=checkbox name=s value=23 "
  	if(check_s23){
  		searchBar+="checked"
  	}
  	searchBar+=">專輯</nobr></td>"
  }
  searchBar+="	<td><nobr><a href=/Srch/SrhUI.asp>[進階搜尋]</a>&nbsp;<a href=/Srch/useway.swf target=_blank>[使用說明]</a>&nbsp;</nobr>"
  
  searchBar+="	</td></tr></table>"
  searchBar+="	</td>"
  searchBar+="<td rowspan=2 width=1% >&nbsp;</td>"
  searchBar+="</tr>"
  searchBar+="<tr>"
  searchBar+="<td valign=middle align=center>"
  searchBar+="	<table border=0 width=100% ><tr><td width=65% >"
  
  searchBar+="	<nobr>"+searchBarDateSelect+"</nobr></td><td >"
    try {
  	if (sHotKeyLink != '') searchBar+="<nobr>熱門查詢詞: "+sHotKeyLink+"</nobr>";
  } catch(e) {
  }

  searchBar+="	</td></tr></table>"
  searchBar+="	</td></tr>"
  searchBar+="</table>"
}

var zIdx = -1;
var menuStr = '';

var NN 	     = (document.layers ? true : false);
var sWidPos  = (NN ? outerWidth  : screen.availWidth);
var sHgtPos  = (NN ? outerHeight : screen.availHeight);
var hideName = (NN ? 'hide' : 'hidden');
var showName = (NN ? 'show' : 'visible');

var opt = Array();

try {
	if (arrFnItem.constructor == Array) {
		var idx, jdx, kdx;
		for (idx = 0, kdx = 0; idx < arrFnItem.length; idx++) {
			if (arrFnItem[idx].constructor == Array) {
				menuStr = "";
				menuStr += "<table border=0 cellpadding=1 cellspacing=5 style='border:#333399 1px solid' bgcolor=#E0FFFF>";
				opt[kdx++] = arrFnItem[idx][0];
	      			for (jdx = 1; jdx < arrFnItem[idx].length; jdx++) {
				        menuStr += "<tr><td class=dt9>" + arrFnItem[idx][jdx] + "</td></tr>";
	      			}
	      			menuStr += '</table>';
	     			if(!NN && menuStr != "") CreateLayer('submenu' + idx, 250, 130, 100, 50, hideName, menuStr);
	     		} else {
	     			opt[kdx++] = arrFnItem[idx];
	     		}
	     	}
	} else {
		//throw "no arrFnItem array !!"
		alert('no arrFnItem array !!');
	}
} catch(e) {
	menuStr = "";
	menuStr += '<table border=0 cellpadding=1 cellspacing=5 style="border:#333399 1px solid" bgcolor=#E0FFFF>';
	menuStr += '<tr><td class=dt9><a href="/n/NwsLst.asp">今日新聞</a></td></tr>';
	menuStr += '<tr><td class=dt9><a href="/n/NwsLst.asp?f=B">分類新聞</a></td></tr>';
	menuStr += '<tr><td class=dt9><a href="/n/NwsLst.asp?f=E">新聞總覽</a></td></tr>';
	menuStr += '<tr><td class=dt9><a href="/n/HotLst.asp">熱門新聞</a></td></tr>';
	menuStr += '</table>';

	if(!NN)	CreateLayer('newsmenu', 250, 130, 100, 50, hideName, menuStr);
}

var bookmarkurl="http://member.digitimes.com.tw";
var bookmarktitle="電子時報 - 產業會員網";


function pureshowmenu(menu){if(!NN) menu.style.visibility = showName;}
function showmenu(menu, px, py)
{	var ax=px;
	var ay=py-50;
	if(!NN) {menu.style.left=ax;menu.style.top=ay;menu.style.visibility=showName;}
}
function hidemenu(menu){if(!NN) menu.style.visibility = hideName;}
function CreateLayer(sName, sLeft, sTop, sWdh, sHgt, sVis, copy)
{
	if (NN)
	{
		document.writeln('<LAYER NAME="' + sName + '" LEFT=' + sLeft + ' TOP=' + sTop +
		' WIDTH=' + sWdh + ' HEIGHT=' + sHgt + ' VISIBILITY="' + sVis + '"' +
		' z-Index=' + (++zIdx) + '>' + copy + '</LAYER>');
	}
	else
	{
		document.writeln('<DIV ID="' + sName + '" STYLE="position:absolute; overflow:none; left:' +
			sLeft + 'px; top:' + sTop + 'px; width:' + sWdh + 'px; height:' + sHgt + 'px;' +
			' visibility:' + sVis + '; z-Index=' + (++zIdx) + '" onMouseOver="pureshowmenu(this);" onMouseOut="hidemenu(this);">' +
			copy + '</DIV>'
			);
	}
}


function addbookmark()
	{
		if (navigator.appName!="Netscape")
			{
				window.external.AddFavorite(bookmarkurl,bookmarktitle);
			}
		else
			{
				window.location = bookmarkurl;
			}
	}

function initHTML(searchDate){
	//alert(RToYear)
	if(top.frames.length>0){
	var idx;
	
	x1=   "<form name=mForm method=post>"
	x1=x1+"<table width=100% border=0 cellpadding=0 cellspacing=0>"
	x1=x1+"<tr>"
	x1=x1+"	<td><img src=/img/t.gif width=14 height=14>"
	x1=x1+"	<td width=100% valign=middle align=center>"
	//modify by anson 2004/12/08 取消全網button
	//x1=x1+"<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td width=12% ><td>"+B0200001+"<td width=24% ><td>"+B0100001+"<td width=24% ><td>"+B0200002+"<td width=12% ></table>"
	x1=x1+"		<table width=100% border=0 cellpadding=0 cellspacing=0>"
	x1=x1+"			<TR>"
	//if (pageTitle==""){
		//x1=x1+"				<TD VALIGN='top' WIDTH=220 ROWSPAN='4'><a href=/index.asp><IMG src=/img/mem_logo.gif BORDER='0' ALT='DigiTimes'><font class='LHead14 r'>"+pageTitle+"</font></TD>"
		x1=x1+"	<TD VALIGN='top' WIDTH=330 ROWSPAN='4'>"
		if (getHPCookie=='Old'){
			x1=x1+"	<A HREF='/index.asp' TITLE='DigiTimes'>"
		}
		else{
			x1=x1+"	<A HREF='/index_2.asp' TITLE='DigiTimes'>"
		}
		x1=x1+"	<IMG src=/img/mem_logo.gif BORDER=0 ALT='DigiTimes'></A></TD>"
	
	/*}
	else{
		//x1=x1+"				<TD VALIGN='top' WIDTH=440 ROWSPAN='4'><a href=/index.asp><IMG src=/img/mem_logo.gif BORDER='0' ALT='DigiTimes'><font class='LHead14 r'>"+pageTitle+"</font></TD>"
		var iWidth = 25*pageTitle.length
		x1=x1+"	<TD VALIGN=top WIDTH=200 ROWSPAN=4>"
		x1=x1+"	<A HREF=/ TITLE=DigiTimes >"
		x1=x1+"	<IMG SRC=/img/mem_logo.gif BORDER='0' ALT='DigiTimes'></A>"
		x1=x1+"	<td rowspan=4 width="+iWidth+"><FONT class='LHead14 r'>"+pageTitle+"</FONT>"
	}*/
	x1=x1+"				<TD align=right style='padding:0 0 3 0'>"
	if (getHPCookie=='Old'){
	x1=x1+"<A Href='/hpdesc.html' Target='_blank'><Img Src='/img/description_off.gif' border=0 alt='新首頁說明' align='absbottom' onmouseover=\"this.src='/img/description_on.gif'\" onmouseout=\"this.src='/img/description_off.gif'\"></A>&nbsp;"
	x1=x1+"<A Href='/index_2.asp'><Img Src='/img/newhomepage_off.gif' border=0 alt='新首頁' align='absbottom' onmouseover=\"this.src='/img/newhomepage_on.gif'\" onmouseout=\"this.src='/img/newhomepage_off.gif'\"></A>&nbsp;"
	}
	x1=x1+"<IMG SRC='/img/x.gif' WIDTH='1' HEIGHT='41' BORDER='0'>"
	if(getShowLogout!='N'){
		x1=x1+"<A Href='/asp/buttonlogout.asp'><Img Src='/img/logout.gif' border=0 alt='登出' align='absbottom' onmouseover=\"this.src='/img/logout1.gif'\" onmouseout=\"this.src='/img/logout.gif'\"></A>"
	}
	x1=x1+"</TD>"
	//x1=x1+"				<TD ALIGN='right' VALIGN='bottom' WIDTH='200' ROWSPAN='3'>"
	x1=x1+"				<TD ALIGN='right' VALIGN='bottom' WIDTH='180' ROWSPAN='3'>"
	x1=x1+"<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td align=center>"
	//x1=x1+"					<a href=/index.asp><img src=/img/f6.gif border=0  alt='繁體版'></a>"
	//x1=x1+"					<a href=http://gb-member.digitimes.com.tw><img src=/img/f7.gif border=0  alt='簡體版'></a>"
	//x1=x1+"					<a href='/article/ListArticle.asp?Code=3000' target='article'><img alt='討論區' src=/img/f1.gif border=0></a>"
	x1=x1+"					<a href='http://forum.digitimes.com.tw' target='article'><img alt='討論區' src=/img/f1.gif border=0></a>"
	x1=x1+"					<a href=/><img src=/img/f2.gif  alt='設為首頁' border=0 onclick=\"this.style.behavior='url(#default#homepage)';this.setHomePage('http://member.digitimes.com.tw');return false;\"></a>"
	x1=x1+"					<a href=javascript:addbookmark()><img  alt='加到我的最愛' src=/img/f3.gif border=0></a>"
	x1=x1+"					<a href=/faq/default.asp><img src=/img/f4.gif border=0  alt='常見問題集'></a>"
	x1=x1+"					<a href=/svc/smap.asp><img src=/img/f5.gif border=0  alt='網站導覽'></a>"
	x1=x1+"<tr><td align=right>"
	//x1=x1+"					<select style='WIDTH:198' name='JumpOut' class='LDropDown'  ONCHANGE='if(options[selectedIndex].value) ChangeWeb(options[selectedIndex].value)'>"
	x1=x1+"					<select name='JumpOut' class='LDropDown'  ONCHANGE='if(options[selectedIndex].value) ChangeWeb(options[selectedIndex].value)'>"	
	x1=x1+"						<option value='http://www.digitimes.com.tw'>相關網站</option>"
	x1=x1+"						<option value='http://www.digitimes.com.tw'>DigiTimes 中文網頁</option>"
	x1=x1+"						<option value='http://www.digitimes.com'>DigiTimes 英文網頁(English)</option>"
	x1=x1+"						<option value='http://www.thg.com.tw'>Tom's 硬體指南(繁體中文)</option>"
	x1=x1+"						<option value='http://www.gb.tomshardware.com'>Tom's 硬件指南(簡體中文)</option>"
	x1=x1+"					</select></table>"
	x1=x1+"				</TD>"
	x1=x1+"			</TR>"
	x1=x1+"			<TR><TD BGCOLOR='#330099' HEIGHT=1><IMG SRC='/img/x.gif'></TD></TR>"
	x1=x1+"			<TR><TD HEIGHT=1><IMG SRC='/img/x.gif'></TD></TR>"
	x1=x1+"			<TR><TD HEIGHT=17><IMG SRC='/img/x.gif'></TD>"
	x1=x1+"				<TD WIDTH=180 HEIGHT=17><IMG src='/img/x.gif'></TD></TR>"
	x1=x1+"		</table>"	

	x1=x1+"		<table width=100% border=0 cellpadding=0 cellspacing=0>"
	x1=x1+"			<tr><td width=24% ><td id=showbanner>&nbsp;<td width=24% >"
	x1=x1+"		</table>"
		
	x1=x1+"<td><img src=/img/t.gif width=14 height=14>"
	x1=x1+"</tr>"
	x1=x1+"<tr><td><img src=/img/t.gif width=14 height=14>"
	//x1=x1+"<td background=/img/bg_b.gif height=24 class=top1>"

	//x1=x1+"<table width=100% border=0 cellpadding=0 cellspacing=0>"
	//x1=x1+"<tr><td width=50% ><a href=/index.asp><img src=/img/web_mem.gif border=0></a>"
	//x1=x1+"<td nowrap class=pgtitle align=center>"+pageTitle
	//x1=x1+"<td nowrap width=50% align=right>"
	//x1=x1+"<a href='/article/ListArticle.asp?Code=3000' target='article'><img alt='討論區' src=/img/f1.gif border=0></a>"
	//x1=x1+"<a href=/><img src=/img/f2.gif  alt='設為首頁' border=0 onclick=\"this.style.behavior='url(#default#homepage)';this.setHomePage('http://member.digitimes.com.tw');return false;\"></a>"
	//x1=x1+"<a href=javascript:addbookmark()><img  alt='加到我的最愛' src=/img/f3.gif border=0></a>"
	//x1=x1+"<a href=/faq/default.asp><img src=/img/f4.gif border=0  alt='常見問題集'></a>"
	//x1=x1+"<a href=/svc/smap.asp><img src=/img/f5.gif border=0  alt='網站導覽'></a>"
	//x1=x1+"</table></td>"

	x1=x1+"<tr><td colspan=3><table width=100% border=0 cellpadding=0 cellspacing=0>"
	x1=x1+"<tr><td></td><td width=100% align=center>"
	x1=x1+"<table width=100% border=0 cellpadding=0 cellspacing=0><tr>"
	//x1=x1+"<td><nobr><a href=http://www.digitimes.com target= _blank style='text-decoration:none;font-family:Arial;font-size:10pt;color:#CC0000'><b>English</b></a>|<a href=http://lab.digitimes.com target= _blank style='text-decoration:none;font-size:10pt;color:#CC0000;font-family:Arial;'><b>Lab.</b></a></nobr>"
	//modify by anson 2005/03/21 拿下lab的連結
	//x1=x1+"<td><nobr><a href=http://www.digitimes.com target= _blank style='text-decoration:none;font-family:Arial;font-size:10pt;color:#CC0000'><b>English</b></a></nobr>"
	x1=x1+"<td width=100% align=center>"
	x1=x1+"<table border=0 cellpadding=0 cellspacing=0>"
	x1=x1+"<tr><td height=1 colspan=23 bgcolor=#999999><IMG SRC=/img/x.gif WIDTH=1 HEIGHT=1 BORDER=0></td></tr>" 
	x1=x1+"<tr><td height=5 colspan=23 bgcolor=#E5E5FF ><IMG SRC=/img/x.gif WIDTH=1 HEIGHT=5 BORDER=0></td></tr>" 

	var zpageTitle = pageTitle;
	//alert(zpageTitle.indexOf("CEO專屬新聞"))
	if (opt.length > 0) {
		for (idx = 0; idx < opt.length; idx++) {
			if (opt[idx].substr(0,1) == "　") {
				x1=x1+"<font class=lw1>" + opt[idx] + "</font>"
			} 
			else {
				var zBgcolor = "#FFFFFF";
				var zClass = "menu hc";
				switch (opt[idx]){
					case "A":
						var zLink = "location.href='/n/NwsLst.asp'";
						var zName = "新聞";
						//alert(zpageTitle.indexOf("CEO專屬新聞"))
						if ((zpageTitle.indexOf("今日新聞")!=-1) || (zpageTitle.indexOf("分類新聞")!=-1) || (zpageTitle.indexOf("多篇新聞")!=-1)){
								zBgcolor = "#003399"
								zClass = "menu hc f";
							}
						break;					
					case "B":
						//var zLink = "/Ceo/CeoLst.asp";
						var zLink = "location.href='/Ceo/CeoLst.asp'";
						var zName = "CEO專屬新聞";
						if (zpageTitle.search(zName)!=-1){
								zBgcolor = "#003399"
								zClass = "menu hc f";
							}
						break;					
					case "C":
						//var zLink = "/Ext/ExtLst.asp";
						var zLink = "location.href='/Ext/ExtLst.asp'";
						var zName = "專輯";
						if (zpageTitle.search(zName)!=-1){
								zBgcolor = "#003399"
								zClass = "menu hc f";
							}
						break;					
					case "D":
						//var zLink = "/a/AMain.asp";
						var zLink = "location.href='/a/AMain.asp'";
						var zName = "產業分析";
						if (zpageTitle.search(zName)!=-1){
								zBgcolor = "#003399"
								zClass = "menu hc f";
							}
						break;					
					case "E":
						//var zLink = "/c/CLst.asp";
						var zLink = "location.href='/c/CLst.asp'";
						var zName = "圖表";
						if (zpageTitle.search(zName)!=-1){
								zBgcolor = "#003399"
								zClass = "menu hc f";
							}
						break;					
					case "F":
						//var zLink = "/Fin/Default.asp";
						var zLink = "location.href='/Fin/Default.asp'";
						var zName = "財務資料庫";
						if (zpageTitle.search(zName)!=-1){
								zBgcolor = "#003399"
								zClass = "menu hc f";
							}
						break;					
					case "G":
						//var zLink = "/n/FnLst.asp";
						var zLink = "location.href='/n/FnLst.asp'";
						var zName = "新聞速寫";
						//if ((zpageTitle.search("新聞")==-1)&&(zpageTitle.search(zName)!=-1)){
						if (zpageTitle.search(zName)!=-1){
								zBgcolor = "#003399"
								zClass = "menu hc f";
							}
						break;					
					case "H":
						//var zLink = "/rpt/index.asp";
						var zLink = "location.href='/rpt/index.asp'";
						var zName = "Digitimes Report";
						if (zpageTitle.search(zName)!=-1){
								zBgcolor = "#003399"
								zClass = "menu hc f";
							}
						break;					
					case "I":
						//var zLink = "/MyPg/Set/set_epaper.asp";
						//var zLink = "location.href='/MyPg/Set/set_epaper.asp'";
						var zLink = "location.href='/MyPg/set/set_epaper.asp'";
						var zName = "我的設定";
						if (zpageTitle.search(zName)!=-1){
								zBgcolor = "#003399"
								zClass = "menu hc f";
							}
						break;					
					case "J":
						//var zLink = "/myfolder/default.asp";
						var zLink = "window.open('/myfolder/default.asp','myFolder')";
						var zName = "我的資料夾";
						break;					
					case "K":
						var zLink = "location.href='/n/newsit.asp'";
						var zName = "IT新聞";
						if (zpageTitle.search(zName)!=-1){
								zBgcolor = "#003399"
								zClass = "menu hc f";
							}
						break;					
				}
				x1=x1+""+"<td width=2% height=10 bgcolor=#E5E5FF><IMG SRC=/img/x.gif WIDTH=1 HEIGHT=10 BORDER=0></td> <td width=110 rowspan=3 bgcolor=#999999><table width=100%  border=0 cellpadding=0 cellspacing=1><tr><td height=20 bgcolor="+zBgcolor+" class='"+zClass+"' onclick="+zLink+"; onmouseover=MenuOver(this,'#D7E5F2');><nobr>"+zName+"</nobr></td></tr> </table></td>";
				//x1=x1+"" + opt[idx];
				
			}
		}
	} else {

	x1=x1+"<td nowrap class=oh1><a href=/n/NwsLst.asp style='text-decoration:none;font-size:10pt;color:#cc0000;font-family:新細明體' OnMouseOver=\"if(window.event) showmenu(document.getElementById('newsmenu'), window.event.x, window.event.y);  else showmenu(document.getElementById('newsmenu'), event.pageX, event.pageY);\" OnMouseOut=\"hidemenu(document.getElementById('newsmenu'));\"><b>新聞</b><img src=/img/popup.gif border=0 align=absmiddle></a>"
	x1=x1+"<td nowrap class=oh1><font class=lw1>　<a href=/Ceo/CeoLst.asp>CEO專屬新聞</a>　<a href=/Ext/ExtLst.asp>專輯</a>　<a href=/a/AMain.asp>產業分析</a>　<a href=/c/CLst.asp>圖表</a>　<a href=/Fin/>財務資料庫</a>　<a href=/n/FnLst.asp>新聞速寫</a>　<a href=/myPge/hp.asp>我的首頁</a>　<a href=/myfolder/default.asp target=myFolderr_>我的資料夾</a></font>"

	}
	x1=x1+"<td width=2%  height=10 bgcolor=#E5E5FF><IMG SRC=/img/x.gif WIDTH=1 HEIGHT=10 BORDER=0></td>"
	x1=x1+"<tr> "
	x1=x1+"<td bgcolor=#999999 ><IMG SRC=/img/x.gif ></td> "
	x1=x1+"<td bgcolor=#999999 ><IMG SRC=/img/x.gif ></td> "
	x1=x1+"<td bgcolor=#999999 ><IMG SRC=/img/x.gif ></td> "
	x1=x1+"<td bgcolor=#999999 ><IMG SRC=/img/x.gif ></td> "
	x1=x1+"<td bgcolor=#999999 ><IMG SRC=/img/x.gif ></td> "
	x1=x1+"<td bgcolor=#999999 ><IMG SRC=/img/x.gif ></td> "
	x1=x1+"<td bgcolor=#999999 ><IMG SRC=/img/x.gif ></td> "
	x1=x1+"<td bgcolor=#999999 ><IMG SRC=/img/x.gif ></td> "
	x1=x1+"<td bgcolor=#999999 ><IMG SRC=/img/x.gif ></td> "
	x1=x1+"<td bgcolor=#999999 ><IMG SRC=/img/x.gif ></td> "
	x1=x1+"<td bgcolor=#999999 ><IMG SRC=/img/x.gif ></td> "
	x1=x1+"<td bgcolor=#999999 ><IMG SRC=/img/x.gif ></td> "
	x1=x1+"</tr> "

	x1=x1+"<tr><td height=10 colspan=21  ><IMG SRC=/img/x.gif WIDTH=1 HEIGHT=10 BORDER=0></td></tr> "

	//x1=x1+"</table><td nowrap><font class=dtx face=Arial style='font-size:12px'>"+today_date+"</font></table><td><img src=/img/right.gif></td></table>"
	x1=x1+"</table><tr><td height=5><img src=/img/t.gif width=14 height=14></table>"
	

	//modify by anson 2004/12/08 取消文字(左)、文字(右)
	x1=x1+"<tr><td><td style='border-left: 1px solid rgb(192,192,192); border-right: 1px solid rgb(192,192,192); border-top: 1px solid; border-bottom: 1px solid rgb(192,192,192)' background=/img/bg_c.gif height=32 align=center>"+pageText+"</td></tr>"
	if (searchBar!=''){
		x1=x1+"<tr><td><td align=center>"
		x1=x1+searchBar
		//x1=x1+"<table border=0 cellpadding=0 cellspacing=0 width=95% bgcolor=#D7E5F2 style='border-left:1px solid rgb(192,192,192);border-right:1px solid rgb(192,192,192);border-bottom:1px solid rgb(192,192,192)'>"
		//x1=x1+"<tr><td width=100% height=50 class=oh1 align=center valign=middle>"
		//x1=x1+searchBar
		//x1=x1+"</table><td></tr>"
		x1=x1+"<td></tr>"
	}
	x1=x1+"<tr><td><td>"

	x2=   "<tr><td><td background=/img/bg_l.gif class=top0>"
	x2=x2+"<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td>　</td><td width=100% align=right><font style='FONT-SIZE:12px;FONT-FAMILY:Times New Roman' color=#666666>本網站內之全部圖文，係屬於大椽股份有限公司所有 </font><br><font style='FONT-SIZE:12px;FONT-FAMILY:Times New Roman' color=#666666>非經本公司同意不得將全部或部分內容轉載於任何形式之媒體 </font><br><font style=FONT-SIZE:12px;FONT-FAMILY:Times New Roman' color=#666666>&copy;&nbsp;DIGITIMES Inc. 版權所有。</font></table>"
	x2=x2+"<td>"
	x2=x2+"<tr><td colspan=3>"
	x2=x2+"<table width=100% border=0 cellpadding=0 cellspacing=0>"
	x2=x2+"<tr><td><img src=/img/foot_left.gif><td width=100% background=/img/bg_f.gif class=lw3><font color=#0232CE style='font-size:10pt'>　<a href=/svc/comp.asp>公司簡介</a>　<a href=/svc/cprgt.asp>著作權</a>　<a href=/faq/default.asp>服務</a>　發佈新聞稿( <a href=mailto:editor@digitimes.com>英文</a>、<a href=mailto:newsroom@digitimes.com>中文</a> )　<a href=/svc/hire.asp>徵人啟事</a></font>"
	x2=x2+"<td nowrap><a href=/index.asp><img src=/img/foot_r1.gif border=0></a><img src=/img/bg_f.gif border=0><a href=#top><img src=/img/foot_r2.gif border=0></a><img src=/img/foot_r3.gif></table>"
	x2=x2+"</table></form>"

	if (navigator.appName == "Netscape"){
		DigiTimes = document.getElementById("DigiTimes");
		DigiTimes.innerHTML=x1+DigiTimes.innerHTML+x2;
		DigiTimes.style.visibility=showName
		document.getElementById("showbanner").innerHTML = B0100001;
		}
	else	{
		document.all['DigiTimes'].innerHTML=x1+document.all['DigiTimes'].innerHTML+x2;
		document.all['DigiTimes'].style.visibility = showName;
		
	}
	
	if (searchDate) setSearchDateSelect();
	document.all['showbanner'].innerHTML = B0100001;
	parent.clickHandler();
	}
}

function setSearchDateSelect(){
 	obj=document.mForm
	day3=today-(91*1000*60*60*24);
	frdate=new Date(day3);
	//alert(frdate)
  if(getFromYear==''){
  	from_year=frdate.getFullYear();
  }
  else{
  	from_year=getFromYear;
  }
  if(getFromMonth==''){
  	from_month=frdate.getMonth()+1;
  }
  else{
 		from_month = getFromMonth;
  }
  if(getFromDay==''){
  	from_day=frdate.getDate();
  }
  else{
   	from_day=getFromDay;
  }
  
  if (from_month<10) from_month='0'+from_month;
  if (from_day<10) from_day='0'+from_day;
	//alert(from_month);
	//from_year=frdate.getFullYear();
	//from_month=frdate.getMonth()+1;
	//from_day=frdate.getDate();
	var xyz = today.getYear();
	if (xyz<1900) xyz=xyz+1900;
	//alert(xyz);
	setSel(obj.from_year.options,1998,xyz,from_year)
	setSel(obj.from_month.options,1,12,from_month)
	setSel(obj.from_day.options,1,31,from_day)
	setSel(obj.to_year.options,1998,xyz,today_year)
	setSel(obj.to_month.options,1,12,today_month)
	setSel(obj.to_day.options,1,31,today_day)
	//alert(RKeyWord)
	if(getKeyWord!=''){
		obj.p.value = getKeyWord;
	}
}

function setSel(selObj,s1,s2,defVal){
	for (i=s1;i<=s2;i++){
		if (i<10) ij='0'+i; else ij=i;
		obj2=new Option(ij,ij);
		selObj[selObj.length]=obj2;
		if (ij==defVal) selObj[selObj.length-1].selected=true;
	}
}

function ckSH(){
	if (CheckSearchBar(document.mForm))
		document.mForm.submit();
	return false;
//	if (CheckSearchUI(document.mForm)) {
//		document.mForm.action='/Srch/SrhLst.asp';
//		document.mForm.submit();
//	}
////	if (CheckDate(document.mForm)){
//		document.mForm.action='/Srch/SrhLst.asp';
//		document.mForm.submit();
////	}
}

function Digi2(sIn) {
	var sVar = new String(sIn);
	if (sVar.length < 2){
		sVar = "0" + sVar;
	}
	return sVar;
}
// 開啟小視窗並顯示萬年曆
// 傳入參數: 欄位前置名, 無清除選項
function OpenDate(preFieldName, cNoClear, cWeekday) {
    var url='';
    var y1=eval('document.mForm.'+preFieldName+'year')
    var m1=eval('document.mForm.'+preFieldName+'month')
    var d1=eval('document.mForm.'+preFieldName+'day')
    y1=y1.options[y1.selectedIndex].value
    m1=m1.options[m1.selectedIndex].value
    d1=d1.options[d1.selectedIndex].value

    dtToday = new Date();
    sToday = dtToday.getFullYear() + "/" + Digi2(dtToday.getMonth() + 1) + "/" + Digi2(dtToday.getDate());

    var url = "/public/Calendar.asp?FormName=mForm&Period=1998/03/16," + sToday; // 設定日期區間
    url = url + "&default=" + y1+'/'+m1+'/'+d1 ;    // 設定預設日期
    url = url + "&PassDate=" + y1+'/'+m1+'/'+d1 ;
    url = url + "&preFieldName=" + preFieldName ;
    if (cNoClear != "")
        url += "&NoBlank=" + cNoClear;        // 設定不顯示清除選項
    if (cWeekday != "")
        url += "&Weekday=" + cWeekday;        // 設定僅工作日有效
    window.open(url, "ShowDate",
        "menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=0,width=290,height=290");
    //return true;
}
function ttt(){
	if(event.keyCode==13) {
		ckSH();
		return false;
	}
	return true;
}

function goSrh(Kwd) {
	document.mForm.p.value = Kwd;
	ckSH();
//	var fObject=document.mForm;
//	fObject.p.value = Kwd;
//	fObject.action='/Srch/SrhLst.asp';
//	fObject.submit();
}

function CheckSearchBar(oForm) {
	var oKeyword = oForm.p;
	var oDBID = oForm.s, bChk = false;

	if (oKeyword.value == "搜尋關鍵字" || oKeyword.value == "")
	{
		alert("對不起，您未輸入任何查詢詞");
		oKeyword.focus();
		return false;
	} else {
		if ((CheckSymbols(oKeyword,"*/,~!@#$%^=_:;`?<>")) || (CheckSymbolsAt1(oKeyword,"-+."))) {
			alert("對不起，我們不支援特殊字元的搜尋！\n請改輸入英文字母或中文字");
			oKeyword.focus();
			oKeyword.value = '';
			return false;
		}
		if(GetLengthFromText(oKeyword)>40){
			alert("對不起，搜尋的關鍵詞請勿超過20個中文字！");	
			oKeyword.focus();
			return false;
		}
	}

	if (!chkdate(oForm.from_year.value, oForm.from_month.value, oForm.from_day.value)) {
		alert("對不起，檢索區間之啟始日期不合法");
		return false;
	}

	if (!chkdate(oForm.to_year.value, oForm.to_month.value, oForm.to_day.value)) {
		alert("對不起，檢索區間之結束日期不合法");
		return false;
	}

	if (oDBID) {
		for(var idx=0; idx < oDBID.length; idx++) {
			if (oDBID[idx].checked) {
				bChk = true;
				break;
			}
		}
		if (!bChk) {
			alert("對不起，未選擇要找尋的資料項，請至少勾選一項");
			return false;
		}
	}
	
	oForm.action="/Srch/SrhLst.asp"
	return true;
}

function chkdate(syear, smonth, sday){
	var date = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	var iyear = 0, imonth = 0, iday = 0, max = 0;

	if (isNaN(syear) || isNaN(smonth) || isNaN(sday)) return false;
	iyear  = parseInt(syear,10);
	imonth = parseInt(smonth,10);
	iday   = parseInt(sday,10);

	if (imonth > 12 ||imonth < 1 || iday > 31 || iday < 1) return false;
	if ((imonth == 2) && (((iyear % 4 == 0) && (iyear % 100 != 0)) || (iyear % 400 == 0))) date[imonth - 1] = 29;
	if (iday <= date[imonth - 1]) return true;

	return false;
}

function CheckSymbol(objText,strSymbol){
	var blSymbol = false;
	if (objText.value.indexOf(strSymbol) != -1){
		blSymbol = true;
	}
	return blSymbol;
}

function CheckSymbols(objText,strSymbol){
	var blSymbol = false;
	for (var i=0; i<strSymbol.length; i++)	{
		if (CheckSymbol(objText,strSymbol.charAt(i))){
			blSymbol = true;
			break;
		}
	}
	return blSymbol;
}

function CheckSymbolAt1(objText,strSymbol){
	var blSymbol = false;
	if (objText.value.indexOf(strSymbol) == 0){
		blSymbol = true;
	}
	return blSymbol;
}

function CheckSymbolsAt1(objText,strSymbol){
	var blSymbol = false;
	for (var i=0; i<strSymbol.length; i++)	{
		if (CheckSymbolAt1(objText,strSymbol.charAt(i))){
			blSymbol = true;
			break;
		}
	}
	return blSymbol;
}
function ChangeWeb(sURL){
		top.frames[2].location.replace('/asp/Logout.asp?act=auto');
		window.top.location.replace(sURL);
	
}
function GetLengthFromText(objText) {
	var ttCounter = 0;
	for(var iCount = 0; iCount < objText.value.length; iCount ++) {
		if (objText.value.charCodeAt(iCount) >= 255){
			ttCounter += 1;
		}
	}

	ttCounter += objText.value.length;
	return ttCounter;
}

if(top.frames.length>0) document.onclick=parent.clickHandler;
//document.onmouseover=parent.clickHandler;//