var LINK_TYPE_EODCHART = "E";
var LINK_TYPE_30MCHART = "M";

var LINK_TYPE_COMP_INFO = "01";
var LINK_TYPE_COMP_DIRECTOR = "10";
var LINK_TYPE_COMP_SHAREHOLDER = "11";
var LINK_TYPE_COMP_PARVALUE = "12";
var LINK_TYPE_COMP_PAIDUPCAP = "13";
var LINK_TYPE_COMP_DIVIDEND = "14";
var LINK_TYPE_COMP_PROPERTY = "15";
var LINK_TYPE_COMP_ANOUNCEMENT = "16";
var LINK_TYPE_COMP_SUBSIDIARY = "17";
var LINK_TYPE_COMP_UPDATELOG = "18";

var LINK_TYPE_COMPFIN_BS = "50";		//balance sheet
var LINK_TYPE_COMPFIN_PL = "51";		//profit and loss
var LINK_TYPE_COMPFIN_CF = "52";		//cash flow
var LINK_TYPE_COMPFIN_FH = "53";		//financial highlight
var LINK_TYPE_COMPFIN_RA = "54";		//ratio analysis
var LINK_TYPE_COMPFIN_MS = "55";		//mining statistics
var LINK_TYPE_COMPFIN_PS = "56";		//plantation statistic


