﻿/*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
 */

/*定义全局路径*/
var thisUrl = document.URL + window.location.search;
var thisdomain = document.domain;
var domain="http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://";
var rooturl = domain+"www.csair.com/";
var haiwai = domain+"www.flychinasouthern.com";
var b2curl = domain+"ec.csair.com";
var b2cmiao = domain+"miao.csair.com";
if(thisdomain == "www.test.csair.com" || thisdomain == "ec.test.csair.com" || thisdomain.indexOf("10.")>=0 || thisdomain == "www.qa.flychinasouthern.com") {
	rooturl = domain+"www.test.csair.com:8081/";
	haiwai = domain+"www.qa.flychinasouthern.com";
	b2curl = domain+"ec.test.csair.com";
	b2cmiao = domain+"10.108.108.73";
}else if(thisdomain == "big5.csair.com"){
	rooturl = domain+"big5.csair.com/SuniT/www.csair.com/";
}else{}

function webPath(url) {
	var allstr = rooturl + url;
	return allstr;
}
function webPath_b2c(url) {
	var allstr = b2curl + url;
	return allstr;
}
function webPath_haiwai(url) {
	var allstr = haiwai + url;
	return allstr;
}
function webPath_b2cmiao(url) {
	var allstr = b2cmiao + url;
	return allstr;
}
/*end定义全局路径*/

/*节日背景图片*/
var bodybg = "background:#fff url('"+webPath('topAndFoot/bg_festival.jpg')+"') no-repeat top center;";
/*header节日背景图片*/
var header_bg = webPath('topAndFoot/logo_festival.jpg');

/*非节日背景*/
//var bodybg = "background:#fff url('"+webPath('topAndFoot/bg.jpg')+"') no-repeat top center;";
/*header背景图片*/
//var header_bg = webPath('topAndFoot/logoo.jpg');

var header_bg = webPath('');

/*头部菜单背景*/
//var menu_bg = "#D7F4F9 url("+webPath('cn/img/asia/bg_menu_0.jpg')+") left center repeat-x";
var menu_bg = "#D7F4F9 url("+webPath('cn/img/asia/bg_menu_0.jpg')+") left center repeat-x";

/*语言菜单链接颜色 深蓝色：#001D55 白色：#fff 深红色：#E60021 黑色：#333*/
var language_links = "#fff";

/*繁体版隐藏*/
ihost = window.location.host;
ibig5 = "big5.csair.com";

