/*
 函 数 名：英文网站头函数
 函数功能：根据需要显示网页头
 输    入：channel -- 频道(数字)
          uid     -- 
 输    出：HTML
 创 建 人：GM
 创建日期：2004-08-23
*/
var _otherWeb = ""
var _bHasHead = true
var _bBanner = true
var _bSubMenu = true
var _hostname = "http://english.yoee.com"
var _hotel = ""
function writeBanner(channel,uid){
	if(!_bBanner) return
    try{
		_otherWeb = cooperationWeb()
		if (_otherWeb != ""){
			document.write (get_WebHead()) // get_WebHead() 函数在合作网站的 .js 中
			return
		}
	}catch(e){}
	if (channel == null || channel == ""){
		channel = 1
	}
	var BannerString = ""
	var BannerList = new Array()
	BannerList[0] = "<TABLE border=0 cellPadding=3 cellSpacing=3 width=778>                                  "+
					"  <TBODY>                                                                               "+
					"    <TR>                                                                                "+
					"      <TD width=188> <!--IMG src='http://image.yoee.com/homepage/yoeeindex_logo.gif' --></TD>"+
					"      <TD width='279'></TD>                                                             "+
					"      <TD width='279' align='center' valign='middle'>                                   "+
					"      <a href='/service/default_service.asp?uid="+uid+"'></a></TD>                     "+
					"    </TR>                                                                               "+
					"  </TBODY>                                                                              "+
					"</TABLE>                                                                                "
	BannerList[1] = BannerList[0]
	BannerList[2] = BannerList[0]
	BannerList[3] = BannerList[0]
	BannerList[4] = BannerList[0]
	BannerList[5] = BannerList[0]
	BannerList[6] = BannerList[0]
	BannerList[7] = BannerList[0]
	BannerString = "<TABLE border=0 cellPadding=3 cellSpacing=3 width=100%><TR><TD width=85%>"
	BannerString += "<IMG src='http://image.yoee.com/homepage/yoeeindex_logo.gif'></TD>"
	BannerString += "<td width=15%><div align=center><a href='http://www.yoee.com' class='errorTextStd3' ><strong>Chinese</strong></a></div></td>"
	BannerString += BannerList[channel-1]+ "</TR></TABLE>"	
	// sina 要求在订票流程中加 sina 的 logo
	var hostname = location.href;
	//if (_sina){
	
	//}else{
		BannerString = "<table border=0 width=778><tr><td>" + BannerString + "</td></tr></table>"
	//}
	
	
	document.write (BannerString)
}
function writeHead(channel,uid){
	if (channel == null || channel == "") {channel = 1}
	var MenuString = ""
	// leiyu 要求没有YOEE头信息
	if (!_bHasHead) return;
	var MenuList = new Array("Home","Domestic Flights","International Flights","E-tickets","My Trips","Customer Support","Company")
	var MenuWidth = new Array(60,115,125,0,79,125,79,120)// 如果宽度为零,则该频道被关闭
	var SpceWidth = new Array(53,  8,  8, 8, 8, 8,  8,120)
	var MenuListLink = new Array()
    var imgPath = "http://image.yoee.com/english/"
	//焦点图,正常图
    var imgString = ""
	var MenuActionA = new Array("homepage/yoeeindex_003.gif"   ,"homepage/yoeeindex_bg011.gif","homepage/yoeeindex_bg010.gif","homepage/yoeeindex_bg005.gif","homepage/yoeeindex_bg005.gif","homepage/yoeeindex_bg010.gif","homepage/yoeeindex_bg005.gif",""); 
	var MenuActionB = new Array("homepage/yoeeindex_bg003.gif" ,"homepage/yoeeindex_011.gif"  ,"homepage/yoeeindex_010.gif"  ,"homepage/yoeeindex_005.gif"  ,"homepage/yoeeindex_005.gif"  ,"homepage/yoeeindex_010.gif"  ,"homepage/yoeeindex_005.gif",""); 
	MenuListLink[0] = _hostname+"/default.asp?uid="+uid
	MenuListLink[1] = _hostname+"/sun/airplane.asp?uid="+uid
	MenuListLink[2] = _hostname+"/interflight/default.asp?uid="+uid
	MenuListLink[3] = _hostname+"/electron/electron.asp?uid="+uid
	MenuListLink[4] = _hostname+"/trip/myAacount_xingcheng.asp?uid="+uid
	MenuListLink[5] = _hostname+"/HelpCenter/cscenter.asp?uid="+uid
	MenuListLink[6] = _hostname+"/company/default.asp?uid="+uid

	MenuString  = "<TABLE background='http://image.yoee.com/homepage/yoeeindex_002.gif' border=0 cellPadding=0 cellSpacing=0 height=30 width=778>"
	MenuString += "<TR><TD rowSpan=2 width=10>&nbsp;</TD><TD valign=top>"
	MenuString += "<TABLE border=0 cellPadding=0 cellSpacing=0 height=30 width=700%><TR>"
	
	for(i=0; i<MenuList.length; i++){
		if (channel=="0" ||channel==0){
	        imgString = imgPath+MenuActionB[i]
		}
		else{
			imgString = channel==(i+1)?imgPath+MenuActionA[i]:imgPath+MenuActionB[i]
		}
		if (MenuWidth[i]!="0"){
			MenuString += "<TD width='"+ SpceWidth[i] +"'>&nbsp;</TD><TD background='"
			MenuString += imgString 
			MenuString += "' width='"+ MenuWidth[i] +"' align=center "
			MenuString += channel==(i+1)?"class=filter_14px>":">"
			MenuString += "<A class=errorTextStd11 href='"+ MenuListLink[i] +"'><B>"
			MenuString += channel==(i+1)?"<B><font color='#003399'><span class='errorTextStd12'>"+ MenuList[i]+"</span></FONT></B></A></TD>":MenuList[i]+"</B></A></TD>"
			}
	}
	
	MenuString += "<TD width='"+ SpceWidth[9] +"'>&nbsp;</TD></TR></TABLE></TD></TR></TABLE>"
	//alert(MenuString)
	document.write (MenuString)
	}