function DisplayStkInfoLink(linktype, p_sStkCode)
{
	var scrWidth, scrHeight, sURL;

	scrWidth = screen.width * 0.8;
	scrHeigth = screen.height * 0.8;

	switch (linktype) {
		case LINK_TYPE_EODCHART:
			// EOD chart
			// http://www.klse-ris.com.my/webchart-html/ceod_html/5088.html
			sURL = 'http://charttb.asiaebroker.com/ebcServlet/stkChartEOD?key='+ p_sStkCode;
			break;
		case LINK_TYPE_30MCHART:
			// 30 minute chart
			// http://www.klse-ris.com.my/webchart-html/c30m_html/5088.html
			sURL = 'http://www.klse-ris.com.my/webchart-html/c30m_html/' + p_sStkCode + '.html';
			break;

		case LINK_TYPE_COMP_INFO:
			// company info / summary
			// http://www.klse-ris.com.my/CDB/owa/cp_summary?cmp_code_in=5088
			// http://www.klse-ris.com.my/CDB/owa/compchq?cp_code_in=5088&cp_sname_in=&cp_rcode_in=
			sURL = 'http://www.klse-ris.com.my/CDB/owa/cp_summary?cmp_code_in=' + p_sStkCode
			break;
		case LINK_TYPE_COMP_DIRECTOR:
			// company director info
			// http://www.klse-ris.com.my/CDB/owa/lcd.genchq?gen_type_in=DR&cmp_code_in=5088
			sURL = 'http://www.klse-ris.com.my/CDB/owa/lcd.genchq?gen_type_in=DR&cmp_code_in=' + p_sStkCode
			break;
		case LINK_TYPE_COMP_SHAREHOLDER:
			// company shareholder info
			// http://www.klse-ris.com.my/CDB/owa/lcd.genchq?gen_type_in=SH&cmp_code_in=5088
			sURL = 'http://www.klse-ris.com.my/CDB/owa/lcd.genchq?gen_type_in=SH&cmp_code_in=' + p_sStkCode
			break;
		case LINK_TYPE_COMP_PARVALUE:
			// par value
			// http://www.klse-ris.com.my/CDB/owa/lcd.genchq?gen_type_in=PV&cmp_code_in=5088
			sURL = 'http://www.klse-ris.com.my/CDB/owa/lcd.genchq?gen_type_in=PV&cmp_code_in=' + p_sStkCode
			break;
		case LINK_TYPE_COMP_PAIDUPCAP:
			// paid-up capital
			// http://www.klse-ris.com.my/CDB/owa/lcd.genchq?gen_type_in=PV&cmp_code_in=5088
			sURL = 'http://www.klse-ris.com.my/CDB/owa/lcd.genchq?gen_type_in=PV&cmp_code_in=' + p_sStkCode
			break;
		case LINK_TYPE_COMP_DIVIDEND:
			// dividend
			// http://www.klse-ris.com.my/CDB/owa/lcd.genchq?gen_type_in=DV&cmp_code_in=5088
			sURL = 'http://www.klse-ris.com.my/CDB/owa/lcd.genchq?gen_type_in=DV&cmp_code_in=' + p_sStkCode
			break;
		case LINK_TYPE_COMP_PROPERTY:
			// property held by company
			// http://www.klse-ris.com.my/CDB/owa/lcd.genchq?gen_type_in=PH&cmp_code_in=5088
			sURL = 'http://www.klse-ris.com.my/CDB/owa/lcd.genchq?gen_type_in=PH&cmp_code_in=' + p_sStkCode
			break;
		case LINK_TYPE_COMP_ANOUNCEMENT:
			// anouncement
			// http://www.klse-ris.com.my/CDB/owa/lcd.genchq?gen_type_in=AM&cmp_code_in=5088
			sURL = 'http://www.klse-ris.com.my/CDB/owa/lcd.genchq?gen_type_in=AM&cmp_code_in=' + p_sStkCode
			break;
		case LINK_TYPE_COMP_SUBSIDIARY:
			// company subsidiary info
			// http://www.klse-ris.com.my/CDB/owa/lcd.genchq?gen_type_in=SC&cmp_code_in=5088
			sURL = 'http://www.klse-ris.com.my/CDB/owa/lcd.genchq?gen_type_in=SC&cmp_code_in=' + p_sStkCode
			break;
		case LINK_TYPE_COMP_UPDATELOG:
			// update log
			// http://www.klse-ris.com.my/CDB/owa/lcd.genchq?gen_type_in=UL&cmp_code_in=5088
			sURL = 'http://www.klse-ris.com.my/CDB/owa/lcd.genchq?gen_type_in=UL&cmp_code_in=' + p_sStkCode
			break;

		case LINK_TYPE_COMPFIN_BS:
			// balance sheet
			// http://www.klse-ris.com.my/CDB/owa/cp_datechq?acct_type_in=BS&frm_yr=&to_yr=&cmp_code_in=5088
			sURL = 'http://www.klse-ris.com.my/CDB/owa/cp_datechq?acct_type_in=BS&frm_yr=&to_yr=&cmp_code_in=' + p_sStkCode
			break;
		case LINK_TYPE_COMPFIN_PL:
			// profit and loss
			// http://www.klse-ris.com.my/CDB/owa/cp_datechq?acct_type_in=PL&frm_yr=&to_yr=&cmp_code_in=5088
			sURL = 'http://www.klse-ris.com.my/CDB/owa/cp_datechq?acct_type_in=PL&frm_yr=&to_yr=&cmp_code_in=' + p_sStkCode
			break;
		case LINK_TYPE_COMPFIN_CF:
			// cash flow
			// http://www.klse-ris.com.my/CDB/owa/cp_datechq?acct_type_in=CF&frm_yr=&to_yr=&cmp_code_in=5088
			sURL = 'http://www.klse-ris.com.my/CDB/owa/cp_datechq?acct_type_in=CF&frm_yr=&to_yr=&cmp_code_in=' + p_sStkCode
			break;
		case LINK_TYPE_COMPFIN_FH:
			// financial highlight
			// http://www.klse-ris.com.my/CDB/owa/cp_datechq?acct_type_in=FH&frm_yr=&to_yr=&cmp_code_in=5088
			sURL = 'http://www.klse-ris.com.my/CDB/owa/cp_datechq?acct_type_in=FH&frm_yr=&to_yr=&cmp_code_in=' + p_sStkCode
			break;
		case LINK_TYPE_COMPFIN_RA:
			// company risk return and performance (ratio analysis)
			// http://www.klse-ris.com.my/CDB/owa/cp_datechq?acct_type_in=RA&frm_yr=&to_yr=&cmp_code_in=5088
			sURL = 'http://www.klse-ris.com.my/CDB/owa/cp_datechq?acct_type_in=RA&frm_yr=&to_yr=&cmp_code_in=' + p_sStkCode
			break;
		case LINK_TYPE_COMPFIN_MS:
			// mining statistics
			// http://www.klse-ris.com.my/CDB/owa/cp_datechq?acct_type_in=MS&frm_yr=&to_yr=&cmp_code_in=5088
			sURL = 'http://www.klse-ris.com.my/CDB/owa/cp_datechq?acct_type_in=MS&frm_yr=&to_yr=&cmp_code_in=' + p_sStkCode
			break;
		case LINK_TYPE_COMPFIN_PS:
			// plantation statistic
			// http://www.klse-ris.com.my/CDB/owa/cp_datechq?acct_type_in=PS&frm_yr=&to_yr=&cmp_code_in=5088
			sURL = 'http://www.klse-ris.com.my/CDB/owa/cp_datechq?acct_type_in=PS&frm_yr=&to_yr=&cmp_code_in=' + p_sStkCode
			break;

		default:
			// default to company info
			sURL = 'http://www.klse-ris.com.my/CDB/owa/cp_summary?cmp_code_in=' + p_sStkCode
	}

	window.showModalDialog(sURL, '', 'center:yes;dialogWidth:' + scrWidth + 'px;dialogHeight:' + scrHeight + 'px');
}

