// template.js (c) 2005 IPRO Digital Tech. All Rights Reserved. 
//                 http://www.e-ipro.com  service@e-ipro.com.tw
//
// 软件使用授权:
//
// 此程序仅授权 三阳工业股份有限公司 SANYANG INDUSTRY CO.,LTD. 使用于该公司企业网站上，
// 未经网际家数位科技正式授权，请勿任意复制作为其它用途。
// 
//

document.write('<link href="/chi/js/sym.css" rel="stylesheet" type="text/css">\n');
document.write('<script src="/admin/js/functions.js"></script>\n');

// 断判是总经销还是地区经销
/*
if(location.pathname.indexOf("/chi/intranet/agency/") == "-1") {
	var businesstype=0;
}
*/

PageNames = new Array(
"company",
"technology",
"product",
"purchase",
"news",
"symclub",
"service",
"hr",
"sitemap");

OutputNames = new Array(
"关于厦杏",
"科技三阳",
"产品信息",
"型录下载",
"新闻中心",
"机车小百科",
"客服中心",
"加入厦杏",
"网站导览");

PageNames_company = new Array(
"global",
"vision",
//"milestone.php",
//"award",
//"environmental.php",
//"autotech",
"relatedcom");
//"finance.php");

OutputNames_company = new Array(
"厦杏公司简介",
"厦杏愿景",
//"三阳历史",
//"荣耀经典",
//"环保三阳",
//"自动化&模具技术",
"相关企业");
//"财务信息");
//"加入三阳");

PageNames_company_global = new Array(
"index.php");
//"guiding.php",
//"composition.php");

OutputNames_company_global = new Array(
"公司简介");
//"经营方针",
//"全球布局");

PageNames_company_vision = new Array(
"index.php");
//"generalmanager.php");
//"brand.php");

OutputNames_company_vision = new Array(
"企业愿景");
//"总经理的话");
//"品牌精神");

PageNames_company_relatedcom = new Array(
"index.php",
"amoy.php",
"ching.php",
"pt.php");

OutputNames_company_relatedcom = new Array(
"三阳总部",
"越南VMEP",
"庆洲机械工业",
"印尼三阳");

PageNames_company_award = new Array(
"index.php",
"products.php",
"public.php",
"special.php");


OutputNames_company_award = new Array(
"品质荣誉 ",
"产品荣誉",
"公益荣誉",
"特殊荣誉");

PageNames_company_autotech = new Array(
"index.php",
"appliance.php",
"bus.php");
//"vender_info.php");

OutputNames_company_autotech = new Array(
"工机厂",
"设备",
"产品");
//"协力厂商");
//添加品质厦杏；
PageNames_technology = new Array(
"research",
"tech",
//"auto",
"quality");

OutputNames_technology = new Array(
"专注研发",
"创新科技",
//"自动化制程",
"品质厦杏");


PageNames_technology_tech = new Array(
"index.php",
"frame.php",
"electric.php",
"firste.php",
"ceramic.php",
"saveoil.php");

OutputNames_technology_tech = new Array(
"动力",
"车架",
"电装",
"SYM顶杆机",
"航太陶瓷汽缸",
"省油技术");

PageNames_technology_auto = new Array("ceramic.php");
OutputNames_technology_auto = new Array("航太陶瓷汽缸");


//品质厦杏
PageNames_technology_quality = new Array(
"index.php",
"control.php");

OutputNames_technology_quality = new Array(
"品质理念",
"质量控制");



PageNames_technology_research = new Array(
"index.php",
"milestone.php",
"achievement.php",
"prospect.php");

OutputNames_technology_research = new Array(
"愿景理念",
"研发历史",
"研发成果",
"实力展望");

PageNames_product = new Array(
"index.php?tid=1",
"index.php?tid=2",
"index.php?tid=3",
//"http://www.sym.com.tw/eng/product/index.php?tid=1"
"index.php?tid=4");
//"http://www.teamworld.com.tw/symcht");

OutputNames_product = new Array(
"踏板车",
"骑士车",
"弯梁车",
"Export Product");
//"正厂零件");

PageNames_purchase = new Array(
//"index.php",
"/chi/symclub/download/index.php");
//"/chi/service/map.php");

OutputNames_purchase = new Array(
//"选购鉴定团",
"型录下载");
//"经销商据点");

PageNames_news = new Array(
"index.php",
"privilege.php");
//"sp.php");

OutputNames_news = new Array(
"最新消息",
"企业信息");
//"SP活动");

PageNames_symclub = new Array(
//"index.php",
//"login.php",
//"epaper.php",
"encyclopedia",
//"vote.php",
"download");
//"edit.php",
//"logout.php");

OutputNames_symclub = new Array(
//"会员加入及服务",
//"登入",
//"电子报",
"机车小百科",
//"历届投票",
"");
//"编修会员数据",
//"登出");

PageNames_symclub_encyclopedia = new Array("index.php");
OutputNames_symclub_encyclopedia = new Array("机车小百科");

PageNames_symclub_download = new Array("index.php");
OutputNames_symclub_download = new Array("型录下载");

PageNames_service = new Array(
"index.php",
//"map.php",
"policy.php",
"maintein.php",
"symparts.php",
//"feedback.php",
//"link.php",
"contactus.php");

OutputNames_service = new Array(
"服务理念",
"三包政策",
"维修中心",
//"经销商据点",
"销售网络",
//"意见反馈",
//"相关网站链接",
"联系我们");


PageNames_hr = new Array(
"index.php");
//"http://symweb/chi/mil/index.htm");

OutputNames_hr = new Array(
"人才招募");
//"国防训储");



