var dropReady = false; var dt = null; var dHeight = null; var timer = null; var fq = 20; function dropTopTip(){ if(!checkShow())return; var hd = 0; var loop = function(){ hd += 3; if(hd >= dHeight){ dt.style.marginTop = '0'; clearInterval(timer); dropReady = true; } else{ dt.style.marginTop = '-' + (dHeight - hd) + 'px'; } }; timer = setInterval(loop,fq); } function hideTopTip(){ if(!dropReady)return; if($('noTips').checked){ writeCookie('notshow',1,30); } var hr = 0; var loop = function(){ hr += 3; if(hr >= dHeight){ dt.style.marginTop = '-' + dHeight + 'px'; clearInterval(timer); dropReady = false; } else{ dt.style.marginTop = '-' + hr + 'px'; } }; timer = setInterval(loop,fq); } function readCookie(name) { var cookieValue = ""; var search = name + "="; if(document.cookie.length > 0) { offset = document.cookie.indexOf(search); if (offset != -1) { offset += search.length; end = document.cookie.indexOf(";", offset); if (end == -1) end = document.cookie.length; cookieValue = unescape(document.cookie.substring(offset, end)) } } return cookieValue; } function writeCookie(name, value, hours) { var expire = ""; if(hours != null) { expire = new Date((new Date()).getTime() + hours*3600000); expire = "; expires=" + expire.toGMTString(); } document.cookie = name + "=" + escape(value) + expire; } function delCookie(name) { var exp = new Date(); exp.setTime(exp.getTime() - 1); var cval=readCookie(name); if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString(); } function checkShow()//需要显示TopTip返回true { if(isIE) { if(isiShowInstalled() || readCookie('notshow')) { return false; } return true; }else{ return false; } } function initDrop() { if(!checkShow())return; dt = $('toptip') ? $('toptip') : document.createElement('div'); dt.id = 'toptip'; dt.innerHTML = '