<!---------- Rotate Logo ---------->
myPix1 = new Array("com/images/MIPHS_Logo.gif","com/images/MIPHS_Logo.gif")


imgCt=myPix1.length

function choosePic() {
   }

<!---------- Swap Image ---------->
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


<!---------- Progress Bar ---------->
	ns4 = (document.layers)? true:false
	ie4 = (document.all)? true:false

	// Check for browser type
	if (ie4)
	{
		if (navigator.userAgent.indexOf('MSIE 5')>0)
			ie5 = true;
	}
	else
		ie5 = false;

	// function to swap the progress image, capture click events and bring document to destination
	function showProgress(imgToShow)
	{
		// imgToShow.src = "/images/progress.gif";
		document.progress.src = imgToShow;

		// define the event handler for mouse click
		document.onclick = isClick;

		// remaining arguments are images to be hidden
		if (ns4)
			document.captureEvents(Event.CLICK);
	}

	function isClick(e)
	{
		return false;
	}


<!---------- Logoff ---------->
function logoff() {
	//var msg ="Thank you for using Hang Seng e-Banking services.\n\nAre you sure you want to Logoff?"
	//	if (confirm(msg))
		parent.document.location = "Logoff";
}

<!---------- Pull Down Focus Radio Button ---------->
radioarray =  new Array(2);
radioarray[0]=true;
radioarray[1]=true;

function changevalue(radioindex,value)
{	
if (value)
{	radioarray[radioindex]=true;
}
else 
{	if (radioarray[radioindex])
{	radioarray[radioindex]=false;
return true;
}
else 
{	return false
}
}
}

function MyClick(form,radioindex)
{	if (changevalue(radioindex,false))
{	form.TransferDate[radioindex].click();
}
}

<!---------- Pop Up Help Window ---------->
function popHelp(help) {
	helpWindow = window.open(help, 'helpWin', 'width=690,height=400,directories=no,toolbar=no,resizable=no,menubar=no,scrollbars=yes,screenX=80,screenY=80');
	helpWindow.focus();
}

<!---------- Pop Up Demo Window ---------->
function popDemo() {
	demoWindow = window.open('/html/demo/index.htm', 'demoWin', 'width=660,height=480,directories=no,toolbar=no,resizable=yes,menubar=no,scrollbars=yes');
	demoWindow.focus();
}
	
<!---------- Pop Up Calculator Window ---------->
function popCal(cal) {
	calWindow = window.open(cal, 'calWin', 'width=750,height=500,directories=no,toolbar=no,resizable=yes,menubar=no,scrollbars=yes,screenX=320,screenY=80');
	calWindow.focus();

}

<!---------- Pop Up Security Tips Window ---------->
function popSecTips() {
	var secWindow = window.open('/hsb/eng/ref/pib/news/diff3.html', 'ebank_popup','width=600,height=500,directories=no,toolbar=no,resizable=yes,menubar=no,scrollbars=yes,screenX=80,screenY=80');
	secWindow.focus();
}

// check whether target is set for the follow url
function isUrlSetTarget(url)
{
	if ((url == "/logon.htm") || (url == "/c_logon.htm") || (url == "/e_logon.htm") 
	|| (url == "LogonProfile") || (url == "Logoff") || (url.indexOf("HomeChangeLang") == 0))
		return true;
	else 
		return false;
}

function setLocation(obj, loc, waitFlag)
{
	if (waitFlag)
	{
		popupWait();
	}
	obj.href = loc;
	if (isUrlSetTarget(loc))
		obj.target = "_parent";
}		

function popUp(popup) {
faqWindow = window.open(popup, 'HangSeng', 'width=750,height=500,directories=no,toolbar=no,resizable=yes,menubar=yes,scrollbars=yes')
faqWindow.focus()
}

