<script type="text/javascript">
var scrip = '';
var iLayerMaxNum = 10000;
var dbId;
var content = "";
var scripNick = "";
var d1;
document.onmouseup = me;
document.onmousemove = ms;
var scripX;
var scripY;
var isShowLogin = false;
function Move(Object, event)
{
scrip = Object.id;
if(document.all)
{
document.getElementById(scrip).setCapture();
scripX = event.x - document.getElementById(scrip).style.pixelLeft;
scripY = event.y - document.getElementById(scrip).style.pixelTop;
}
else if(window.captureEvents)
{
window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
scripX = event.clientX - parseInt(document.getElementById(scrip).style.left);
scripY = event.clientY - parseInt(document.getElementById(scrip).style.top) - d1.offsetTop;
}
if(scrip != "scrip"+dbId){
document.getElementById(scrip).style.zIndex = iLayerMaxNum;
iLayerMaxNum = iLayerMaxNum + 1;
}
}
function ms(evt)
{
if(scrip!=''){
if(document.all)
{
document.getElementById(scrip).style.left = event.x - scripX;
document.getElementById(scrip).style.top = event.y - scripY;
}
else if(window.captureEvents)
{
/* var iScrollTop = document.body.scrollTop + document.documentElement.scrollTop;
var iScrollLeft = document.body.scrollLeft + document.documentElement.scrollLeft;
var s = document.getElementById(scrip);
s.style.left = evt.clientX + iScrollLeft - d1.offsetLeft + "px";
s.style.top = evt.clientY + iScrollTop - d1.offsetTop + "px";
*/
var s = document.getElementById(scrip);
s.style.left = evt.clientX - scripX + "px";
s.style.top = evt.clientY - scripY - d1.offsetTop + "px";
}
}
}
function me(evt){
if(scrip!=''){
if(document.all)
{
document.getElementById(scrip).releaseCapture();
scrip='';
}
else if(window.captureEvents){
window.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP);
scrip='';
}
}
}
//删除函数
function delMessage(n)
{
var Messageid = 'scrip' + n;
document.getElementById(Messageid).style.display = 'none';
if(n == dbId)App.lock(false);
}
//查询函数
function searchmessage(no)
{
var b = 0 ;
if(no)
b = no;
else
b = document.getElementById("scripNo").value;
var n = parseInt(b,10);
if(isNaN(b)){
alert("纸条编号必须为数字");
return false;
}else if(n < 1){
alert("纸条编号必须为正整数");
return false;
}
/* for(var i = 0;i < sArray.length;i++)
{
if(n == sArray[i][0]){
var Messageid = 'scrip' + n;
document.getElementById(Messageid).style.display = 'block';
dbrun(n,false,true);
break;
}
}
if(i == sArray.length){*/
var strMethod = "get";
var url = document.URL.substring(0,document.URL.lastIndexOf("/")) + "/service";
var sParam = '?serviceid=query&scrip=' + n + "&patch=" + Date.parse(new Date());
startRequest(url+sParam);
// }
return false;
}
function afterCall(oResponse)
{
var str = oResponse.responseText;
eval(str);
}
//动态显示纸条
function showmessage(n) {
if (sArray[n] != undefined){
dbrun(n);
}
}
//双击纸条函数
function dbrun(id,bOpen,bCenter)
{
dbId = id;
show(true,id,bCenter);
}
function init(){
var c = document.getElementById("console");
d1 = document.getElementById("d1");
App.init(c);
if(initno == 0)return;
if(initno < 0){
alert("您搜索的纸条不存在!");
}else{
searchmessage(initno);
// QQLoveShowRecevier(initno)
}
}
function show(b,id,bCenter){
var flashDiv = document.getElementById("messageflash");
if(b && (b ^ App.isLocked)){
var showDiv = document.getElementById("scrip"+id);
showDiv.style.zIndex = 200101;
showDiv.firstChild.lastChild.previousSibling.innerHTML = " <a href=/"step1.jsp/">我也要发字条</a> "+showDiv.firstChild.lastChild.previousSibling.innerHTML;
if(id == initno || bCenter){
showDiv.style.left = 353;
showDiv.style.top = 150;
}
App.lock(true);
}else{
if(isShowLogin)
return ;
var showDiv = document.getElementById("scrip"+dbId);
if(showDiv.firstChild.lastChild.previousSibling.firstChild && showDiv.firstChild.lastChild.previousSibling.firstChild.tagName == "A")
showDiv.firstChild.lastChild.previousSibling.removeChild(showDiv.firstChild.lastChild.previousSibling.firstChild);
showDiv.style.zIndex = iLayerMaxNum;
iLayerMaxNum = iLayerMaxNum + 1;
dbId = 0;
App.lock(false);
}
}
function showSingle()
{
var j = sArray.length - 1;
var str = '<div id="scrip'+sArray[j][0]+'" class="Message" style="position:absolute; left:'+sArray[j][2]+'px;top:'+sArray[j][3]+'px;z-index:'+sArray[j][9]+'" οnmοusedοwn="Move(this, event)" οndblclick="dbrun('+sArray[j][0]+')"><div class="Style'+sArray[j][1]+'">/
<div class="Num">字条编号:'+sArray[j][0]+' <img src="images/icon_close.gif" alt="关闭" οnclick="delMessage(/''+sArray[j][0]+'/')"></div>/
<p class="Detail"><img src="'+sArray[j][4]+'" class="Heart" /><span class="Head">'+sArray[j][5]+'</span><br />'+sArray[j][6]+'</p>/
<p class="Sign">'+sArray[j][7]+' </p>/
<P class="Date"><a href="note.jsp?scrip='+sArray[j][0]+'" target="_blank"> 评论('+sArray[j][10]+')</a> '+sArray[j][8]+'</p></div></div>';
document.getElementById("d1").innerHTML += str;
}
function Tip(ID,Attr){
document.getElementById(ID).style.display = Attr;
}
function showLogin(show,id)
{
if(!id)
id = "Login";
if(show){
isShowLogin = true;
document.getElementById(id).style.display = "block";
document.getElementById("logifr").src = "log_ind.jsp?bu=log_ok.jsp?from=bulletin#pay";
App.lock(true);
}else{
isShowLogin = false;
document.getElementById(id).style.display = "none";
App.lock(false);
}
return false;
}
var xmlHttp;
function createXMLHttpRequest(){
if(window.ActiveXObject){
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}else if(window.XMLHttpRequest){
xmlHttp = new XMLHttpRequest();
}
}
function startRequest(url){
createXMLHttpRequest();
xmlHttp.onreadystatechange = afterRequest;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function afterRequest(){
if(xmlHttp.readyState == 4){
if(xmlHttp.status == 200){
eval(xmlHttp.responseText);
}
}
}
function toInt(str){
var ret=0;
var mid_num;
for(var i=0;i<str.length;i++){
mid_num=str.charAt(i);
if(mid_num<'0' || mid_num>'9')
{
return -1;
}
ret=ret*10+(mid_num-'0');
}
return ret;
}
function QQLoveShowRecevier(array)
{
if (!document.getElementById("ViewmyMessageWrap"))
{
var e = document.createElement("DIV");
e.id = "ViewmyMessageWrap";
QQLoveRecevierBody(array,e);
document.body.appendChild(e);
}else{
QQLoveRecevierBody(array,document.getElementById("ViewmyMessageWrap"));
}
showLogin(true,"ViewmyMessageWrap");
}
function QQLoveRecevierBody(array,recevierObj)
{
var htmlStr = "<h2><span οnclick='showLogin(false,/"ViewmyMessageWrap/")'>×</span> <em class='t_bold'>"+array[9]+"("+array[10]+")</em> 写给你的爱墙字条:</h2>";
htmlStr += "<div id='ViewmyMessageLeft'>";
htmlStr += "<div id='Message' class='Message'><div id='styleDiv' class='Style"+array[1]+"'>";
htmlStr += "<div class='Num'>字条编号: "+array[0]+"<img src='images/icon_close.gif' alt='关闭' /></div>";
htmlStr += "<p id='Detail' class='Detail'><img src='"+array[4]+"' name='IconImg' width='50' height='50' class='Heart' id='IconImg' /><span class='Head' id='Head'>"+array[5]+":</span><br />";
htmlStr += "<span id='AreaText'>"+array[6]+"</span></p>";
htmlStr += "<p class='Sign' id='Sign'>"+array[7]+"</p>";
htmlStr += "<p class='Date'>"+array[8]+"</p>";
htmlStr += "</div></div></div>";
htmlStr += "<div id='ViewmyMessageRight'><form action='service' method='post' οnsubmit='var v = this.c.value.toString(); if(v.length == 0){alert(/"请输入评论内容/");return false;}'><p>给 <em class='t_bold'>"+array[9]+"</em> 的回复:</p><textarea id='c' name='c'></textarea>"
htmlStr += "<p class='AC'><input type='hidden' name='serviceid' value='subdis'/><input type='hidden' name='redirect' value='true'/><input type='hidden' name='scrip' value='"+array[0]+"'/><input type='submit' id='reremarks' value='' /></p></form></div>";
recevierObj.innerHTML = htmlStr;
}
function QQLoveShowSingle(array)
{
var n = array[0];
for(var i = 0;i < sArray.length;i++)
{
if(n == sArray[i][0]){
var Messageid = 'scrip' + n;
document.getElementById(Messageid).style.display = 'block';
dbrun(n,false,true);
break;
}
}
if(i == sArray.length){
sArray[sArray.length] = array;
var str = '<div id="scrip'+array[0]+'" class="Message" style="position:absolute; left:'+array[2]+'px;top:'+array[3]+'px;z-index:'+array[9]+'" οnmοusedοwn="Move(this, event)" οndblclick="dbrun('+array[0]+')"><div class="Style'+array[1]+'">/
<div class="Num">字条编号:'+array[0]+' <img src="images/icon_close.gif" alt="关闭" οnclick="delMessage(/''+array[0]+'/')"></div>/
<p class="Detail"><img src="'+array[4]+'" class="Heart" /><span class="Head">'+array[5]+'</span><br />'+array[6]+'</p>/
<p class="Sign">'+array[7]+' </p>/
<P class="Date"><a href="note.jsp?scrip='+array[0]+'" target="_blank"> 评论('+array[10]+')</a> '+array[8]+'</p></div></div>';
document.getElementById("d1").innerHTML += str;
dbrun(array[0],false,true);
}
}
</script>
<style type="text/css">
.Message{
line-height:18px;
width:240px;
height:203px;
position:absolute;
cursor:move;
z-index:0;
font-size:12px;
background-repeat: no-repeat;
background-position: center top;
}
.Message h2{font-weight:normal; font-size:12px; margin:4px 0;}
.Style0{padding:11px 10px 0 22px; height:192px;}
.Num{cursor:move; padding-left:13px;}
.Num img{float:right; cursor:pointer; margin-top:-15px;}
.Detail{margin:3px -1px 0 0; height:115px; line-height:17px; overflow:hidden; word-wrap:break-word;}
.Sign{height:14px;margin:0; text-align:right; line-height:14px;}
.Message a{text-decoration:underline;}
.Message a:hover{text-decoration:none;}
.Date{margin:0; text-align:right; font-size:10px;}
.Heart{float:left; margin:0 4px -10px 0;}
</style>
<div id='scrip4361705' class='Message' style='left:8px;top:78px;background-image: url(style4.gif);' οnmοusedοwn='Move(this, event)' οndblclick='dbrun(4361705)'>
<div class='Style0'>
<div class='Num'>
字条编号:4361705<img src='http://lovewall.qq.com/images/icon_close.gif' alt='关闭' οnclick='delMessage(4361705)'>
</div>
<p class='Detail'>
<img src='http://ring1.qq.com/lovewall_item/images/2007/0710/11700000.gif' class='Heart'>辉:<br>
好几天没和你联系上了 没有你的时候觉得好寂寞
<img src="http://imgcache.qq.com/qzone/em/e34.gif" border="0">
</p>
<p class='Sign'>雪</p>
<p class='Date'><a href='note.jsp?scrip=4361705' target='_blank'>评论(0)</a> 2007-09-17 12:55:14</p>
</div>
</div>