function FormatStkInfoLink(linktype, p_sStkCode, p_sStkName)
{
	return ("<font style='cursor:hand;color:blue;text-decoration:underline' onclick=DisplayStkInfoLink('"+ linktype +"','"+ p_sStkCode + "')>" + p_sStkName + "</font>");
}

function OpenLinkWinNormal(sURL, sTargetWin, sParam)
{
	window.open(sURL, sTargetWin, sParam, false)
}
function OpenLinkWindow(sURL, sTargetWin, sParam)
{
	if (sParam=='') {
		sParam = 'left=10,top=100,width=770,height=450,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes'
	}
	var newWin = window.open(sURL, sTargetWin, sParam, false)
	newWin.focus();
}
function OpenPopUpTeaser(sURL, sTargetWin, sParam)
{
	if (sParam=='') {
		sParam = 'left=10,top=40,width=300,height=300,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no'
	}
	window.open(sURL, sTargetWin, sParam, false)
}
function OpenWinNetResearch(sURL, sTargetWin, sParam)
{
	if (sParam=='') {
		sParam = 'left=10,top=100,width=770,height=450,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes'
	}
	window.open('/bin/gotoNetResearch.asp?url='+ sURL, sTargetWin, sParam, false)
}

function OpenWinNews(sURL, sParam)
{
	if (sParam=='') {
		sParam = 'left=10,top=100,width=770,height=450,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes'
	}
	window.open(sURL, 'winNews', sParam, false)
}

function OpenWinNewsResearch(urls)
{
	if (urls == "") {
	    window.open('/bin/newsResearch.asp', 'winNewsResearch', '', false);
  } else {
  		window.open(urls, 'winNewsResearch', '', false);
  }
}

function OpenWinNewsResearch()
{
//	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop
//	nLeft = (scrWidth - 770) /2
//	nTop = (scrHeight - 450) /2
//	window.open('/bin/newsResearch.asp', 'winNewsResearch', 'left='+ nLeft +',top='+ nTop +',width=770,height=450,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)

	window.open('/bin/newsResearch.asp', 'winNewsResearch', '', false);
}

function OpenWinCliLogin()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 300) /2
	nTop = (scrHeight - 220) /2
	window.open('/bin/cliLogin.asp', 'winCliLogin', 'left='+ nLeft +',top='+ nTop +',width=300,height=220,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
}

