var arrLabel=new Array()
arrLabel[0]=new SetProperty("首页","/index.htm","/index.htm")
arrLabel[1]=new SetProperty("关于Silkbank","/about/","/about/")
arrLabel[2]=new SetProperty("蚕沙. 蚕蛹","/cs-pupa/","/cs-pupa/")
arrLabel[3]=new SetProperty("桑. 蚕","/worm-mul/","/worm-mul/")
arrLabel[4]=new SetProperty("茧. 丝绸","/silk/","/silk/")
arrLabel[5]=new SetProperty("代理产品","/agent/","/agent/")
arrLabel[6]=new SetProperty("正在供应","/promotion/","/promotion/")
arrLabel[7]=new SetProperty("联系我们","/contact/","/contact/")
//arrLabel[7]=new SetProperty("成功案例","/case/","/case/")

var arrSubInfo=new Array()//下拉框配置
arrSubInfo[0]=new Array()
arrSubInfo[1]=new Array()
arrSubInfo[2]=new Array()
arrSubInfo[3]=new Array()
arrSubInfo[4]=new Array()
arrSubInfo[5]=new Array()
arrSubInfo[0][0]=new SetSubInfo("- 关于Silkbank.com","/about/index.htm")
arrSubInfo[0][1]=new SetSubInfo("- 产品基地概况","/about/base.htm")
arrSubInfo[0][2]=new SetSubInfo("- 包装与仓储","/about/ps.htm")
arrSubInfo[0][3]=new SetSubInfo("- 联系我们","/contact/index.htm")
arrSubInfo[1][0]=new SetSubInfo("- 蚕沙原料、蚕沙枕产品","/cs-pupa/cansha.htm")
arrSubInfo[1][1]=new SetSubInfo("- 蚕蛹原料、食用级蚕蛹产品","/cs-pupa/pupa.htm")
arrSubInfo[2][0]=new SetSubInfo("- 栽桑与桑苗产品","/worm-mul/mul.htm")
arrSubInfo[2][1]=new SetSubInfo("- 桑叶与桑叶开发","/worm-mul/mul.htm")
arrSubInfo[2][2]=new SetSubInfo("- 养蚕与副产品","/worm-mul/worm.htm")
arrSubInfo[3][0]=new SetSubInfo("- 蚕茧产品","/silk/canjian.htm")
arrSubInfo[3][1]=new SetSubInfo("- 丝产品一览","/silk/silk.htm")
arrSubInfo[3][2]=new SetSubInfo("- 丝绸服饰产品","/silk/silkproducts.htm")
arrSubInfo[4][0]=new SetSubInfo("- 叶绿素","/agent/Chlorophyll.htm")
arrSubInfo[4][1]=new SetSubInfo("- 丝绸床上用品、服饰","/agent/bedding.htm")
arrSubInfo[5][0]=new SetSubInfo("- 蚕沙供应与预定","/promotion/index.htm#1")
arrSubInfo[5][1]=new SetSubInfo("- 蚕蛹供应与预定","/promotion/index.htm#2")
arrSubInfo[5][2]=new SetSubInfo("- 桑苗与桑叶","/promotion/index.htm#3")

