(function(){ YAHOO.namespace('CN.NKS'); YAHOO.CN.NKS.msgTip = function(){ var _dom = YAHOO.util.Dom; var _event = YAHOO.util.Event; var showTip = function(e){ var el = _event.getTarget(e); var tip = document.createElement('div'); //tip.style = "background:#fffbb9; border:1px solid #fc0; padding:.6em; color:#9e7702; line-height:1.6; position:absolute"; tip.id = 'source-tip'; tip.style.position = 'absolute'; tip.style.background = '#fffbb9'; tip.style.border = '1px solid #fc0'; tip.style.color = '#9e7501'; tip.style.lineHeight = '1.6'; tip.style.zIndex = '999'; tip.style.padding = '.5em'; //var ico = _dom.getElementsByClassName('source-ico'); if(el.className == 'source-ico-web'){ var icopos = _dom.getXY(el); tip.innerHTML = '来源网页搜索'; document.body.appendChild(tip); _dom.setXY('source-tip',[icopos[0]+20,icopos[1]+10]); } if(el.className == 'source-ico-mobile'){ var icopos = _dom.getXY(el); tip.innerHTML = '来源手机提问'; document.body.appendChild(tip); _dom.setXY('source-tip',[icopos[0]+20,icopos[1]+10]); } } var hideTip = function(){ if(_dom.get('source-tip')){ _dom.get('source-tip').parentNode.removeChild(_dom.get('source-tip')); } } _event.on(document,'mouseover',showTip); _event.on(document,'mouseout',hideTip); } //选择来源 YAHOO.CN.NKS.chooseSource = function(){ var _dom = YAHOO.util.Dom; var _event = YAHOO.util.Event; var selebtn = _dom.get('select-source'); var container = _dom.get('source-container'); var list = container.getElementsByTagName('a'); var flag = 0; var showContainer = function(){ container.style.display = ''; flag = 1; } var hideContainer = function(){ container.style.display = 'none'; flag = 0; } var selectSource = function(){ for(var i=0,j=list.length; i