function bannerRedirect(url, parmStr, target){
		
		var html_file = "BannerRedirect";		
	
		if (target == "_blank") {		
			var bannerWindow = window.open(html_file+'?'+parmStr+'&'+url, 'HangSeng', 'width=750,height=500,directories=no,toolbar=no,resizable=yes,menubar=no,scrollbars=yes');
			bannerWindow.focus();
		}	
		else
			parent.location.href = html_file+'?'+parmStr+'&'+url;		
}

function bannerRedirect2(url, parmStr, target, width, height){
		
		var html_file = "BannerRedirect";		
	
		if (target == "_blank") {		
			var bannerWindow = window.open(html_file+'?'+parmStr+'&'+url, 'HangSeng', 'width=' + width + ',height=' + height + ',directories=no,toolbar=no,resizable=no,menubar=no,scrollbars=yes');
			bannerWindow.focus();
		}	
		else
			parent.location.href = html_file+'?'+parmStr+'&'+url;		
}

function popPayeeList()
{
    var js_url = "/html/appl/pb/PbPayeeList.htm";
    var js_wn_name = "pop_win";
    var js_wn_attribute = "width=800,height=500,directories=no,toolbar=no,resizable=yes,menubar=no,scrollbars=yes,screenX=80,screenY=80,status=no,location=no";
    js_g_wn = window.open(js_url, js_wn_name, js_wn_attribute);
    js_g_wn.focus();
}


<!---------- No IPS message ---------->
function writeNoIPSMessage()
{		
	document.write('<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">');
	document.write('<TR> ');
	document.write('<TD><FONT CLASS="CONTENT">- Prestige Banking Account</FONT></TD>');
	document.write('<TD><A HREF="/hsb/eng/per/acc/pb/index.html" TARGET="_blank"><IMG SRC="/images/BankCardPres.gif" WIDTH="85" HEIGHT="55" BORDER="0"></A></TD>');
	document.write('<TD><FONT CLASS="CONTENT">or</FONT></TD>');
	document.write('</TR>');
	document.write('<TR> ');
	document.write('<TD><FONT CLASS="CONTENT">- Femina Banking Account</FONT></TD>');
	document.write('<TD><A HREF="/hsb/eng/per/acc/fem/index.html" TARGET="_blank"><center><IMG SRC="/images/FeminaCard.gif" WIDTH="81" HEIGHT="55" border="0"></center></A></TD>');
	document.write('<TD><FONT CLASS="CONTENT">or</FONT></TD>');
	document.write('</TR>');
	document.write('<TR> ');
	document.write('<TD><FONT CLASS="CONTENT">- Stamina Banking Account</FONT></TD>');
	document.write('<TD><A HREF="/hsb/eng/per/acc/stam/index.html" TARGET="_blank"><center><IMG SRC="/images/StaminaCard.gif" WIDTH="84" HEIGHT="55" border="0"></center></A></TD>');
	document.write('<TD><FONT CLASS="CONTENT">or</FONT></TD>');
	document.write('</TR>');
	document.write('<TR> ');
	document.write('<TD><FONT CLASS="CONTENT">- Bank-In-One Account</FONT></TD>');
	document.write('<TD><A HREF="/hsb/eng/per/acc/bio/index.html" TARGET="_blank"><IMG SRC="/images/BankCardBank.gif" WIDTH="85" HEIGHT="55" BORDER="0"></A></TD>');
	document.write('<TD><FONT CLASS="CONTENT">&nbsp;</FONT></TD>');
	document.write('</TR>');	
	document.write('</TABLE>');
	document.write('<P><FONT class="CONTENT">The Prestige Banking Account or other Integrated Accounts brings ');
	document.write('you a full range of banking and investment services under one account and you ');
	document.write('can manage all these services through e-Banking. </FONT></P>');
	
}

function writeBIARemark()
{
	document.write('<FONT CLASS="CONTENT"><FONT COLOR="#0000FF">HKD Current Account is not applicable to \'Bank-In-One\' Basic Plan Customers.</FONT></FONT>');
}

function writeBIARemark2()
{
	document.write('<FONT CLASS="CONTENT"><FONT COLOR="#0000FF">This service is not applicable to \'Bank-In-One\' Basic Plan Customers.</FONT></FONT>');
}