/*

PageNames_intranet = new Array(
"agency",
"http://symweb/inside/finance/login.asp",
"pay");

OutputNames_intranet = new Array(
"经销商登入",
"协力厂商登入",
"付款信息");

if(businesstype==0) {  //未登入前的子选单
PageNames_intranet_agency = new Array(
"index.php",
"login_pcm.php",
"http://symweb/chi/business/meb/meb_login.php");

OutputNames_intranet_agency = new Array(
"经销商登入",
"零件查询",
"协力厂商电子布告栏");
} else if(businesstype==1) {  //总经销的子选单
PageNames_intranet_agency = new Array(
"index.php?mode=edit_ga",
"index.php?mode=ag_list",
"index.php?mode=password",
"dms.php",
"logout.php");

OutputNames_intranet_agency = new Array(
"总经销商数据",
"地区经销商数据",
"变更密码",
"现货查询",
"登出");
} else if(businesstype==2) {  //地区经销的子选单
PageNames_intranet_agency = new Array(
"index.php?mode=edit_ag",
"index.php?mode=password",
"dms.php",
"logout.php");

OutputNames_intranet_agency = new Array(
"地区经销商数据",
"变更密码",
"现货查询",
"登出");
}

PageNames_intranet_pay = new Array(
"index.php",
"pay1.php",
"pay.php",
"pay_password_form.php");

OutputNames_intranet_pay = new Array(
"登入",
"汇总查询",
"明细查询",
"变更密码");


*/



PageNames_sitemap = new Array(
"index.php");

OutputNames_sitemap = new Array(
"网站导览");

PageNames_search = new Array(
"index.asp");

OutputNames_search = 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);  
}

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;
}

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];
   }
}

function MM_openBrWindow(theURL,winName,features) 
{ //v2.0
   window.open(theURL,winName,features);
 }

function MM_jumpMenu(targ,selObj,restore)
{ //v3.0
  
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  
	if (restore) selObj.selectedIndex=0;
}

var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
var ns6=document.getElementById&&!document.all
var ns4=document.layers
var curObj;

function showmenu(e,which,ppX,ppY){
    
    if (!document.all&&!document.getElementById&&!document.layers)
        return

    clearhidemenu()

    menuobj=ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : ns4? document.popmenu : ""
    menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj

    if (ie4||ns6)
        menuobj.innerHTML=which
    else{
        menuobj.document.write('<layer name=gui bgColor=#E6E6E6 width=165 onMouseOver="clearhidemenu()" onMouseOut="hidemenu()">'+which+'</layer>')
        menuobj.document.close()
    }

    menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width
    menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height
    
    if (ie4){
        menuobj.thestyle.left=ppX;
        menuobj.thestyle.top= ppY;
    }else if (ns6){
        menuobj.thestyle.left=ppX;
        menuobj.thestyle.top= ppY;
    }else{
        menuobj.thestyle.left=ppX;
        menuobj.thestyle.top= ppY;
    }

    menuobj.thestyle.visibility="visible";
    return false;
}

function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
    while (b.parentNode)
        if ((b = b.parentNode) == a)
            return true;
    return false;
}

function hidemenu(){
    if (window.menuobj)
        menuobj.thestyle.visibility=(ie4||ns6)? "hidden" : "hide"
	showmenu(event,linkset[0],155,125);
}

function dynamichide(e){
    if (ie4&&!menuobj.contains(e.toElement))
        hidemenu()
    else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
    hidemenu()
}

function delayhidemenu(){
    
    if (ie4||ns6||ns4)
        delayhide=setTimeout("hidemenu()",3000)
}

function clearhidemenu(){
    if (window.delayhide)
        clearTimeout(delayhide)
}

function highlightmenu(e,state){
    if (document.all)
        source_el=event.srcElement
    else if (document.getElementById)
        source_el=e.target
    if (source_el.className=="menuitems"){
        source_el.id=(state=="on")? "mouseoverstyle" : ""
    }else{
        while(source_el.id!="popmenu"){
            source_el=document.getElementById? source_el.parentNode : source_el.parentElement
            if (source_el.className=="menuitems"){
                source_el.id=(state=="on")? "mouseoverstyle" : ""
            }
        }
    }
}

if (ie4||ns6)
    document.onclick=hidemenu
    
 var ie4=document.all&&navigator.userAgent.indexOf('Opera')==-1;
 var ns6=document.getElementById&&!document.all;
 var ns4=document.layers;

