// function.js (c) 2000-2001 IPRO 網際家數位科技 All Rights Reserved. 
//                 http://www.iprodigi.com  service@iprodigi.com.tw
//
// 軟體使用授權:
//
// 此程式僅授權 中小企業升級轉型資訊網(Technology Enhancement Project for Small & Medium Enterprises) 使用於該公司企業網站上，
// 未經網際家數位科技正式授權，請勿任意複製作為其它用途。
// 
//
StyleName = "chi";      // chi 一般; Dragon_Boat 端午節; mid_autumny    ;xmas
codePath = "/chi/js/";
document.write("<Scr" + "ipt Language='JavaScript' src='" + codePath + "technomart.js'><\/Scr" + "ipt>");
document.write("<Scr" + "ipt Language='JavaScript' src='" + codePath + "loader.js'><\/Scr" + "ipt>");

document.write("<script language='JavaScript1.2' src='" + codePath + "fw_menu.js' TYPE='text/javascript'></script>");

function fwLoadMenus() {
  if (window.fw_menu_0) return;
  window.fw_menu_0 = new Menu("root",132,22,"新細明體, Verdana, Arial, Helvetica, sans-serif",13,"#FFFFFF","#4E85A6","#4E85A6","#C0EDEF");
  fw_menu_0.addMenuItem("最新消息","window.location='/chi/news/index.php';");
  fw_menu_0.addMenuItem("服務廠商專題報導","window.location='/chi/news/rptnews.php';");
  fw_menu_0.addMenuItem("產業動態","window.location='/chi/news/business.php';");
  fw_menu_0.addMenuItem("活動訊息","window.location='/chi/news/ab_index.php';");
  fw_menu_0.addMenuItem("產業資訊","window.open('http://www.itis.org.tw/','itis');");
  fw_menu_0.addMenuItem("商情資訊","window.location='/chi/news/opportunity.php';");
  fw_menu_0.hideOnMouseOut=true;
  
  /*window.fw_menu_1 = new Menu("root",78,22,"新細明體, Verdana, Arial, Helvetica, sans-serif",13,"#FFFFFF","#4E85A6","#4E85A6","#C0EDEF");
  fw_menu_1.addMenuItem("緣　　起","window.location='/chi/about/index.php';");
  fw_menu_1.addMenuItem("目　　的","window.location='/chi/about/object.php';");
  fw_menu_1.addMenuItem("服務內容","window.location='/chi/about/service.php';");
  fw_menu_1.addMenuItem("成果分享","window.location='/chi/about/fruition.php';");
  fw_menu_1.hideOnMouseOut=true;*/
  
  window.fw_menu_2 = new Menu("root",118,22,"新細明體, Verdana, Arial, Helvetica, sans-serif",13,"#FFFFFF","#4E85A6","#4E85A6","#C0EDEF");
  fw_menu_2.addMenuItem("技術供給資料庫","window.location='/chi/techs/ts_index.php';");
  fw_menu_2.addMenuItem("可行性評估報告","window.location='/chi/techs/estimate.php';");
  fw_menu_2.addMenuItem("政府補助計畫","window.location='/chi/techs/subsidy.php';");
  fw_menu_2.addMenuItem("科技專案","window.location='/chi/techs/project.php';");
  fw_menu_2.addMenuItem("可移轉技術","window.location='/chi/techs/transfer.php';");
  fw_menu_2.hideOnMouseOut=true;
  
  //window.fw_menu_3 = new Menu("root",118,22,"新細明體, Verdana, Arial, Helvetica, sans-serif",13,"#FFFFFF","#4E85A6","#4E85A6","#C0EDEF");
  //fw_menu_3.addMenuItem("近期博覽會介紹","window.location='/chi/exposition/new/';");
  //fw_menu_3.addMenuItem("各期博覽會回顧","window.location='/chi/exposition/old/';");
  //fw_menu_3.hideOnMouseOut=true;
  
  window.fw_menu_3 = new Menu("root",104,22,"新細明體, Verdana, Arial, Helvetica, sans-serif",13,"#FFFFFF","#4E85A6","#4E85A6","#C0EDEF");
  fw_menu_3.addMenuItem("登　　入","window.location='/chi/member/login.php';");
  fw_menu_3.addMenuItem("聯絡窗口","window.location='/chi/member/index.php';");
  fw_menu_3.addMenuItem("編修基本資料","window.location='/chi/member/member.php';");
  fw_menu_3.addMenuItem("技術供給","window.location='/chi/member/ts_index.php';");
  fw_menu_3.addMenuItem("服務需求","window.location='/chi/member/td_index.php';");
  //fw_menu_3.addMenuItem("媒合預約","window.location='/chi/member/tech_meeting.php';");
  fw_menu_3.addMenuItem("登　　出","window.location='/chi/member/logout.php';");
  fw_menu_3.hideOnMouseOut=true;
  
  window.fw_menu_4 = new Menu("root",104,22,"新細明體, Verdana, Arial, Helvetica, sans-serif",13,"#FFFFFF","#4E85A6","#4E85A6","#C0EDEF");
  fw_menu_4.addMenuItem("國內相關網站","window.location='/chi/web/index.php';");
  fw_menu_4.addMenuItem("國外相關網站","window.location='/chi/web/other.php';");
  fw_menu_4.hideOnMouseOut=true;
  
  fw_menu_4.writeMenus();
} // fwLoadMenus()