/*打开IE6页面缓存*/
(function(){
    try{
        var userAgent = navigator.userAgent.toLowerCase();
        var env = null;
        var ver = 0;
        env = userAgent.match(/msie ([\d.]+)/);ver = env ? parseInt(env[1], 10) : 0;
        if(ver == 6){
            try{ 
            	document.execCommand("BackgroundImageCache", false, true);
            }catch(e){}
        }
    }catch(e){}
})();

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.shtml")},
			{iText_A : "预订管理", id_A : "booking_id", iLink_A : webPath("cn/index.shtml"), menus_B : [
				{iId_B:"1",iText_B : "机票预订",tInfo : "预订南航航班，畅飞全国各地" ,iLink_B : webPath("cn/index.shtml")},
				{iId_B:"2",iText_B : "酒店预订",tInfo : "预订南航酒店，让您的旅行也有家一般的温暖",iLink_B : "http://hotel.csair.com"},
				{iId_B:"3",iText_B : "度假预订",tInfo : "南航伴您轻松度假",iLink_B : "http://hotel.csair.com/vacation"},
				{iId_B:"4",iText_B : "餐饮预订",tInfo : "预订餐饮，让您体验更好服务",iLink_B : "http://hvp.csair.com/food/app"},
				{iId_B:"10",iText_B : "座位预留",tInfo : "提前预留，让旅程更舒心",iLink_B : webPath_b2c("/B2C/modules/customservice/ASRLogin.jsp")},
				{iId_B:"5",iText_B : "办理登机牌",tInfo : "在线登机，让您更便捷更轻松",iLink_B : "http://airport.csair.com/cki/app"},
				{iId_B:"6",iText_B : "客票验证",tInfo : "验证您的机票，让您放心旅行",iLink_B : "http://etkt.csair.com/CheckTicket/modules/checkTicket/checkTicket.jsp"},
				{iId_B:"8",iText_B : "改退票",tInfo : "网上办理改退票，让您放心旅行",iLink_B : webPath("cn/booking/08/index.html")},
				{iId_B:"9",iText_B : "行李查询",tInfo : "在线查询您的行李位置" ,iLink_B : "http://airport.csair.com/outbaggage/app"}
			]},
			{iText_A : "优惠信息", id_A : "favourable_id", iLink_A : webPath("cn/favourable/01/index.html"), menus_B : [
				{iId_B:"1",iText_B : "优惠机票",tInfo : "预订优惠机票，让您的旅行更经济",iLink_B : webPath("cn/favourable/01/01/index.html")},
				{iId_B:"2",iText_B : "促销活动",tInfo : "参与促销活动，享受南航的特惠",iLink_B : webPath("cn/favourable/01/index.html")},
				/*{iId_B:"3",iText_B : "秒杀专区",tInfo : "定期低价机票销售",iLink_B : "http://miao.csair.com/SecKill/seckill/seckill.html"},*/
				{iId_B:"4",iText_B : "E-易行卡",tInfo : "选择E-易行卡，享受折上折优惠",iLink_B : webPath("cn/aboutcsn/04/newsSale/2010/20100702/20100702_0.html")},
				{iId_B:"5",iText_B : "南航行",tInfo : "纵横中国、真情关爱2011等",iLink_B : webPath("cn/favourable/02/index.html")},
				{iId_B:"6",iText_B : "尊享假期",tInfo : "南航为您精心打造经济假期",iLink_B : "http://hotel.csair.com/vacation/"},
				{iId_B:"7",iText_B : "RSS订阅",tInfo : "第一时间接收到最新的网上促销信息",iLink_B : webPath("cn/favourable/04/index.html")},
				{iId_B:"8",iText_B : "Widget下载",tInfo : "桌面购票终端软件，让您购票更加方便、快捷",iLink_B : webPath("cn/favourable/05/widget/widget.html")}
			]},
			{iText_A : "出行向导", id_A : "tour_id", iLink_A : webPath("cn/tourguide/index.html"), menus_B : [
			    {postion_b:"1",iId_B:"1",iText_B : "出行前准备",tInfo : "了解您出行前需要做好哪些准备",iLink_B : webPath("cn/tourguide/before_ready/index.html")},
				{postion_b:"2",iId_B:"2",iText_B : "机场服务",tInfo : "查询机场的各种服务信息",iLink_B : webPath( "cn/tourguide/airport_service/index.html")},
				{postion_b:"3",iId_B:"3",iText_B : "机上服务",tInfo : "查看机上餐饮、机上娱乐、机舱特色等信息",iLink_B : webPath("cn/tourguide/flight_service/index.html")},
				{postion_b:"4",iId_B:"4",iText_B : "行李服务",tInfo : "查看随身携带、托运行李服务信息",iLink_B : webPath("cn/tourguide/luggage_service/index.html")},
				{postion_b:"5",iId_B:"5",iText_B : "航班信息",tInfo : "查询您关注的航班最新信息",iLink_B : webPath("cn/tourguide/flight_info/index.html")},
				{postion_b:"6",iId_B:"6",iText_B : "办理乘机手续",tInfo : "查看办理乘机手续的方式及方法体验",iLink_B : webPath("cn/tourguide/Check-in_Procedures/index.html")},
				{postion_b:"6",iId_B:"6",iText_B : "体验南航",tInfo : "感受南航为您带来更多完美体验",iLink_B : webPath("cn/tour/05/index.html?par_1=tour_id&par_2=7")}
			]},
			{iText_A : "明珠会员", id_A : "skypearl_id", iLink_A : "http://skypearl.csair.com/cn/index.html", menus_B : [
				{iId_B:"1",iText_B : "关于明珠",tInfo : "了解成为明珠会员的各种优惠信息",iLink_B : "http://skypearl.csair.com/cn/aboutUs.html"},
				{iId_B:"2",iText_B : "里程积累",tInfo : "查询您的里程累积情况",iLink_B : "http://skypearl.csair.com/cn/air1.html"},
				{iId_B:"3",iText_B : "里程兑换",tInfo : "使用累积的里程，兑换免票",iLink_B : webPath_b2c("/B2C/modules/order/ffpticket/searchIndex.jsp")},
				{iId_B:"4",iText_B : "短信专区",tInfo : "查询会员的各种短信服务",iLink_B : "http://skypearl.csair.com/cn/pdaAbout.html"},
				{iId_B:"5",iText_B : "会员快讯",tInfo : "第一时间了解会员的各种资讯",iLink_B : "http://skypearl.csair.com/cn/index_4.html"},
				{iId_B:"5",iText_B : "合作伙伴",tInfo : "了解南航合作伙伴，累积里程",iLink_B : "http://skypearl.csair.com/cn/cooperation.html"},
				{iId_B:"5",iText_B : "南航明珠信用卡",tInfo : "了解南航明珠信用卡，您可一卡多用",iLink_B : "http://skypearl.csair.com/cn/visa.html"}
			]},
			/*{iText_A : "企业用户", id_A : "corporateclient", iLink_A :"http://ec.csair.com/B2C/modules/minorenterprises/login.jsp"},*/
			{iText_A : "常见问题", id_A : "help_id", iLink_A : webPath("cn/help/index.html"),menus_B : [
				{iId_B:"1",iText_B : "航班信息",tInfo : "代码共享、航班取消与变更等",iLink_B : webPath("cn/help/01/01.html"), 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 : "网上预订服务",tInfo : "电子客票、使用条件、退票与变更、酒店预订等",iLink_B : webPath("cn/help/02/01.html"), 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:"11",iText_C : "促销代码",iLink_C : "/cn/help/02/11.html"},
						{iId:"10",iText_C : "支付商折扣代码",iLink_C : "/cn/help/02/10.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:"12",iText_C : "企业用户",iLink_C : "/cn/help/02/corporateclient.html"},
						{iId:"13",iText_C : "座位预留",iLink_C : "/cn/help/02/12.html"}
				]},
				{iId_B:"3",iText_B : "办理登机手续",tInfo : "办理登机指南、短信值机、机场自助值机等",iLink_B : webPath("cn/help/03/01.html"), 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 : "机场服务",tInfo : "休息室、登机、机场的主要交通等",iLink_B : webPath("cn/help/04/01.html"), 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 : "机上服务",tInfo : "舱位分类及服务、机上娱乐项目等",iLink_B : webPath("cn/help/05/01.html"), 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 : "行李服务",tInfo : "免费行李托运配额、超重及特殊行李等",iLink_B : webPath("cn/help/06/01.html"), 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 : "特殊旅客服务",tInfo : "无成人陪伴儿童、病残旅客、老人、孕妇服务等",iLink_B : webPath("cn/help/07/01.html"), 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 : "明珠俱乐部",tInfo : "会员级别、里程有效期、免票规则等",iLink_B : webPath("cn/help/08/01.html"), 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:"9",iText_C : "奖励机票兑换受让人规则",iLink_C : "/cn/help/08/09.html"}
				]}
			]},
			{iText_A : "虚拟客服", id_A : "onlineserver", iLink_A : "javascript:ActiveAgent_Launch();"},
			{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.shtml")},
				{iId_B:"5",iText_B : "投资者关系",iLink_B : webPath("cn/aboutcsn/05/index.shtml")},
				{iId_B:"11",iText_B : "南航货运",iLink_B :  webPath("cn/aboutcsn/011/index.html")},
				{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")}
			]}
		]
	}

