/*script document*/
/*
 * csair.com v0.1
 * http://csair.com/
 *
 * Copyright (c) 2009 csair.com
 * 
 * Date: 2009-05-18 11:14:14 (GMT+08:00)
 * Revision: 1
 */

/*定义全局路径*/
if(!thisUrl){
	var thisUrl=document.URL+window.location.search;
	//发布时需改此项为：http://www.csair.com/
	function webPath(url){var allstr="http://www.csair.com/"+url;return allstr}
}
//alert(window.location.search);

/*节日背景图片*/
var bodybg = webPath("topAndFoot/bg_festival.jpg");
/*header节日背景图片*/
//var header_bg = webPath('topAndFoot/logo_festival.jpg');
var header_bg = webPath('');

/*非节日背景*/
//var bodybg = "#fff";
/*header背景图片*/
//var header_bg = webPath('topAndFoot/logo.jpg');

/*头部菜单背景*/
var menu_bg = "#D7F4F9 url("+webPath('cn/img/asia/bg_menu_0.jpg')+") left center repeat-x";

/*繁体版隐藏*/
ihost = window.location.host;
ibig5 = "58.248.41.218:82";

if(!(typeof($C) == "function")){
	function $C(ele){
		return document.createElement(ele);	
	}
}
if (!(typeof(addCssClass) == "function")) {
	function addCssClass(htmlEl,iclssName){//对元素添加class样式
		try{
	    htmlEl.className += " "+iclssName;
		}catch(e){}
	}
}