/////输出导航条
function OutputTop(){
var Output      
Output ='  <table width="775" bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="0">'
Output+='   <tr> '
Output+='     <td rowspan="2" valign="top">&nbsp;&nbsp;&nbsp;</td>'
Output+='     <td rowspan="2" width="350"> <img src="/Images/logo.gif"></td>'
Output+='     <td valign="top" align="right"><img src="/Images/connergray.gif"> '
Output+='     </td>'
Output+='     <td valign="top"> <div style="height:25;border-bottom:1 #aabbaa solid;padding-top:3px;background:#ccddcc;"  align="center"> '
Output+='         <font color="#FFFFFF"><a href="#1">中文版</a> | <a href="#2">English</a> | <a href="#3">日本语</a>'
Output+='      | <a href="#4">韩国语</a> | <a href="#5">网站导览</a></font></div></td>'
Output+='   </tr>'
Output+='   <tr> '
Output+='     <td colspan="2" valign="top" align="right" style="padding-right:10;">您访问本网站的原因：'
Output+='       <select name=D1 onchange="window.open(this.options[this.selectedIndex].value)" style="font-size:9pt;">'
Output+='         <option value="请选择...">请选择...</option>'
Output+='         <option value="../cs-pupa/">- 购买干桑蚕沙与桑蚕蛹</option>'
Output+='         <option value="../worm-mul/">- 购买蚕,桑苗,桑叶</option>'
Output+='         <option value="../agent/bedding.htm">- 购买蚕沙枕,蚕丝被.毯,丝绸产品</option>'
Output+='         <option value="../silk/">- 购买蚕茧,白厂丝,绢丝等</option>'
Output+='         <option value="../agent/">- 采购叶绿素,蚕丝床上用品</option>'
Output+='         <option value="../promotion/">- 了解正在供应的商品</option>'
Output+='         <option value="../contact/">- 与我们联系与合作</option>'
Output+='       </select></td>'
Output+='   </tr>'
Output+='   <tr bgcolor="#ffffff"> '
Output+='     <td height="14" colspan="4"></tr>'
Output+=' </table>'
Output+='        <table width="775" border="0" cellspacing="0" cellpadding="0">'
Output+='          <tr> '
Output+='            <td colspan="2" bgcolor="#009900" height="2"></td>'
Output+='          </tr>'
Output+='          <tr class="sbgreenbg"> '
Output+='            <td width="670" align="center">'
Output+=            ShowLabel()
Output+='            </td>'
Output+='            <td>'+ ShowDate() +'</td>'
Output+='          </tr>'
Output+='          <tr bgcolor="#99cc33"> '
Output+='            <td height="2" colspan="2"></td>'
Output+='          </tr>'
Output+='        </table>'
Output+='<div id="Triangle" style="position:absolute;left:-100px;visibility:hidden;"><img src="/Image/triangle.gif"></div>'
document.write (Output)
CreateSub()
}


////输出广告条
function OutputChannelAd(){
var Output
var ImageFile
var ImageUrl
var aAd=new Array(new Array("/Image/ChannelAd/pupa.jpg","/cs-pupa/pupa.htm"),new Array("/Image/ChannelAd/cansha.jpg","/cs-pupa/cansha.htm"),new Array("/Image/ChannelAd/pupa.jpg","/cs-pupa/pupa.htm"),new Array("/Image/ChannelAd/worm.jpg","/worm-mul/worm.htm"),new Array("/Image/ChannelAd/mul.jpg","/worm-mul/mul.htm"),new Array("/Image/ChannelAd/silks.jpg","/silk/index.htm"),new Array("/Image/ChannelAd/agents.jpg","/agent/index.htm"))


//====================================================
//产生随机图片名
//====================================================
num=Math.floor(Math.random()*(aAd.length+1))
if (num==0) num=1
ImageFile=aAd[num-1][0]
ImageUrl=aAd[num-1][1]
//====================================================

Output ='<table width="775" border="0" cellspacing="0" cellpadding="0">'
Output+='          <tr> '
Output+='            <td bgcolor="#99cc99"><a href="'+ImageUrl+'"><img border="0" src="'+ImageFile+'"></a></td>'
Output+='            <td><a href="../promotion/index.htm#1">'
Output+=' <img src="/Image/ChannelAd/adv.gif" border="0" alt="20吨精品蚕沙热销中，数千吨干蚕沙订购中，现在联络，正在供货"></a></td>'
Output+='          </tr>'
Output+='          <tr> '
Output+='            <td colspan="2" bgcolor="#007700" height="1"></td>'
Output+='          </tr>'
Output+='        </table>'
document.write (Output)
}

/////输出页脚
function OutputFoot(){

var Output
var d = new Date()

Output ='<table width="775" border="0" cellspacing="0" cellpadding="0" bgcolor="#ffffff">'
Output+='          <tr> '
Output+='            <td bgcolor="#007700" height="1"></td>'
Output+='          </tr>'
Output+='          <tr> '
Output+='            <td align="center" height="25"> | '
Output+='              <a href="/about/index.htm">走进Silkbank</a> | '
Output+='              <a href="/promotion/index.htm">正在供应</a> | '
Output+='              <a href="/contact/index.htm">联系我们</a> | '
Output+='              <a href="#" alt="即将开启">友情链接</a> | '
Output+='            </td>'
Output+='          </tr>'
Output+='          <tr> '
Output+='            <td bgcolor="#007700" height="1"></td>'
Output+='          </tr>'
Output+='          <tr> '
Output+='            <td align="center" bgcolor="#337700" height="25" style="padding:8 0 8 0;"><font size="-4" face="Arial, Helvetica, sans-serif" color="#ffffff">'
Output+=d.getYear()
Output+='             www.Silkbank.com 版权所有:<a href="http://www.upean.com" class="UPeanYellowLink">上海优品科技</a>，本网站一切图片与文字、网站结构，未经版权人许可，一律不得侵权与模仿,违反必究。<br>'
Output+='   <a href=http://www.miibeian.gov.cn target=_blank><font color="#00FF00">沪ICP备05028124号</font></a>&nbsp;&nbsp;24小时服务电话：021－2996 8059，手机: 139 163 84772，地址：上海市武夷路491-14号商务楼303室<br><a href="http://www.54md.com" target="_blank">友好链接--美迪健康网</a></font></td>'
Output+='          </tr>'
Output+='        </table>'
document.write (Output)
}


