﻿<!--

function openNewWindow(Wname, WURL) {
	var w_handle = window.open('', Wname, 'width=800,height=600,menubar=no,scrollbars=yes,status=yes,resizable=yes');
	try
	{
	if (w_handle.location.href == 'about:blank')
	{
		w_handle.location.href = WURL;
	}
	else
	{
//		w_handle.focus();
		if (confirm('你已開啟中銀國際交易視窗,你希望重新登入嗎?'))
		{
			w_handle.location.href = WURL;
			w_handle.focus();
		}				
		else
			w_handle.focus();
	}
	}
	catch (err)
	{
//		alert(err.description);
//		w_handle.focus();
		if (confirm('你已開啟中銀國際交易視窗,你希望重新登入嗎?'))
		{
			w_handle.location.href = WURL;
			w_handle.focus();
		}
		else
			w_handle.focus();
	}

}

function openIndexLoginWindow() {
	var w_handle = window.open('', 'LoginWindow', 'width=800,height=600,menubar=no,scrollbars=yes,status=yes,resizable=yes');
	var host_address = location.hostname;
	WURL = "https://" + host_address + "/NASApp/intl/login";
	try
	{
	if (w_handle.location.href == 'about:blank')
	{
		w_handle.location.href = WURL;
	}
	else
	{
//		w_handle.focus();
		if (confirm('你已開啟中銀國際交易視窗,你希望重新登入嗎?'))
		{
			w_handle.location.href = WURL;
			w_handle.focus();
		}				
		else
			w_handle.focus();
	}
	}
	catch (err)
	{
//		alert(err.description);
//		w_handle.focus();
		if (confirm('你已開啟中銀國際交易視窗,你希望重新登入嗎?'))
		{
			w_handle.location.href = WURL;
			w_handle.focus();
		}
		else
			w_handle.focus();
	}

}

function openAccountWindow() {
	var w_handle = window.open('', 'OpenAccountWindow', 'width=800,height=600,menubar=no,scrollbars=yes,status=yes,resizable=yes,location=no');
	var host_address = location.hostname;
	WURL = "https://cs.bocionline.com/AccountOpen/register.htm?locale=zh_HK";
	try
	{
	if (w_handle.location.href == 'about:blank')
	{
		w_handle.location.href = WURL;
	}
	else
	{
//		w_handle.focus();
		if (confirm('你已開啟中銀國際交易視窗,你希望重新登入嗎?'))
		{
			w_handle.location.href = WURL;
			w_handle.focus();
		}				
		else
			w_handle.focus();
	}
	}
	catch (err)
	{
//		alert(err.description);
//		w_handle.focus();
		if (confirm('你已開啟中銀國際交易視窗,你希望重新登入嗎?'))
		{
			w_handle.location.href = WURL;
			w_handle.focus();
		}
		else
			w_handle.focus();
	}

}

function openFutureLoginWindow() {
	var w_handle = window.open('', 'LoginFuturesWindow', 'width=800,height=600,menubar=no,scrollbars=yes,status=yes,resizable=yes,location=no');
	
	WURL = "https://www.bocionline.com/NASApp/intl/futures_login_tc.jsp";
	try
	{
	if (w_handle.location.href == 'about:blank')
	{
		w_handle.location.href = WURL;
	}
	else
	{
//		w_handle.focus();
		if (confirm('你已開啟中銀國際期貨交易視窗,你希望重新登入嗎?'))
		{
			w_handle.location.href = WURL;
			w_handle.focus();
		}				
		else
			w_handle.focus();
	}
	}
	catch (err)
	{
//		alert(err.description);
//		w_handle.focus();
		if (confirm('你已開啟中銀國際期貨交易視窗,你希望重新登入嗎?'))
		{
			w_handle.location.href = WURL;
			w_handle.focus();
		}
		else
			w_handle.focus();
	}

}

function popUp(URL, size, window_name, resizeable) {

var w = 1024;
var h = 768;
var l = 128;
var t = 130;
var sw = screen.width;
var sh = screen.height;


switch(size)
{
case 3:
    h = sh / 2;
    w = sw;
    break;
case 2:
    w = sw / 2;      
    h = sh;
    break;
case 1:
    w = sw / 2;      
    h = sh / 2;
    break;    

case 0:
    w = sw -25;      
    h = sh;
    break;

}

var string = 'width='+w+ ',height='+h;//+',left = '+l+',top = '+t;
my_win = window.open(URL, window_name, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=' + resizeable + ',' + string);
my_win.resizeTo(w,h);
my_win.focus();
}
//-->