/*定义下拉选单 linkset */
var linkset=new Array();
for(var lv_0=0; lv_0 < 9; lv_0++) {
    var PageNamesArray="PageNames";
    var OutputNamesArray="OutputNames";
    PageNamesArray += "_" + PageNames[lv_0];
    OutputNamesArray += "_" + PageNames[lv_0];
    var PageNA = eval(PageNamesArray);
    var OutputNA = eval(OutputNamesArray);
     var tmpi=lv_0+1;
    
    linkset[tmpi] ='<div class="menuitems" align="center">';
    linkset[tmpi] +='<table border="0" cellpadding="0" cellspacing="0"><tr><td height="26" nowrap>';
    for(var lv_1=0; lv_1 < PageNA.length; lv_1++) {
    	if(PageNA[lv_1].indexOf("/chi/") == "-1" && PageNA[lv_1].indexOf("http") == "-1") {
    		if(PageNA[lv_1].indexOf(".php") == "-1") {
    			linkset[tmpi]+='<a href="/chi/'+PageNames[lv_0]+'/'+PageNA[lv_1]+'/index.php" onMouseOver="javascript:submenu'+lv_1+'.src=\'/chi/images/red_tri.gif\'" onMouseOut="submenu'+lv_1+'.src=\'/chi/images/spacer.gif\'"><img src="/chi/images/spacer.gif" border="0" width="4" height="8" id="submenu'+lv_1+'"><img src="/chi/images/spacer.gif" border="0" width="2" height="8">'+OutputNA[lv_1]+'</a> ';
    		} else {
    			linkset[tmpi]+='<a href="/chi/'+PageNames[lv_0]+'/'+PageNA[lv_1]+'" onMouseOver="javascript:submenu'+lv_1+'.src=\'/chi/images/red_tri.gif\'" onMouseOut="submenu'+lv_1+'.src=\'/chi/images/spacer.gif\'"><img src="/chi/images/spacer.gif" border="0" width="4" height="8" id="submenu'+lv_1+'"><img src="/chi/images/spacer.gif" border="0" width="2" height="8">'+OutputNA[lv_1]+'</a> ';
    		}
    	} else if(PageNA[lv_1].indexOf("http") != "-1") {
    		linkset[tmpi]+='<a href="'+PageNA[lv_1]+'" target="_blank" onMouseOver="javascript:submenu'+lv_1+'.src=\'/chi/images/red_tri.gif\'" onMouseOut="submenu'+lv_1+'.src=\'/chi/images/spacer.gif\'"><img src="/chi/images/spacer.gif" border="0" width="4" height="8" id="submenu'+lv_1+'"><img src="/chi/images/spacer.gif" border="0" width="2" height="8">'+OutputNA[lv_1]+'</a> ';
    	} else {
    		linkset[tmpi]+='<a href="'+PageNA[lv_1]+'" onMouseOver="javascript:submenu'+lv_1+'.src=\'/chi/images/red_tri.gif\'" onMouseOut="submenu'+lv_1+'.src=\'/chi/images/spacer.gif\'"><img src="/chi/images/spacer.gif" border="0" width="4" height="8" id="submenu'+lv_1+'"><img src="/chi/images/spacer.gif" border="0" width="2" height="8">'+OutputNA[lv_1]+'</a> ';
    	}
    }
    linkset[tmpi]+='</td></tr></table>';
    linkset[tmpi]+='</div>';
    
}
 linkset[0] ='<div class="menuitems" align="center"></div>';
 
 //依屏幕解析度设定子选单要出现的位置
 var menu_left=0;
 if(screen.availWidth==1280) {
 	menu_left=130;
 } else if(screen.availWidth==1600) {
 	menu_left=280;
 } else if(screen.availWidth==1920) {
 	menu_left=450;
 }