/*判断网站宽度*/
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=530;
		if(thisUrl.toLowerCase().indexOf("skypearl.cs")>-1){ww2=695} //skypearl
		if(thisUrl.toLowerCase().indexOf("airport.csair.com/cki")>-1){ww2=650} //airport
		if(thisUrl.toLowerCase().indexOf("sp.cs")>-1){ww2=710} //sp 2009-09-21
		return ww2;
	}
	
}
var topWidth=new checkWidth;


/*创建header头部*/
function header(){
	var hdDiv_id = $C("div");
	hdDiv_id.id = "headerId";
	// 撤下A380广告后应该恢复为 5px 的 padding-bottom
	//hdDiv_id.style.cssText="width:"+topWidth.width()+"px;padding:0 0 5px 0;line-height:1.5;font-size:12px;";
	hdDiv_id.style.cssText="width:"+topWidth.width()+"px;padding: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.zIndex = 5000;
	hdDiv.style.backgroundRepeat="no-repeat";
	
	var langDiv = $C("div");
	langDiv.id = "languages";
	//alert(topWidth.world())
	langDiv.style.cssText = "padding:5px 0px 5px 0;position:absolute;top:5px;right:0px;z-index:5001;";
	var a="h",b="ttp://www.",c="csair.com",gbUrl=a+b+c

	
	var langul = $C("ul");
	 langul.style.cssText="list-style:none; margin:0;padding:0;position:relative;z-index:5002;";
	 var langli = $C("li");
	 langli.style.cssText="cursor:pointer;margin:0;padding:0;position:absolute;text-align:center;position:relative;font-weight:normal;z-index:5003;";
	 
	 var jfti = "简体中文";
	 if(thisdomain=="big5.csair.com"){
		 jfti = "繁體中文";
	 }
	 var langcn = $C("a");
	 langcn.href="#";
	 langcn.style.cssText="padding:3px 5px 3px 25px;float:left;position:relative;color:"+language_links+";display:block;z-index:5004;"
	 langcn.innerHTML = "<span style=''>"+jfti+"<img style='margin-left: 2px;vertical-align: middle;' src='"+webPath('topAndFoot/more_top.gif')+"'></span>";
	 langli.appendChild(langcn);
	 langli.onmouseover = function (){
		 if(!document.getElementById("langCont")){
		 var langContainer = $C("div");
		 langContainer.id = "langCont";
		 langContainer.style.zIndex = 5005;
		 //langContainer.style.cssText="z-index:5103";
		 langContainer.className = "langCont";
         langContainer.innerHTML = "<div class='leftPanel'><label class='panelTitle'>Your country</label><form name='langForm' id='langForm' method='POST' action='"+haiwai+"/index.php?SO_SITE_OFFICE_ID=HKGCZ12TK'><input name='lang' type='hidden' value=''/><select style='z-index:6103' name='country' id='country' onchange='countryClick(this);' size='6'><option value='Australia'>Australia</option><option value='Austria'>Austria</option><option value='Azerbaijan'>Azerbaijan</option><option value='Belgium'>Belgium</option><option value='Cambodia'>Cambodia</option><option value='China' selected>China</option><option value='Denmark'>Denmark</option><option value='Finland'>Finland</option><option value='France'>France</option><option value='Germany'>Germany</option><option value='Greece'>Greece</option><option value='Italy'>Italy</option><option value='Iran'>Iran</option><option value='India'>India</option><option value='Indonesia'>Indonesia</option><option value='Japan'>Japan</option><option value='Krygyzstan'>Krygyzstan</option><option value='Malaysia'>Malaysia</option><option value='Myanmar'>Myanmar</option><option value='Netherlands'>Netherlands</option><option value='Nigeria'>Nigeria</option><option value='Pakistan'>Pakistan</option><option value='peru'>Peru</option><option value='Philippines'>Philippines</option><option value='Poland'>Poland</option><option value='Portugal'>Portugal</option><option value='Russia'>Russia</option><option value='Saudi Arabia'>Saudi Arabia</option><option value='Scotland'>Scotland</option><option value='Singapore'>Singapore</option><option value='South Korea'>South Korea</option><option value='Spain'>Spain</option><option value='Sweden'>Sweden</option><option value='Switzerland'>Switzerland</option><option value='Tajikistan'>Tajikistan</option><option value='Thailand'>Thailand</option><option value='Turkmenistan'>Turkmenistan</option><option value='United Arab Emirates'>United Arab Emirates</option><option value='United States'>United States</option><option value='United Kingdom'>United Kingdom</option><option value='Uzberkistan'>Uzberkistan</option><option value='Vietnam'>Vietnam</option></select></form></div><div class='langspacer' ><!--tt-->&nbsp;</div><div class='rightPanel'><label class='panelTitle'>Your language</label><div style='height: 120px;'><ul class='sublangul'><li><a href='#' id='enlang' onclick='langClick(this)'>English</a></li><li style='display:none;' ><a href='#' id='frlang' onclick='langClick(this)'>Français</a></li><li style='display:none;' ><a href='#' id='nllang' onclick='langClick(this)'>Netherlands</a></li><li style='display:none;' ><a href='#' id='krlang' onclick='langClick(this)'>&#54620;&#44397;&#50612;</a></li><li style='display:none;' ><a href='#' id='jplang' onclick='langClick(this)'>日本語</a></li><li><a href='#' id='scnlang' onclick='langClick(this)'>简体中文</a></li><li><a href='#' id='tcnlang' onclick='langClick(this)'>繁體中文</a></li></ul></div></div>";
	 	 langli.appendChild(langContainer);
		 }else{
			 document.getElementById("langCont").style.display = "";
	     }
		 langcn.style.cssText="border-top:1px solid #6BADE1;border-left:1px solid #6BADE1;border-right:1px solid #6BADE1;top:1px;padding:3px 5px 3px 25px;position:relative;color:"+language_links+";display:block;z-index:5006;"
	 }
	 langli.onmouseout = function (){
		 try{
		 document.getElementById("langCont").style.display = "none";
		 langcn.style.cssText="padding:3px 5px 3px 25px;float:left;position:relative;color:"+language_links+";display:block;z-index:5004;"
		 }catch(err){}
	 }
	 langul.appendChild(langli);
	 langDiv.appendChild(langul);
	 
	 var phoneDiv=$C("div");
	 phoneDiv.id="phoneClient"
	 phoneDiv.style.cssText="padding:3px 5px 3px 18px;position:absolute;right:95px;top:9px;_top:6px;line-height:20px;*line-height:25px;display:block;z-index:5004;";
	 phoneDiv.innerHTML="<a href='"+webPath_b2c('/B2C/Mobile/download.jsp')+"' style='color:#fff;'>手机客户端</a>";

	 hdDiv.appendChild(langDiv);
	 
 	 hdDiv.appendChild(phoneDiv);
	
	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.shtml")+"'><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.borderBottom = "#C9DEE1 1px solid";
	Main_menu.style.padding = "1px 5px 2px 80px";
	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  = "left"; //for IE
	iM_ul.style.cssFloat  = "left"; //for FF
	iM_ul.style.position = "relative";
	iM_ul.style.zIndex = 2000;
	
	var ileft =0;
	ihost==ibig5?ileft = 0:'';
	
	var subleft = -175;
	
	/*未加入企业客户之前*/
	//var ileft =-628;
	//ihost==ibig5?ileft = -580:'';

	
	for(i=0;i<iHeaderMenu.menus_A.length;i++){//一级菜单
		if(iHeaderMenu.menus_A[i].id_A=="abouccsn_id"||iHeaderMenu.menus_A[i].id_A=="help_id"){}else{
		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.textAlign="center";
		iM_li.style.position = "relative";
		//iM_li.style.lineHeight = "21px";
		iM_li.style.left = ileft+"px";
		iM_li.style.zIndex = 1800;
		
		/*
		if(iHeaderMenu.menus_A[i].id_A=="booking_id"){
			ileft = ileft+100;
		}else if(iHeaderMenu.menus_A[i].id_A=="favourable_id"){
			ileft = ileft+100;
		}else if(iHeaderMenu.menus_A[i].id_A=="tour_id"){
			ileft = ileft+100;
		}else if(iHeaderMenu.menus_A[i].id_A=="skypearl_id"){
			ileft = ileft+100;
		}else{ileft = ileft+100;}
		*/
		
		ileft = ileft+100;
		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;
		if(iHeaderMenu.menus_A[i].id_A=="onlineserver"){
			iM_a.href = iHeaderMenu.menus_A[i].iLink_A;
		}else{
		iM_a.href = iHeaderMenu.menus_A[i].iLink_A+"?par_1="+iHeaderMenu.menus_A[i].id_A;	
		}
		iM_a.id = iHeaderMenu.menus_A[i].id_A+"BL";
		/*if(iHeaderMenu.menus_A[i].id_A=="favourable_id"||iHeaderMenu.menus_A[i].id_A=="skypearl_id"){
			iM_a.style.cssText = "width:100px;";
		}else{iM_a.style.width ="100px";iM_a.style.textAlign = "center";}*/
		iM_a.style.cssText = "width:100px;text-align:center;display:block;position:absolute;height:20px;";
		if(iHeaderMenu.menus_A[i].id_A=="onlineserver"&&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";
						iM_ul_b.style.cssText = "display:block;margin:0;padding:10px 0px 0px 10px;border:1px solid #6BADE1;background:#fff;position:absolute;top:20px;z-index:1100;cursor:default; background:url("+webPath('topAndFoot/bg-menu-skytrax.jpg')+") repeat-x;";
						if(n==2){
						   subleft = -280;
						}else if(n==3){
						   subleft = -380;	
						}else if(n==4){
						   subleft = -480;	
						}else if(n==6){
						   subleft = -580;		
						}else{subleft = -180;}
						iM_ul_b.style.left = subleft+"px";
						iM_ul_b.style.width = "765px"; 
						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:60px;line-height:16px;cursor:default;margin:0;padding:0 15px;text-align:left;width:123px;float:left; background:url("+webPath('topAndFoot/pagelink_hover.gif')+") no-repeat left 5px;"
							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+"?par_1="+iHeaderMenu.menus_A[n].id_A+"&par_2="+iHeaderMenu.menus_A[n].menus_B[k].iId_B;
							iM_a_b.style.cssText="font-weight:bold;";
							if(iHeaderMenu.menus_A[n].menus_B[k].iText_B=="联盟伙伴"){
								iM_a_b.target = "_blank";	
							}
							
							if(iHeaderMenu.menus_A[n].menus_B[k].iText_B=="业绩发布会"){
								iM_a_b.target = "_blank";	
							}
							
							iM_li_b.appendChild(iM_a_b );
							
							/*if(iHeaderMenu.menus_A[n].menus_B[k].iText_B=="体验南航"){
								new_s = $C("span");
								new_s.style.color="red";
								new_s.innerHTML=" New"
								iM_li_b.appendChild(new_s);
							}*/
							
							var iM_p_b = $C("p");
							iM_p_b.innerHTML = iHeaderMenu.menus_A[n].menus_B[k].tInfo;
							iM_p_b.style.cssText="font-weight:normal; color:#333;margin:0;padding:0;text-align:left;text-indent:0;";
							iM_a_b.appendChild(iM_p_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);
							if(n==2){
							   subleft = -185;
							}else if(n==3){
							   subleft = -305;	
							}else if(n==4){
							   subleft = -395;	
							}else if(n==6){
							   subleft = -595;		
							}else{subleft = -85;}
							menuIframe.style.left = subleft+"px";
							menuIframe.style.top = "20px";
							if(n==0){
								menuIframe.height = "0px";
								menuIframe.width = "0px"
							}else{
								menuIframe.height = "130px";
								menuIframe.width = "680px"
							}
							menuIframe.style.position = "absolute";
							menuIframe.style.index = 1090;
							document.getElementById(this.id).appendChild(menuIframe);
						}
						document.getElementById(this.id+"BL").style.border = "1px solid #6BADE1";
						document.getElementById(this.id+"BL").style.borderBottom = "none";
						document.getElementById(this.id+"BL").style.background = "url("+webPath('topAndFoot/bg-menu-skytrax.jpg')+") repeat-x";
						document.getElementById(this.id+"BL").style.display = "block";
						document.getElementById(this.id+"BL").style.color = "#D9242B";
						document.getElementById(this.id+"BL").style.zIndex = "1111";
						document.getElementById(this.id).appendChild(iM_ul_b);
					}
				}
			}
			}else{
				document.getElementById(this.id + "_b").style.display = "";	
				document.getElementById(this.id+"BL").style.border = "1px solid #6BADE1";
				document.getElementById(this.id+"BL").style.borderBottom = "none";
				document.getElementById(this.id+"BL").style.background = "url("+webPath('topAndFoot/bg-menu-skytrax.jpg')+") repeat-x";
				document.getElementById(this.id+"BL").style.display = "block";
				document.getElementById(this.id+"BL").style.color = "#D9242B";
				document.getElementById(this.id+"BL").style.zIndex = "1111";
				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 = bodybg;
	}
	
	return hdDiv_id;
	
}