function OpenWinCliChgPwd(vsURL)
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 360) /2
	nTop = (scrHeight - 295) /2
	if (vsURL == '') {
		vsURL = '/bin/cliChgPwd.asp'
	}
	window.open(vsURL, 'winCliPwdPIN', 'left='+ nLeft +',top='+ nTop +',width=360,height=295,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
}
function OpenWinCliForgetPwd(vsURL)
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 410) /2
	nTop = (scrHeight - 215) /2
	if (vsURL == '') {
		vsURL = '/bin/cliForgetPwd.asp'
	}
	window.open(vsURL, 'winCliPwdPIN', 'left='+ nLeft +',top='+ nTop +',width=410,height=215,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
}
function OpenWinCliChgPIN(vsURL)
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 300) /2
	nTop = (scrHeight - 215) /2
	if (vsURL == '') {
		vsURL = '/bin/cliChgPIN.asp'
	}
	window.open(vsURL, 'winCliPwdPIN', 'left='+ nLeft +',top='+ nTop +',width=300,height=215,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
}
function OpenWinCliForgetPIN(vsURL)
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 410) /2
	nTop = (scrHeight - 217) /2
	if (vsURL == '') {
		vsURL = '/bin/cliForgetPIN.asp'
	}
	window.open(vsURL, 'winCliPwdPIN', 'left='+ nLeft +',top='+ nTop +',width=410,height=217,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
}

function OpenWinCliReg()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 795) /2
	nTop = (scrHeight - 500) /2
	window.open('/bin/cliTermCond.asp', 'winCliReg', 'left='+ nLeft +',top='+ nTop +',width=795,height=500,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes', false)
}

function OpenWinCliReg(vsType)
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 795) /2
	nTop = (scrHeight - 500) /2
	if (vsType == "C") {
		window.open('/bin/cliTermCond.asp?Type=C', 'winCliReg', 'left='+ nLeft +',top='+ nTop +',width=795,height=500,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes', false)
	} else {
		window.open('/bin/cliTermCond.asp', 'winCliReg', 'left='+ nLeft +',top='+ nTop +',width=795,height=500,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes', false)
	}
}

function OpenWinCliRegIPO(vsUrl)
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 795) /2
	nTop = (scrHeight - 500) /2
	window.open(vsUrl, 'winCliReg', 'left='+ nLeft +',top='+ nTop +',width=795,height=500,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes', false)
}

function OpenWinCliReg2()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 795) /2
	nTop = (scrHeight - 500) /2
	window.open('/web/faqCliAcctReg.asp', 'winCliRegFAQ', 'left='+ nLeft +',top='+ nTop +',width=795,height=500,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes', false)
}
function OpenWinCliReg3()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 795) /2
	nTop = (scrHeight - 500) /2
	window.open('/web/faqCliAcctRegCBorder.asp', 'winCliRegFAQ', 'left='+ nLeft +',top='+ nTop +',width=795,height=500,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes', false)
}

//param is vsLang, bPopUp, bProxySafe
function OpenWinStkRealTime(vsLang)
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop, sURL

	nLeft = (scrWidth - 780) /2
	nTop = (scrHeight - 475) /2
	if (vsLang == 'CN')
		sURL = '/bin/stkRealTimeAWT.asp?lang=CN'
	else {
		//check ProxySafe
		if (OpenWinStkRealTime.arguments.length > 2 && (OpenWinStkRealTime.arguments[2] == true))
			sURL = '/bin/stkRealTimeAWT.asp?lang=EN'
		else
			sURL = '/bin/stkRealTimeAWT.asp?lang=EN'
	}

	//check PopUp
	if (OpenWinStkRealTime.arguments.length > 1 && (OpenWinStkRealTime.arguments[1] == true))
		window.open(sURL, 'winStkRealTime', 'left='+ nLeft +',top='+ nTop +',width=780,height=475,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
	else
		window.location.href = sURL;
}

//param is vsLang, vbPopUp
function OpenWinStkFuture(vsLang, vbPopUp)
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop, sURL;

	nLeft = (scrWidth - 780) /2;
	nTop = (scrHeight - 550) /2;

	sURL = '/bin/stkRealTimeFuture.asp?lang='+ vsLang;

	//check PopUp
	if (vbPopUp == true)
		window.open(sURL, 'winStkFuture', 'left='+ nLeft +',top='+ nTop +',width=780,height=550,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
	else
		window.location.href = sURL;
}