function RightList(){

var Output
Output ='<table width="100%" border="0" cellspacing="0" cellpadding="0">'
Output+='                <tr> '
Output+='  <td colspan="2" valign="top" style="border-top:1 #009900 solid;"><a href="../contact/">'
Output+=' <img src="../Images/contact.gif" border="0" alt="24小时服务电话：021－2996 8059，手机: 139 163 84772，周西康先生"></a></td>'
Output+='                </tr>'
Output+='                  <tr> '
Output+='                    <td colspan="2" bgcolor="#A0A0A0"><img src="none.htm" width="1" height="1"></td>'
Output+='                  </tr>'
Output+='                  <tr> '
Output+='                    <td colspan="2"><img src="none.htm" width="1" height="2"></td>'
Output+='                  </tr>'
Output+='                <tr> '
Output+='                  <td width="15" height="25" bgcolor="#bbbbbb">&nbsp;</td>'
Output+='                  <td bgcolor="#bbbbbb"><B>产品快捷通道</B></td>'
Output+='                </tr>'
Output+='                <tr> '
Output+='                  <td>&nbsp;</td>'
Output+='                  <td valign="top"><img src="../Image/triangle1.gif" width="12" height="8"></td>'
Output+='                </tr>'
Output+='              </table>'
Output+='<center>'
Output+='                <table width="84%" border="0" cellspacing="0" cellpadding="0">'
Output+='                  <tr> '
Output+='                          <td>'
Output+='                            - <a href="/cs-pupa/cansha.htm">蚕沙原料、蚕沙枕产品</a> <br>'
Output+='                            - <a href="/cs-pupa/pupa.htm">蚕蛹原料、食用级蚕蛹产品</a> <br>'
Output+='                            - <a href="/worm-mul/mul.htm">栽桑与桑苗产品</a> <br>'
Output+='                            - <a href="/worm-mul/mul.htm">桑叶与桑叶茶</a> <br>'
Output+='                            - <a href="/worm-mul/worm.htm">养蚕与副产品</a> <br>'
Output+='                            - <a href="/silk/canjian.htm">蚕茧产品</a> <br>'
Output+='                            - <a href="/silk/silk.htm">丝产品一览</a> <br>'
Output+='                            - <a href="/silk/silkproducts.htm">丝绸制品、服饰</a><br> '
Output+='                            - <a href="/agent/Chlorophyll.htm">叶绿素</a> <br>'
Output+='                            - <a href="/agent/bedding.htm">丝绸床上用品、服饰</a><br><br>'
Output+='                          </td>'
Output+='                  </tr>'
Output+='                </table>'				
Output+='	</center>'
Output+='<table width="100%" border="0" cellspacing="0" cellpadding="0">'
Output+='                  <tr> '
Output+='                    <td colspan="2" bgcolor="#A0A0A0"><img src="none.htm" width="1" height="1"></td>'
Output+='                  </tr>'
Output+='                  <tr> '
Output+='                    <td colspan="2"><img src="none.htm" width="1" height="2"></td>'
Output+='                  </tr>'
Output+='                  <tr> '
Output+='                  <td width="15" height="25" bgcolor="#bbbbbb">&nbsp;</td>'
Output+='                  <td bgcolor="#bbbbbb"><B>正在供应、接受预定预告</B></td>'
Output+='                  </tr>'
Output+='                  <tr> '
Output+='                    <td>&nbsp;</td>'
Output+='                    <td valign="top"><img src="../Image/triangle1.gif" width="12" height="8"></td>'
Output+='                  </tr>'
Output+='                </table>'
Output+='                          <table width="100%" border="0" cellspacing="0" cellpadding="0">'
Output+='                      <tr> '
Output+='                        <td width="18"></td>'
Output+='                        <td><a href="/promotion/index.htm">-&nbsp;各种用途的蚕沙、蚕蛹、桑叶</a></td>'
Output+='                      </tr>'
Output+='                    </table><br>'
Output+='<table width="100%" border="0" cellspacing="0" cellpadding="0">'
Output+='                  <tr> '
Output+='                    <td colspan="2" bgcolor="#A0A0A0"><img src="none.htm" width="1" height="1"></td>'
Output+='                  </tr>'
Output+='                  <tr> '
Output+='                    <td colspan="2"><img src="none.htm" width="1" height="2"></td>'
Output+='                  </tr>'
Output+='                  <tr> '
Output+='                  <td width="15" height="25" bgcolor="#bbbbbb">&nbsp;</td>'
Output+='                  <td bgcolor="#bbbbbb"><B>客户服务</B></td>'
Output+='                  </tr>'
Output+='                  <tr> '
Output+='                    <td>&nbsp;</td>'
Output+='                    <td valign="top"><img src="../Image/triangle1.gif" width="12" height="8"></td>'
Output+='                  </tr>'
Output+='                </table>'

Output+=' <table width="100%" border="0" cellspacing="0" cellpadding="2">'
Output+='                       <tr> '
Output+='                         <td width="10">&nbsp;</td>'
Output+='                         <td valign="top">Silkbank提供全面的蚕桑丝绸产品供销解决方案，并接受客户咨询与技术服务，有需求请致电 周西康 先生：<br><strong><font color="#330099" face="Arial, Helvetica, sans-serif">上海：021－2996 8059,手机：139 163 84772</font></strong>，或发送电子邮件至：<a href="mailto:upean@vip.sina.com "><font color="#330099" face="Arial, Helvetica, sans-serif">upean@vip.sina.com</font> '
Output+='                           </a></td>'
Output+='                         <td width="10">&nbsp;</td>'
Output+='                      </tr>'
Output+='                      <tr>'
Output+='                       <td rowspan="2">&nbsp;</td>'
Output+='                       <td align="right"><a href="../contact/index.htm"><img src="../Image/more_4.gif" width="39" height="12" border="0"></a></td>'
Output+='                        <td rowspan="2">&nbsp;</td>'
Output+='                      </tr>'
Output+='                      <tr>'
Output+='                       <td height="8" align="right">'
Output+=' 						</td>'
Output+='                      </tr>'
Output+='                     </table>'

document.write (Output)	
}
////////////////////////////////////////////////////////////////////