/*pop提示信息 2010-12-24*/
function closepop(){document.getElementById("poptips_id").style.display = "none";}

/*创建footer内容*/
function footer(){
	var ftDiv = $C("div");
	addCssClass(ftDiv,"footer");
	ftDiv.id = "footerId";
	ftDiv.style.cssText="text-align:center;padding:13px 10px 10px;";
	if(thisUrl.toLowerCase().indexOf("www.csair.com/cn/index.shtml")>0||thisUrl.toLowerCase().indexOf("csair.com:8081/cn/index.shtml")>0||thisUrl.toLowerCase().indexOf("skypearl.csair.com")>0){salephone="95539";hotline="销售服务热线";}else{salephone="4006695539";hotline="南航网站服务专线";} 
	//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/index.html?par_1=abouccsn_id')+"'>关于南航</a> | <a href='"+webPath('cn/aboutcsn/05/index.shtml?par_1=abouccsn_id&par_2=5')+"'>投资者关系</a> | <a target=_blank href=http://www.csair.cn>南航集团</a> | <a href='"+('http://cargo.csair.com/cn/index.asp ')+"' target='_blank'>南航货运</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/help/index.html?par_1=help_id')+"'>常见问题</a> | <a href='"+webPath('cn/contactus/contactus.html')+"'>联系我们</a> | <a href='http://ec.csair.com/B2C/modules/feedback/feedbackIndex.html'>用户反馈</a> | <a href='http://t.sina.com.cn/csair' style='background:url("+webPath('topAndFoot/sina_t.png')+") no-repeat right top;padding-right:18px; padding-top:10px;' target='_blank'>南航微博</a><br />南航门户网站：<a href='"+webPath("cn/")+"' target='_blank'>www.csair.com</a> | 电子邮箱：webmaster@csair.com |   "+hotline+"："+salephone+" | 在线客服：<a title='有疑问点击联系在线客服' onclick='onlineService();' href='#'>QQ交谈</a> <a title='有疑问点击联系在线客服' onclick='onlineService2();' href='#'>网页交谈</a><br />Copyrights (C) 1997-<span id='CopyRightDate'>2012</span>中国南方航空股份有限公司 版权所有 不得转载</div><div style='padding-top:10px;'><a href='http://search.cxwz.org/cert/l/CX20111018000617000625' target='_blank' style='padding-right:15px;'><img src='"+webPath('topAndFoot/cxzz.png')+"' /></a><a href='http://www.miibeian.gov.cn/state/outPortal/loginPortal.action' target='_blank'><img src='"+webPath('topAndFoot/icp3330.png')+"' /></a></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;
			}
		}
	}
};