/*Start 雙擊左鍵至頁首*/
function dblclick() {
window.scrollTo(0,0)
}
if (document.layers) {
document.captureEvents(Event.ONDBLCLICK);
}
document.ondblclick=dblclick;
/*End 雙擊左鍵至頁首*/


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_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;
      //x.width=x.width+2;
      //x.height=x.height+2;
      //x.border=0;
  }
}

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];
          //x.width=x.width-2;
          //x.height=x.height-2;
          //x.border=1;
      }
}

PageNames = new Array(
"news",        //0
"about",       //1
"techs",        //2    
//"exposition",  //3
"member",      //4
"web",         //5
"phpbb",       //6
"qa",          //7
"download",    //8
"sitemap",     //9
"contact",     //10
"search",     //11
"epaper");    //12

OutputNames = new Array(
"新聞動態",
"關於我們",
"技術&機會",
//"線上博覽會",
"會員專區",
"相關網站",
"互動交流",
"常見問答集",
"下載專區",
"網站導覽",
"聯絡我們",
"全文檢索",
"電子報");

PageNames_news = new Array(
"index.php",
"rptnews.php",
"business.php",
"ab_index.php",
"itis",
"opportunity.php");

OutputNames_news = new Array(
"最新消息",
"專題報導",
"產業動態",
"活動訊息",
"ITIS產業資訊",
"商情資訊");  

PageNames_about = new Array(
//"index.php",
//"object.php",
//"service.php",
//"fruition.php");
"index.php");

OutputNames_about = new Array(
//"緣起",
//"目的",
//"服務內容",
//"成果分享"); 
"計畫簡介"); 

PageNames_techs = new Array(
"ts_index.php",
"estimate.php",
"subsidy.php",
"project.php",
"transfer.php");

OutputNames_techs = new Array(
"技術供給資料庫",
"可行性評估報告",
"政府輔助計畫",
"科技專案",
"可移轉技術");

PageNames_exposition = new Array(
"new",
"old");

OutputNames_exposition = new Array(
"近期博覽會介紹",
"各期博覽會回顧");

PageNames_exposition_new = new Array(
"index.php",
"ets_add.php",
"my_index.php",
"join.php",
"ets_index.php",
"ec_index.php",
"mo_index.php");

OutputNames_exposition_new = new Array(
"博覽會簡介",
"線上徵展",
"我的參與記錄",
"活動報名",
"技術一覽",
"博覽會活動介紹",
"商談預約");

PageNames_exposition_old = new Array(
"index.php");

OutputNames_exposition_old = new Array(
"各期博覽會回顧");

PageNames_member = new Array(
"login.php",
"index.php",
"member.php",
"ts_index.php",
"td_index.php",
//"index.php",
//"tech_meeting.php",
"logout.php");

OutputNames_member = new Array(
"登入",
"聯絡窗口",
"編修基本資料",
"技術供給",
"服務需求",
//"其他需求",
//"媒合預約",
"登出");

PageNames_web = new Array(
"index.php",
"other.php");

OutputNames_web = new Array(
"國內相關網站",
"國外相關網站");

PageNames_phpbb = new Array(
"index.html");

OutputNames_phpbb = new Array(
"互動交流");

PageNames_qa = new Array(
"index.php");

OutputNames_qa = new Array(
"常見問答集");

PageNames_download = new Array(
"index.php");

OutputNames_download = new Array(
"下載專區");

PageNames_sitemap = new Array(
"index.php");

OutputNames_sitemap = new Array(
"網站導覽");

PageNames_contact = new Array(
"index.php");

OutputNames_contact = new Array(
"聯絡我們");

PageNames_search = new Array(
"index.php");

OutputNames_search = new Array(
"全文檢索");

PageNames_epaper = new Array(
"index.php");

OutputNames_epaper = new Array(
"電子報");

