/** obtain news content components of the vote */ var _newscontent_errcode = ""; var _newscontent_errorcode = ""; var _newscontent_votebgcolor = ""; var _newscontent_votetitlestyle = ""; var _newscontent_votefgcolor = ""; var _newscontent_qdimg = ""; var _newscontent_votestyle = ""; var _newscontent_welcomevote = ""; var _newscontent_padding = ""; var _newscontent_toupiao = ""; var _newscontent_chakan = ""; var _newscontent_myform = ""; var _newscontent_writevote = ""; var _newscontent_owner = ""; var _newscontent_ip = ""; var _newscontent_newsid = ""; var _newscontent_againvote = ""; var _newscontent_errvote = ""; var _newscontent_thinksvote = ""; var _newscontent_voteresult = ""; function showvote(pnewsid,powner,pvotebgcolor,pvotetitlestyle,pvotefgcolor,pqdimg,pvotestyle,pwelcomevote,ppadding,ptoupiao,pchakan,pformname,pwritevote,pip,pagainvote,perrvote,pthinksvote,pvoteresult) { _newscontent_votebgcolor = pvotebgcolor; _newscontent_votetitlestyle = pvotetitlestyle; _newscontent_votefgcolor = pvotefgcolor; _newscontent_qdimg = pqdimg; _newscontent_votestyle = pvotestyle; _newscontent_welcomevote = pwelcomevote; _newscontent_padding = ppadding; _newscontent_toupiao = ptoupiao; _newscontent_chakan = pchakan; _newscontent_myform = pformname; _newscontent_writevote = pwritevote; _newscontent_owner = powner; _newscontent_ip = pip; _newscontent_newsid = pnewsid; _newscontent_againvote = pagainvote; _newscontent_errvote = perrvote; _newscontent_thinksvote = pthinksvote; _newscontent_voteresult = pvoteresult; newsvotedwr.getvotetitle(pnewsid,powner,_newscontent_puttitle); } function _newscontent_puttitle(title) { if(title.result == "true") { var vote = "
" vote += ""; vote += "
" + _newscontent_qdimg + "  " + _newscontent_welcomevote + "
" for(i=0; i"; vote += title.titlelist[i]; vote += ""; vote += ""; for(j = 0;j< title.option[i].optitlelist.length;j++) { if(j != 0) checked = ""; vote += ""; vote += ""; vote += ""; } } vote += "" vote += "" vote += "" vote += "
"; vote += " " vote += title.option[i].optitlelist[j]; vote += "
" vote += _newscontent_toupiao; vote += " "+_newscontent_chakan; vote += "
"; vote += "
" document.getelementbyid("div_vote_id").innerhtml = vote; } else { } } function _newscontent_getresult(_newscontent_newsid,_newscontent_owner) { var hascheck =false; var ischeck = false; for(var i = 0; i < _newscontent_myform.elements.length; i++) { var item = _newscontent_myform.elements[i]; if(item.tagname == "input" ) { if(item.type.tolowercase()=="checkbox") { hascheck = true; var checkboxvalues = document.getelementsbyname(item.name); for(var j=0;j"; vote += "
" + _newscontent_qdimg + "  " + _newscontent_voteresult + "
" for(i=0; i"; vote += title.titlelist[i]; vote += ""; vote += ""; for(j = 0;j< title.option[i].optitlelist.length;j++) { vote += ""; vote += ""; vote += title.option[i].optitlelist[j]; vote += ""; vote += ""; vote += "" vote += "" vote += "
" vote += "
" vote += title.option[i].opchecklist[j]+"("+ title.option[i].opnumlist[j] +")"; vote += "" vote += ""; } } vote += ""; vote += "" document.getelementbyid("div_vote_id").innerhtml = vote; } else { alert(_newscontent_errvote); } } function _newscontnent_checkradiovalue(keystr) { var keyname = keystr; var obj = document.getelementsbyname(keyname); var flag = false; var i = 0; if(obj == null) { return ""; } if(obj.length == null) { if(obj.checked) { return obj.value; } } for(i = 0; i < obj.length; i++) { if(obj[i].checked) { return obj[i].value; break; } } return ""; } function shareto(a,u,t,s,key) { var ec = encodeuricomponent, a = '/system/resource/news/weiboshare.htm'; var c = '?type=' + a + '&url=' + ec(u || document.location) + '&title=' + ec(t) + (s ? '&summary=' + s : '')+(key ? '&appkey=' + key : ''); if(a=='tsohu') c = '?type=' + a + '&url=' + ec(u || document.location) + '&title=' + t + (s ? '&summary=' + s : '')+(key ? '&appkey=' + key : ''); try { window.open(a + c, ''); } catch (e) { } return false; } function download_news(contentid,treeid,owner,newsid) { if(checkobj_content(contentid)) { if(confirm('文章含有word中无法显示内容,下载后可能无法正常显示。是否继续下载?')) { location.href='/system/resource/news/newstoword.jsp?treeid='+treeid+'&owner='+owner+'&wbnewsid='+newsid; } }else{ location.href='/system/resource/news/newstoword.jsp?treeid='+treeid+'&owner='+owner+'&wbnewsid='+newsid; } } function checkobj_content(contentid) { if(getcontenttags(contentid)) { return true; } return false; } function getcontenttags(contentid) { var current; var contentnode = document.getelementbyid(contentid).innerhtml; var regex = //]*>(.*?)<\/object|object|iframe|iframe|embed|embed>/i; var groups = regex.exec(contentnode); if(groups){ return true; } return false; } function show_vsb_content_tips(buttonobj,conentid) { buttonobj.style.display="none"; var o=document.getelementbyid(conentid); o.style.display=""; } //正文中输出mp3播放代码 function showvsbaudio(aurl,vheight,vwidth,align,styles,vautoplay) { if(aurl=="") { return; } var playersrc = "/system/resource/images/ueditor/musicflash/player_mp3_maxi.swf"; var flashvars = "mp3="+aurl+"&showstop=1&showvolume=1&bgcolor1=eeeeee&bgcolor2=a0a0a0"; var autoplaystr = ""; if(vautoplay=="true") { autoplaystr = "autoplay = 'true'"; flashvars +="&autoplay=1"; } var outputhtml=""; outputhtml +=''; document.write(outputhtml); } /** * 正文中显示pdf * @param path * @param width * @param heigth * @param imagenum * @param style * @param imagedata */ function showvsbpdfiframe(path,width,heigth,imagenum,style,imagedata){ if(path=="") { return; } var outputhtml=""; //判断浏览器版本 if(issupportpddfjs()){ //pdfjs outputhtml = ""; }else{ //图片 if(imagedata && imagedata.length >0){ var imagestr = ""; imagestr = "
"; for(var i=0;i"; imagestr += "
第 "+(i+1)+" 页
"; } imagestr += "
"; outputhtml = imagestr; }else{ outputhtml = ""; } } document.write(outputhtml); } /** * 判断浏览器是否支持pdf.js * @returns {boolean} */ function issupportpddfjs(){ var agent = navigator.useragent.tolowercase(); var isie = /(msie\s|trident.*rv:)([\w.]+)/.test(agent); var version = 0; if(isie){ var v1 = agent.match(/(?:msie\s([\w.]+))/); var v2 = agent.match(/(?:trident.*rv:([\w.]+))/); if(v1 && v2 && v1[1] && v2[1]){ version = math.max(v1[1]*1,v2[1]*1); }else if(v1 && v1[1]){ version = v1[1]*1; }else if(v2 && v2[1]){ version = v2[1]*1; }else{ version = 0; } if(version < 11){ return false; } } var safari; if(/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(agent) && !/chrome/i.test(agent)){ safari = + (regexp['\x241'] || regexp['\x242']); } if(safari && safari < 9){ return false; } var mobile = agent.match(/applewebkit.*mobile.*/); if(mobile){ return false; } return true; }