<!-- #include file="setup.asp" -->
<%
if Request.Cookies("username")=empty then ERROR2("您还未登录社区，不能参观别人的住宅！")
building=Request.QueryString ("building")
username1=Request("username")
select case building
case "1"
name="小 木 房"
price=500
info="简陋的木屋，虽然不怎么好看，但是也算有个家了！"
case "2"
name="阳 光 屋"
price=2000
info="池塘边的石屋，冬暖夏凉，环境优雅，适合喜欢大自然的情侣居住！"
case "3"
name="叮 当 窝"
price=3000
info="环境优雅，景色宜人，但是噪音比较大！"
case "4"
name="清 风 居"
price=5000
info="与城市住宅相比，噪音明显下降，而且周边服务设施比较齐全！"
case "5"
name="豪华宾馆"
price=7000
info="白雪皑皑的圣诞夜里，你不想和异性伴侣来此欢度一夜吗？"
case "6"
name="小型别墅"
price=7000
info="地处悠远的神秘之林，有周到的仆人为你服务，还可以探索大自然的奥秘！"
case "7"
name="花园别墅"
price=10000
info="宫殿金碧辉煌，配有室外游泳池，露天足球场！"
case "8"
name="红色宫殿"
price=15000
info="璀璨的白玉让你目不暇接，殿下的神湖配有汽艇供你游玩！"
case "9"
name="黄金圣殿"
price=30000
info="人间最美丽的地方莫过于此，神话般的游船可以带你到向往的地方！"
case "10"
name="钻石圣殿"
price=40000
info="不理世间一切繁琐之事，和神仙姐姐来此共度至死不渝的爱情神话！"
case "11"
name="云莱仙境"
price=50000
info="带上自己心爱的人到这里体会梦一般的境界，爱情在这里得到永生！"

end select 
select case Request("menu")

case "xiuxi"
            

 if Request.Cookies("username")<>Request("username") and Request.Cookies("username")<>Request("consort") then error2("你走错门了吧，这不是你家！")
 if Request.Cookies("username")=Request("username") then conn.execute("update [user] set userlife=100 where username='"&Request("username")&"'")
if Request.Cookies("username")=Request("consort") then conn.execute("update [user] set userlife=100 where username='"&Request("consort")&"'")

 %>
<script language="vbscript">
			msgbox"回家休息了一会，体力全满了！",0,"社区提示"
			history.back
			</script>
<% 
			 
case "daoqie"
if Request.Cookies("username")=Request("username") or Request.Cookies("username")=Request("consort") then error2("你疯了，连自己家也偷！")
	            
if conn.execute("select userlife from [user] where username='"&Request.Cookies("username")&"'")(0)<50 then error2("体力还不足50，不能进行盗窃！")
Randomize
d1=rnd*10+Request("building")
if d1>1 and d1<7 then 
sql="select money from [user] where username='"&Request("username")&"'"
rs.Open sql,Conn,1,3
money1=100
rs("money")=rs("money")-100
rs.update
rs.close

sql1="select money from [user] where username='"&Request.Cookies("username")&"'"
rs.Open sql1,Conn,1,3
rs("money")=rs("money")+money1
rs.update
rs.close
%>
<script language="vbscript">
			msgbox"入室盗窃成功，偷到了<%=money1%>元！",0,"社区提示"
			history.back
</script><% 
			  
end if

if d1>7 and d1<15 then
conn.execute("update [user] set userlife=20 where username='"&Request.Cookies("username")&"'")
%>
<script language="vbscript">
			msgbox"盗窃时恰好主人回来，你仓皇逃跑，体力减少为20！",0,"社区提示"
			history.back
</script>

<%
end if
if d1>15 then
sql="select money,userlife from [user] where username='"&Request.Cookies("username")&"'"
rs.Open sql,Conn,1,3
money2=rs("money")
rs("money")=0
rs("userlife")=0
rs.update
rs.close
sql1="select money from [user] where username='"&Request("username")&"'"
rs.Open sql1,Conn,1,3
rs("money")=rs("money")+money2
rs.update
rs.close
%>
<script language="vbscript">
			msgbox"盗窃时被保安抓住，挨了顿打后体力降为0，身上的钱也全被没收了！",0,"社区提示"
			history.back
</script>
<% end if
       end select
%>
<HTML>
<HEAD>
<title>住宅详情</title>
<script Language="JavaScript">
//***********默认设置定义.*********************
tPopWait=0;//停留tWait豪秒后显示提示。
tPopShow=7000;//显示tShow豪秒后关闭提示
showPopStep=150;
popOpacity=250;