function showHeader_home() {

  document.write('<body onLoad="MM_preloadImages(\'/chi/images/menu/red_triangle.gif\',\'/chi/images/menu/menu_01.gif\',\'/chi/images/menu/menu_02.gif\',\'/chi/images/menu/menu_03.gif\',\'/chi/images/menu/menu_04.gif\',\'/chi/images/menu/menu_05.gif\',\'/chi/images/menu/menu_06.gif\',\'/chi/images/menu/menu_07.gif\',\'/chi/images/menu/menu_08.gif\')">\n');
  document.write('<table width="100%" height="100%"  border="0" align="center" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td align="center" valign="top"><table width="850" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">\n');
  document.write('<tr>\n');
  document.write('<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">\n');
  document.write('<tr>\n');
  document.write('<td width="17" bgcolor="#003580"><img src="/chi/images/spacer.gif" width="17" height="50"></td>\n');
  document.write('<td><table width="100%"  border="0" cellspacing="0" cellpadding="0">\n');
  document.write('<tr>\n');
  document.write('<td width="164" rowspan="2" valign="bottom"><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="164" height="120">\n');
  document.write('<param name="movie" value="/chi/images/logo_chi.swf">\n');
  document.write('<param name="quality" value="high">\n');
  document.write('<embed src="/chi/images/logo_chi.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="164" height="120"></embed>\n');
  document.write('</object></td>\n');
  document.write('<td height="53" valign="bottom" bgcolor="#FFFFFF"><table width="100%"  height="53" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">\n');
  document.write('<tr>\n');
  document.write('<td bgcolor="#FFFFFF">&nbsp;</td>\n');
  document.write('<td width="669" height="53" align="right" valign="top" background="/chi/images/bg_top_ch.gif" bgcolor="#FFFFFF"><table border="0" cellpadding="0" cellspacing="7">\n');
  document.write('<tr>\n');
  document.write('<td valign="top" class="txt_10"><table width="100" height="6" border="0" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td><img src="/chi/images/spacer.gif" width="50" height="6"></td>\n');
  document.write('</tr>\n');
  document.write('</table>\n');
  document.write('<a href="/chi/"><span style="font-size:8pt;">回到首页</span></a> &nbsp;| &nbsp;<a href="/chi/sitemap/index.php"><span style="font:8pt">网站导览</span></a> &nbsp;| &nbsp;<a href="/chi/symclub/download/index.php"><span style="font:8pt">型录下载</span></a> &nbsp;| &nbsp;<a href="/chi/service/feedback.php"><span style="font:8pt;">Help</span></a> &nbsp;&nbsp;<img src="/chi/images/red_triangle.gif" width="4" height="8" align="absmiddle"> <a href="http://www.xsmt.com/eng/"><span style="font:8pt">GLOBAL site</span></a>&nbsp;&nbsp;<img src="/chi/images/red_triangle.gif" width="4" height="8" align="absmiddle"> <a href="http://www.xsmt.com/eng/support/index.php"><span style="font:8pt">SYM Worldwide</span></a><a href="http://120.33.51.75:88/registe_print.asp?id=4488"> <img src="/chi/images/gs_icon.gif" width="30" height="30" align="absmiddle"></a></td>\n');
  //document.write('<a href="/chi/">回到首页</a> &nbsp;| &nbsp;<a href="/chi/sitemap/index.php">网站导览</a> &nbsp;| &nbsp;<a href="/chi/symclub/download/index.php">型录下载</a> &nbsp;| &nbsp;<a href="/chi/service/feedback.php">Help</a> &nbsp;&nbsp;<img src="/chi/images/red_triangle.gif" width="4" height="8" align="absmiddle"> <a href="http://www.sym.com.tw/eng/">GLOBAL site</a>&nbsp;&nbsp;<img src="/chi/images/red_triangle.gif" width="4" height="8" align="absmiddle"> <a href="http://www.sym.com.tw/eng/support/index.php">SYM Worldwide</a></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('</tr>\n');
  document.write('<tr>\n');
  document.write('<td valign="bottom" bgcolor="#FFFFFF">\n');
  document.write('<table width="100%" height="67" border="0" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n'); 
  document.write('<td width="72px">\n');
  document.write('</td>\n');
  
  document.write('<td valign="bottom"><a href="/chi/company/global/" title="关于厦杏"><img src="/chi/images/menu/menu_off_01.gif" border="0" width="77" height="40" id="menu1" onMouseOver="javascript:this.src=\'/chi/images/menu/menu_01.gif\';showmenu(event,linkset[1],265+72+menu_left,94);this.style.cursor=\'hand\';" onMouseOut="this.src=\'/chi/images/menu/menu_off_01.gif\';delayhidemenu();this.style.cursor=\'auto\';"></a><a href="/chi/technology/research/" title="科技三阳"><img src="/chi/images/menu/menu_off_02.gif" border="0" width="72" height="40" id="menu2" onMouseOver="javascript:this.src=\'/chi/images/menu/menu_02.gif\';showmenu(event,linkset[2],335+72+5+menu_left,94);this.style.cursor=\'hand\';" onMouseOut="this.src=\'/chi/images/menu/menu_off_02.gif\';delayhidemenu();this.style.cursor=\'auto\';"></a><a href="/chi/product/index.php?tid=1" title="产品信息"><img src="/chi/images/menu/menu_off_03.gif" border="0" width="71" height="40" id="menu3" onMouseOver="javascript:this.src=\'/chi/images/menu/menu_03.gif\';showmenu(event,linkset[3],406+72+5+menu_left,94);this.style.cursor=\'hand\';" onMouseOut="this.src=\'/chi/images/menu/menu_off_03.gif\';delayhidemenu();this.style.cursor=\'auto\';"></a><a href="/chi/symclub/download/" title="型录下载"><img src="/chi/images/menu/menu_off_04.gif" border="0" width="71" height="40" id="menu4" onMouseOver="javascript:this.src=\'/chi/images/menu/menu_04.gif\';showmenu(event,linkset[4],478+72+5+menu_left,94);this.style.cursor=\'hand\';" onMouseOut="this.src=\'/chi/images/menu/menu_off_04.gif\';delayhidemenu();this.style.cursor=\'auto\';"></a><a href="/chi/news/" title="新闻中心"><img src="/chi/images/menu/menu_off_05.gif" border="0" width="72" height="40" id="menu5" onMouseOver="javascript:this.src=\'/chi/images/menu/menu_05.gif\';showmenu(event,linkset[5],545+72+10+menu_left,94);this.style.cursor=\'hand\';" onMouseOut="this.src=\'/chi/images/menu/menu_off_05.gif\';delayhidemenu();this.style.cursor=\'auto\';"></a><a href="/chi/symclub/" title="机车小百科"><img src="/chi/images/menu/menu_off_06.gif" border="0" width="79" height="40" id="menu6" onMouseOver="javascript:this.src=\'/chi/images/menu/menu_06.gif\';showmenu(event,linkset[6],615+72+5+menu_left,94);this.style.cursor=\'hand\';" onMouseOut="this.src=\'/chi/images/menu/menu_off_06.gif\';delayhidemenu();this.style.cursor=\'auto\';"></a><a href="/chi/service/" title="客服中心"><img src="/chi/images/menu/menu_off_07.gif" border="0" width="72" height="40" id="menu7" onMouseOver="javascript:this.src=\'/chi/images/menu/menu_07.gif\';showmenu(event,linkset[7],480+80+menu_left,94);this.style.cursor=\'hand\';" onMouseOut="this.src=\'/chi/images/menu/menu_off_07.gif\';delayhidemenu();this.style.cursor=\'auto\';"></a><a href="/chi/hr/" title="加入厦杏"><img src="/chi/images/menu/menu_off_08.gif" border="0" width="72" height="40" id="menu8" onMouseOver="javascript:this.src=\'/chi/images/menu/menu_08.gif\';showmenu(event,linkset[8],770+72+5+menu_left,94);this.style.cursor=\'hand\';" onMouseOut="this.src=\'/chi/images/menu/menu_off_08.gif\';delayhidemenu();this.style.cursor=\'auto\';"></a></td>\n');
  document.write('</tr>\n'); 
  document.write('<tr bgcolor="#003580">\n');
  document.write('<td width="72px">\n');
  document.write('</td>\n'); 
  
  document.write('<td height="27" bgcolor="#003580" nowrap>');
  document.write('<div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,\'on\')" onMouseout="highlightmenu(event,\'off\');dynamichide(event)"></div>\n');
  document.write('</td>\n</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td align="left">\n');
  
}