function popIpsTandC(acctType, custGroup)
{
	var pdf = "/html/tandc/";
	if (acctType == "IA")
		pdf += "049_BIA_E.pdf";
	else if (acctType == "SA")
	{
		if (custGroup == "SOLE") // sole prop.
			pdf += "050_BSA_E.pdf";
		else
			pdf += "HS503-E(StaminaBanking).pdf";
	}
	else if (acctType == "FB")
		pdf += "HS485-E(Femina).pdf";
	else if (acctType == "PB")
		pdf += "051_PBA_E.pdf";
	else
		pdf = "";
	
	tandcWindow = window.open(pdf, 'tandcWin', 'width=800,height=500,directories=no,toolbar=no,resizable=yes,menubar=no,scrollbars=yes,screenX=80,screenY=80');
}

function popDotCom(dotComUrl)
{
	dotCom = window.open(dotComUrl, 'prodInfoWin', 'width=800,height=500,directories=no,toolbar=no,resizable=yes,menubar=no,scrollbars=yes,screenX=80,screenY=80');
	dotCom.focus();
}

function showQuote()
{
	document.write("<TR><TD COLSPAN=\"2\"><FONT CLASS=\"CONTENT\"><B>");
	document.write("Real-time quote usage may incur charges. Please refer to the screen of &quot;Quote Meter&quot; under &quot;Market Express&quot; for details.<BR><BR>");
	document.write("Now you can access first-hand stock market information through &quot;Market Express&quot;.");
	document.writeln("</B></FONT></TD></TR>");
}

function popupErmtStream() {
	ermtStreamWin = window.open('/servlet/ErmtExchRate','ErmtStream','width=430,height=260,directories=no,toolbar=no,resizable=yes,menubar=no,scrollbars=yes,screenX=360,screenY=5,left=360,top=5,status=yes,location=no');
	ermtStreamWin.focus();
}

function ermtDoTxnShowLinks(type)
{
	document.writeln("<TABLE width=\"99%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	document.write("<TR><TD valign=\"TOP\">");
	document.write("<A href=\"javascript:popupErmtStream();\"><IMG src=\"/images/butRealTimeL.gif\" width=\"151\" height=\"14\" border=\"0\"></A>&nbsp;");
	document.write("<A href=\"javascript:popCal('/servlet/ErmtRollInt');\"><IMG src=\"/images/butRollL.gif\" width=\"184\" height=\"14\" border=\"0\"></A>&nbsp;");
	document.write("<A href=\"javascript:popDotCom('/hsb/eng/ref/eml/einfo/forex.pdf');\"><IMG src=\"/images/butForexComL.gif\" WIDTH=\"127\" HEIGHT=\"14\" BORDER=\"0\"></A>");
	document.writeln("</TD></TR>");
	document.writeln("<TR><TD valign=\"TOP\"><IMG src=\"/images/space.gif\" width=\"10\" height=\"15\"></TD></TR>");
	document.write("<TR><TD valign=\"TOP\">");
	document.write("<a href=\"javascript:popDotCom('/hsb/eng/ref/ermt/cale/econ_cale.pdf');\"><IMG src=\"/images/butEconCalen.gif\" width=\"122\" height=\"14\" border=\"0\"></A>&nbsp;");
	document.write("<A href=\"javascript:popDotCom('/hsb/eng/ref/ermt/trad/hr/main.html');\"><IMG src=\"/images/butTradHours.gif\" width=\"89\" height=\"14\" border=\"0\"></A>&nbsp;"); 
	if (type==1) // account balance
		document.write("<IMG src=\"/images/butAccBalL.gif\" width=\"105\" height=\"14\" border=\"0\">&nbsp;");
  else
		document.write("<A href=\"ErmtTfAcBal\"><IMG src=\"/images/butAccBalL.gif\" width=\"105\" height=\"14\" border=\"0\"></A>&nbsp;");
	if (type==0) // fund transfer
		document.write("<IMG src=\"/images/butFundTranL.gif\" width=\"95\" height=\"14\" border=\"0\">");	
	else
		document.write("<A href=\"ErmtTfFxIn\"><IMG src=\"/images/butFundTranL.gif\" width=\"95\" height=\"14\" border=\"0\"></A>");
	document.writeln("</TD></TR>");
	document.writeln("</table>");
}