var iHeaderMenu = {
		menus_A : [
			{iText_A : "首页", id_A : "order", iLink_A : webPath("cn/index.asp"),menus_B :[]},
			{iText_A : "预订查询", id_A : "booking_id", iLink_A : webPath("cn/index.asp"), menus_B : [
				{iId_B:"1",iText_B : "机票预订",iLink_B : webPath("cn/")},
				{iId_B:"2",iText_B : "酒店预订",iLink_B : "http://hotel.csair.com"},
				{iId_B:"3",iText_B : "度假预订",iLink_B : "http://hotel.csair.com/vacation"},
				{iId_B:"4",iText_B : "餐饮预订",iLink_B : "http://hvp.csair.com/food/app"},
				{iId_B:"5",iText_B : "办理登机牌",iLink_B : "http://airport.csair.com/cki/app"},
				{iId_B:"6",iText_B : "客票验证",iLink_B : "http://etkt.csair.com/CheckTicket/modules/checkTicket/checkTicket.jsp"},
				{iId_B:"7",iText_B : "航班动态",iLink_B : webPath("cn/booking/07/index.html")},
				{iId_B:"8",iText_B : "改退票",iLink_B : webPath("cn/booking/08/index.html")},
				{iId_B:"9",iText_B : "行李查询",iLink_B : "http://airport.csair.com/outbaggage/app"},
				{iId_B:"10",iText_B : "航线图",iLink_B : "http://ec.csair.com/B2C/modules/GMap/GMapShowFlight.jsp"}
			]},
			{iText_A : "精选优惠", id_A : "favourable_id", iLink_A : webPath("cn/favourable/01/index.html"), menus_B : [
				{iId_B:"1",iText_B : "特价促销",iLink_B : webPath("cn/favourable/01/index.html")},
				{iId_B:"2",iText_B : "南航行",iLink_B : webPath("cn/favourable/02/index.html")},
				{iId_B:"3",iText_B : "旅游套餐",iLink_B : "http://hotel.csair.com/vacation"},
				{iId_B:"4",iText_B : "RSS订阅",iLink_B : webPath("cn/favourable/04/index.html")},
				//{iId_B:"5",iText_B : "Widget下载",iLink_B : webPath("cn/favourable/widget.rar")}
				{iId_B:"5",iText_B : "Widget下载",iLink_B : webPath("cn/favourable/05/widget/widget.html")}
				//,{iId_B:"5",iText_B : "Email订阅",iLink_B : webPath("cn/favourable/05/index.html")}
			]},
			{iText_A : "旅行信息", id_A : "tour_id", iLink_A : webPath("cn/tour/index.html"), menus_B : [
				{iId_B:"1",iText_B : "筹备旅行",iLink_B : webPath("cn/tour/index.html?t1"), menus_C : [
						//{iId:"1",iText_C : "航班时刻表",iLink_C : "/cn/tour/01/01.html"},
						{iId:"2",iText_C : "网上订票",iLink_C : "/cn/tour/01/02.html"},
						{iId:"3",iText_C : "95539订票",iLink_C : "/cn/tour/01/03.html"},
						{iId:"4",iText_C : "E-旅行保险",iLink_C : "/cn/tour/01/04.html"},
						//{iId:"5",iText_C : "我的预订",iLink_C : "#"},
						{iId:"6",iText_C : "网上预办理登机",iLink_C : "/cn/tour/01/06.html"},
						{iId:"7",iText_C : "航班动态查询",iLink_C : "/cn/tour/01/07.html"},
						{iId:"8",iText_C : "95539短信服务",iLink_C : "/cn/95539/"}
						//{iId:"9",iText_C : "旅行服务",iLink_C : "#"}
				]},
				{iId_B:"2",iText_B : "旅行前准备",iLink_B : webPath("cn/tour/index.html?t2"), menus_C : [
						{iId:"1",iText_C : "行李服务",iLink_C : "/cn/tour/02/01.html"},
						{iId:"2",iText_C : "特殊旅行需求",iLink_C : "/cn/tour/02/02.html"},
						{iId:"3",iText_C : "乘客须知",iLink_C :"/cn/tour/02/03.html"},
						{iId:"4",iText_C : "支付须知",iLink_C : "/cn/tour/02/04.html"},
						{iId:"5",iText_C : "租车服务",iLink_C : "/cn/tour/02/05.html"},
						{iId:"6",iText_C : "酒店预订",iLink_C : "/cn/tour/02/06.html"}
				]},
				{iId_B:"3",iText_B : "在机场",iLink_B : webPath("cn/tour/index.html?t3"), menus_C : [
						{iId:"1",iText_C : "各地机场信息",iLink_C : "/cn/tour/03/01.html"},
						{iId:"2",iText_C : "办理登机手续",iLink_C : "/cn/tour/03/02.html"},
						{iId:"3",iText_C : "机场贵宾室",iLink_C : "/cn/tour/03/03.html"},
						//{iId:"4",iText_C : "机场头等舱服务",iLink_C : webPath("cn/tour/03/04/index.html")},
						//{iId:"5",iText_C : "出入境指南",iLink_C : webPath("cn/tour/03/05/index.html")},
						{iId:"6",iText_C : "安全检查须知",iLink_C : "/cn/tour/03/06.html"},
						{iId:"7",iText_C : "登机",iLink_C : "/cn/tour/03/07.html"},
						{iId:"8",iText_C : "进港",iLink_C : "/cn/tour/03/08.html"}
				]},
				{iId_B:"4",iText_B : "机上服务",iLink_B : webPath("cn/tour/index.html?t4"), menus_C : [
						//{iId:"1",iText_C : "客舱服务",iLink_C :"/cn/tour/04/01.html"},
						{iId:"2",iText_C : "机上餐饮",iLink_C : "/cn/tour/04/02.html"},
						{iId:"3",iText_C : "机上娱乐",iLink_C : "/cn/tour/04/03.html"},
						{iId:"4",iText_C : "通讯及座位电子系统",iLink_C : "/cn/tour/04/04.html"},
						{iId:"5",iText_C : "免税商品预订",iLink_C : "/cn/tour/04/05.html"},
						{iId:"6",iText_C : "南航机队",iLink_C : "/data/cn/help/09/index.html"}
				]}
			]},
			{iText_A : "明珠会员", id_A : "skypearl_id", iLink_A : "http://skypearl.csair.com", menus_B : [
				{iId_B:"1",iText_B : "立即加入",iLink_B : "http://skypearl.csair.com/apply.html"},
				{iId_B:"2",iText_B : "里程累积",iLink_B : "http://skypearl.csair.com/air1.html"},
				//{iId_B:"3",iText_B : "里程兑换",iLink_B : "http://skypearl.csair.com/index_3.html"},
				{iId_B:"3",iText_B : "里程兑换",iLink_B : "http://ec.csair.com/B2C/modules/order/ffpticket/searchIndex.jsp"},
				{iId_B:"4",iText_B : "明珠快讯",iLink_B : "http://skypearl.csair.com/index_4.html"},
				{iId_B:"5",iText_B : "关于明珠",iLink_B : "http://skypearl.csair.com/aboutUs.html"}
			]},
			{iText_A : "关于南航", id_A : "abouccsn_id", iLink_A : webPath("cn/aboutcsn/index.html"), menus_B : [
				{iId_B:"1",iText_B : "公司简介",iLink_B : webPath("cn/aboutcsn/01/index.html")},				
				{iId_B:"2",iText_B : "招聘信息",iLink_B : webPath("cn/aboutcsn/02/index.html")},
				{iId_B:"4",iText_B : "南航新闻",iLink_B : webPath("cn/aboutcsn/04/index.asp")},
				{iId_B:"5",iText_B : "投资者关系",iLink_B : webPath("cn/aboutcsn/05/index.asp"), menus_C : [
						{iId:"7",iText_C : "公司治理",iLink_C : "javascript:selectLoad3('/data/cn/structure/index.html','a50507','content',setHtmlLoad)"},
						{iId:"8",iText_C : "公司组织结构",iLink_C : "javascript:selectLoad3('/data/cn/structure/index2.html','a50508','content',setHtmlLoad)"},
						{iId:"4",iText_C : "股票信息",iLink_C : "javascript:selectLoad3('/data/cn/investor/StockInfo/index.html','a50504','content',setHtmlLoad)"},
						{iId:"2",iText_C : "生产数据",iLink_C : "javascript:selectLoad3('/data/cn/investor/finance/index.html','a50502','content',setHtmlLoad)"},
						{iId:"3",iText_C : "业绩报告",iLink_C : "javascript:selectLoad3('/data/cn/investor/report/index.html','a50503','content',setHtmlLoad)"},
						{iId:"1",iText_C : "其他报告",iLink_C : "javascript:selectLoad3('/data/cn/investor/other/index.html','a50501','content',setHtmlLoad)"},
						//{iId:"5",iText_C : "荣誉与奖励",iLink_C : "javascript:selectLoad3('/data/cn/investor/HonorsAwards/index.html','a50505','content',setHtmlLoad)"}
						{iId:"5",iText_C : "投资者关系日历",iLink_C : "javascript:selectLoad3('/data/cn/investor/Calendar/index.html','a50505','content',setHtmlLoad)"},
						{iId:"6",iText_C : "董秘信箱",iLink_C : "javascript:selectLoad3('/data/cn/investor/Mailbox/index.html','a50506','content',setHtmlLoad)"}
				]},
				
				{iId_B:"6",iText_B : "联盟伙伴",iLink_B : "http://www.skyteam.com"},
				{iId_B:"7",iText_B : "社会责任报告",iLink_B : webPath("cn/aboutcsn/07/index.html")},
				{iId_B:"8",iText_B : "董事长会客厅",iLink_B : webPath("cn/aboutcsn/08/index.html")}
			]},
			{iText_A : "帮助", id_A : "help_id", iLink_A : webPath("cn/help/index.html"),menus_B : [
				{iId_B:"1",iText_B : "航班信息",iLink_B : webPath("cn/help/index.html?t1"), menus_C : [
						{iId:"1",iText_C : "查询航班信息",iLink_C : "/cn/help/01/01.html"},
						{iId:"2",iText_C : "代码共享",iLink_C : "/cn/help/01/02.html"},
						{iId:"3",iText_C : "航班取消与变更",iLink_C : "/cn/help/01/03.html"},
						{iId:"4",iText_C : "手机服务",iLink_C : "/cn/help/01/04.html"},
						{iId:"5",iText_C : "南航机队",iLink_C : "/cn/help/01/05.html"}
				]},
				{iId_B:"2",iText_B : "网上预定服务",iLink_B : webPath("cn/help/index.html?t2"), menus_C : [
						{iId:"1",iText_C : "电子机票",iLink_C : "/cn/help/02/01.html"},
						{iId:"2",iText_C : "使用条件",iLink_C : "/cn/help/02/02.html"},
						{iId:"3",iText_C : "旅行保险",iLink_C : "/cn/help/02/03.html"},
						{iId:"4",iText_C : "网上支付",iLink_C : "/cn/help/02/04.html"},
						{iId:"8",iText_C : "E易行卡",iLink_C : "/cn/help/02/07.html"},
						{iId:"5",iText_C : "退票与变更",iLink_C : "/cn/help/02/05.html"},
						{iId:"6",iText_C : "网上订餐",iLink_C : "/cn/help/02/06.html"},
						{iId:"7",iText_C : "酒店预订",iLink_C : "/cn/help/02/08.html"},
						{iId:"9",iText_C : "度假预订",iLink_C : "/cn/help/02/09.html"}
				]},
				{iId_B:"3",iText_B : "办理登机手续",iLink_B : webPath("cn/help/index.html?t3"), menus_C : [
						{iId:"1",iText_C : "办理登机手续指南",iLink_C : "/cn/help/03/01.html"},
						{iId:"2",iText_C : "网上办理登机手续",iLink_C : "/cn/help/03/02.html"},
						{iId:"3",iText_C : "机场自助值机",iLink_C : "/cn/help/03/03.html"},
						{iId:"4",iText_C : "短信值机",iLink_C : "/cn/help/03/04.html"},
						{iId:"5",iText_C : "手机登机牌 ",iLink_C : "/cn/help/03/05.html"},
						{iId:"6",iText_C : "机场柜台办理登机",iLink_C : "/cn/help/03/06.html"}
				]},
				{iId_B:"4",iText_B : "机场服务",iLink_B : webPath("cn/help/index.html?t4"), menus_C : [
						{iId:"1",iText_C : "休息室",iLink_C : "/cn/help/04/01.html"},
						{iId:"2",iText_C : "登机",iLink_C : "/cn/help/04/02.html"},
						{iId:"3",iText_C : "到埠服务",iLink_C : "/cn/help/04/03.html"},
						{iId:"4",iText_C : "机场的主要交通",iLink_C : "/cn/help/04/04.html"},
						{iId:"5",iText_C : "航班延误或取消",iLink_C : "/cn/help/04/05.html"},
						{iId:"6",iText_C : "机场看板",iLink_C : "/cn/help/04/06.html"}
				]},
				{iId_B:"5",iText_B : "机上服务",iLink_B : webPath("cn/help/index.html?t5"), menus_C : [
						{iId:"1",iText_C : "南航的舱位分类及服务",iLink_C : "/cn/help/05/01.html"},
						{iId:"2",iText_C : "餐饮",iLink_C : "/cn/help/05/02.html"},
						{iId:"3",iText_C : "机上娱乐项目",iLink_C : "/cn/help/05/03.html"},
						{iId:"4",iText_C : "乘机保健须知",iLink_C : "/cn/help/05/04.html"},
						{iId:"5",iText_C : "工作与通讯",iLink_C : "/cn/help/05/05.html"},
						{iId:"6",iText_C : "杂志与报纸",iLink_C : "/cn/help/05/06.html"},
						{iId:"7",iText_C : "免税商品",iLink_C : "/cn/help/05/07.html"},
						{iId:"8",iText_C : "其他",iLink_C : "/cn/help/05/08.html"}
				]},
				{iId_B:"6",iText_B : "行李服务",iLink_B : webPath("cn/help/index.html?t6"), menus_C : [
						{iId:"1",iText_C : "行李服务指南",iLink_C : "/cn/help/06/01.html"},
						{iId:"2",iText_C : "免费行李托运配额",iLink_C : "/cn/help/06/02.html"},
						{iId:"3",iText_C : "随身携带行李须知",iLink_C : "/cn/help/06/03.html"},
						{iId:"4",iText_C : "超重及特殊行李",iLink_C : "/cn/help/06/04.html"},
						{iId:"5",iText_C : "动物",iLink_C : "/cn/help/06/05.html"},
						{iId:"6",iText_C : "危险物品",iLink_C : "/cn/help/06/06.html"},
						{iId:"7",iText_C : "责任与保险",iLink_C : "/cn/help/06/07.html"},
						{iId:"8",iText_C : "行李损坏或丢失",iLink_C : "/cn/help/06/08.html"},
						{iId:"9",iText_C : "遗失物品",iLink_C : "/cn/help/06/09.html"}
				]},
				{iId_B:"7",iText_B : "特殊旅客服务",iLink_B : webPath("cn/help/index.html?t7"), menus_C : [
						{iId:"1",iText_C : "无成人陪伴儿童",iLink_C : "/cn/help/07/01.html"},
						{iId:"2",iText_C : "婴儿",iLink_C : "/cn/help/07/02.html"},
						{iId:"3",iText_C : "病残旅客",iLink_C : "/cn/help/07/03.html"},
						{iId:"4",iText_C : "老人服务",iLink_C : "/cn/help/07/04.html"},
						{iId:"5",iText_C : "孕妇",iLink_C : "/cn/help/07/05.html"},
						{iId:"6",iText_C : "特殊餐食及其他 ",iLink_C : "/cn/help/07/06.html"}
				]},
				{iId_B:"8",iText_B : "明珠俱乐部",iLink_B : webPath("cn/help/index.html?t8"), menus_C : [
						{iId:"1",iText_C : "加入南航明珠俱乐部",iLink_C : "/cn/help/08/01.html"},
						{iId:"2",iText_C : "明珠里程账户管理",iLink_C : "/cn/help/08/02.html"},
						{iId:"3",iText_C : "南航明珠会员级别",iLink_C : "/cn/help/08/03.html"},
						{iId:"4",iText_C : "赢取南航明珠里程",iLink_C : "/cn/help/08/04.html"},
						{iId:"5",iText_C : "兑换南航明珠里程",iLink_C : "/cn/help/08/05.html"},
						{iId:"6",iText_C : "天合联盟",iLink_C : "/cn/help/08/06.html"},
						{iId:"7",iText_C : "南航明珠信用卡",iLink_C : "/cn/help/08/07.html"},
						{iId:"8",iText_C : "明珠里程有效期",iLink_C : "/cn/help/08/08.html"}
				]}
				//{iId_B:"9",iText_B : "95539短信",iLink_B : webPath("cn/95539")}
			]},
			{iText_A : "虚拟客服", id_A : "onlineserver", iLink_A : "javascript:ActiveAgent_Launch();"}
		]
	}