function showFooter_home(){
  document.write('</td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td height="17" align="right" valign="bottom" bgcolor="#809AC0"><table border="0" align="right" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td height="3" class="txt_copy"><img src="/chi/images/spacer.gif" width="10" height="3"></td>\n');
  document.write('<td rowspan="3"><img src="/chi/images/spacer.gif" width="10" height="17"></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td class="txt_copy">Copyright &copy; 2006 Sanyang Industry Co., Ltd. All rights reserved.</td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('</table>\n');
  document.write('<script src="http://wm6.ecrm.com.tw/web_service/TrackingService/e5c317e5a5.js"></script>\n');
  document.write('</body>\n');
}

function showHeader() {

  document.write('<body onLoad="MM_preloadImages(\'/chi/images/menu/red_triangle.gif\',\'/chi/images/menu/menu_01.gif\',\'/chi/images/menu/menu_02.gif\',\'/chi/images/menu/menu_03.gif\',\'/chi/images/menu/menu_04.gif\',\'/chi/images/menu/menu_05.gif\',\'/chi/images/menu/menu_06.gif\',\'/chi/images/menu/menu_07.gif\',\'/chi/images/menu/menu_08.gif\')">\n');
  document.write('<table width="100%" height="100%"  border="0" align="center" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td align="center" valign="top"><table width="850" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">\n');
  document.write('<tr>\n');
  document.write('<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">\n');
  document.write('<tr>\n');
  document.write('<td width="17" bgcolor="#003580"><img src="/chi/images/spacer.gif" width="17" height="50"></td>\n');
  document.write('<td><table width="100%"  border="0" cellspacing="0" cellpadding="0">\n');
  document.write('<tr>\n');
  document.write('<td width="164" rowspan="2" valign="bottom"><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="164" height="120">\n');
  document.write('<param name="movie" value="/chi/images/logo_chi.swf">\n');
  document.write('<param name="quality" value="high">\n');
  document.write('<embed src="/chi/images/logo_chi.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="164" height="120"></embed>\n');
  document.write('</object></td>\n');
  document.write('<td height="53" valign="bottom" bgcolor="#FFFFFF"><table width="100%"  height="53" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">\n');
  document.write('<tr>\n');
  document.write('<td bgcolor="#FFFFFF">&nbsp;</td>\n');
  document.write('<td width="669" height="53" align="right" valign="top" background="/chi/images/bg_top_ch.gif" bgcolor="#FFFFFF"><table border="0" cellpadding="0" cellspacing="7">\n');
  document.write('<tr>\n');
  document.write('<td valign="top" class="txt_10"><table width="100" height="6" border="0" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td><img src="/chi/images/spacer.gif" width="50" height="6"></td>\n');
  document.write('</tr>\n');
  document.write('</table>\n');
  document.write('<a href="/chi/"><span style="font:8pt">回到首页</span></a> &nbsp;| &nbsp;<a href="/chi/sitemap/index.php"><span style="font:8pt">网站导览</span></a> &nbsp;| &nbsp;<a href="/chi/symclub/download/index.php"><span style="font:8pt">型录下载</span></a> &nbsp;| &nbsp;<a href="/chi/service/feedback.php"><span style="font:8pt;">Help</span></a> &nbsp;&nbsp;<img src="/chi/images/red_triangle.gif" width="4" height="8" align="absmiddle"> <a href="http://www.sym.com.tw/eng/"><span style="font:8pt">GLOBAL site</span></a>&nbsp;&nbsp;<img src="/chi/images/red_triangle.gif" width="4" height="8" align="absmiddle"> <a href="http://www.sym.com.tw/eng/support/index.php"><span style="font:8pt">SYM Worldwide</span></a></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('</tr>\n');
  document.write('<tr>\n');
  document.write('<td valign="bottom" bgcolor="#FFFFFF">\n');
  document.write('<table width="100%" height="67" border="0" cellpadding="0" cellspacing="0">\n');
  document.write('<td width="72px">\n');
  document.write('</td>\n');
  
  document.write('<td valign="bottom"><a href="/chi/company/global/" title="关于厦杏"><img src="/chi/images/menu/menu_off_01.gif" border="0" width="77" height="40" id="menu1" onMouseOver="javascript:this.src=\'/chi/images/menu/menu_01.gif\';showmenu(event,linkset[1],265+72+menu_left,94);this.style.cursor=\'hand\';" onMouseOut="this.src=\'/chi/images/menu/menu_off_01.gif\';delayhidemenu();this.style.cursor=\'auto\';"></a><a href="/chi/technology/research/" title="科技三阳"><img src="/chi/images/menu/menu_off_02.gif" border="0" width="72" height="40" id="menu2" onMouseOver="javascript:this.src=\'/chi/images/menu/menu_02.gif\';showmenu(event,linkset[2],335+72+5+menu_left,94);this.style.cursor=\'hand\';" onMouseOut="this.src=\'/chi/images/menu/menu_off_02.gif\';delayhidemenu();this.style.cursor=\'auto\';"></a><a href="/chi/product/index.php?tid=1" title="产品信息"><img src="/chi/images/menu/menu_off_03.gif" border="0" width="71" height="40" id="menu3" onMouseOver="javascript:this.src=\'/chi/images/menu/menu_03.gif\';showmenu(event,linkset[3],406+72+5+menu_left,94);this.style.cursor=\'hand\';" onMouseOut="this.src=\'/chi/images/menu/menu_off_03.gif\';delayhidemenu();this.style.cursor=\'auto\';"></a><a href="/chi/symclub/download/" title="型录下载"><img src="/chi/images/menu/menu_off_04.gif" border="0" width="71" height="40" id="menu4" onMouseOver="javascript:this.src=\'/chi/images/menu/menu_04.gif\';showmenu(event,linkset[4],478+72+5+menu_left,94);this.style.cursor=\'hand\';" onMouseOut="this.src=\'/chi/images/menu/menu_off_04.gif\';delayhidemenu();this.style.cursor=\'auto\';"></a><a href="/chi/news/" title="新闻中心"><img src="/chi/images/menu/menu_off_05.gif" border="0" width="72" height="40" id="menu5" onMouseOver="javascript:this.src=\'/chi/images/menu/menu_05.gif\';showmenu(event,linkset[5],545+72+10+menu_left,94);this.style.cursor=\'hand\';" onMouseOut="this.src=\'/chi/images/menu/menu_off_05.gif\';delayhidemenu();this.style.cursor=\'auto\';"></a><a href="/chi/symclub/" title="机车小百科"><img src="/chi/images/menu/menu_off_06.gif" border="0" width="79" height="40" id="menu6" onMouseOver="javascript:this.src=\'/chi/images/menu/menu_06.gif\';showmenu(event,linkset[6],615+72+5+menu_left,94);this.style.cursor=\'hand\';" onMouseOut="this.src=\'/chi/images/menu/menu_off_06.gif\';delayhidemenu();this.style.cursor=\'auto\';"></a><a href="/chi/service/" title="客服中心"><img src="/chi/images/menu/menu_off_07.gif" border="0" width="72" height="40" id="menu7" onMouseOver="javascript:this.src=\'/chi/images/menu/menu_07.gif\';showmenu(event,linkset[7],480+80+menu_left,94);this.style.cursor=\'hand\';" onMouseOut="this.src=\'/chi/images/menu/menu_off_07.gif\';delayhidemenu();this.style.cursor=\'auto\';"></a><a href="/chi/hr/" title="加入厦杏"><img src="/chi/images/menu/menu_off_08.gif" border="0" width="72" height="40" id="menu8" onMouseOver="javascript:this.src=\'/chi/images/menu/menu_08.gif\';showmenu(event,linkset[8],770+72+5+menu_left,94);this.style.cursor=\'hand\';" onMouseOut="this.src=\'/chi/images/menu/menu_off_08.gif\';delayhidemenu();this.style.cursor=\'auto\';"></a></td>\n');
  
  document.write('</tr>\n');
  document.write('<tr bgcolor="#003580">\n');
  document.write('<td width="72px">\n');
  document.write('</td>\n'); 
  document.write('<td height="27" bgcolor="#003580" nowrap>');
  document.write('<div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,\'on\')" onMouseout="highlightmenu(event,\'off\');dynamichide(event)"></div>\n');
  document.write('</td>\n</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td>\n');
  
  document.write('<table width="100%"  border="0" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td height="5" valign="top"><img src="/chi/images/spacer.gif" width="100" height="5"></td>\n');
  document.write('<td width="5" rowspan="3" bgcolor="#FFFFFF"><img src="/chi/images/spacer.gif" width="5" height="50"></td>\n');
  document.write('<td rowspan="3" valign="top" bgcolor="#f2f2f2"><table bgcolor="#f2f2f2" width="175" border="0" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td height="5" bgcolor="#FFFFFF"><img src="/chi/images/spacer.gif" width="100" height="5"></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td valign="top">\n');
  
  ShowMenu();
  
  document.write('</td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td height="100%" bgcolor="#f2f2f2"><img src="/chi/images/spacer.gif" width="100" height="5"></td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td width="100%" valign="top">\n');
  document.write('<table width="100%"  border="0" cellspacing="0" cellpadding="0">\n');
  document.write('<tr>\n');
  document.write('<td width="5"><img src="/chi/images/spacer.gif" width="5" height="50"></td>\n');
  document.write('<td valign="top"> <table width="100%" height="100%"  border="0" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td height="25"><table width="100%"  border="0" cellspacing="0" cellpadding="0">\n');
  document.write('<tr>\n');
  document.write('<td background="/chi/images/pageindex_bg.gif">\n');
  document.write('<div align="right">\n');
  document.write('<table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">\n');
  document.write('<tr>\n');
  document.write('<td>');
  
  ShowPageIndex();
  
  document.write('</td>\n');
  document.write('</tr>\n');
  document.write('</table>\n');
  document.write('</div></td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td bgcolor="D9E1EC"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td width="10" height="38">&nbsp;</td>\n');
  document.write('<td>');
  
  ShowPageName();
  
  document.write('</td>\n');
  document.write('<td width="10">&nbsp;</td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td>&nbsp;</td>\n');
  document.write('<td valign="top" bgcolor="#FFFFFF"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td><table width="100%" height="100%" border="0" cellpadding="8" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td valign="top"><div style="margin-top:15px;margin-bottom:10px ">\n');
}

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('&nbsp;<span class="pageindex"><a href="/chi/index.php">首页</a></span>');

   for(var i=2; arrayOfpath[i] && i < arrayOfpath.length-1; i++) 
   {

      urlstr += arrayOfpath[i] + "/" ;
      
      var PageNA = eval(PageNamesArray);
      var id=ItemID(arrayOfpath[i], PageNA);

      document.write('&gt;<span class="pageindex"><a href="' + urlstr + '">');
      document.write( eval(OutputNamesArray + '[' + id + ']' ) );
      document.write('</a></span>');

      OutputNamesArray += "_" + arrayOfpath[i];
      PageNamesArray += "_" + arrayOfpath[i];
   }

     PageNA = eval(PageNamesArray);

      id = ItemID(pagename, PageNA);
       if( PageNA.length> 1 ) {
      document.write('&gt;<span class="pageindex">');
      document.write( eval(OutputNamesArray + '[' + id + ']' ) );
      document.write('</span>');
       }     
       document.write('&nbsp;');

}  

function ShowPageName(){

   var arrayOfpath = location.pathname.split("/");
   var arrayOfpage = arrayOfpath[arrayOfpath.length-1].split(".");

   var PageNamesArray="PageNames";
   var OutputNamesArray="OutputNames";
   var SectionName=arrayOfpath[2];
      
   PageNamesArray += "_" + SectionName;
   OutputNamesArray += "_" + SectionName;
 
   var PageNA = eval(PageNamesArray);
   var OutputNA = eval(OutputNamesArray);
   
   var id=ItemID(arrayOfpath[3], PageNA); 

  document.write('<table width="100%" height="38" border="0" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td width="20" valign="top"><div align="center"><img src="/chi/images/red_circle.gif" width="12" height="12" vspace="12"></div></td>\n');
  document.write('<td valign="middle"><span class="txt_12_title">'+OutputNA[id]+'</span></td>\n');
  document.write('<td valign="bottom" ><div align="right">\n');
  document.write('<table border="0" cellspacing="0" cellpadding="3">\n');
  document.write('<tr>\n');
  document.write('<td class="txt_11_menu_sub3">');
   
  if (PageNA[id].indexOf(".") == "-1") {
	PageNamesArray += "_" + PageNA[id];
	OutputNamesArray += "_" + PageNA[id];

	
  	 var SubPageNA = eval(PageNamesArray);
	   var SubOutputNA = eval(OutputNamesArray);
	   
	   var subid=ItemID(arrayOfpath[4], SubPageNA); 
	
	  for( var i=0; i < (SubPageNA.length) ; i++) {
		if(i>0) {
			document.write(' | ');
		}
		if(SubPageNA[i].indexOf("http") != "-1") {
    			document.write('<a href="' + SubPageNA[i] + '" target="_blank">' + SubOutputNA[i] + '</a>');
    		} else {
			document.write('<a href="/chi/'+arrayOfpath[2]+'/'+arrayOfpath[3]+'/' + SubPageNA[i] + '">' + SubOutputNA[i] + '</a>');
		}
	   }
  }
  
  document.write('</td>\n');
  document.write('</tr>\n');
  document.write('</table>\n');
  document.write('</div></td>\n');
  document.write('</tr>\n');
  document.write('</table>\n');
}  

function showFooter() {
	
  document.write('<\div></td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('<td>&nbsp;</td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td height="10"><img src="/chi/images/spacer.gif" width="1" height="10"></td>\n');
  document.write('<td height="10"><img src="/chi/images/spacer.gif" width="1" height="10"></td>\n');
  document.write('<td height="10"><img src="/chi/images/spacer.gif" width="1" height="10"></td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('</table>\n');
  document.write('</td>\n');
  document.write('</tr>\n');
  document.write('<tr bgcolor="#FFFFFF">\n');
  document.write('<td height="5" valign="top" bgcolor="#FFFFFF"><img src="/chi/images/spacer.gif" width="100" height="5"></td>\n');
  document.write('</tr>\n');
  document.write('</table>\n');
  document.write('</td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td height="17" align="right" valign="bottom" bgcolor="#809AC0"><table border="0" align="right" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td height="3" class="txt_copy"><img src="/chi/images/spacer.gif" width="10" height="3"></td>\n');
  document.write('<td rowspan="3"><img src="/chi/images/spacer.gif" width="10" height="17"></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td class="txt_copy">Copyright &copy; 2006 Sanyang Industry Co., Ltd. All rights reserved.</td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('</table>\n');
  document.write('<script src="http://wm6.ecrm.com.tw/web_service/TrackingService/e5c317e5a5.js"></script>\n');
  document.write('</body>\n');
  document.write('</html>\n');

}

function ShowMenu(){

   var arrayOfpath = location.pathname.split("/");
   var arrayOfpage = arrayOfpath[arrayOfpath.length-1].split(".");

   var PageNamesArray="PageNames";
   var OutputNamesArray="OutputNames";
   var SectionName=arrayOfpath[2];
      
   PageNamesArray += "_" + SectionName;
   OutputNamesArray += "_" + SectionName;
 
   var PageNA = eval(PageNamesArray);
   var OutputNA = eval(OutputNamesArray);
   
   var id=ItemID(arrayOfpath[3], PageNA); 
   var mainid=ItemID(SectionName, PageNames); 
    
  document.write('<table width="100%" border="0" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td height="22" bgcolor="#898989"><table border="0" cellspacing="3">\n');
  document.write('<tr>\n');
  document.write('<td><img src="/chi/images/red_circle_w_bg.gif" width="12" height="12"></td>\n');
  document.write('<td class="txt_11_white">'+OutputNames[mainid]+'</td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td height="3" bgcolor="#DC0032"><img src="/chi/images/spacer.gif" width="1" height="3"></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td valign="top" bgcolor="#f2f2f2"><table width="100%" border="0" cellpadding="0" cellspacing="0">\n');
  document.write('<tr>\n');
  document.write('<td height="19"><img src="/chi/images/spacer.gif" width="10" height="19"></td>\n');
  document.write('</tr>\n');

   for( var i=0; i < (PageNA.length) ; i++) {
	if (i==id){
		document.write('<tr>\n');
		document.write('<td align="right" valign="middle"><table width="135" border="0" cellpadding="0" cellspacing="0" class="dot_lines">\n');
		document.write('<tr>\n');
		document.write('<td><img src="/chi/images/spacer.gif" width="1" height="1"></td>\n');
		document.write('</tr>\n');
		document.write('</table></td>\n');
		document.write('</tr>\n');
		document.write('<tr>\n');
		document.write('<td valign="middle"><div id="navigation">\n');
		document.write('<ul>\n');
		document.write('<li><span>' + OutputNA[i] + '</span></li>\n');
		document.write('</ul>\n');
		document.write('</div></td>\n');
		document.write('</tr>\n');
        } else {
		document.write('<tr>\n');
		document.write('<td align="right" valign="middle"><table width="135" border="0" cellpadding="0" cellspacing="0" class="dot_lines">\n');
		document.write('<tr>\n');
		document.write('<td><img src="/chi/images/spacer.gif" width="1" height="1"></td>\n');
		document.write('</tr>\n');
		document.write('</table></td>\n');
		document.write('</tr>\n');
		document.write('<tr>\n');
		document.write('<td valign="middle"><div id="navigation">\n');
		document.write('<ul>\n');
		
		if(PageNA[i].indexOf("http") != "-1") {
    			document.write('<li><a href="' + PageNA[i] + '" target="_blank">' + OutputNA[i] + '</a></li>\n');
    		} else {
    			if(PageNA[i].indexOf(".php") == "-1") {
				document.write('<li><a href="/chi/'+arrayOfpath[2]+'/' + PageNA[i] + '/index.php">' + OutputNA[i] + '</a></li>\n');
			} else {
				document.write('<li><a href="/chi/'+arrayOfpath[2]+'/' + PageNA[i] + '">' + OutputNA[i] + '</a></li>\n');
			}
		}
		
		document.write('</ul>\n');
		document.write('</div></td>\n');
		document.write('</tr>\n');
  	}
   }

  document.write('<tr>\n');
  document.write('<td height="19"><img src="/chi/images/spacer.gif" width="10" height="19"></td>\n');
  document.write('</tr>\n');
  document.write('</table></td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td height="1" bgcolor="#FFFFFF"><img src="/chi/images/spacer.gif" width="50" height="1"></td>\n');
  document.write('</tr>\n');

  document.write('<tr>\n');
  document.write('<td valign="bottom" bgcolor="#e5e5e5">');
  
//EpaperSearch();
  
  document.write('</td>\n');
  document.write('</tr>\n');
  document.write('<tr>\n');
  document.write('<td height="3" bgcolor="#DC0032"><img src="/chi/images/spacer.gif" width="50" height="3"></td>\n');
  document.write('</tr>\n');
  
// showVote();

  document.write('</table>\n');
}  

//电子报订阅+检索

function EpaperSearch() {
 	
   document.write('<table width="175" height="85"  border="0" cellpadding="0" cellspacing="0" bgcolor="#e5e5e5">\n');
   document.write('<tr>\n');
   document.write('<td align="center" valign="middle"><table  border="0" cellpadding="0" cellspacing="0">\n');
   document.write('<form name="EpaperForm" method="post" action="index.php" onsubmit="return CheckTopEmail1()">');
   document.write('<tr>\n');
   document.write('<td></td>\n');
   document.write('</tr>\n');
   document.write('<tr>\n');
   document.write('<td></td>\n');
   document.write('<td></td>\n');
   document.write('<td></td>\n');
   document.write('</tr>\n');
   document.write('</form>');
   document.write('</table></td>\n');
   document.write('</tr>\n');
   
   document.write('<tr>\n');
   document.write('<td><table width="165" height="1" border="0" cellpadding="0" cellspacing="0">\n');
   document.write('<tr>\n');
   document.write('<td></td>\n');
   document.write('</tr>\n');
   document.write('</table></td>\n');
   document.write('</tr>\n');
   
   document.write('<tr>\n');
   document.write('<td align="center" valign="top"><table  border="0" cellpadding="0" cellspacing="0">\n');
   document.write('<form name="SearchForm" method="post" action="/chi/search/index.asp" onSubmit="return CheckSearch()">');
   document.write('<tr>\n');
   document.write('<td></td>\n');
   document.write('</tr>\n');
   document.write('<tr>\n');
   document.write('<td></td>\n');
   document.write('<td></td>\n');
   document.write('<td></td>\n');
   document.write('</tr>\n');
   document.write('</form>');
   document.write('</table></td>\n');
   document.write('</tr>\n');
   document.write('</table>\n');
   
 }
 
 
 function sf(){

 }

// 检查是否有输入电子报的email
function CheckTopEmail1() {

  if (! isTopEmail(document.EpaperForm.email, "") ) {
     return false;
  } else {
     var org="";
     var search="@";
     var sub="(a)";
     var result="";
     var i=0;
	
		org=document.EpaperForm.email.value;  
   		i=org.indexOf(search);
		result= org.substring(0,i);
		result= result+sub;
		result= result+org.substring(i+search.length);
		org=result;
			
     window.open('/chi/epaper/order.php?email='+org,'','width=400,height=150');
  }
  
}

//检查email的function
function isTopEmail(elm, prompt_str) {
  var i;
  if (elm.value == prompt_str) {
    alert('请输入"电子邮件"!!');
    elm.select();
    return false;
  } 
  if (elm.value.indexOf("@.") != "-1" ||
      elm.value.indexOf(".@") != "-1") {
    alert ('"电子邮件"位址错误!!');
    elm.select();
    return false;
  }
  if (elm.value.indexOf("@") == "-1" ||
      elm.value.indexOf(".") == "-1") {
    alert ('"电子邮件"位址应该包含"@"和"."!!');
    elm.select();
    return false;
  }
  if (elm.value.indexOf(" ") != "-1") {
    alert ('"电子邮件"位址不可含有空白!!');
    elm.select();
    return false;
  }
  if (elm.value.indexOf("\"") != "-1") {
    alert ('"电子邮件"位址不可含有 \"!!');
    elm.select();
    return false;
  }
  for (i = 0;i < elm.value.length; i ++) {
    
    var count=0; //计算@出现的次数
  
    if (elm.value.charCodeAt(i) >= 128) {
      alert ('"电子邮件"位址不可含有中文字!!');
      elm.select();
      return false;
    }
    if (i == elm.value.length-1 &&
        elm.value.charAt(i) == ".") {
      alert ('"电子邮件"位址错误!!');
      elm.select();
      return false;
    }
    if (i == 0 &&
        elm.value.charAt(i) == ".") {
      alert ('"电子邮件"位址错误!!');
      elm.select();
      return false;
    }
    if (i == elm.value.length-1 &&
        elm.value.charAt(i) == "@") {
      alert ('"电子邮件"位址错误!!');
      elm.select();
      return false;
    }
    if (i == 0 &&
        elm.value.charAt(i) == "@") {
      alert ('"电子邮件"位址错误!!');
      elm.select();
      return false;
    }
    if (elm.value.charAt(i) == "@") 
      count = count + 1;
  }
  
  if (count > 1)
    return false;
  
  return true;
}

// 检查是否有输入全文检索的字串
function CheckSearch() {
  if ( document.SearchForm.keyword.value == "" ) {
     alert('请输入要查询的关键字!!');
     document.SearchForm.keyword.focus();
     return false;
  }
  return true;
}
