var ismozilla; var objdiv = null; var originaldivhtml = ""; var divid = ""; var isover = false; var aimdiv = ""; function builddimmerdiv() { document.write('
') } function displayfloatingdiv(divid, title, width, height) { divid = divid; aimdiv = document.getelementbyid(divid); var popdiv = $("#" + divid).find(".popdivarea")[0]; popdiv.style.background = "none repeat scroll 0 0 #ffffff"; popdiv.style.width =width+ "px"; popdiv.style.height = (height - 40).tostring() + "px";//如果头部高度调整,则这里也需要调整 document.getelementbyid('dimmer').style.display = "block"; aimdiv.style.width = width + 'px'; aimdiv.style.height = height + 'px'; //aimdiv.style.left = ((window.innerwidth - width) / 2).tostring() + "px"; aimdiv.style.left = ((document.documentelement.clientwidth - width) / 2).tostring() + "px"; //aimdiv.style.top = '208px'; aimdiv.style.top = ((730 - height) * (1 / 3)) + "px"; aimdiv.style.position = "fixed"; var addheader; originaldivhtml = aimdiv.innerhtml; addheader = '' + '' + '
' + title + '' + 'close...
'; aimdiv.innerhtml = addheader + originaldivhtml; aimdiv.classname = 'dimming'; aimdiv.style.display = "block"; } function hiddenfloatingdiv(divid) { aimdiv.innerhtml = originaldivhtml; aimdiv.style.display = 'none'; document.getelementbyid('dimmer').style.display = 'none'; divid = "" } function mousedown(e) { if (isover) { if (ismozilla) { objdiv = aimdiv; x = e.layerx; y = e.layery; return false } else { objdiv = aimdiv; objdiv = objdiv.style; x = event.offsetx; y = event.offsety } } } function mousemove(e) { if (objdiv) { if (ismozilla) { objdiv.style.top = (e.clienty - y) + 'px'; objdiv.style.left = (e.clientx - x) + 'px'; return false } else { objdiv.pixelleft = event.clientx - x + document.body.scrollleft; objdiv.pixeltop = event.clienty - y + document.body.scrolltop; return false } } } function mouseup() { objdiv = null } function init() { ismozilla = (document.all) ? 0 : 1; if (ismozilla) { document.captureevents(event.mousedown | event.mousemove | event.mouseup) } document.onmousedown = mousedown; document.onmousemove = mousemove; document.onmouseup = mouseup; builddimmerdiv() } init();