/*判断网站宽度*/
function checkWidth(){
	this.width=function(){
		var ww1=777;
		if(thisUrl.toLowerCase().indexOf("skypearl.cs")>-1){ww1=960} //skypearl
		if(thisUrl.toLowerCase().indexOf("airport.csair.com/cki")>-1){ww1=900} //airport
		if(thisUrl.toLowerCase().indexOf("sp.cs")>-1){ww1=960} //sp 2009-09-21
		return ww1;
	}
	//return width;
	this.world=function(){
		var ww2=570;
		if(thisUrl.toLowerCase().indexOf("skypearl.cs")>-1){ww2=735} //skypearl
		if(thisUrl.toLowerCase().indexOf("airport.csair.com/cki")>-1){ww2=690} //airport
		if(thisUrl.toLowerCase().indexOf("sp.cs")>-1){ww2=750} //sp 2009-09-21
		return ww2;
	}
	
}
var topWidth=new checkWidth;


/*创建header头部*/
function header(){
	var hdDiv_id = $C("div");
	hdDiv_id.id = "headerId";
	hdDiv_id.style.cssText="width:"+topWidth.width()+"px;padding:0 0 5px 0;line-height:1.5;font-size:12px;";
	
	var hdDiv = $C("div");
	addCssClass(hdDiv,"header");
	hdDiv.style.background = "url("+header_bg+")";
	hdDiv.style.height="78px"; 
	hdDiv.style.width=topWidth.width()+"px";
	hdDiv.style.position = "relative";
	hdDiv.style.margin="0 auto";
	hdDiv.style.backgroundRepeat="no-repeat";
	
	var langDiv = $C("div");
	langDiv.id = "languages";
	langDiv.style.cssText = "padding:5px 5px 5px 0;position:absolute;top:5px;left:"+topWidth.world()+"px";
	var a="h",b="ttp://www.",c="csair.com",gbUrl=a+b+c
	langDiv.innerHTML = "<kanhanbypass><a style='color:#fff;' href='"+gbUrl+"'>简体</a></kanhanbypass>&nbsp;&nbsp;<a style='color:#fff;' href='http://58.248.41.218:82/SuniT/www.csair.com/cn/index.asp'>繁體</a>&nbsp;&nbsp;<a style='color:#fff;' href='http://www.csair.com/urlResponse.asp?url=Languages01'>ENGLISH</a>&nbsp;&nbsp;<a style='color:#fff;' href='"+webPath("world/index.html")+"'>WORLD WIDE</a>";
	hdDiv.appendChild(langDiv);
	
	var logoLinkDiv = $C("div");
	logoLinkDiv.id = "logoLink";
	logoLinkDiv.style.cssText = "height:42px;border:0px solid #c1c1c1;position:absolute;top:24px;left:0px;width:266px;";
	logoLinkDiv.innerHTML = "<a href='"+webPath("cn/index.asp")+"'><span style='width:266px;height:42px;display:block;cursor:pointer;'></span></a>";
	hdDiv.appendChild(logoLinkDiv);
	
	var Main_menu = $C("div");
	Main_menu.id = "Main_menu";
	addCssClass(Main_menu,"clearfix");
	Main_menu.style.background = menu_bg;
	//Main_menu.style.width="777px";
	Main_menu.style.borderBottom = "#C9DEE1 1px solid";
	Main_menu.style.padding = "1px 5px 2px 5px";
	Main_menu.style.height = "18px";
	Main_menu.style.margin = "5px 0 0 0";
	var iM_ul = $C("ul");
	iM_ul.id = "iM_ul_id";
	iM_ul.style.listStyle = "none"; 
	iM_ul.style.margin = "0"; 
	iM_ul.style.padding = "0";
	iM_ul.style.styleFloat  = "right"; //for IE
	iM_ul.style.cssFloat  = "right"; //for FF
	iM_ul.style.position = "relative";
	iM_ul.style.zIndex = 2000;
	
	var ileft =-628;
	ihost==ibig5?ileft = -580:ileft = -628;
	
	for(i=0;i<iHeaderMenu.menus_A.length;i++){//一级菜单
		var iM_li = $C("li");
		iM_li.style.styleFloat  = "left"; //for IE
		iM_li.style.cssFloat  = "left"; //for FF
		iM_li.style.cursor = "pointer";
		iM_li.style.margin = "0";
		iM_li.style.padding = "0";
		iM_li.style.position = "absolute";
		iM_li.style.left = ileft+"px";
		iM_li.style.zIndex = 1800;
		ileft = ileft+79
		iM_li.style.top = "0";
		iM_li.id = iHeaderMenu.menus_A[i].id_A;
		
		var iM_a = $C("a");
		iM_a.innerHTML = iHeaderMenu.menus_A[i].iText_A;
		iM_a.href = iHeaderMenu.menus_A[i].iLink_A;
		iM_a.id = iHeaderMenu.menus_A[i].id_A+"BL";
		if(i==7){
			iM_a.style.width ="75px";
			iM_a.style.padding_right ="5px";
			iM_a.style.textAlign = "left";
			iM_a.style.background = "url("+webPath('cn/img/asia/bg_menu_1.jpg')+") top right no-repeat";
		}else{iM_a.style.width ="68px";iM_a.style.textAlign = "center";}
		iM_a.style.display = "block";
		iM_a.style.position = "absolute";
		iM_a.style.height = "20px";
		if(i==7&&ihost==ibig5){iM_a.style.display='none';iM_a.style.width ="0";}
		iM_li.appendChild(iM_a );
		
		iM_li.onmouseover = function (){//显示二级菜单
			if(!document.getElementById(this.id + "_b")){
			for(n=0;n<iHeaderMenu.menus_A.length;n++){
				if(iHeaderMenu.menus_A[n].id_A == this.id){
					if(iHeaderMenu.menus_A[n].menus_B){
						var iM_ul_b = $C("ul");
						iM_ul_b.id = this.id +"_b";
						if(n==0){
						iM_ul_b.style.cssText = "display:block;margin:0;padding:0;border:1px solid #78CFD9;background:#9DD5E2 url("+webPath('cn/img/asia/bg_menu_3.jpg')+") no-repeat;position:absolute;top:-1120px;z-index:1100;";	
						}else{
						iM_ul_b.style.cssText = "display:block;margin:0;padding:0;border:1px solid #78CFD9;background:#9DD5E2 url("+webPath('cn/img/asia/bg_menu_3.jpg')+") no-repeat;position:absolute;top:20px;z-index:1100;";}
						if(this.id == "abouccsn_id"){
							iM_ul_b.style.width = "99px";
						}else if(this.id == "help_id"){
							iM_ul_b.style.width = "99px";
						}else if(this.id == "favourable_id" || this.id == "skypearl_id"){
							iM_ul_b.style.width = "78px";
						}else{
							iM_ul_b.style.width = "87px"; 
						}
						iM_ul_b.style.padding = "5px";
						iM_ul_b.style.zIndex = 1100;
						for(k=0;k<iHeaderMenu.menus_A[n].menus_B.length;k++){
							var iM_li_b = $C("li");
							iM_li_b.style.styleFloat  = "left"; //for IE
							iM_li_b.style.cssFloat  = "left"; //for FF
							iM_li_b.style.cssText="display:inline;height:22px;line-height:22px;cursor:pointer;margin:0;padding:0 0 0 14px;text-align:left;width:78px;float:left;";
							var iM_a_b = $C("a");
							iM_a_b.innerHTML = iHeaderMenu.menus_A[n].menus_B[k].iText_B;
							iM_a_b.href = iHeaderMenu.menus_A[n].menus_B[k].iLink_B;
							if(iHeaderMenu.menus_A[n].menus_B[k].iText_B=="联盟伙伴"){
								iM_a_b.target = "_blank";	
							}
							iM_li_b.appendChild(iM_a_b );
							iM_ul_b.appendChild(iM_li_b);
						}
						if(!window.XMLHttpRequest){//IE6
							var menuIframe = $C('iframe');
							menuIframe.id = this.id+"ifra";
							menuIframe.name = this.id+"ifra";
							menuIframe.setAttribute('frameborder', '0', 0);
							menuIframe.style.top = "20px";
							if(this.id == "booking_id"){
								menuIframe.height = "200px";
								menuIframe.width = "100px"
							}else{
								if(n==0){
									menuIframe.height = "0px";
									menuIframe.width = "0px"
								}else{
									menuIframe.height = "100px";
									menuIframe.width = "100px"
								}
							}
							menuIframe.style.position = "absolute";
							menuIframe.style.index = 1090;
							document.getElementById(this.id).appendChild(menuIframe);
						}
						document.getElementById(this.id+"BL").style.border = "0px solid #005989";
						document.getElementById(this.id+"BL").style.borderBottom = "none";
						document.getElementById(this.id+"BL").style.background = "#669BB8 url("+webPath('cn/img/asia/bg_menu_2.jpg')+")  left center repeat-x";
						document.getElementById(this.id+"BL").style.display = "block";
						document.getElementById(this.id+"BL").style.color = "#D9242B";
						document.getElementById(this.id).appendChild(iM_ul_b);
					}
				}
			}
			}else{
				document.getElementById(this.id + "_b").style.display = "";	
				document.getElementById(this.id+"BL").style.border = "0px solid #005989";
				document.getElementById(this.id+"BL").style.borderBottom = "none";
				document.getElementById(this.id+"BL").style.background = "#669BB8 url("+webPath('cn/img/asia/bg_menu_2.jpg')+")  left center repeat-x";
				document.getElementById(this.id+"BL").style.display = "block";
				document.getElementById(this.id+"BL").style.color = "#D9242B";
				if(!window.XMLHttpRequest){//IE6
						document.getElementById(this.id+"ifra").style.display = "block";
				}
			}
		};
		iM_li.onmouseout = function (){//隐藏子菜单
			if(document.getElementById(this.id + "_b")){
					document.getElementById(this.id + "_b").style.display = "none";
					document.getElementById(this.id+"BL").style.border = "none";
					document.getElementById(this.id+"BL").style.background = "none";
					document.getElementById(this.id+"BL").style.display = "block";
					document.getElementById(this.id+"BL").style.color = "#fff";
					if(!window.XMLHttpRequest){//IE6
						document.getElementById(this.id+"ifra").style.display = "none";
					}
			}
		};
		
		iM_ul.appendChild(iM_li);
	}
	Main_menu.appendChild(iM_ul);
	
	hdDiv_id.appendChild(hdDiv);
	hdDiv_id.appendChild(Main_menu);
	
	if(bodybg){
		document.body.style.cssText = "background:#B2EFF0 url('"+bodybg+"') no-repeat top center;";
	}
	
	return hdDiv_id;
	
}