function OpenWinDemo()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 650) /2
	nTop = (scrHeight - 480) /2
	window.open('/web/demo.htm', 'winDemo', 'left='+ nLeft +',top='+ nTop +',width=650,height=480,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
}

function OpenWinDemoEIPO()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 760) /2
	nTop = (scrHeight - 530) /2
	window.open('/web/demo_eIPO.htm', 'winDemo', 'left='+ nLeft +',top='+ nTop +',width=760,height=530,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
}

function OpenWinStlOutstandingCliPos()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 780) /2
	nTop = (scrHeight - 510) /2
	window.open('/bin/stlOutstandingCliPos.asp', 'winStl', 'left='+ nLeft +',top='+ nTop +',width=780,height=510,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes', false)
}
function OpenWinStlPayStatus()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 635) /2
	nTop = (scrHeight - 330) /2
	window.open('/bin/stlPayStatus.asp', 'winStlPayStatus', 'left='+ nLeft +',top='+ nTop +',width=635,height=330,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes', false)
}
function OpenWinStlDepositStatus()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 600) /2
	nTop = (scrHeight - 530) /2
//	window.open('/bin/stlDepositStatus.asp', 'winStlDepStatus', 'left='+ nLeft +',top='+ nTop +',width=555,height=400,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes', false)
//	window.open('/bin/stlDepositStatus.asp', 'winStlDepStatus', 'left='+ nLeft +',top='+ nTop +',width=555,height=530,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes', false)
	window.open('/bin/stlDepositStatus.asp', 'winStlDepStatus', 'left='+ nLeft +',top='+ nTop +',width=600,height=530,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes', false)
}

function OpenWinGameMenu()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 800) /2
	nTop = (scrHeight - 580) /2
	window.open('http://game.itradecimb.com/bin/gameMenu.asp', 'winGameMenu', 'left='+ nLeft +',top='+ nTop +',width=800,height=580,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes', false)
}
function OpenWinStkRealTimeGame(vsLang)
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop, sURL

	nLeft = (scrWidth - 780) /2
	nTop = (scrHeight - 555) /2
	if (vsLang == 'CN')
		sURL = '/bin/stkRealTimeGame.asp?lang=CN'

	else {
		//check ProxySafe
		if (OpenWinStkRealTimeGame.arguments.length > 2 && (OpenWinStkRealTimeGame.arguments[2] == true))
			sURL = '/bin/stkRealTimeGameAWT.asp?lang=EN'
		else
			sURL = '/bin/stkRealTimeGameAWT.asp?lang=EN'
	}

	//check PopUp
	if (OpenWinStkRealTimeGame.arguments.length > 1 && (OpenWinStkRealTimeGame.arguments[1] == true))
		window.open(sURL, 'winStkRealTime', 'left='+ nLeft +',top='+ nTop +',width=780,height=555,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
	else
		window.location.href = sURL;
}
function OpenWinCliRegGame()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 785) /2
	nTop = (scrHeight - 485) /2
	window.open('/bin/cliTermCond_Game.asp', 'winCliReg', 'left='+ nLeft +',top='+ nTop +',width=790,height=485,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes', false)
}
function OpenWinGameRanking()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 780) /2
	nTop = (scrHeight - 555) /2
	window.open('/bin/anlyRanking.asp?Game=Y', 'winGameRanking', 'left='+ nLeft +',top='+ nTop +',width=800,height=450,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes', false)
}
function OpenWinGameRule()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 785) /2
	nTop = (scrHeight - 485) /2
	window.open('/bin/cliTermCond_Game.asp', 'winFAQGameRule', 'left='+ nLeft +',top='+ nTop +',width=790,height=485,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes', false)
}

function OpenWinPrtfSumm()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 770) /2
	nTop = (scrHeight - 450) /2
	window.open('/bin/prtfSumm.asp', 'winPrtf', 'left='+ nLeft +',top='+ nTop +',width=770,height=450,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes', false)
}
function OpenWinInfoSiteMap()
{
	window.open('/web/infoSiteMap.asp', 'winInfoSiteMap', 'left=0,top=0,width=350,height=400,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes', false)
}