function setCookie(sName, sValue, oExpires, sPath, sDomain, bSecure) {
	/*
	sName:cookie名
	sValue:cookie值
	oExpires:cookie保存天数，即多少天过期
	sPath:cookie保存路径
	sDomain:cookie域名
	bSecure:
	*/
	var sCookie = sName + "=" + encodeURIComponent(sValue);
	if(oExpires){
		var Days = oExpires;   //cookie 将被保存天数
    	var iepx  = new Date();//获得当前时间
    	iepx.setTime(iepx.getTime()+Days*24*60*60*1000);//换成毫秒
		sCookie+=";expires="+iepx.toGMTString();
	}else{
		var Days = 180;   //cookie 将被保存天数
    	var iepx  = new Date();//获得当前时间
    	iepx.setTime(iepx.getTime()+Days*24*60*60*1000);//换成毫秒
		sCookie+=";expires="+iepx.toGMTString();
	}
	if(sPath){sCookie+=";path="+sPath;}
	if(sDomain){sCookie+=";domain="+sDomain;}
	if(bSecure){sCookie+=";secure";}
	document.cookie = sCookie;
}

function getCookie(sName){
	var sRE = "(?:; )?" + sName + "=([^;]*);?";
	var oRE = new RegExp(sRE);
	if (oRE.test(document.cookie)){
		return decodeURIComponent(RegExp["$1"]);
	}else{
		return null;
	}
}