/*创建footer内容*/
function footer(){
	var ftDiv = $C("div");
	addCssClass(ftDiv,"footer");
	ftDiv.id = "footerId";
	ftDiv.style.cssText="text-align:center;padding:10px;";
	//ftDiv.style.width=topWidth.width();
	//ftDiv.style.background = "#EFF4F8 url("+webPath("/img/bg.jpg")+") 0 -553px"
	ftDiv.innerHTML = "<div class='footer'><a href='"+webPath('cn/aboutcsn/05/index.asp')+"'>投资者关系</a> | <a href='"+webPath('data/cn/booking/index.html')+"'>预订须知</a> | <a href='"+webPath('cn/rule/index.html')+"'>服务协议</a> | <a href='"+webPath('cn/rule/index.html?/data/cn/rule/005.html')+"'>隐私条款</a> | <a href='"+webPath('cn/contact/index.html')+"'>联系我们</a> | <a href='http://ec.csair.com/B2C/modules/feedback/feedbackIndex.html'>用户反馈</a><br />南航门户网站：<a href='"+webPath("cn/")+"' target='_blank'>www.csair.com</a> | 电子邮箱：webmaster@csair.com |   销售服务热线：95539 | 在线客服：<a title='有疑问点击联系在线客服' onclick='onlineService();' href='#'>QQ交谈</a> <a title='有疑问点击联系在线客服' onclick='onlineService2();' href='#'>网页交谈</a><br />Copyrights (C) 1997-<span id='CopyRightDate'>2010</span>中国南方航空股份有限公司 版权所有 不得转载 <br /> ICP经营许可编号:粤ICP备05053330号</div>";
	return ftDiv;
}
function onlineService(){
	window.open('http://b.qq.com/webc.htm?new=0&sid=800095539&o=中国南方航空&q=7', '_blank', 'height=502, width=644,toolbar=no,scrollbars=no,menubar=no,status=no');
}
function onlineService2(){//网友交谈
  window.open('http://b4.qq.com/webc.htm?new=0&sid=800095539&o=www.csair.com&q=1', '_blank', 'height=502, width=644,toolbar=no,scrollbars=no,menubar=no,status=no');
}
 