function ShowLabel(){

	var temp
	temp ='<table border=0 cellpadding=0 cellspacing=0 height="18" id="TBLabel">'
	temp+='  <tr>'
	
	for (i=0;i<arrLabel.length;i++){
		temp+='<td style="padding-left:12;padding-right:12" onmouseover="OverLabel(this)" onmouseout="ResetBg(this)">'
		temp+='  <a class="UPeanYellowLink" href="'+ arrLabel[i].Link +'">'		
		temp+=      arrLabel[i].Content
		temp+='  </a>'
		temp+='</td>'
	}
	
	temp+='  </tr>'
	temp+='</table>'
		
	return temp
}
function SetProperty(Content,Link,Key){
	this.Content=Content
	this.Link=Link
	this.Key=Key
}

function SetSubInfo(Content,Link){
	this.Content=Content
	this.Link=Link
}
function CreateSub(){
	var Output
	for (var i=0; i<arrSubInfo.length; i++){
		Output='<table cellpadding="0" cellspacing="0" border="0" style="visibility:hidden; position:absolute;border:1 #336633 solid" id="sub'+i+'" bgcolor="#ccff33" onmouseout="SubOut(this)">'//下拉框样式
		for (var j=0; j<arrSubInfo[i].length; j++){
			Output+='<tr>'
			Output+='  <td style="padding:0 9 2 9">'//下拉框边距调整
			Output+='  <a href="'+arrSubInfo[i][j].Link+'"><font color="#006600" style="border-bottom:1 #ffffff dotted;">'+arrSubInfo[i][j].Content+'</font></a>'
			Output+='  </td>'
			Output+='</tr>'
		}
		Output+='</table>'		
		document.write (Output)
	}	
}
function ShowDate(){
	//arrWeek=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")
	arrWeek=new Array("日","一","二","三","四","五","六")
	ToDay=new Date()
	temp ='<font color="#000000">'
	temp+=ToDay.getYear() +"-"
	temp+=(ToDay.getMonth()+1) +"-"
	temp+=ToDay.getDate()+" "
	temp+="星期"+arrWeek[ToDay.getDay()]
	temp+='</font>'
	
	return temp
}
function SubOut(el){
	if (!el.contains(event.toElement)){
		el.style.visibility="hidden";	
		for (var i=0; i<TBLabel.rows[0].cells.length; i++){
			TDel=TBLabel.rows[0].cells[i]
			if (TDel.style.background == "#3333cc") TDel.style.background = ""//导航菜单背景
		}
	}
}
function OverLabel(el){	
	for(var i=0; i<arrSubInfo.length; i++){
		subEl=eval("sub"+i)	
		if (subEl.style.visibility=="visible"){		
			subEl.style.visibility="hidden"	
		}
	}
	
	for (var i=0; i<TBLabel.rows[0].cells.length; i++){
		TDel=TBLabel.rows[0].cells[i]
		if (TDel.style.background == "#009900") TDel.style.background = ""
	}
	
	for (var i=0; i<TBLabel.rows[0].cells.length; i++){
		if (el==TBLabel.rows[0].cells[i]) {break;}
	}
	var SubName=null//下拉显示框配置	
	switch(i){
		case 1:	
			SubName=sub0;break;
		case 2:	
			SubName=sub1;break;
		case 3:	
			SubName=sub2;break;
		case 4:	
			SubName=sub3;break;
		case 5:	
			SubName=sub4;break;
		case 6:	
			SubName=sub5;break;
		default:
			SubName=null
	}
	if (SubName != null){
		if (SubName.style.visibility == "hidden") {			
			TDTop =GetPosition(el,"Top")+0
			TDLeft=GetPosition(el,"Left")
			SubName.style.top =TDTop+el.offsetHeight
			SubName.style.left=TDLeft
			SubName.style.visibility = "visible"
		}		
	}
	if (el.style.background=="white") return
	el.style.background="#009900"
}
function SetCurrLabel(el){
	for (i=0 ;i<arrLabel.length;i++){		
		ResetBg(TBLabel.rows[0].cells[i])
	}
	
	TDTop =GetPosition(el,"Top")
	TDLeft=GetPosition(el,"Left")
		
	Triangle.style.top =TDTop-Triangle.offsetHeight-3
	Triangle.style.left=TDLeft+el.offsetWidth/2-6
	
	el.style.background="white"
	el.childNodes(0).className=""
}
function GetPosition(referenceEl,direction){
	pos=0
	tmpEl=referenceEl
	while(tmpEl != null){
	    pos+=tmpEl["offset"+direction]
	    tmpEl=tmpEl.offsetParent
	}	
	return pos
}
function ResetBg(el){
	
	//if (el.style.background=="white") return
	
	for (var i=0; i<TBLabel.rows[0].cells.length; i++){
		if (el==TBLabel.rows[0].cells[i]) {break;}
	}
	var SubName=null//下拉鼠标移出显示框配置	
	switch(i){
		case 1:	
			SubName=sub0;break;
		case 2:	
			SubName=sub1;break;
		case 3:	
			SubName=sub2;break;
		case 4:	
			SubName=sub3;break;
		case 5:	
			SubName=sub4;break;
		case 6:	
			SubName=sub5;break;
		default:
			SubName=null
	}
	if (SubName==null) return
	toEl=event.toElement
	if (!SubName.contains(toEl)){
		SubName.style.visibility="hidden"
		if (el.style.background=="white") return
		el.style.background=""
		el.childNodes(0).className="UPeanYellowLink"
	}
}

function InitializeTriangle(){
	url=location.href	
	flag=false
	for (i=0 ;i<arrLabel.length;i++){
		if (url.indexOf(arrLabel[i].Key) != -1){
			SetCurrLabel(TBLabel.rows[0].cells[i])
			flag=true
		}
	}
	
	if (!flag) {
		SetCurrLabel(TBLabel.rows[0].cells[0])	
	}
	Triangle.style.visibility="visible"
}