// find index # in array
function ItemID(name,nameArray){	
  
  if( name==null || name=='' ) return(0);
    
  for(var i=0; i < nameArray.length; i++) {
    if( name == nameArray[i] ) return(i);
  }

  return(0);  
}

// Display CatPic Function
function ShowCatPic(){
   var arrayOfpath = location.pathname.split("/");
 
   var SectionName=arrayOfpath[2];
   document.write('<td>\n');    
   document.write('<img src="/chi/images/title_'+SectionName+'.gif" vspace=15>\n');
   if (SectionName=="news"){
   //document.write('<a href="http://www.technomart.org.tw/chi/exposition/new/ets_index.php?Eb_id=1" title="博覽會 台北場 「商談預約」"><img src="/chi/images/btn_link_1.gif" border=0></a>\n');
   //document.write('<a href="http://www.technomart.org.tw/chi/exposition/new/ets_index.php?Eb_id=2" title="博覽會 台南場 「商談預約」"><img src="/chi/images/btn_link_2.gif" border=0></a>\n');
/*
      document.write('<table border="0" cellspacing="0" cellpadding="0">\n');
      document.write('<tr><td rowspan=2 width=210>\n');
      document.write('<img src="/chi/images/title_'+SectionName+'.gif" vspace=15>\n');
      document.write('</td>\n');      
      document.write('<td>\n');
      document.write('<a href="http://www.technomart.org.tw/chi/exposition/new/ets_index.php?Eb_id=1" title="博覽會 台北場 「商談預約」"><img src="/chi/images/btn_link_1.gif" border=0></a>\n');
      document.write('</td></tr>\n');
      document.write('<tr><td>\n');
      document.write('<a href="http://www.technomart.org.tw/chi/exposition/new/ets_index.php?Eb_id=2" title="博覽會 台南場 「商談預約」"><img src="/chi/images/btn_link_2.gif" border=0></a>\n');
      document.write('</td></tr>\n');
      document.write('</table>\n');
*/      
   }
   document.write('</td>\n');   
}

// Display Flash Function
function ShowFlash(){
   var arrayOfpath = location.pathname.split("/");
 
   var SectionName=arrayOfpath[2];
   document.write('<td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="141" height="97">\n');
   document.write('<param name="movie" value="/'+StyleName+'/images/flash/fla_'+SectionName+'.swf">\n');
   document.write('<param name="quality" value="high">\n');
   document.write('<embed src="/'+StyleName+'/images/flash/fla_'+SectionName+'.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="141" height="97"></embed></object></td>\n');
}

// Display Menu Function
function showFuncMenu(){
   var arrayOfpath = location.pathname.split("/");
 
   var SectionName=arrayOfpath[2];
   var ix=180;
   
   //===2006/09/20 Before Azure Change(Start)===
   //var ItemSizeW=new Array(ix,76,74,86,91,74,76);
   //===2006/09/20 Before Azure Change(End)===
   
   //===2006/09/20 After Azure Change(Start)===
   var ItemSizeW=new Array(ix,76,74,86,74,74,76);
   //===2006/09/20 After Azure Change(End)===
   
   ItemSizeW[1]=ItemSizeW[0]+ItemSizeW[1];
   ItemSizeW[2]=ItemSizeW[1]+ItemSizeW[2];
   ItemSizeW[3]=ItemSizeW[2]+ItemSizeW[3];
   ItemSizeW[4]=ItemSizeW[3]+ItemSizeW[4];
   ItemSizeW[5]=ItemSizeW[4]+ItemSizeW[5];
   ItemSizeW[6]=ItemSizeW[5]+ItemSizeW[6];
   
   for(var itemNum=0; itemNum < 5; itemNum++) {
      if( PageNames[itemNum]!='sitemap' && PageNames[itemNum]!='search' && PageNames[itemNum]!='epaper') 	
      {
    	  if( PageNames[itemNum]==SectionName ) {
          document.write('<td><a href="/chi/' + PageNames[itemNum] + '/" ');
          if ( itemNum == 1 ){
          document.write('onMouseOut="" onMouseOver="">');
        	}else{
        	document.write('onMouseOut="FW_startTimeout();" onMouseOver="window.FW_showMenu(window.fw_menu_' + itemNum + ','+ItemSizeW[itemNum]+',90);">');
        	}
          document.write('<img src="/chi/images/menu_' + PageNames[itemNum] + '_on.gif" border=0 name="' + PageNames[itemNum] + '" alt="' + OutputNames[itemNum] + '" title="' + OutputNames[itemNum] + '">');
          document.write('</a></td>');
      	}else{
	        document.write('<td><a href="/chi/' + PageNames[itemNum] + '/" ');
	        if ( itemNum == 1 ){
		      document.write('onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\''+ PageNames[itemNum] + '\',\'\',\'/chi/images/menu_'+ PageNames[itemNum] + '_on.gif\',1)">');
        	}else{
        	document.write('onMouseOut="FW_startTimeout();MM_swapImgRestore()" onMouseOver="window.FW_showMenu(window.fw_menu_' + itemNum + ','+ItemSizeW[itemNum]+',90);MM_swapImage(\''+ PageNames[itemNum] + '\',\'\',\'/chi/images/menu_'+ PageNames[itemNum] + '_on.gif\',1)">');
        	}
         	document.write('<img src="/chi/images/menu_' + PageNames[itemNum] + '.gif" border=0 name="' + PageNames[itemNum] + '" alt="' + OutputNames[itemNum] + '" title="' + OutputNames[itemNum] + '">');
         	document.write('</a></td>');
        }
      }
  }
}