/*创建城市IFrame*/
function cityList(){
			if (!document.getElementById("showCityIframe")){
				var cityIframe=$C("iframe");
				cityIframe.id="showCityIframe";
				cityIframe.name="showCityIframe";
				cityIframe.className="iframeTextDropdown";
				cityIframe.style.padding = "0";
				cityIframe.style.display = "none";
				cityIframe.style.left = "0";
				cityIframe.style.top = "0";
				cityIframe.style.overflow = "hidden";
				cityIframe.style.position = "absolute";
				cityIframe.style.width = "222px";
				cityIframe.style.zIndex = 1010;
				cityIframe.src=webPath("citylist/city.html");
				cityIframe.setAttribute('frameborder','0',0); 
				document.body.appendChild(cityIframe);
			}
}

//----------------------------------------------------------

function setP(){
	if($("#middlerId").length<=0){
		var ibody = $("body").children();
		$("<div></div>").attr({"class":"middler clearfix","id":"middlerId"}).appendTo("body");
		ibody.appendTo("#middlerId");
	}
	var wrapperId = $("<div></div>").attr({"id":"wrapper"}).appendTo("body");
	publicTop();
	publicFoot();
	$("#publicTop").appendTo("#wrapper");
	$("#middlerId").appendTo("#wrapper");
	$("#publicBot").appendTo("#wrapper");
}