function setCookieHrefUrl(this_a){
	var ithis_a = this_a.id;
	if(ithis_a=="jianti_w"){
	setCookie("mycsairsite", "jianti", "", "/", "csair.com", "");
	window.location.href=webPath('cn/index.shtml');
	}
	if(ithis_a=="fanti_w"){
	setCookie("mycsairsite", "fanti", "", "/", "csair.com", "");
	window.location.href='http://big5.csair.com/SuniT/www.csair.com/cn/index.shtml';
	}
	if(ithis_a=="english_w"){
	setCookie("mycsairsite", "english", "", "/", "csair.com", "");
	window.location.href='http://www.csair.com/urlResponse.asp?url=Languages01';
	}
	if(ithis_a=="world_w"){
	setCookie("mycsairsite", "world", "", "/", "csair.com", "");
	window.location.href=webPath("world/index.html");
	}
}

// when user visit www.csair.com, we'll need this function to set the language choosen by user
function setLang(lang){
	var xmlhttp;
	if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
  		xmlhttp=new XMLHttpRequest();
  	}
	else
  	{// code for IE6, IE5
  	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  	}
  	xmlhttp.open('GET',"/setlang.aspx?lang="+lang, false);
  	xmlhttp.send();
        //alert(xmlhttp.responseText);
}