function writeSubMenu(channel,uid){
	if (channel == null || channel == "") {channel = 1}
	if (!_bSubMenu)return
	var SubMenuString = ""
	var SubMentList = new Array()
	SubMentList[0] = "<TABLE border=0 cellPadding=0 cellSpacing=0 width=740>                                                                    "+
					"  <TBODY>                                                                                                                 "+
					"  <TR>                                                                                                                    "+
					"    <TD align='right' valign='middle' width='549'> <img src='http://image.yoee.com/homepage/yoee_index_n03.gif' border=0> "+
					"    </TD>                                                                                                                 "+
					"    <TD align='right' valign='middle' width='191'>                                                                        "+
					"      <div align='left'>Call-center <font color=ff0000 size=3><b class='errorTextStd'>4007-00-4007</b></font></div>       "+
					"    </TD>                                                                                                                 "+
					"  </TR>                                                                                                                   "+
					"  </TBODY>                                                                                                                "+
					"</TABLE>                                                                                                                  "
	SubMentList[1] = SubMentList[0]
	SubMentList[2] = SubMentList[0]
	SubMentList[3] = SubMentList[0]
	SubMentList[4] = SubMentList[0]	
	SubMentList[5] = SubMentList[0]
	SubMentList[6] = SubMentList[0]
	SubMentList[7] = SubMentList[0]
	

	SubMenuString = "<TABLE border=0 cellPadding=0 cellSpacing=0 width=778 height=30 bgcolor='C4CDFF'><TR><TD align='right' valign='middle'>"
	SubMenuString += SubMentList[channel-1] +"</TD></TR></TABLE>"
	document.write (SubMenuString)
}