// Display Menu Function2
function showFuncMenu2(){
   var arrayOfpath = location.pathname.split("/");
   var SectionName=arrayOfpath[2];


   for(var itemNum=5; itemNum < PageNames.length-2; itemNum++) {
      if( PageNames[itemNum]=='phpbb' ) 	
      {
            document.write('<td><a href="/chi/' + PageNames[itemNum] + '/" target="phpbb"');
            document.write('onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\''+ PageNames[itemNum] + '\',\'\',\'/'+StyleName+'/images/icon_'+ PageNames[itemNum] + '_on.gif\',1)">');
            document.write('<img src="/'+StyleName+'/images/icon_' + PageNames[itemNum] + '.gif" border=0 name="' + PageNames[itemNum] + '" alt="' + OutputNames[itemNum] + '" title="' + OutputNames[itemNum] + '">');
            document.write('</a></td>');
      }else{
	    if( PageNames[itemNum]==SectionName ) 	
        	document.write('<td><img src="/'+StyleName+'/images/icon_' + PageNames[itemNum] + '_on.gif" border=0></td>');
      	else {
            document.write('<td><a href="/chi/' + PageNames[itemNum] + '/" ');
            document.write('onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\''+ PageNames[itemNum] + '\',\'\',\'/'+StyleName+'/images/icon_'+ PageNames[itemNum] + '_on.gif\',1)">');
            document.write('<img src="/'+StyleName+'/images/icon_' + PageNames[itemNum] + '.gif" border=0 name="' + PageNames[itemNum] + '" alt="' + OutputNames[itemNum] + '" title="' + OutputNames[itemNum] + '">');
            document.write('</a></td>');
        }      
      }
  }  
  document.write('<td><a href="/chi/" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'imghome\',\'\',\'/'+StyleName+'/images/icon_home_on.gif\',1)"><img src="/'+StyleName+'/images/icon_home.gif" alt="回首頁" title="回首頁" name="imghome" width="27" height="31" border="0"></a></td>\n');
  document.write('<td><a href="/eng/" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'imgeng\',\'\',\'/'+StyleName+'/images/icon_eng_on.gif\',1)"><img src="/'+StyleName+'/images/icon_eng.gif" alt="English" title="English" name="imgeng" width="34" height="31" border="0"></a></td>\n');  
}

// show sub_Page links on current subdirectory  
function ShowSubMenu(){

   var arrayOfpath = location.pathname.split("/");
   var arrayOfpage = arrayOfpath[arrayOfpath.length-1].split(".");

   var PageNamesArray="PageNames";
   var SectionName=arrayOfpath[2];
    
   PageNamesArray += "_" + SectionName;

   var PageNA = eval(PageNamesArray);
   //var id=ItemID(arrayOfpath[arrayOfpath.length-1], PageNA); 
   var id=ItemID(arrayOfpath[3], PageNA); 

   for( var i=0; i < (PageNA.length) ; i++) {
    if ((PageNA.length)>1){
      if( i==id ){
        document.write('<tr><td >\n');
  	    document.write('<a href="/chi/'+arrayOfpath[2]+'/' + PageNA[i] + '"><img name="' + SectionName + '_' + (i+1) + '" src="/chi/images/btn_' + SectionName + '_0' + (i+1) + '_on.gif" border=0></a>');
  	    document.write('</td></tr>\n');
      }else {
	    document.write('<tr><td>\n');
	    if (PageNA[i]=="itis"){
	        document.write('<a href="http://www.itis.org.tw/" target="itis" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'' + SectionName + '_' + (i+1) + '\',\'\',\'/chi/images/btn_' + SectionName + '_0' + (i+1) + '_on.gif\',1)"><img name="' + SectionName + '_' + (i+1) + '" src="/chi/images/btn_' + SectionName + '_0' + (i+1) + '.gif" border=0></a>');
	    }else{
            document.write('<a href="/chi/'+arrayOfpath[2]+'/' + PageNA[i] + '" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'' + SectionName + '_' + (i+1) + '\',\'\',\'/chi/images/btn_' + SectionName + '_0' + (i+1) + '_on.gif\',1)"><img name="' + SectionName + '_' + (i+1) + '" src="/chi/images/btn_' + SectionName + '_0' + (i+1) + '.gif" border=0></a>');
        }
        document.write('</td></tr>\n');
      }
    }
   }
}  