function ermtShowVersionLinks(type)
{
	document.writeln("<TABLE BORDER=\"0\" CELLPADDING=\"3\" WIDTH=\"99%\" CELLSPACING=\"0\"><TR>");
	document.write("<TD WIDTH=\"50%\" ALIGN=\"RIGHT\">");
	if (type==1) // dialup
		document.write("<IMG src=\"/images/butDailupo.gif\" width=\"119\" height=\"20\" border=\"0\" alt=\"56K Dial-up Version\" hspace=\"5\">");
	else
		document.write("<IMG src=\"/images/butBoardband.gif\" width=\"119\" height=\"20\" border=\"0\" alt=\"BroadBand Version\" hspace=\"5\">");
	document.writeln("</TD>");
	document.writeln("</TR></TABLE>");
}

function ermtTradingFooter()
{
  document.writeln("<font class=\"CONTENT\"><font class=\"TextNoLink\">Trading</font> ");
  document.writeln("| <A href=\"ErmtOutPosnSum\" class=\"Bold\"><b>Position and Account Enquiry</b></A></font> ");
}

function ermtIcon()
{
	document.write("<A HREF=\"javascript:showHelp()\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Help','','/images/icoHelp_a.gif',1)\">");
	document.write("<IMG NAME=\"Help\" BORDER=\"0\" SRC=\"/images/icoHelp.gif\" WIDTH=\"30\" HEIGHT=\"20\" ALT=\"Help\"></A>");
	document.write("<A HREF=\"javascript:window.print();\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Print','','/images/icoPrint_a.gif',1)\">");
	document.write("<IMG NAME=\"Print\" BORDER=\"0\" SRC=\"/images/icoPrint.gif\" WIDTH=\"30\" HEIGHT=\"20\" ALT=\"Print\"></A>");
	document.write("<A HREF=\"ErmtServiceExit\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Logoff Forex Margin Service','','/images/icoCloseFx_a.gif',1)\">");
	document.write("<IMG SRC=\"/images/icoCloseFx.gif\" WIDTH=\"107\" HEIGHT=\"20\" BORDER=\"0\" NAME=\"Image1\"></A>");
	document.write("<A HREF=\"javascript:logoff();\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Logoff','','/images/icoLogoff_a.gif',1)\">");
	document.writeln("<IMG NAME=\"Logoff\" BORDER=\"0\" SRC=\"/images/icoLogoff.gif\" WIDTH=\"30\" HEIGHT=\"20\" ALT=\"Logoff\"></A>");
}

function ermtTxn2ndMenu()
{
	document.writeln("<TD BACKGROUND=\"/images/FxMenuBkg.gif\"><A HREF=\"ErmtOutPosnSum\"><IMG SRC=\"/images/FxPosiAccEnq.gif\" WIDTH=\"99\" HEIGHT=\"35\" ALT=\"Position and Account Enquiry\" BORDER=\"0\"></A></TD>");
}

function popupLotSize()
{
	lotSize = window.open("/servlet/ErmtLotSize", 'ErmtLotSize', 'width=800,height=500,directories=no,toolbar=no,resizable=yes,menubar=no,scrollbars=yes,screenX=80,screenY=80');
	lotSize.focus();
}

function writeErmtNote()
{
	document.writeln("<TABLE width=\"99%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	document.writeln("<TR><TD><FONT class=\"CONTENT\">All the information of your FlexiForex / ProForex Trading Services Account displayed in e-Banking will not be updated during non-trading hours.</FONT></TD></TR>");
	document.writeln("<TR><TD>&nbsp;</TD></TR>");
	document.writeln("</TABLE>");
}