function publicTop(){
		var headDiv=document.getElementsByTagName('HEAD').item(0);
		var styleDiv=document.createElement('link');
		styleDiv.href=webPath('css/iMenu.css');
		styleDiv.rel='stylesheet';
		styleDiv.type='text/css';
		headDiv.appendChild(styleDiv);
	
		var topDiv = $C("div");
		topDiv.id = "publicTop";
		topDiv.style.width=topWidth.width()+"px";
		topDiv.style.marginRight="auto";
		topDiv.style.marginLeft="auto";
		document.body.appendChild(topDiv);
		
		var headhtml=new header();
		//alert(headhtml.hdDiv.style.width);
		topDiv.appendChild(headhtml);
		document.getElementById("headId")
}

function publicFoot(){
		var footHtml=new footer();
		footHtml.id = "publicBot";
		footHtml.style.marginRight="auto";
		footHtml.style.marginLeft="auto";
		footHtml.style.fontSize="12px";
		footHtml.style.width=topWidth.width()-20+"px";
		document.body.appendChild(footHtml);
}


/******************* online Server************************/
var IPCheck = "";

function ActiveAgent_Launch(question)
{
	var x = 744;
    var y = 50;
    var height = 2000;
    var width = 280;
    var parentHeight = 20000;
    var parentWidth = 744;
	var ActiveAgent_PageName = 'http://sms.csair.com/robot/OnlineAgent.html';

    var agentAlign = 'Right';
    
    if(question=='Save yourself a call and type your question here.')
    {
        question = null;
    }
    
	x = screen.availWidth - width;
	var ActiveAgent_AgentWindow = window.open(ActiveAgent_PageName, 'ActiveAgentCS', 'width='+width+'px,height='+height+'px,left='+x+',top='+y+',yes,scrollbars=no,menubar=no,resizable=yes,location=no,status=yes,titlebar=no,toolbar=no');
	
	LayoutParent(screen.availWidth - width, parentHeight, width, agentAlign);
	ActiveAgent_AgentWindow.focus();
};


