document.write(""); function DelCookies(name) { var exp = new Date(); exp.setTime(exp.getTime() - 1); var cval=getCookie(name); if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString() + ";path=/"; } function OpenChatBox(url) { var iHeight = 600; var iWidth = 710; var iTop = (window.screen.availHeight - 30 - iHeight) / 2; //获得窗口的垂直位置; var iLeft = (window.screen.availWidth - 10 - iWidth) / 2; //获得窗口的水平位置; window.open(url, '_blank', 'height=' + iHeight + ', width=' + iWidth + ', top=' + iTop + ', left=' + iLeft + ', toolbar=no, menubar=no, scrollbars=no,resizable=no, location=no, status=no'); //window.open(url, window, 'dialogWidth:700px; dialogHeight:600px;help:1;status:1;resizeable:0;'); } //获取窗口高度 function getWindowHeight() { var windowHeight = 0; if (typeof (window.innerHeight) == 'number') { windowHeight = window.innerHeight; } else { if (document.documentElement && document.documentElement.clientHeight) { windowHeight = document.documentElement.clientHeight; } else { if (document.body && document.body.clientHeight) { windowHeight = document.body.clientHeight; } } } return windowHeight; } //获取窗口宽度 function getWindowWidth() { var windowWidth = 0; if (typeof (window.innerWidth) == 'number') { windowWidth = window.innerWidth; } else { if (document.documentElement && document.documentElement.clientWidth) { windowWidth = document.documentElement.clientWidth; } else { if (document.body && document.body.clientWidth) { windowWidth = document.body.clientWidth; } } } return windowWidth; } function ResetRightDivpostion() { var _move = false; var _x, _y; var index_x, index_y; jQuery("#KFRightScreen").bind("mousedown", downIndex); jQuery(document).bind("mousemove", mmove); jQuery(document).bind("mouseup", mup); jQuery("#KFRightScreen").css("cursor", "move"); //jQuery("#KFRightScreen").css("-moz-user-select", "none"); function mmove(event) { if (_move) { var x = event.pageX - _x; var y = event.pageY - _y; if(x>getWindowWidth()-10) x=getWindowWidth()-10 if(y>getWindowHeight()-10) y=getWindowHeight()-10 jQuery("#KFRightScreen").css({ top: y, left: x }); showDiv(x, y); } var tishi=document.getElementById("KFBoxTitle"); //e = e||event; event = event || window.event; var obj = event.srcElement?event.srcElement:event.target; while(obj) { if(obj.id=="KFCenterScreen"||obj.id=="KFRightScreen"){ tishi.style.display="block"; var clientLeft=event.clientX+10; var clientTop=event.clientY+10+document.documentElement.scrollTop+document.body.scrollTop; //if(clientLeft>getWindowWidth()-215) //clientLeft=getWindowWidth()-215 //if(clientTop>getWindowHeight()-20) //clientTop=getWindowHeight()-20 tishi.style.left=clientLeft+"px"; tishi.style.top=clientTop+"px"; obj = null; } else{ obj = obj.offsetParent; tishi.style.display="none"; } } } function mup() { _move = false; } function downIndex(e) { _move = true; _x = e.pageX - parseInt(jQuery("#KFRightScreen").css("left")); _y = e.pageY - parseInt(jQuery("#KFRightScreen").css("top")); } function showDiv(x, y) { setCookie("KFRightScreenLeft_2", x, 365); setCookie("KFRightScreenTop_2", y, 365); } } function RightBoxShow(){ if ((jQuery("#KFRightScreen")==null||jQuery("#KFRightScreen").length < 1)&&typeof getCookie("KfCenterBox_469") != "undefined") { var topMargin = getWindowHeight() / 2 - 168 / 2; var leftMargin = getWindowWidth()-116; var abc = ""; abc += "
"; abc += "
"; abc += "
"; abc += "
点住鼠标左键,可以拖动到任意位置
"; jQuery("body").prepend(abc); if (jQuery("#KFRightScreen") != null) { jQuery("#KFRightScreen a").click(function(){ var strUrlReferrer=""; OpenChatBox("http://chat.fzfzjx.com/Chat/ChatIndex/2?Weburl="+strUrlReferrer); return false; }); ResetRightDivpostion(); if(typeof getCookie("KFRightScreenLeft_2") != "undefined") { var leftpx=getCookie("KFRightScreenLeft_2"); jQuery("#KFRightScreen").css("left", leftpx + "px"); } else jQuery("#KFRightScreen").css("left", leftMargin + "px"); if (!( /msie/.test(navigator.userAgent.toLowerCase())) || ( /msie/.test(navigator.userAgent.toLowerCase())) && ('undefined' == typeof(document.body.style.maxHeight))){ if(typeof getCookie("KFRightScreenTop_2") != "undefined") { var toppx=getCookie("KFRightScreenTop_2"); jQuery("#KFRightScreen").css("top", toppx + "px"); jQuery("#KFRightScreen").animate({ height: '168px' }, 1000); } else{ jQuery("#KFRightScreen").css("top", topMargin + "px"); jQuery("#KFRightScreen").animate({ height: '168px' }, 1000); } } jQuery("#KFRightScreen").show(); jQuery(window).resize(function(){ DelCookies("KFRightScreenLeft_2"); DelCookies("KFRightScreenTop_2"); leftMargin = getWindowWidth()-116; jQuery("#KFRightScreen").css("left", leftMargin + "px"); if (!(jQuery.browser.msie) || (jQuery.browser.msie) && (jQuery.browser.version != "6.0")){ topMargin = getWindowHeight() / 2 - 168 / 2; jQuery("#KFRightScreen").css("top", topMargin + "px"); } }); } } } jQuery(document).ready(function () { RightBoxShow(); });