﻿function flightInfoLeftBanner(par1, par2, par3) {
	/*
	document.write("<div>");
	document.write("	<div><a href=\"#\"><img src=\"http://www.hongkongairport.com/eng/img/ad_ad.jpg\" alt=\"\" border=\"0\" /></a></div>");
	document.write("</div>");
	*/
}

function flightInfoRightBanner(par1, par2, par3) {
	/*
	if (par1 == "gb" && par2 == "passenger" && par3 == "departure") {
		document.write("<div align=\"center\">");
		document.write("<img src=\"/gb/img/spacer.gif\" height=\"10\" border=\"0\">");
		document.write("</div>");
		document.write("<div id=\"bannerRight\">");
		document.write("<div class=\"bannerRightImg\" align=\"center\"><a href=\"javascript:NewWindow('/gb/flight/airline-information/notice_popup.html', 'airlines', '517', '707', 'yes', 'yes');\"><img src=\"/gb/img/flight/banner_passenger_notice.jpg\" alt=\"\" width=\"195\" height=\"70\" border=\"0\"></a></div>");
		document.write("</div>");
	}
	

	document.write("<div id=\"bannerRight\">");
	document.write("	<div class=\"bannerRightImg\"><a href=\"/gb/worldwideflight.html\" target=\"_blank\"><img src=\"/eng/img/banner_1.gif\" alt=\"\" width=\"191\" height=\"66\" border=\"0\" /></a></div>");
	document.write("	<br class=\"clearer\" />");
	document.write("	<div class=\"bannerRightImg\">");
	document.write("		<a href=\"http://www.jasl.com.hk/\" target=\"_blank\">");
	genFlash("/gb/img/swf/jasl_banner.swf", 191, 66, "jasl_banner.swf", null);
	document.write("		</a>");
	document.write("	</div>");
	document.write("</div>");
	*/
	
	document.write("<div align=\"center\">");
	document.write("<img src=\"/chi/img/spacer.gif\" height=\"10\" border=\"0\">");
	document.write("</div>");
	document.write("<div id=\"bannerRight\">");
	if( par1 == "gb" && par2 == "passenger" && (par3 == "departure" || par3 == "arrival")){
		if(par3 == "arrival"){
			document.write("<div class=\"bannerRightImg\" align=\"center\"><a href=\"/gb/passenger/arrival/t1/airport-services-facilities/sms-information.html\" onclick=\"javascript:trackPage('banner', this);\"><img src=\"/gb/img/flight/SMS-flight-info-web-banner.jpg\" alt=\"以短讯查询航班资料\" width=\"195\" height=\"70\" border=\"0\"></a></div>");
		}else{
			document.write("<div class=\"bannerRightImg\" align=\"center\"><a href=\"/gb/passenger/departure/all/airport-services-facilities/sms-information.html\" onclick=\"javascript:trackPage('banner', this);\"><img src=\"/gb/img/flight/SMS-flight-info-web-banner.jpg\" alt=\"以短讯查询航班资料\" width=\"195\" height=\"70\" border=\"0\"></a></div>");
		}
		document.write("<div class=\"bannerRightImg\" align=\"center\"><a href=\"/gb/flight/airline-information/check-in-areas.html\" onclick=\"javascript:trackPage('banner', this);\"><img src=\"/gb/img/flight/counter_banner_03.jpg\" alt=\"新航空公司登记区\" width=\"195\" height=\"70\" border=\"0\"></a></div>");
	}
	
	document.write("<div class=\"bannerRightImg\" align=\"center\"><a href=\"/CBT/Controller?locale=gb\" onclick=\"javascript:trackPage('banner', this);\"><img src=\"/gb/img/flight/banner_prd_side.gif\" alt=\"来往中国内地交通接驳\" width=\"195\" height=\"140\" border=\"0\"></a></div>");
	
	document.write("</div>");
}

function flightInfoBottomBanner(par1, par2, par3) {
}

function resizeMainIframe() {
	var minHeight=325;
	var height=calcMainIframeHeight();
	//resize the iframe according to the size of the
	//window (all these should be on the same line)
	if (height <= minHeight) {
		height = minHeight;
	} else {
		height=parseInt(height - document.getElementById("main").offsetTop-8);
	}
	document.getElementById("main").style.height = height + "px";
}

function calcMainIframeHeight() {
	var headerHeight = 115;
	var mainIframeHeight;
	var height;
	
	height = window.innerHeight; //Firefox
	if (height != undefined && height != null) {
		mainIframeHeight = height;
	} else {
		height = document.body.clientHeight; //IE
		if (height != undefined && height != null) {
			mainIframeHeight = height;
		}
	}
	
	if (mainIframeHeight == undefined || mainIframeHeight == null) {
		return 0;
	} else {
		return (mainIframeHeight - headerHeight);
	}
}

function printMainFrame() {
	parent["main"].focus();
	parent["main"].print();
}

function bodyOnLoad() {
//	genTop();
	genLeft();
	genWinTitle();
	genAnnounceLink();
	resizeMainIframe();
}