// show Page flow structure
function ShowPageIndex(){

   var arrayOfpath = location.pathname.split("/");
   var arrayOfpage = arrayOfpath[arrayOfpath.length-1].split(".");
   var pagename = arrayOfpath[arrayOfpath.length-1];
   var urlstr="/"+arrayOfpath[1]+"/";
   var OutputNamesArray="OutputNames";
   var PageNamesArray="PageNames";

   document.write('<a href="/chi/" class="pageindex">首頁</a>'); 

   for(var i=2; arrayOfpath[i] && i < arrayOfpath.length-1; i++) {

      document.write(' > ');
      urlstr += arrayOfpath[i] + "/" ;
      
      var PageNA = eval(PageNamesArray);
      var id=ItemID(arrayOfpath[i], PageNA);

      document.write('<a href="' + urlstr + '" class="pageindex">');
      document.write( eval(OutputNamesArray + '[' + id + ']' ) );
      document.write('</a>');

      OutputNamesArray += "_" + arrayOfpath[i];
      PageNamesArray += "_" + arrayOfpath[i];
   }
   
   PageNA = eval(PageNamesArray);
   id = ItemID(pagename, PageNA);
      
   if( PageNA.length> 1 ) {
      document.write(' > ');
      document.write( eval(OutputNamesArray + '[' + id + ']' )+'&nbsp;&nbsp;' );
   }   
}  

