
var message="This page is provided by eBroker Systems Ltd.";
document.onmousedown=click;
if (document.layers) document.captureEvents(Event.MOUSEDOWN);

function click(e)
{
	if (document.all)
		if (event.button == 2)
		{
			alert(message);
			return false;
		}
	
	if (document.layers)
		if (e.which == 3)
		{
			alert(message);
			return false;
		}
}

function CopyPrice(aSymbol, aPrice, aQty)
{
	document.QLoader.CopyPrice(aSymbol, aPrice, aQty);	
	return;
}


function openWin(html)
{
	//this function is used for print function
	var win = window.open('',null,"left=50,top=50,width=600,height=400,scrollbars,menubar");
	win.document.open();
	win.document.writeln(html);
	win.document.close();
}

function GoToProChart()
{
	//this function is for eBroker Pro chart hooking
	window.open('http://www.ebsdata.com/shares/chart/prochart', 'ProChart', 'status=yes,height=600,width=600', false);
}

function GoToOtherVendor(bU, bP, bB, aLang)
{
	//aLang 0:big5, 1:eng, 2:gb
	//ud1 0:eng, 1:big5, 2:gb
	var aValue;
	aValue = 0;
	if(aLang == 0)
		aValue=1;
	if(aLang == 1)
		aValue=0;
	if(aLang == 2)
		aValue=2;				

	//http://www.e-finet.net/FIE/login/yuexiu_login.php?username=???&password=???&UD1=0
	window.open('./blank.html', 'EFinet', 'status=yes,height=370,width=620', false);
	//var aURL = 'http://www.e-finet.net/FMELoginBase/script/ebroker_login.php' + '?company='+bB+'&userid='+bU+'&password='+bP;
	var aURL = 'http://www.e-finet.net/FIE/login/yuexiu_login.php' + '?company='+bB+'&username='+bU+'&password='+bP+'&UD1='+aValue;
	document.eFinet.target.value = aURL;
	document.eFinet.submit();
}

function GoToOtherVendorSnapShot(bU, bP, bB, aLang)
{
	//aLang 0:big5, 1:eng, 2:gb
	//language 1:eng, 2:big5, 3:gb
	var aValue;
	aValue = 0;
	if(aLang == 0)
		aValue=2;
	if(aLang == 1)
		aValue=1;
	if(aLang == 2)
		aValue=3;				
	//http://fif2.e-finet.net/fulbright/quote/RTQuoteCheck.php?code=1&password=fulbright&userid=jackie&language=1
	var aURL = 'http://fif2.e-finet.net/fulbright/quote/RTQuoteCheck.php'+'?code=1&userid='+ bU+'&password=fulbright'+'&language='+aValue;
	window.open(aURL, 'EFinet', 'status=yes,height=370,width=620', false);
}

function GoToTradeDetail(anO, aA, aS, aL)
{
	window.open('', 'TradeDetail', 'scrollbars=yes,status=yes,height=370,width=620', false);
	document.tradedetail.anO.value = anO;
	document.tradedetail.aA.value = aA;
	document.tradedetail.aS.value = aS;
	document.tradedetail.aL.value = aL;
	document.tradedetail.submit();
}

function JavaAlertMsg(aMsg)
{
	alert("[iTrader]\n\n\n"+aMsg);
	return;
}

function CopyPriceToOther(aSymbol, aPrice)
{
	if(parent.parent.Orderf)
		if(parent.parent.Orderf.QLoader)
			parent.parent.Orderf.QLoader.CopyPrice(aSymbol, aPrice,0);	
	return;
	

}
function JavaLoadQuote(ansessionid)
{
	document.open('./left.html','controlp','',false);
	document.open('','mktwatch','',false);
	document.Quote.sessionid.value=ansessionid;
	document.Quote.submit();
	
	parent.Quotef.myQuoteframe.rows="0%,100%,0%";
	parent.Quotef.myQuoteframe.rows="0%,0%,100%";

}
function popupAAStocks(url, uname, password, broker, lang) {
	window.open('./blank.html', 'aastock', '', false);
	document.AAStocks.target.value = url;
	document.AAStocks.uname.value = uname.toLowerCase();
	document.AAStocks.password.value = password;
	document.AAStocks.broker.value = broker;
	document.AAStocks.lang.value = lang;
	document.AAStocks.submit();
	parent.Quotef.myQuoteframe.rows="0%,0%,100%";
}
function dailyStatement(accountid, password) {
	window.open('./blank.html', 'DailyStatement', 'status=yes', false);
	document.DailyStatement.acct.value=accountid;
	document.DailyStatement.pwd.value=password;
	document.DailyStatement.submit();
}

function mktwatchBtnClick()
{
	parent.myQuoteframe.rows="0%,100%,0%";	
}
	

function aastockbtnClick()
{
	parent.myQuoteframe.rows="0%,0%,100%";
}
function JavaLogout(aLang)
{
	if(aLang == 0)
		document.open('./quote_zh.asp','Quotef','',false);
	if(aLang == 1)
		document.open('./quote_en.asp','Quotef','',false);
	if(aLang == 2)
		document.open('./quote_cn.asp','Quotef','',false);
}

function JavaExit()
{
	top.window.close();
}