function OpenWinCancelReqFAQ()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 590) /2
	nTop = (scrHeight - 270) /2
	window.open('/web/faqCancelRequest.htm', 'winFAQCancel', 'left='+ nLeft +',top='+ nTop +',width=590,height=270,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
}

function OpenWinPDARegis()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop
	window.open('/web/MobileAppForm.asp', 'winPDARegis', 'left=50,top=50,width=800,height=555,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
}
function OpenWinPDATermCond()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop
	window.open('/web/MobileTermCond.asp', 'winPDATermCond', 'left=50,top=50,width=841,height=595,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
}
function OpenWinFlashMain()
{
	window.open('/web/FlashMain.htm', 'winFlashMainPage', 'left=10,top=10,width=500,height=300,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
	window.close();
}
function OpenWinFlashDemo()
{
	window.open('/web/FlashDemo.htm', 'winFlashDemo', 'left=10,top=10,width=700,height=630,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
	window.close();
}
function PDAGameTermCond()
{
	window.open('/bin/pdfViewer.asp?pdf=/Doc/TermCondGame.pdf', 'winPDAGame', 'left=16,top=191,width=785,height=488,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
}

function OpenWinCliLoginIPO()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 320) /2
	nTop = (scrHeight - 220) /2
//	window.open('/ipo/IPOLoginReq.asp', 'winCliLogin', 'left='+ nLeft +',top='+ nTop +',width=610,height=320,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
	window.open('/ipo/cliLogin.asp', 'winCliLogin', 'left='+ nLeft +',top='+ nTop +',width=320,height=395,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
}
function OpenWinCliProfiler()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 720) /2
	nTop = (scrHeight - 220) /2
	window.open('/bin/cliProfilerTrd.asp', 'winCliReg', 'left='+ nLeft +',top='+ nTop +',width=720,height=220,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes', false)
}
function OpenWinDemoSMS()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 760) /2
	nTop = (scrHeight - 530) /2
	window.open('/web/demoSMSTrd.htm', 'winDemo', 'left='+ nLeft +',top='+ nTop +',width=760,height=530,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no', false)
}
function OpenWinTrdChannel()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 625) /2
	nTop = (scrHeight - 490) /2
	window.open('/bin/cliProfilerTrd.asp', 'winSMSTrd', 'left='+ nLeft +',top='+ nTop +',width=625,height=490,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=no', false)
}
function OpenWinSMSTrdEdit()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 465) /2
	nTop = (scrHeight - 235) /2
	window.open('/bin/cliProfilerTrdEdit.asp', 'winSMSTrdSetting', 'left='+ nLeft +',top='+ nTop +',width=465,height=235,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes', false)
}

function OpenWinFuturesTrading()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 795) /2
	nTop = (scrHeight - 500) /2
	window.open('http://www.cimb.com.my/article.cfm?id=498', 'winFAQFutures', 'left='+ nLeft +',top='+ nTop +',width=795,height=500,location=yes,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes', false)
}

function OpenWinPopUpBanner3(){
		
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop;

	nLeft = (scrWidth - 800) /2
	nTop = (scrHeight - 530) /2
	
	window.open('http://www.cimbbank.com.my/index.php?ch=subch_personal_si&pg=pg_si_si&ac=84&tpt=cimb_bank', 'winBanner', 'left='+ nLeft +',top='+ nTop +',width=800,height=530,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes', false);
}

function OpenWinCliReg4()
{
	var scrWidth=screen.width, scrHeight=screen.height, nLeft, nTop

	nLeft = (scrWidth - 795) /2
	nTop = (scrHeight - 500) /2
	window.open('https://www.cimbinvest.com/app/help.client.services.z?cat=01&subcat=01_02&subsubcat=40288c9f1fa2f9da011fac62d93c06fb', 'winCliRegFAQ', 'left='+ nLeft +',top='+ nTop +',width=795,height=500,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes', false)
}