function showHeader(space_w) {
  if (isNaN(space_w)) space_w=20;
  //menusGo();
  fwLoadMenus();
  document.write('<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 onLoad="MM_preloadImages(\'/chi/images/icon_phpbb_on.gif\',\'/chi/images/icon_qa_on.gif\',\'/chi/images/icon_download_on.gif\',\'/chi/images/icon_sitemap_on.gif\',\'/chi/images/icon_contact_on.gif\',\'/chi/images/icon_home_on.gif\',\'/chi/images/icon_eng_on.gif\',\'/chi/images/menu_news_on.gif\',\'/chi/images/menu_about_on.gif\',\'/chi/images/menu_techs_on.gif\',\'/chi/images/menu_exposition_on.gif\',\'/chi/images/menu_member_on.gif\',\'/chi/images/menu_web_on.gif\',\'/chi/images/icon_ep_online_on.gif\',\'/chi/images/icon_ep_vote_on.gif\',\'/chi/images/btn_news_03_on.gif\',\'/chi/images/btn_news_01_on.gif\',\'/chi/images/btn_news_04_on.gif\',\'/chi/images/btn_news_02_on.gif\')">\n');
  document.write("<SCRIPT LANGUAGE='JavaScript1.2' SRC='/acount.txt' TYPE='text/javascript'><\/SCRIPT>");
  document.write("<link rel=\"stylesheet\" href=\"/chi/js/popmenu.css\">");
  document.write("<script src=\"/chi/js/popmenu.js\"></script>");
  document.write("<div id=\"popmenu\" class=\"menuskin\" onMouseover=\"clearhidemenu();highlightmenu(event,'on')\" onMouseout=\"highlightmenu(event,'off');dynamichide(event)\"></div>  ");
  document.write('<a name="top"></a><table height="100%" border="0" align="center" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td width="973" height="45" valign="top" background="/chi/images/main_bg.gif"> \n');
if ( StyleName=='chi' ){  
  document.write('<table width="973" height="90" border="0" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td rowspan="3"><a href="/index.php"><img src="/chi/images/main_01.gif" width=141 height=90 border="0"></a></td>\n');

  document.write('<td><img src="/chi/images/main_02.gif" width=184 height=59></td>\n');
  document.write('<td><IMG SRC="/chi/images/main_03.jpg" WIDTH=186 HEIGHT=59></td>\n');
  document.write('<td><IMG SRC="/chi/images/main_04.jpg" WIDTH=270 HEIGHT=59></td>\n');
  document.write('<td><IMG SRC="/chi/images/main_05.jpg" WIDTH=192 HEIGHT=59></td>\n');

  document.write('</tr>\n');
  document.write('<tr>\n');

  document.write('<td colspan="3"><img src="/chi/images/main_07.jpg" width=640 height=10></td>\n');
  document.write('<td rowspan="2">\n');
  document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">\n');
  document.write('<tr>\n');
  
  showFuncMenu2();
  
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');

  document.write('<tr>\n');
  document.write('<td colspan="3" background="/chi/images/main_21.gif">\n');
  document.write('<table border="0" cellspacing="0" cellpadding="0">\n');
  document.write('<tr><td>\n');
  
  showFuncMenu();

  document.write('</td></tr>\n');
  document.write('</table>\n');
  document.write('</td>\n');
  document.write('</tr>\n');
  document.write('</table>\n');
}else{

  document.write('<table width="100%"  border="0" cellspacing="0" cellpadding="0"><tr>\n');
  document.write('<td width="141"><a href="/index.php"><img src="/'+StyleName+'/images/main_01.gif" width="141" height="90" border="0"></a></td>\n');
  document.write('<td valign="top">\n');
  document.write('<table width="100%"  border="0" cellspacing="0" cellpadding="0">\n');
  document.write('<tr><td valign="top">\n');
  document.write('<table width="100%"  border="0" cellspacing="0" cellpadding="0"><tr>\n');
  document.write('<td width="184"><img src="/'+StyleName+'/images/main_02.gif" width="184" height="59"></td><td>\n');
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="649" height="59">\n');
  document.write('<param name="movie" value="/'+StyleName+'/'+StyleName+'.swf">\n');
  document.write('<param name="quality" value="high">\n');
  document.write('<embed src="/'+StyleName+'/'+StyleName+'.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="649" height="59"></embed>\n');
  document.write('</object>\n');
  document.write('</td></tr></table></td></tr><tr><td valign="top">\n');
  document.write('<table width="100%"  border="0" cellspacing="0" cellpadding="0">\n');
  document.write('<tr><td width="640" valign="top">\n');
  document.write('<table width="100%"  border="0" cellspacing="0" cellpadding="0">\n');
  document.write('<tr><td height="10"><img src="/'+StyleName+'/images/main_04.jpg" width="640" height="10"></td></tr>\n');
  document.write('<tr><td valign="top"  align=left><table width="100%"  border="0" cellspacing="0" cellpadding="0"><tr>\n');

    showFuncMenu();
  document.write('<td background="/'+StyleName+'/images/main_21.gif" width="100%"></td>\n');
  document.write('</tr></table></td></tr></table></td><td valign="top">\n');
  document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>\n');
    showFuncMenu2();
      document.write('<td background="/'+StyleName+'/images/main_21.gif" width="100%"></td>\n');
  document.write('</tr></table></td></tr></table></td></tr></table></td></tr></table>\n');

}   
  
  document.write('<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td width="141" valign="top">\n');
  
  document.write('<table width="141" border="0" cellpadding="0" cellspacing="0" background="/chi/images/main_btn_bg.gif">\n');
  document.write('<tr>\n');

  ShowFlash();  

  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td><img src="/chi/images/main_26.gif" width="141" height="16"></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td>\n');
  document.write('<table width="140" border="0" cellspacing="0" cellpadding="0" >\n');
  
  ShowSubMenu();  
  
  document.write('</table>\n');
  document.write('</td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td><img src="/chi/images/main_30.gif" width="141" height="13"></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td><p align="center"><img src="/chi/images/main_btn_bgline.gif" width="127" height="2" vspace="8"></p></td>\n');
  document.write('</tr>\n');

//Login Info
  document.write('<tr>\n');
  document.write('<td><table width="100%" border="0" cellspacing="0" cellpadding="0">\n');
  showLoginInfo();
  document.write('</td></table>\n');
  document.write('</tr>\n');

  document.write('<tr>\n');
  document.write('<td><p align="center"><img src="/chi/images/main_btn_bgline.gif" width="127" height="2" vspace="8"></p></td>\n');
  document.write('</tr>\n');
    
  document.write('<tr>\n');
  document.write('<td><table width="100%" border="0" cellspacing="0" cellpadding="0">\n');
  
  
//Search Engine  
  document.write('<tr>\n');
  document.write('<td colspan="2"><img src="/'+StyleName+'/images/main_search.gif" width="77" height="24" hspace="1" vspace="2"></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td><div align="right"><form name=S onsubmit="searchgo(1);" action="/chi/search/result.php"><input type=hidden name=type value=1>\n');
  document.write('<input name="keyword" type="text" size="16" class="inputText" onBlur=\"this.style.backgroundColor=\'#D4EEF3\'\" onMouseOver=\"this.focus()\" onFocus=\"this.style.backgroundColor=\'#FFffde\'\">\n');
  document.write('</div></td>\n');
  document.write('<td width=30><a href="#"><img src="/chi/images/icon_search.gif" width="28" height="20" hspace="5" border=0 onclick="searchgo(1)"></a></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td>&nbsp;</td>\n');
  document.write('<td width=30><a href="#"><img src="/chi/images/icon_searchmore.gif" width="28" height="21" hspace="5" border=0 onclick="searchgo(2)"></a></td>\n');
  document.write('</form></tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td><div align="center"><img src="/chi/images/main_btn_bgline.gif" width="127" height="2" vspace="10"></div></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td><table width="100%" border="0" cellspacing="0" cellpadding="0">\n');
  document.write('<tr>\n');
  document.write('<td colspan="2"><img src="/'+StyleName+'/images/main_epaper.gif" width="66" height="24" hspace="1" vspace="2"></td>\n');
  document.write('</tr>\n');
//epaper
  document.write('<tr>\n');
  document.write('<td><div align="right"><form name=EpaperForm action="#" method=post onsubmit="return checkEpaper();">\n');
  document.write('<input name="email" type="text" value=" 請輸入e-mail" size="16" class="inputText" onBlur=\"this.style.backgroundColor=\'#D4EEF3\'\" onMouseOver=\"this.focus()\" onFocus=\"this.style.backgroundColor=\'#FFffde\'\" >\n');
  document.write('</div></td>\n');
  document.write('<td width=30><a href="#" title="訂閱電子報"><img src="/chi/images/icon_epaper_oder.gif" width="28" height="21" hspace="5" border="0" alt="訂閱電子報" onClick="CheckTopEmail1()"></a></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td><table border="0" align="right" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td><a href="/chi/epaper/index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image33\',\'\',\'/chi/images/icon_ep_online_on.gif\',1)"><img src="/chi/images/icon_ep_online.gif" name="Image33" width="48" height="21" border="0"></a></td>\n');
  document.write('<td><a href="mailto:312637@itri.org.tw" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image34\',\'\',\'/chi/images/icon_ep_vote_on.gif\',1)"><img src="/chi/images/icon_ep_vote.gif" name="Image34" width="36" height="21" border="0"></a></td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('<td width=30><a href="#" title="取消訂閱電子報"><img src="/chi/images/icon_epaper_cel.gif" width="28" height="21" hspace="5" border="0" alt="取消訂閱電子報" onClick="CheckTopEmail2()"></a></td>\n');
  document.write('</form></tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  
  document.write('<tr>\n');
  document.write('<td valign="top"> <div align="center"> <img src="/chi/images/main_btn_bgline.gif" width="127" height="2" vspace="10"> \n');
  document.write('</div></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  //document.write('<td valign="top"> <div align="center"><a href="http://www.technomart.org.tw/chi/download/20040524台瑞技術商業化合作_尋求台灣合作廠商.doc" target="_blank" title="20040524台瑞技術商業化合作_尋求台灣合作廠"><img src="/chi/images/year.gif" vspace="10" border=0></a></td>\n');
  //document.write('<td valign="top" align="center"><img src="/chi/images/year.gif" width="120" border=0></td>\n');
  document.write('</tr>\n');
  
  document.write('</table></td>\n');
  document.write('<td width="832" valign="top">\n');
  document.write('<table width="832" border="0" cellpadding="0" cellspacing="0" background="/chi/images/main_23.gif">\n');
  document.write('<tr>\n');
  document.write('<td width="798" align="right" class="pageindex">\n');
  
  ShowPageIndex();
  
  document.write('</td>\n');
  
  document.write('<td width="1" align="right"><a href="#" onclick="history.back();" ><img src="/chi/images/main_24.gif" width="34" height="33" alt="回上一頁" title="回上一頁" border=0></a></td>\n');
  document.write('</tr>\n');
  document.write('</table>\n');
  document.write('<table width="832" border="0" cellspacing="0" cellpadding="0">\n');
  document.write('<tr>\n');
  document.write('<td width="1"><img src="/chi/images/spacer.gif" width="'+space_w+'" height="8"></td>\n');

  ShowCatPic();
  
  document.write('<td width="1"><img src="/chi/images/spacer.gif" width="'+space_w+'" height="8"></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td>&nbsp;</td>\n');
  document.write('<td>\n');
}


function showFooter() {
  
  document.write('</td>\n');
  document.write('<td>&nbsp;</td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('<td rowspan="2" background="/chi/images/main_line.gif"><img src="/chi/images/spacer.gif" width="1" height="1"></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td width="973" height="20" valign="bottom" background="/chi/images/main_bg.gif">\n');
  document.write('<table width="973" height="20" border="0" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td width="141" rowspan="3" valign="bottom">\n');
  document.write('<table border="0" align="center" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td><img src="/chi/images/count_line.gif" width="8" height="13"></td>\n');
  document.write('<td align=center colspan=5>'+counter+'</td>\n');
  document.write('<td><img src="/chi/images/count_line.gif" width="8" height="13"></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td colspan="7" class="count"><div align="center">since 2002.07.01</div></td>\n');
  document.write('</tr>\n');
  document.write('</table>\n');
  document.write('</td>\n');
  document.write('<td width="832"><p>&nbsp;</p><div align="center">\n');
  document.write('<p class="footermenu"><a href="/chi/news/" class="footermenu">新聞動態</a> | <a href="/chi/about/" class="footermenu">關於我們</a> | <a href="/chi/techs/" class="footermenu">技術&amp;機會</a> | <a href="/chi/member/" class="footermenu">會員專區</a> | <a href="/chi/web/" class="footermenu">相關網站</a><br>\n');
  document.write('<a href="/chi/phpbb/" class="footermenu">互動交流</a> | <a href="/chi/qa/" class="footermenu">常見問答集</a> | <a href="/chi/download/" class="footermenu">下載專區</a> | <a href="/chi/sitemap/" class="footermenu">網站導覽</a> | <a href="/chi/contact/" class="footermenu">聯絡我們</a> | <a href="/chi/news/" class="footermenu">首頁</a></p></div>\n');
  document.write('</td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td>&nbsp;</td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td><div align="center" class="footer">主辦單位：<img src="/chi/images/s_logo_01.gif" width="20" height="14" vspace="4" align="absmiddle">經濟部中小企業處 承辦單位：<img src="/chi/images/s_logo_02.gif" width="20" height="15" align="absmiddle">工業技術研究院  Copyright &copy;2002 中小企業升級轉型資訊網. All rights reserved.</div></td>\n');
  document.write('</tr>\n');
  document.write('</table>\n');
  document.write('</td>\n');
  document.write('</tr>\n');
  document.write('</table>\n');
  
  document.write('<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">\n');
  document.write('</script>\n');
  /*2006/07/25 Azure Mark
  document.write('<script type="text/javascript">\n');
  document.write('_uacct = "UA-311912-2";\n');
  document.write('urchinTracker();\n');
  document.write('</script>  \n');
  */
  document.write('</BODY>\n');
  document.write('</HTML>\n');
}

function isDate(aobj,caption,display) {
  var sdate,sYY,sMM,sDD;
  var allValid = true;
  sdate = aobj.value;
  sdate = sdate.replace("/","-");
  sdate = sdate.replace("/","-");
  sYY=sdate.substring(0,sdate.indexOf("-"));
  sdate=sdate.substring(sdate.indexOf("-")+1,sdate.length);
  sMM=sdate.substring(0,sdate.indexOf("-"));
  sDD=sdate.substring(sdate.indexOf("-")+1,sdate.length);
  
  if ( !isNumber("S",sYY,"",false) ){
      allValid=false;
  }else{
      if (sYY.length!=4) allValid=false;
  }
  
  if ( !isNumber("S",sMM,"",false) ){
      allValid=false;
  }else{
      if (sMM.length!=2) {
        allValid=false;
      }else{
         sMM = parseInt(sMM);
         if ( (sMM < 1) || (sMM > 12) ) allValid = false;
      }
  }
  if ( !isNumber("S",sDD,"",false) ){
      allValid=false;
  }else{
      if (sDD.length!=2) {
          allValid=false;
      }else{
          sDD = parseInt(sDD);
          switch (String(sMM)) {
          case '1' :
          case '3' :
          case '5' :
          case '7' :
          case '8' :
          case '10':
          case '12':
              if ( (sDD < 1) || (sDD > 31) ) allValid = false;
              break;
          case '4' :
          case '6' :
          case '9' :
          case '11':
              if ( (sDD < 1) || (sDD > 30) ) allValid = false;
              break;
          case '2':
              if ( (sDD < 1) || (sDD > 29) ) allValid = false;
              break;
          default :
              allValid = false;
              break;
          }
      }
  }

  if ( !allValid ){
      if (display) alert("\"" + caption + "\"輸入錯誤, 不是合法的日期格式!");
  }
  return allValid;
}

// stype   : 要進行判斷數值的形態, "F":Float "I":Integer "S":Single
// elm