var timeout = 500; var closetimer = 0; var ddmenuitem = 0; function jsddm_open() { jsddm_canceltimer(); jsddm_close(); ddmenuitem = $(this).find('ul').eq(0).css('visibility', 'visible'); } function jsddm_close() { if (ddmenuitem) ddmenuitem.css('visibility', 'hidden'); } function jsddm_timer() { closetimer = window.setTimeout(jsddm_close, timeout); } function jsddm_canceltimer() { if (closetimer) { window.clearTimeout(closetimer); closetimer = null; } } $(document).ready(function () { $('#jsddm > li').bind('mouseover', jsddm_open); $('#jsddm > li').bind('mouseout', jsddm_timer); }); document.onclick = jsddm_close; function CheckLogin() { var taget_obj = document.getElementById('_ajax_feedback'); myajax = new DedeAjax(taget_obj, false, false, '', '', ''); myajax.SendGet2("/member/ajax_feedback.php"); DedeXHTTP = null; } function checkSubmit() { if (document.feedback.msg.value != '') document.feedback.submit(); else alert("评论内容不能为空!"); } function postBadGood(ftype, fid) { var taget_obj = document.getElementById(ftype + fid); var saveid = GetCookie('badgoodid'); if (saveid != null) { var saveids = saveid.split(','); var hasid = false; saveid = ''; j = 1; for (i = saveids.length - 1; i >= 0; i--) { if (saveids[i] == fid && hasid) continue; else { if (saveids[i] == fid && !hasid) hasid = true; saveid += (saveid == '' ? saveids[i] : ',' + saveids[i]); j++; if (j == 10 && hasid) break; if (j == 9 && !hasid) break; } } if (hasid) { alert('您刚才已表决过了喔!'); return false; } else saveid += ',' + fid; SetCookie('badgoodid', saveid, 1); } else { SetCookie('badgoodid', fid, 1); } myajax = new DedeAjax(taget_obj, false, false, '', '', ''); myajax.SendGet2("/plus/feedback.php?aid=" + fid + "&action=" + ftype + "&fid=" + fid); DedeXHTTP = null; } function postDigg(ftype, aid) { var taget_obj = document.getElementById('newdigg'); var saveid = GetCookie('diggid'); if (saveid != null) { var saveids = saveid.split(','); var hasid = false; saveid = ''; j = 1; for (i = saveids.length - 1; i >= 0; i--) { if (saveids[i] == aid && hasid) continue; else { if (saveids[i] == aid && !hasid) hasid = true; saveid += (saveid == '' ? saveids[i] : ',' + saveids[i]); j++; if (j == 20 && hasid) break; if (j == 19 && !hasid) break; } } if (hasid) { alert("您已经顶过该帖,请不要重复顶帖 !"); return; } else saveid += ',' + aid; SetCookie('diggid', saveid, 1); } else { SetCookie('diggid', aid, 1); } myajax = new DedeAjax(taget_obj, false, false, '', '', ''); var url = "/plus/digg_ajax.php?action=" + ftype + "&id=" + aid; myajax.SendGet2(url); DedeXHTTP = null; } function getDigg(aid) { var taget_obj = document.getElementById('newdigg'); myajax = new DedeAjax(taget_obj, false, false, '', '', ''); myajax.SendGet2("/plus/digg_ajax.php?id=" + aid); DedeXHTTP = null; } var shortname = ".html"; var npage = 1; var totalpage = 1; var namehand = '151'; var displaytype = 'st'; var gtimer = null; //大图 function dPlayBig() { var imgObj = document.getElementById("bigimg"); window.open(imgObj.src); } //停止幻灯 function dStopPlay() { if (gtimer) clearTimeout(gtimer); else dPlayNext(); } //开始幻灯 function dStartPlay() { if (npage != totalpage) { gtimer = setTimeout("dPlayNext()", 10000); } } //上一张 function dPlayPre() { if (npage < 2) { alert("这是第一页"); } else { if (npage == 2) { if (namehand != '') location.href="obnfiboe" + shortname; else location.href="wjfx.qiq?bje=151"; } else if (displaytype == 'st' && namehand != '') { location.href="obnfiboe" + "_" + (npage - 1) + shortname; } else { location.href="wjfx.qiq?bje=151&qbhfop=" + (npage - 1); } } } //下一张 function dPlayNext() { if (npage == totalpage) { alert("没有了哦"); } else { if (displaytype == 'st' && namehand != '') location.href="obnfiboe" + "_" + (npage + 1) + shortname; else location.href="wjfx.qiq?bje=151&qbhfop=" + (npage + 1); } }