function callSetLang(i){
    if(i==1){
      setLang('cn');
    }
    if(i==2){
      setLang('tw');
    }
    if(i==3){
      setLang('den');
    }
}

function countryClick(obj){
    var country = obj.value;
    if(!country){
      return;
    }
    
    var cnt = country.toLowerCase();
    var frlang = document.getElementById('frlang');
    var enlang = document.getElementById('enlang');
    var nllang = document.getElementById('nllang');
    var jplang = document.getElementById('jplang');
    var krlang = document.getElementById('krlang');
    frlang.parentNode.style.display = "";
    enlang.parentNode.style.display = "";
    nllang.parentNode.style.display = "";
    jplang.parentNode.style.display = "";
    krlang.parentNode.style.display = "";
    if(cnt=="japan"){
      frlang.parentNode.style.display = "none";
      nllang.parentNode.style.display = "none";
      krlang.parentNode.style.display = "none";    
    }else if(cnt=="south korea"){
      frlang.parentNode.style.display = "none"; 
      jplang.parentNode.style.display = "none"; 
      nllang.parentNode.style.display = "none"; 
    }else if(cnt=="france"){
      nllang.parentNode.style.display = "none"; 
      jplang.parentNode.style.display = "none"; 
      krlang.parentNode.style.display = "none"; 
    }else if(cnt=="netherlands"){
      jplang.parentNode.style.display = "none"; 
      krlang.parentNode.style.display = "none"; 
      frlang.parentNode.style.display = "none"; 
    }else{
      frlang.parentNode.style.display = "none";
      nllang.parentNode.style.display = "none";
      krlang.parentNode.style.display = "none"; 
      jplang.parentNode.style.display = "none"; 
    }
}
function langClick(obj){
	var country = document.getElementById("country").value;
	var url = "";
    var lang = obj.id;
    var langInput = document.getElementsByName("lang")[0];
    if(!lang){
      return;
    }
    if(lang=="enlang"){
      langInput.value = "en";
	  if(country && country == "China"){
		url = "http"+"://"+"www.csair.com/en/index.shtml";
		//url = webPath('en/index.shtml');
	  }
    }
    if(lang=="frlang"){
      langInput.value = "fr";
    }
    if(lang=="jplang"){
      langInput.value = "jp";
    }
    if(lang=="nllang"){
      langInput.value = "nl";
    }
    if(lang=="krlang"){
      langInput.value = "kr";
    }
    if(lang=="scnlang"){
      langInput.value = "scn";
	  if(country && country == "China"){
		url = "http"+"://"+"www.csair.com/cn/index.shtml";
	  }
    }
    if(lang=="tcnlang"){
      langInput.value = "tcn";
	  if(country && country == "China"){
		url = "http"+"://"+"big5.csair.com/SuniT/www.csair.com/cn/index.shtml";
	  }
    }
	if(country && country == "China"){
		window.location.href = url;
	}else{
		document.getElementById("langForm").submit();  
	}
}
function showLangsBox(obj){
	var lang_cont = document.getElementById("langCont");
	if(lang_cont.style.display && lang_cont.style.display!="none"){
		lang_cont.style.display="none";
	}else{
		lang_cont.style.display="block";
	}
}