function writeBottom(channel,uid){
	if (channel == null || channel == "") {channel = 1}
	try{
		if (_otherWeb != ""){
			document.write (get_WebBottom())
			return
		}
	}catch(e){}
	var bottomString = ""	
	var bottomList = new Array()
	bottomList[0] = "<table height=40 cellspacing=3 cellpadding=3 width=778 border=0>"+
					"        <tbody> "+
					"        <tr> "+
					"          <td align=center> "+
					"            <a href='"+_hostname+"/static/aboutus.asp?uid="+uid+"'>About us</a><font color=#ccccff> |<font color=#ffffff> </font></font>"+
					"            <a href='"+_hostname+"/static/privacy.asp?uid="+uid+"'>Privacy Policy</a><font color=#ffffff> </font><font color=#ccccff>| </font>"+
					"            <a href='"+_hostname+"/static/service.asp?uid="+uid+"'>Terms of use </a><font color=#ccccff>| </font>"+
					"            <a href='"+_hostname+"/trip/advice.asp?uid="+uid+"'>Comments & Suggestions</a><font color=#ccccff>| </font>"+
					"	     <a href='"+_hostname+"/static/hezuo.asp?uid="+uid+"'>Contact Us</a><font color=#ccccff>| </font>"+
					"            </div>"+
					"          </td>"+
					"        </tr>"+
					"        </tbody>"+
					"</table>"+
					"<table width='778' border='0' cellspacing='2' cellpadding='2'>"+
					"  <tr> "+
					"    <td> "+
					"      <div align='center'>Copyright &copy; 2003-2009 <img src='http://image.yoee.com/y/yoeeindex_027.gif' width='81' height='13' align='absmiddle'> "+
					"    </td>"+
					"  </tr>"+
					"</table>";
	
	
	
	bottomList[1] = bottomList[0]
	bottomList[2] = bottomList[0]
	bottomList[3] = bottomList[0]
	bottomList[4] = bottomList[0]
	bottomList[5] = bottomList[0]
	bottomList[6] = bottomList[0]
	bottomList[7] = bottomList[0]
	bottomString  = ""
	document.write (bottomString + bottomList[channel-1]) 
}
function openwin(page,size){
	window.open(page,"newuser","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=no,"+size);
}
function cooperationWeb(){
	var cooperation = "beijing,";
	var hostname = location.hostname;
	hostname = hostname.split(".");
	
	/*
	 各合作公司特殊要求
	 1. beijing 要求修改背景图，换头换尾
	*/
	if (hostname[0] == "beijing") {
		//_bHasHead = false
		//_bBanner = false
		//_bSubMenu = false
	}



/*	
	// show.jsp,login.jsp,filltable.jsp,userconfirm,finishshow.asp
	if (hostname[0]	== "beijing") {
		var hostHref = location.href
		if(hostHref.indexOf("show.jsp")>0 || hostHref.indexOf("login.jsp")>0 || hostHref.indexOf("filltable.jsp")>0 || hostHref.indexOf("userconfirm")>0 || hostHref.indexOf("finishshow.asp")>0 || hostHref.indexOf("airplane.asp")>0)
			//_sina = true
	}

	
	if(hostname[0] =="hotel" || hostname[0] == "211" || hostname[0] == "sun"){
		_hostname="http://english.yoee.com";
	}else{
		_hostname="";
	}
*/

	cooperation = cooperation.split(",")
	//alert(cooperation.length)
	for (i=0; i<cooperation.length; i++){
		if (cooperation[i].indexOf(hostname[0]) >= 0 && hostname[0] != ""){
			if (_hostname.indexOf("http://")>=0){
			jsString = "<script language=javascript src="+_hostname+"/inc/partner/"+ hostname[0] +".js><"
			}else{
			jsString = "<script language=javascript src=http://"+_hostname+"/inc/partner/"+ hostname[0] +".js><"
			}
			jsString += "/script>"
		    document.write (jsString)
			return hostname[0]
		}
	}
	
	return ""
}
cooperationWeb();