ODN.keyTitle={cksId:"odn-keyTitle",init:function(){var a=$.cookie(this.cksId);if(a=="1"||a==null){this.toggle()}},toggle:function(){var b=$("#keyTitle .contentBox");if(b.length>0){var a=(b.css("height")!="auto");
b.css("height",(a?"auto":"20px"));$("#keyTitle .icon").removeClass("contract").removeClass("expand").addClass((a?"contract":"expand"));$.cookie(this.cksId,(a?"1":"0"),{expires:365,path:"/"})}}};ODN.content.keyTitleToggle=function(){ODN.keyTitle.toggle()
};ODN.keywordContent={autoId:0,data:{},getAutoId:function(){this.autoId++;return this.autoId},add:function(j,k,c,b,e,f){var m=j.split(",");var a=(e||this.getAutoId());var d=(f||0);for(var g=0;g<m.length;
g++){var h=m[g].replace(/^\s+|\s+$/g,"");if(typeof this.data[h]==="undefined"){this.data[h]=new Array()}this.data[h].push({id:a,regEx:k,func:c,objAD:b,limit:d})}},addPopup:function(g,c,f,d,b,a){var e=this.getAutoId();
d=(d)?" "+d:"";this.add(g,new RegExp(c,"g"),function(h){return'<a href="'+f.url+'" target="_blank" class="adKeyword'+d+'" onmouseover="ODN.keywordContent.showPopup(this, '+e+", '"+h+"',"+b+","+a+')" onmouseout="ODN.keywordContent.hidePopup()">'+h+"</a>"
},f,e,15)},init:function(){if(!ODN.isAD){var b=$("#newsContentCTN .newsText");if(b.length>0&&typeof this.data[ODN.sect]!="undefined"){for(var a=0;a<this.data[ODN.sect].length;a++){this.renderHtml(this.data[ODN.sect][a].regEx,this.data[ODN.sect][a].func,this.data[ODN.sect][a].limit)
}}}},renderHtml:function(d,c,a){var b=0;$("#newsContentCTN .newsText .summaryPara, #newsContentCTN .newsText p").each(function(){var e=$(this).html();var k=e.match(d);if(k!=null){if(a==0){k=$.arrayUtils.unique(k);
for(var j=0;j<k.length;j++){e=e.replace(new RegExp(k[j],"g"),c(k[j]))}}else{if(b<a){var g=[];var f=e;for(var j=0;j<k.length;j++){var h=f.split(k[j]);if(h.length>0){g.push(h[0]+c(k[j]));h.shift();f=h.join(k[j]);
b++;if(b==a){break}}else{f=h.toString()}}g.push(f);e=g.join("")}}$(this).html(e)}})},getDataById:function(b){for(var a=0;a<this.data[ODN.sect].length;a++){if(b==this.data[ODN.sect][a].id){return this.data[ODN.sect][a]
}}return null},puTimerId:null,puBoxId:"keyword-popup-box",showPopup:function(f,a,g,i,h){clearTimeout(this.puTimerId);$("#"+this.puBoxId).remove();var e=$(f).position();var c=this.getDataById(a);if(c!=null){var j=e.top-c.objAD.height;
var d=e.left;var b=20;if(e.left+c.objAD.width+b>$(document).width()){d=d-((e.left+c.objAD.width)-$(document).width())-b}c.objAD.flashVars({kw:g});if(h==undefined){h=j}else{h+=e.top}if(i==undefined){i=d
}else{i+=e.left}var k='<div id="'+this.puBoxId+'" style="z-index:99999;position:absolute;width:'+c.objAD.width+"px;height:"+c.objAD.height+"px;top:"+h+"px;left:"+i+'px" onmouseover="ODN.keywordContent.overPopup()" onmouseout="ODN.keywordContent.hidePopup()">'+c.objAD.renderHtml()+"</div>";
$("body").append(k);c.objAD.writeFlash()}},overPopup:function(){clearTimeout(this.puTimerId)},hidePopup:function(){this.puTimerId=setTimeout("ODN.keywordContent.closePopup()",200)},closePopup:function(){clearTimeout(this.puTimerId);
$("#"+this.puBoxId).remove()}};$AD.keyword.func=function(){ODN.keywordContent.addPopup(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])};ODN.content.stockKeyword={regEx:/\（\d{4,5}\）/g,renderHtml:function(a){var b=a.match(/\d{4,5}/g);
if(b!=null){return a.replace(b,'<a href="javascript:void(0);" onclick="javascript:M18box.livequotebox.LQB_show(\''+b+'\');" class="stockNum">'+b+"</a>")}return a}};ODN.miscPanel={shareList:[{n:"在Facebook上分享",k:"facebook",url:"http://www.facebook.com/share.php?u={url}"},{n:"Twitter",k:"twitter",url:"http://twitter.com/home?status={url}"},{n:"del.icio.us",k:"delicious",url:"http://del.icio.us/post?url={url}&title={title}"},{n:"Yahoo",k:"yahoo",url:"http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&u={url}&t={title}"},{n:"Google",k:"google",url:"http://www.google.com/bookmarks/mark?op=edit&bkmk={url}&title={title}"},{n:"Xanga",k:"xanga",url:"http://www.xanga.com/private/editorx.aspx?t={title}&u={url}"},{n:"MySpace",k:"myspace",url:"http://www.myspace.com/Modules/PostTo/Pages/?l=3&u={url}&t={title}"}],init:function(){$("#miscPanel").html(this.renderHTML())
},renderArticlePanel:function(){var html=[];html.push('<div id="articlePanel-bottom" class="clear"><ul class="clearList">');if(ODN.articleListSELECT!=undefined){with(ODN.articleListSELECT){if(prevBtn.css("display")!=="none"){html.push('<li class="prevArticle"><a href="'+prevBtn.find("a").attr("href")+'">上一則</a></li>')
}if(nextBtn.css("display")!=="none"){html.push('<li class="nextArticle"><a href="'+nextBtn.find("a").attr("href")+'">下一則</a></li>')}}}html.push('<li class="printBtn"'+((html.length>1)?' style="margin-left:30px;"':"")+'><a href="javascript:ODN.print();">列印此頁</a></li>');
html.push("</ul></div>");return html.join("")},renderHTML:function(){var a=[];a.push(this.renderArticlePanel());a.push('<div><table class="wireContentBox">');a.push("<tr>");a.push('<td class="tlc corner"></td><td class="t"></td><td class="trc corner"></td>');
a.push("</tr>");a.push("<tr>");a.push('<td class="l corner"></td><td class="contentBox">');a.push('<ul class="clearList clear">');a.push('<li class="title">本文連結 :</li>');a.push('<li><a href="'+ODN.href+'" class="shareLink">'+ODN.href+"</a>");
a.push("</ul>");a.push('<div class="hrThin"></div>');a.push('<ul class="clearList clear" id="shareToList"><img src="/img/ic_sharehelp.gif" border="0" width="14" height="14" style="float:right;cursor:pointer;" onmouseout="ODN.toolTip.hide(this)" alt="" onmouseover="ODN.toolTip.show(this, 14, {caption:\'點擊分享工具，登入個人戶口，便<br>可以將這篇文章分享到指定網站上。\'})" class="ttUp">');
a.push('<li class="title">分享 / 加入書籤 :</li>');a.push(this.renderShareList());a.push("</ul>");a.push('<div class="hrThin"></div>');a.push('<table id="iReportInfo">');a.push("<tr>");a.push('<td rowspan="3" class="title">人人做記者<br>爆料方法 :</td>');
a.push('<td class="col1">爆料熱線：&nbsp;</td>');a.push('<td class="col2">(852) 3600 3600</td>');a.push('<td class="col3">電 郵：&nbsp;</td>');a.push('<td class="col4"><a href="mailto:news@opg.com.hk">news@opg.com.hk</a></td>');
a.push('<td class="col1"><a href="http://ireport1.on.cc/p/b5/web/SubmitPage.jsp" target="_blank">網上爆料</a></td>');a.push("</tr>");a.push("<tr>");a.push('<td class="col1">傳 真：&nbsp;</td>');a.push('<td class="col2">(852) 3600 8800</td>');
a.push('<td class="col3">手機網站：&nbsp;</td>');a.push('<td class="col4">wap.on.cc</td>');a.push("</tr>");a.push("<tr>");a.push('<td class="col1">SMS：&nbsp;</td>');a.push('<td class="col2">(852) 6500 6500</td>');
a.push('<td class="col3">MMS：&nbsp;</td>');a.push('<td class="col4"><a href="mailto:ireport@on.cc">ireport@on.cc</a></td>');a.push("</tr>");a.push("</table>");a.push('</td><td class="r corner"></td>');
a.push("</tr>");a.push("<tr>");a.push('<td class="blc corner"></td><td class="b"></td><td class="brc corner"></td>');a.push("</tr>");a.push("</table></div>");return a.join("")},renderShareList:function(){var a="";
var d=encodeURIComponent(ODN.content.getTitle());for(var b=0;b<this.shareList.length;b++){var e=this.shareList[b].k;if(b!=0){e+=" next"}a+='<li class="'+e+'"><a href="'+this.shareList[b].url.replace("{url}",ODN.href).replace("{title}",d)+'" target="_blank">'+this.shareList[b].n+"</a></li>"
}return a}};ODN.stockQuote=function(){var a=document.getElementById("txt_qstock_symbol");var b=a.value;var c="http://money18.on.cc/info/liveinfo_quote.html?symbol=";if(b!=""&&b.match(new RegExp(/^\d{0,5}$/))){b=onccLib.digitPad("0",b,5);
window.location=c+b}else{alert("請輸入正確股票編號。");a.focus()}};ODN.onFocusStock=function(a){if(a.value=="輸入股票編號"){a.value=""}};ODN.onBlurStock=function(a){if(a.value==""){a.value="輸入股票編號"}};ODN.imageGalleryInfo={domReady:false,data:{photo:new Array(),caption:new Array()},init:function(){this.domReady=true;
$("a.thickbox").each(function(index){with(ODN.imageGalleryInfo.data){photo.push({path:$(this).attr("href")});caption.push({text:$(this).attr("title")})}})},queue:function(){return false}};ODN.fontSizePanel={id:"#fontSizePanel",cksId:"odn-fontSize",sizes:[{h1:13,h3:12,p:12,lh:19},{h1:15,h3:13,p:13,lh:21},{h1:19,h3:16,p:16,lh:23},{h1:23,h3:21,p:21,lh:26},{h1:26,h3:24,p:24,lh:30}],curIdx:3,init:function(){if($(this.id).length>0){var a=$.cookie(this.cksId);
if(String(a)!=String(this.curIdx)&&a!=null){this.curIdx=a;this.changeSize()}$(this.id+" li.small").click(function(){ODN.fontSizePanel.small()});$(this.id+" li.large").click(function(){ODN.fontSizePanel.large()
})}},small:function(){if(this.curIdx>1){this.curIdx--}this.changeSize()},large:function(){if(this.curIdx<this.sizes.length){this.curIdx++}this.changeSize()},changeSize:function(){$("#newsContentCTN h1").css({"font-size":this.sizes[this.curIdx-1].h1+"px"});
$("#newsContentCTN .newsText h3").css({"font-size":this.sizes[this.curIdx-1].h3+"px"});$("#newsContentCTN .newsText p, #newsContentCTN .newsText .summaryPara, #newsContentCTN .newsText td, #newsContentCTN .newsText th, #newsContentCTN .newsText .infoBox").css({"font-size":this.sizes[this.curIdx-1].p+"px"});
$("#newsContentCTN .newsText").css({"line-height":this.sizes[this.curIdx-1].lh+"px"});$(this.id+" .dot").removeClass("on");$(this.id+" .font"+this.curIdx).addClass("on");$.cookie(this.cksId,this.curIdx,{expires:365,path:"/"})
}};ODN.vodPlayerInfo={articleId:"",vlXmlPath:"/cnt/keyinfo/"+ODN.arcDate+"/videolist.xml",data:{mid:"",msect:"",mtype:"",mtime:""},screenWidth:screen.width,videoTitle:"",videoThmbnl:"/ontv/"+ODN.arcDate+"/",bind:function(d){var c=false;
var a;$(d).find("news").each(function(){if(($(this).find("articleID").text()==ODN.vodPlayerInfo.articleId)&&!c){c=true;var e=$(this).find("video_title").text();ODN.vodPlayerInfo.videoTitle=(e.length>14)?e.substring(0,14)+"...":e;
ODN.vodPlayerInfo.videoThmbnl+=$(this).find("thumbnail").text();a=$(this).find("video_url").text();ODN.vodPlayerInfo.data.mid=$.urlParams.extract("mid",a);ODN.vodPlayerInfo.data.mtype=$.urlParams.extract("mtype",a);
ODN.vodPlayerInfo.data.mtime=$.urlParams.extract("mtime",a);ODN.vodPlayerInfo.data.msect=(a.indexOf("broadcast.html")!=-1)?"2":((a.indexOf("commentary.html")!=-1)?"41":((a.indexOf("ent.html")!=-1)?"4":((a.indexOf("life.html")!=-1)?"5":((a.indexOf("news.html")!=-1)?"3":""))))
}});if(c){if(ODN.vodPlayerInfo.videoTitle.length>0){$(".videobox").addClass("showVideoBtn");var b=$("#newsInfoCTN a.showVideoBtn");b.append('<div class="thmbnlCTN"><div class="thmbnl" style="background-image:url('+ODN.vodPlayerInfo.videoThmbnl+')"><div class="playIcon"></div></div>'+ODN.vodPlayerInfo.videoTitle+"</div>");
if($.browser.msie&&(parseInt($.browser.version)<7)){DD_belatedPNG.fix("#newsInfoCTN div.playIcon")}}else{$(".videobox").addClass("showSimpleVideoBtn")}}},init:function(){with(ODN.vodPlayerInfo){$.get(vlXmlPath,bind)
}}};ODN.keywordContent.add("finance",ODN.content.stockKeyword.regEx,ODN.content.stockKeyword.renderHtml);if($.browser.msie&&(parseInt($.browser.version)<7)){document.write(unescape("%3Cscript src='/js/DD_belatedPNG_0.0.8a.js' type='text/javascript'%3E%3C/script%3E"))
}$(document).ready(function(){ODN.fontSizePanel.init();ODN.keyTitle.init();$("head").append('<link rel="stylesheet" type="text/css" href="/css/odn_content_print.css" media="print">');$("#topNavCTN").append('<img src="/img/logo_odn.png" border="0" width="142" height="31" class="printable">');
ODN.keywordContent.init();ODN.thickbox.TB_launch();ODN.videobox.VB_launch();ODN.browserHistory.bind("#browseHistoryList");ODN.miscPanel.init();ODN.imageGalleryInfo.init();ODN.vodPlayerInfo.init()});
