document.writeln ('<scr' + 'ipt language="java' + 'script" src="/z/js/cookie.djjs"></script>');
document.writeln ('<scr' + 'ipt language="java' + 'script" src="/z/js/IsiMoneyTest.js"></script>');

function GenChannel(sImg, sAlign)
{
	var iMoneyPath;
	if (iMoneyTesting) {
		iMoneyPath = 'http://203.69.145.203/s/index.djhtm';		
	}
	else {
		iMoneyPath = '/s/index.djhtm';
	}
	switch (sImg.toUpperCase()) {
		case 'CHANNEL_SELECT.GIF':
		case 'CHANNEL_DICTIONARY.GIF':
		case 'CHANNEL_COLLEGE.GIF':
		case 'CHANNEL_FOLK.GIF':
		case 'CHANNEL_BGWHITE.GIF':
		case 'CHANNEL_SERVICE.GIF':
		case 'CHANNEL_BLOG.GIF':
		case 'CHANNEL_FUNDDJ_HOME.GIF':
		case 'CHANNEL_FUNDDJ_INSIDE.GIF':
		case 'CHANNEL_FUNDDJ_EXTEND.GIF':	
		case 'CHANNEL_CFO.GIF':
		case 'CHANNEL_IPO.GIF':
		case 'CHANNEL_MONEYDJ.GIF':
		case 'CHANNEL_MONEYDJ_HOME.GIF':
		case 'CHANNEL_ETF.GIF':
		case 'CHANNEL_HK.GIF':
			//爛IE
			var sChannel = '';
			sChannel  += '<table align=center border="0" cellpadding="0" cellspacing="0" width="100%">';
			sChannel  += '<tr>';
			sChannel  += '<td align="' + sAlign + '">';
			sChannel  += '<IMG SRC="/z/images/' + sImg + '" BORDER=0 hspace=0 USEMAP="#Map" align="' + sAlign + '">';
			sChannel  += '<MAP NAME="Map">';
			sChannel  += '<AREA HREF="/z/z00.htm" alt="台股" target="_top" SHAPE="rect" COORDS="0,0,41,20">';
			sChannel  += '<AREA HREF="/HKb2b/HK00.htm" alt="港股" target="_top" SHAPE="rect" COORDS="42,0,84,20">';
			sChannel  += '<AREA HREF="/etf/default.djhtm" alt="ETF" target="_top" SHAPE="rect" COORDS="85,0,128,20">';
			sChannel  += '<AREA HREF="javascript:void(0);" onClick="OpenVip3();" alt="VIP看盤室" target="_top" SHAPE="rect" COORDS="128,0,160,20">';
			sChannel  += '<AREA HREF="/z/mydj/" alt="My MoneyDJ" target="_top" SHAPE="rect" COORDS="164,0,205,20">';
			sChannel  += '<AREA HREF="/z/zk/zk00.htm" alt="選股大師" target="_top" SHAPE="rect" COORDS="210,0,250,20">';
			sChannel  += '<AREA HREF="/z/z200.htm" alt="未上市" target="_top" SHAPE="rect" COORDS="250,0,305,20">';
			sChannel  += '<AREA HREF="/r/r00.htm" alt="金融CFO" target="_top" SHAPE="rect" COORDS="305,0,350,20">';
			sChannel  += '<AREA HREF="/y/yFund.htm" alt="基金" target="_top" SHAPE="rect" COORDS="348,0,390,20">';
			sChannel  += '<AREA HREF="'+iMoneyPath+'" ALT="貴賓理財" target="_top" SHAPE="rect" COORDS="390,0,455,20">';
			sChannel  += '<AREA HREF="/y/fundblog/blog.aspx" alt="Blog" target="_top" SHAPE="rect" COORDS="455,0,496,20">';	
			sChannel  += '<AREA HREF="/KMDJ/" alt="財經知識庫" target="_top" SHAPE="rect" COORDS="500,0,574,19">';
			sChannel  += '<AREA HREF="/e/" alt="DJ櫃檯" target="_top" SHAPE="rect" COORDS="576,0,617,18">';
			sChannel  += '<AREA HREF="/default.htm" alt="DJ家族" target="_top" SHAPE="rect" COORDS="620,0,660,18">';
			sChannel  += '</MAP>';
			sChannel  += '</td>';
			sChannel  += '</tr>';
			sChannel  += '</table>';
			document.write(sChannel);
			break;
		case 'CHANNEL_MYDJ.GIF':
			
			var sChannel = '';
			sChannel  += '<table border="0" cellpadding="0" cellspacing="0" bordercolor="#111111" id="AutoNumber16"  width="100%">';
			sChannel  += '<tr>';
			sChannel  += '<td valign="top">';
			sChannel  += '<IMG SRC="/z/images/' + sImg + '" BORDER=0 hspace=0 USEMAP="#djchannel_Map" align="' + sAlign + '">';
			sChannel  += '<MAP NAME="djchannel_Map">';

			sChannel  += '<AREA HREF="/z/z00.htm" alt="台股" target="_top" SHAPE="rect" COORDS="0,0,41,20">';
			sChannel  += '<AREA HREF="/HKb2b/HK00.htm" alt="港股" target="_top" SHAPE="rect" COORDS="42,0,84,20">';
			sChannel  += '<AREA HREF="/etf/default.djhtm" alt="ETF" target="_top" SHAPE="rect" COORDS="85,0,128,20">';
			sChannel  += '<AREA HREF="javascript:void(0);" onClick="OpenVip3();" alt="VIP看盤室" target="_top" SHAPE="rect" COORDS="128,0,160,20">';
			sChannel  += '<AREA HREF="/z/mydj/" alt="My MoneyDJ" target="_top" SHAPE="rect" COORDS="164,0,205,20">';
			sChannel  += '<AREA HREF="/z/zk/zk00.htm" alt="選股大師" target="_top" SHAPE="rect" COORDS="210,0,250,20">';
			sChannel  += '<AREA HREF="/z/z200.htm" alt="未上市" target="_top" SHAPE="rect" COORDS="250,0,305,20">';
			sChannel  += '<AREA HREF="/r/r00.htm" alt="金融CFO" target="_top" SHAPE="rect" COORDS="305,0,350,20">';
			sChannel  += '<AREA HREF="/y/yFund.htm" alt="基金" target="_top" SHAPE="rect" COORDS="348,0,390,20">';
			sChannel  += '<AREA HREF="'+iMoneyPath+'" ALT="貴賓理財" target="_top" SHAPE="rect" COORDS="390,0,455,20">';
			sChannel  += '<AREA HREF="/y/fundblog/blog.aspx" alt="Blog" target="_top" SHAPE="rect" COORDS="455,0,496,20">';	
			sChannel  += '<AREA HREF="/KMDJ/" alt="財經知識庫" target="_top" SHAPE="rect" COORDS="500,0,574,19">';
			sChannel  += '<AREA HREF="/e/" alt="DJ櫃檯" target="_top" SHAPE="rect" COORDS="576,0,617,18">';
			sChannel  += '<AREA HREF="/default.htm" alt="DJ家族" target="_top" SHAPE="rect" COORDS="620,0,660,18">';
			sChannel  += '</MAP>';
			sChannel  += '</td>';
			sChannel  += '</tr>';
			sChannel  += '</table>';
			document.write(sChannel);			
			break;
		case 'CHANNEL_HOTPRODUCT.GIF':
			//爛IE
			var sChannel = '';
			sChannel  += '<table align=center border="0" cellpadding="0" cellspacing="0" width="100%">';
			sChannel  += '<tr>';
			sChannel  += '<td align="' + sAlign + '">';
			sChannel  += '<IMG SRC="/z/images/' + sImg + '" BORDER=0 hspace=0 USEMAP="#Map" align="' + sAlign + '">';
			sChannel  += '<MAP NAME="Map">';
			sChannel  += '<AREA HREF="/z/z00.htm" alt="台股" target="_top" SHAPE="rect" COORDS="14,5,46,30">';
			sChannel  += '<AREA HREF="/HKb2b/HK00.htm" alt="港股" target="_top" SHAPE="rect" COORDS="57,6,88,29">';
			sChannel  += '<AREA HREF="/etf/default.djhtm" alt="ETF" target="_top" SHAPE="rect" COORDS="97,3,124,31">';
			sChannel  += '<AREA HREF="javascript:void(0);" onClick="OpenVip3();" alt="VIP看盤室" target="_top" SHAPE="rect" COORDS="137,5,164,30">';
			sChannel  += '<AREA HREF="/z/mydj/" alt="My MoneyDJ" target="_top" SHAPE="rect" COORDS="172,6,209,32">';
			sChannel  += '<AREA HREF="/z/zk/zk00.htm" alt="選股大師" target="_top" SHAPE="rect" COORDS="218,8,250,32">';
			sChannel  += '<AREA HREF="/z/z200.htm" alt="未上市" target="_top" SHAPE="rect" COORDS="262,7,304,31">';
			sChannel  += '<AREA HREF="/r/r00.htm" alt="金融CFO" target="_top" SHAPE="rect" COORDS="318,7,350,31">';
			sChannel  += '<AREA HREF="/y/yFund.htm" alt="基金" target="_top" SHAPE="rect" COORDS="358,6,391,31">';
			sChannel  += '<AREA HREF="'+iMoneyPath+'" ALT="貴賓理財" target="_top" SHAPE="rect" COORDS="398,6,457,32">';
			sChannel  += '<AREA HREF="/y/fundblog/blog.aspx" alt="Blog" target="_top" SHAPE="rect" COORDS="468,3,499,34">';	
			sChannel  += '<AREA HREF="/KMDJ/" alt="財經知識庫" target="_top" SHAPE="rect" COORDS="508,4,578,30">';
			sChannel  += '<AREA HREF="/e/" alt="DJ櫃檯" target="_top" SHAPE="rect" COORDS="590,4,621,32">';
			sChannel  += '<AREA HREF="/default.htm" alt="DJ家族" target="_top" SHAPE="rect" COORDS="632,3,660,30">';
			sChannel  += '</MAP>';
			sChannel  += '</td>';
			sChannel  += '</tr>';
			sChannel  += '</table>';
			document.write(sChannel);
			break;
		default:
			document.writeln ('<table align=center border="0" cellpadding="0" cellspacing="0">');
			document.writeln ('<tr>');
			document.writeln ('<td>');
			document.writeln ('<IMG SRC="/z/images/channel_moneydj.gif" BORDER=0 hspace=0 USEMAP="#Map" align="left">');
			document.writeln ('<MAP NAME="Map">');

			document.writeln ('<AREA HREF="/z/z00.htm" alt="台股" target="_top" shape="rect" coords="205,0,245,20">');
			document.writeln ('<AREA HREF="/HKb2b/HK00.htm" alt="港股" target="_top" shape="rect" coords="246,0,288,20">');
			document.writeln ('<AREA HREF="/etf/default.djhtm" alt="ETF" target="_top" shape="rect" coords="289,0,351,20">');
			document.writeln ('<AREA HREF="javascript:void(0);" onClick="OpenVip3();" alt="VIP看盤室" target="_top" shape="rect" coords="352,0,387,20">');
			document.writeln ('<AREA HREF="/z/mydj/" alt="My MoneyDJ" target="_top" shape="rect" coords="388,0,434,20">');
			document.writeln ('<AREA HREF="/z/zk/zk00.htm" alt="選股大師" target="_top" shape="rect" coords="435,0,476,20">');
			document.writeln ('<AREA HREF="/z/z200.htm" alt="未上市" target="_top" shape="rect" coords="477,0,530,20">');
			document.writeln ('<AREA HREF="/r/r00.htm" alt="金融CFO" target="_top" shape="rect" coords="531,0,573,20">');
			document.writeln ('<AREA HREF="/y/yFund.htm" alt="基金" target="_top" shape="rect" coords="574,0,614,20">');
			document.writeln ('<AREA HREF="'+iMoneyPath+'" ALT="iMoney" target="_top" SHAPE="rect" COORDS="615,0,670,20">');
			document.writeln ('<AREA HREF="/y/fundblog/blog.aspx" alt="Blog" target="_top" shape="rect" coords="671,0,713,20">');
			document.writeln ('<AREA HREF="/e/" alt="DJ櫃檯" target="_top" shape="rect" coords="714,0,755,20">');
			document.writeln ('<AREA HREF="/default.htm" alt="DJ家族" target="_top" shape="rect" coords="756,0,798,20">');
			document.writeln ('<AREA HREF="http://www.flowerdj.com/" alt="網路花店" target="_blank" shape="rect" coords="799,0,841,20">');
			document.writeln ('<AREA HREF="http://www.babydj.com/" alt="BabyDJ" target="_blank" shape="rect" coords="842,0,900,20">');
			
			document.writeln ('</MAP>');
			document.writeln ('</td>');
			document.writeln ('</tr>');
			document.writeln ('</table>');
	}
}
var g_VIPWindow = null;
function OpenVip3()
{
	var w = screen.availWidth; 
	//if (w >= 1600)
	//	w = w / 2;

	//if (w < 800) w = 800;
	var h = screen.availHeight;
	//if (h < 560) h = 560;
	
	var w = w - 10;
	var h = h - 33;
	var sStyle = 'top=0,left=0,width=' + w + ',height=' + h + ',resizable=no,status=no,toolbar=no,location=no,menubar=no,true'
	
	var DJ_VIPBID = readCookie("DJ_VIPBID");
	if (DJ_VIPBID == "P001"){
		clearCookie();	
	}

	saveCookie('DJ_VIPBID', 'J001', 0, '/z');
		
	g_VIPWindow = window.open('/z/checkVIP.asp?a=J001', 'VIP3', sStyle);	
	
	setTimeout('ReOpenVip3()', 1000);
		
	//window.open('/z/vip3.htm', 'VIP3', sStyle);
}

//檢查是否VIP視窗被關掉,關掉則再開一次
var checkTime =0;
function ReOpenVip3(){
		
		checkTime++;
		if (checkTime > 10){
			return;
		}
		if (g_VIPWindow.closed)	
			OpenVip3();
		else	
			setTimeout('ReOpenVip3()', 1000);
			
		//window.status = g_VIPWindow;
	
}

//外部VIP用 do nothing
function BackBroker(){
	
}