function LayoutParent(agentParentWidth, agentParentHeight, agentWidth, agentAlign)
{
	var win = window;
	var w;
	var h;
	
	// set parent width
	if (agentParentWidth > 0 && agentParentWidth < screen.availWidth)
	{		
		w = agentParentWidth;
	}
	else
	{
		w = screen.availWidth-agentWidth;
	}
	
	// set parent height
	if (agentParentHeight > 0)
	{
		h = agentParentHeight;
		if (h > screen.availHeight)
		{
			h = screen.availHeight;
		}
	}
	else
	{
		h = screen.availHeight;
	}
	
	
	var left;
	if (agentAlign == 'Right') // Leave space on left or right side?
	{
		left = 0;
	}
	else
	{
		// figure agent window overlap if there's not enough width for both
		if (agentWidth + parseInt(w) > screen.availWidth)
		{
			left = screen.availWidth - w;
		}
		else
		{
			left = agentWidth;
		}
	}
	try
	{
		win.moveTo(0,0); // This helps it work better when it's maximized... (IE seems to get confused sometimes)
		win.resizeTo(w,h);
		win.moveTo(left, 0);

	}
	catch(e) // Permission denied? Happens if we change out of our domain, we should make sure it doesn't happen in any other situation, or comment out throw below
	{
		//if (e.message.indexOf('denied') == -1) // if not permission denied, throw the error
		if ( e.message )
		{
			if(e.message.indexOf('denied') == -1)
			{
				throw e;
			}
		}
		else
		{
			if( e.toString().indexOf('denied') == -1 )
			{
				throw e;
			}
		}
	}
};