/*webtrends analytics*/
setTimeout('setwtid()',0);
    function setwtid(){
    if (typeof(initime) != "undefined") var initime = new Date().getTime();
    
    var gDomain="sdc.csair.com";	// SDC Production Mode Domain
    var gDcsId="dcs82b9ujitigdu3gaykxw0hn_5p6b";
    var gFpc="WT-FPC";
    var gConvert=true;
    var gWTIDJS=window.document.createElement("script"); 
    window.document.getElementsByTagName("head")[0].appendChild(gWTIDJS); 
    if ((typeof(gConvert)!="undefined")&&gConvert&&(document.cookie.indexOf(gFpc+"=")==-1)&&(document.cookie.indexOf("WTLOPTOUT=")==-1)){
      gWTIDJS.src="http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://"+gDomain+"/"+gDcsId+"/wtid.js"; 
    }
     }
    
setTimeout('setsdcjs()',0);
    function setsdcjs(){
      var jDomain="www.csair.com"; //地址应该为js文件的域名
      var js_path="/topAndFoot/sdc_gd.js"; //地址应该为js文件的路径
      var domain="http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://"+jDomain;
      var SDC_js=document.createElement("script");
      SDC_js.src=domain+js_path;
      var headElem=document.getElementsByTagName("head")[0];
      headElem.appendChild(SDC_js);
     }