//***************内部变量定义*****************
sPop=null;
curShow=null;
tFadeOut=null;
tFadeIn=null;
tFadeWaiting=null;

document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText { background-color: #ffffff;color:#333399; border: 1px #3366ff solid;font-color: font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id='dypopLayer' ' style='position:absolute;z-index:1000;' class='cPopText'></div>");


function showPopupText(){
var o=event.srcElement;
MouseX=event.x;
MouseY=event.y;
if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
if(o.dypop!=sPop) {
sPop=o.dypop;
clearTimeout(curShow);
clearTimeout(tFadeOut);
clearTimeout(tFadeIn);
clearTimeout(tFadeWaiting); 
if(sPop==null || sPop=="") {
dypopLayer.innerHTML="";
dypopLayer.style.filter="Alpha()";
dypopLayer.filters.Alpha.opacity=0; 
}
else {
if(o.dyclass!=null) popStyle=o.dyclass 
else popStyle="cPopText";
curShow=setTimeout("showIt()",tPopWait);
}

}
}

function showIt(){
dypopLayer.className=popStyle;
dypopLayer.innerHTML=sPop;
popWidth=dypopLayer.clientWidth;
popHeight=dypopLayer.clientHeight;
if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
else popLeftAdjust=0;
if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
else popTopAdjust=0;
dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
dypopLayer.style.filter="Alpha(Opacity=0)";
fadeOut();
}

function fadeOut(){
if(dypopLayer.filters.Alpha.opacity<popOpacity) {
dypopLayer.filters.Alpha.opacity+=showPopStep;
tFadeOut=setTimeout("fadeOut()",1);
}
else {
dypopLayer.filters.Alpha.opacity=popOpacity;
tFadeWaiting=setTimeout("fadeIn()",tPopShow);
}
}

function fadeIn(){
if(dypopLayer.filters.Alpha.opacity>0) {
dypopLayer.filters.Alpha.opacity-=1;
tFadeIn=setTimeout("fadeIn()",1);
}
}
document.onmouseover=showPopupText;

function CheckAll(form) {
for (var i=0;i<form.elements.length;i++) {
var e = form.elements[i];
if (e.name != 'chkall') e.checked = form.chkall.checked; 
}
}
</script>
<link href="images/skins/<%=Request.Cookies("skins")%>/bbs.css" rel="stylesheet">
</HEAD>
<body  leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="280" border="0" cellspacing="0" cellpadding="0" height="226" background="images/plus/b<%=building%>.gif" title="<%=info%>" align="center">
  <tr> 
    <td align="center"  valign="bottom">	
	<table border="0" cellspacing="3" cellpadding="3" align="center">
  <tr>
<%

sql="select userface,consort from [user] where username='"&username1&"'"
rs.Open sql,Conn
    Response.Write"<td align=center><img height=80 width=80 border=0 title=有空进屋坐坐！ src='"&rs("userface")&"'><br>"&username1&"</td>"
if rs("consort")<>empty then 
Response.Write"<td align=center><img height=80 title=欢迎来我家做客啊！  border=0 src='"&conn.execute("select userface from [user] where username='"&rs("consort")&"'")(0)&"'><br>"&rs("consort")&"</td>"
Response.Write"<td align=right valign=bottom><form method=POST action=?menu=xiuxi&username="&username1&"&consort="&rs("consort")&"><input type=submit title=今天累了一天，要回家歇歇了！ value=回家休息 name=submit class=input></form><form method=POST action=?menu=daoqie&building="&building&"&username="&username1&"&consort="&rs("consort")&"><input type=submit title=这家好象没人，看看里面有什么值钱的东西！ value=入室盗窃 name=submit class=input></form></td>"
else
Response.Write"<td align=right valign=bottom><form method=POST action=?menu=xiuxi&username="&username1&"><input type=submit title=今天累了一天，要回家歇歇了！ value=回家休息 name=submit class=input></form><form method=POST action=?menu=daoqie&building="&building&"&username="&username1&"><input type=submit title=这家好象没人，看看里面有什么值钱的东西！ value=入室盗窃 name=submit class=input></form></td>"
end if
rs.close
set rs=nothing

 %>
</tr>
</table>
	</td>  </tr>
</table>

<table width="280" border="0" cellspacing="1" cellpadding="0" height="20" align="center" class=a2 >
<tr class=a4>
     <td width="140"  align="center"><font color="#0066CC">住宅名称：<%=name%></font></td>
	<td  align="center" width="140">价格：<font color="#FF3300"><%=price%></font>元</td>
  </tr>

</table>
</body>
</HTML>

