MutilMeetingRoomBrowserChld.jsp 21.8 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697

<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="weaver.general.Util"%>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ page import="java.util.*"%>
<%@page import="weaver.meeting.MeetingShareUtil"%>
<%@page import="net.sf.json.JSONObject"%>
<%@ taglib uri="/browserTag" prefix="brow"%>
<%@ include file="/systeminfo/init_wev8.jsp"%>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="SubCompanyComInfo"
	class="weaver.hrm.company.SubCompanyComInfo" scope="page" />
<jsp:useBean id="MeetingRoomComInfo"
	class="weaver.meeting.Maint.MeetingRoomComInfo" scope="page" />

<%
	String userid = "" + user.getUID();
	String titlename = SystemEnv.getHtmlLabelName(17625, user.getLanguage());
	int from = Util.getIntValue(request.getParameter("from"), -1);
	String callbkfun = Util.null2String(request.getParameter("callbkfun"));
	int forall = Util.getIntValue(request.getParameter("forall"), 0);
	int pageindex=Util.getIntValue(request.getParameter("pageindex"), 0);
	int frommeeting = Util.getIntValue(request.getParameter("frommeeting"), 0);

	String subcompany = Util.null2String(request.getParameter("subcompany"));
	String name = Util.null2String(request.getParameter("name"));
	String desc = Util.null2String(request.getParameter("desc"));
	String equipment = Util.null2String(request.getParameter("equipment"));
	String selectedids = Util.null2String(request.getParameter("selectedids"));
	String selectednames=MeetingRoomComInfo.getMeetingRoomInfoname(selectedids);
	String method = Util.null2String(request.getParameter("method"));
	String mrtype = Util.null2String(request.getParameter("mrtype"));
	if ("getroom".equals(method)) {
		int size=6;
		if(frommeeting==1){
			size=8;
		}
		//构建where语句
		String SqlWhere = "";
		String allUser = MeetingShareUtil.getAllUser(user);

		SqlWhere += " 1=1";
		if (!"".equals(name)) {
			SqlWhere += " and name like '%" + name + "%'";
		}
		if (!"".equals(desc)) {
			SqlWhere += " and roomdesc like '%" + desc + "%'";
		}
		if (!"".equals(subcompany)) {
			SqlWhere += " and subcompanyid = '" + subcompany + "'";
		}
		if (!"".equals(equipment)) {
			SqlWhere += " and equipment like '%" + equipment + "%'";
		}
		if(!"".equals(mrtype)){
			SqlWhere += " and mrtype ='" + mrtype + "'";
		}
		if (forall != 1) {
			SqlWhere += MeetingShareUtil.getRoomShareSql(user);
			SqlWhere += " and (a.status=1 or a.status is null )";
		}
		
		String ret = "";
		rs.execute("select a.id,a.name,a.subcompanyid,a.roomdesc,a.images from meetingroom a where" + SqlWhere+" order by a.dsporder,a.name");
		int j=0;
		int count=rs.getCounts();
		while (rs.next()) {
			if((pageindex*size >j)){
				j++;
				continue;
			}
			if(j>=(pageindex+1)*size){
				break;
			}
			j++;
			String id = rs.getString("id");
			String imgid="";
			String images = rs.getString("images");
			if(images.length()>0){
				imgid = images.split(",")[0];
			}
			String imgsrc = "";
			String ischecked = "";
			String ishide=" style='display:none' ";
			String showImgHtml="";
			if ("".equals(imgid)) {//无图片 不显示右上角显示图片按钮
				imgsrc = "/images/ecology9/meeting/no_img_wev8.png";
			} else {
				imgsrc = "/weaver/weaver.file.FileDownload?fileid=" + imgid;
				showImgHtml="<div class='showimg' title='"+SystemEnv.getHtmlLabelName(221, user.getLanguage())+"' onclick='showImg(\"" + images + "\");'></div>";
			}
			if (!"".equals(selectedids) && ("," + selectedids + ",").indexOf("," + id + ",") > -1) {
				ischecked = "checked='checked'";
				ishide="";
			}
			ret += "<div class='roomdiv'>";
			
			ret += "<div class='img_center' onclick='selected(event,\""+id+"\")'><img style='width:170px;height:165px;margin-top:20px' src='"
					+ imgsrc + "' class='img' /><div class='room_chk' id='room_chk_"+id+"' ><input class='inputstyle' style='height:13px' type='checkbox'  id='roomchk_" + id + "' name='roomchk'  value='" + id
					+ "' " + ischecked + "></div>"+showImgHtml;
			
			ret += "<div class='room_name'>" + Util.fromScreen2(rs.getString("name"), user.getLanguage()) + "</div>";
			ret += "<input id='roomname_" + id + "' type='hidden' value='" + Util.fromScreen2(rs.getString("name"), user.getLanguage()) + "'>";
			ret += "<div class='room_sub'>"
				   + Util.fromScreen2(SubCompanyComInfo.getSubCompanyname(rs.getString("subcompanyid")), user.getLanguage()) + "</div>";
				   
			ret+="<div class='over'></div><div class='desc'>" + Util.fromScreen2(rs.getString("roomdesc"), user.getLanguage()) + "</div></div>";
			ret += "</div>";
		}
		if("".equals(ret)){
			ret+="<div style='text-align: center; height: 30px;width:100%;margin-top:30px'>"+SystemEnv.getHtmlLabelName(83320, user.getLanguage())+"</div>";
		}
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("count",count);
		map.put("html", ret);
		out.clearBuffer();
		JSONObject json = JSONObject.fromObject(map);
		out.println(json);
		return;
	}
%>

<HTML>
	<HEAD>
		<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
		<link rel="stylesheet" href="/css/ecology8/request/requestTopMenu_wev8.css" type="text/css" />
		<link rel="stylesheet" href="/wui/theme/ecology8/jquery/js/zDialog_e8_wev8.css" type="text/css" />
		<LINK href="/wui/theme/ecology8/jquery/js/e8_zDialog_btn_wev8.css" type=text/css rel=STYLESHEET>
		<link href="/js/checkbox/jquery.tzCheckbox_wev8.css" type=text/css rel=STYLESHEET>
		
		<link rel="stylesheet" href="/js/ecology8/jNice/jNice/jNice.css" type="text/css" />
<script type="text/javascript" src="/js/ecology8/jNice/jNice/jquery.jNice.js"></script>
		<!-- 图片浏览处理库 -->
		<script type="text/javascript" src="/social/js/imcarousel/imcarousel.js"></script>
		<style>
.img_center {
	width: 180px;
	height: 230px;
	cursor: pointer;
	position: relative;
	border:0px solid #e2e2e2;
	
}

.over {
	text-align: left;
	background: #2f2f2f;
	position: absolute;
	bottom: 0px;
	width: 170px;
	height: 60px;
	display: none;
	cursor: pointer;
	filter: alpha(opacity = 90);
	-moz-opacity: 0.7;
	-khtml-opacity: 0.7;
	opacity: 0.7;
	color: #fff;
	z-index: 1;
	margin-bottom:45px;
	margin-left:5px;
}

.desc {
	text-align: left;
	position: absolute;
	bottom: 0px;
	width: 170px;
	height: 60px;
	display: none;
	cursor: pointer;
	color: #fff;
	z-index: 2;
	word-wrap: break-word;
	margin-bottom:45px;
	margin-left:5px;
}

.showimg{
	width:18px;
	height:18px;
	float:right;
	z-index:3;
	right:8px;
	top:28px;
	display:none;
	position:absolute;
	background-image:url(/images/ecology9/meeting/zoom_wev8.png);
}
.showimg:hover{
	background-image:url(/images/ecology9/meeting/zoom_hot_wev8.png);
}
.showmore{
	height:30px;
	width:100%;
	line-height: 30px;
}
.showmore:hover {
	color: #000;
	cursor: pointer;
	background:#f8f8f8;
	margin-left:5%;
	margin-right:5%;
	width:90%;
}
.roomdiv{
float:left;margin-top:20px;text-align:center;
}

/**弹出层   开始*/  
.show_m_div { /**弹出层 */  
    display: none;  
    position: absolute;  
    height:60%;  
    width:60%; 
    padding: 8px;  
    z-index: 1002;  
}  
.nextbtn{
	text-align:center;
	cursor: pointer;
	color:#999;
	width: 100%;
	height:20px;
	margin-top:20px;
	margin-bottom:120px;
}
.room_chk{
	left:80px;
	top:0px;
	position:absolute;
	height:13px;
	line-height: 13px;
}
.room_name{
	width:180px;
	height:16px;
	text-align:center;
	margin-left:5px;
}
.room_sub{
	width:180px;
	height:16px;
	color:#999;
	margin-top:4px;
	text-align:center;
	margin-left:5px;
}
</style>
	</HEAD>
	<BODY>
		<%@ include file="/systeminfo/TopTitle_wev8.jsp"%>
		<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp"%>
		<%
			RCMenu += "{" + SystemEnv.getHtmlLabelName(826, user.getLanguage()) + ",javascript:SumitData(),_self} ";
			RCMenuHeight += RCMenuHeightStep;
			RCMenu += "{" + SystemEnv.getHtmlLabelName(197, user.getLanguage()) + ",javascript:search()',_top} ";
			RCMenuHeight += RCMenuHeightStep;
			RCMenu += "{" + SystemEnv.getHtmlLabelName(2022, user.getLanguage()) + ",javascript:resetCondtion()',_top} ";
			RCMenuHeight += RCMenuHeightStep;
		%>
		<%@ include file="/systeminfo/RightClickMenu_wev8.jsp"%>
		<table id="topTitle" cellpadding="0" cellspacing="0">
			<tr>
				<td>
				</td>
				<td class="rightSearchSpan" style="text-align: right;">

					<input type="text" class="searchInput" id="t_name" name="name"
						value="" />
					<span id="advancedSearch" class="advancedSearch"><%=SystemEnv.getHtmlLabelName(21995, user.getLanguage())%></span>
					<span
						title="<%=SystemEnv.getHtmlLabelName(23036, user.getLanguage())%>"
						class="cornerMenu middle"></span>
				</td>
			</tr>
		</table>
		
		<div id="tabDiv" >
			<span id="hoverBtnSpan" class="hoverBtnSpan">
					<span><%=SystemEnv.getHtmlLabelName(780,user.getLanguage()) %></span>
			</span>
		</div>
		<div class="advancedSearchDiv" id="advancedSearchDiv">
			<FORM id=weaverA name=weaverA action="MutilMeetingRoomBrowserChld.jsp"
				method=post>
				<input type="hidden" name="isfrist" value='1'>
				<input type="hidden" name="from" id="from" value='<%=from%>'>
				<input type="hidden" name="forall" id="forall" value='<%=forall%>'>
				<input type="hidden" name="frommeeting" id="frommeeting" value='<%=frommeeting %>'>
				<input type="hidden" name="callbkfun" id="callbkfun"
					value='<%=callbkfun%>'>
				<input type="hidden" name="selectedids" id="selectedids"
					value='<%=selectedids%>'>
				<input type="hidden" name="selectednames" id="selectednames"
					value='<%=selectednames%>'>
				<wea:layout type="4col" attributes='{expandAllGroup:false}'>
					<wea:group
						context='<%=SystemEnv.getHtmlLabelName(32905, user.getLanguage())%>'>
						<wea:item><%=SystemEnv.getHtmlLabelName(31232, user.getLanguage())%></wea:item>
						<wea:item>
							<input type="text" class="InputStyle" id="name" name="name"
								value="<%=name%>">
						</wea:item>
						<wea:item><%=SystemEnv.getHtmlLabelName(433, user.getLanguage())%></wea:item>
						<wea:item>
							<input type="text" class="InputStyle" id="desc" name="desc"
								value="<%=desc%>">
						</wea:item>
						<wea:item><%=SystemEnv.getHtmlLabelName(17868, user.getLanguage())%></wea:item>
						<wea:item>
							<brow:browser viewType="0" name="subcompany"
								browserValue='<%=subcompany%>' browserOnClick=""
								browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/company/SubcompanyBrowser.jsp?selectedids="
								hasInput="true" isSingle="true" hasBrowser="true"
								isMustInput='1' completeUrl="/data.jsp?type=164"
								linkUrl="/hrm/company/HrmSubCompanyDsp.jsp?id="
								browserSpanValue='<%=SubCompanyComInfo.getSubCompanyname(subcompany)%>'></brow:browser>
						</wea:item>
						<wea:item><%=SystemEnv.getHtmlLabelName(500749, user.getLanguage())%></wea:item>
						<wea:item>
							<input type="text" class="InputStyle" id="equipment"
								name="equipment" value="<%=equipment%>">
						</wea:item>
						<!-- 会议室类型-->
						<wea:item><%=SystemEnv.getHtmlLabelName(383904,user.getLanguage())%></wea:item>
						<wea:item>
							<select class=inputstyle name="mrtype" id="mrtype" style="width:185px;float:left">
								<option value=""></option>
							<%rs.execute("select * from MeetingRoom_type order by dsporder"); 
								while(rs.next()){
									String rid=rs.getString("id");
									String rname=rs.getString("name");
									if(mrtype.equals(rid)){
										%>
										<option value="<%=rid %>" selected><%=rname%></option>
										<%
									}else{
							%>		
										<option value="<%=rid %>"><%=rname%></option>
							<%		}
								}%>
							</select>
							</wea:item>
					</wea:group>
					<wea:group context="">
						<wea:item type="toolbar">
							<input type="button" onclick="search();" class="e8_btn_submit"
								value="<%=SystemEnv.getHtmlLabelName(197, user.getLanguage())%>" />
							<input type="button"
								value="<%=SystemEnv.getHtmlLabelName(2022, user.getLanguage())%>"
								class="e8_btn_cancel" onclick="resetCondtion();" />
							<input type="button"
								value="<%=SystemEnv.getHtmlLabelName(201, user.getLanguage())%>"
								class="e8_btn_cancel" id="cancel" />
						</wea:item>
					</wea:group>
				</wea:layout>
			</FORM>
		</div>
		<div id="room" style="width:100%;height:475px;">
		<div id="roomContent" style='width: 100%;'>
		</div>
		
		<div id="nextBtn" class='nextbtn' onclick='showMore()'>
			<div class="showmore"><%=SystemEnv.getHtmlLabelName(83704, user.getLanguage())%></div>
			
		</div>
		</div>
		<div id="show_m_div"></div>
		<div id="zDialog_div_bottom" class="zDialog_div_bottom">
			<wea:layout type="2col">
				<wea:group context="">
					<wea:item type="toolbar">
						<input type="button"
							value="<%=SystemEnv.getHtmlLabelName(826, user.getLanguage())%>"
							class="zd_btn_cancle" onclick="SumitData()">
						<input type="button"
							value="<%=SystemEnv.getHtmlLabelName(311, user.getLanguage())%>"
							class="zd_btn_cancle" onclick="submitClear()">
						<input type="button"
							value="<%=SystemEnv.getHtmlLabelName(201, user.getLanguage())%>"
							class="zd_btn_cancle" onclick="closeDlg()">
					</wea:item>
				</wea:group>
			</wea:layout>
		</div>
	</BODY>
</HTML>
<SCRIPT language="javascript" defer="defer" src="/js/datetime_wev8.js"></script>
<SCRIPT language="javascript" defer="defer"
	src="/js/JSDateTime/WdatePicker_wev8.js"></script>
<script language="javascript"
	src="/js/ecology8/meeting/meetingbase_wev8.js"></script>
<SCRIPT LANGUAGE="JavaScript">
var diag_vote;
var parentWin = parent.parent.parent.getParentWindow(parent.parent);
var dialog = parent.parent.parent.getDialog(parent.parent);
var pageindex=0;
jQuery(document).ready(function(){
$("#nextBtn").css("display","none");
$("#room").css("height",(dialog.Height-105)+"px");
jQuery("#room").perfectScrollbar();
	$.post("/meeting/Maint/MutilMeetingRoomBrowserChld.jsp",{method:'getroom',subcompany:'<%=subcompany%>',name:'<%=name%>',desc:'<%=desc%>',equipment:'<%=equipment%>',selectedids:'<%=selectedids%>',mrtype:'<%=mrtype%>',pageindex:pageindex,frommeeting:'<%=frommeeting%>'},function(data){
			$("#roomContent").html(data.html);
			changestyle(data.count);
			initSelected();
			bindFun();
	},"json");
});

function resetCondtion(){
	resetCondtionBrw("advancedSearchDiv");

	//清空下拉框
	jQuery("#meetingstatus").val("");
	jQuery("#meetingstatus").trigger("change");
	jQuery("#meetingstatus").selectbox('detach');
	jQuery("#meetingstatus").selectbox('attach');
}

function onBtnSearchClick(){
	var name=$("input[name='t_name']",parent.document).val();
	$("input[name='names']").val(name);
	doSearchsubmit();
}


function search(){
	doSearchsubmit();
}

function doSearchsubmit(){
	$('#weaverA').submit();
}

function closeDlg(){
	if(1 == <%=from%>){
		parentWin.closeBrwDlg();
	} else {
		if(dialog){
			dialog.close();
		}else{ 
			window.parent.parent.close();
		}
	}
}
function SumitData(){
	var roomids=$("#selectedids").val();
	var roomnames=$("#selectednames").val();
	roomnames=toHtml(roomnames);
	returnValue({id:roomids,name:roomnames});
}
//返回json格式数据
function returnValue(returnjson){
	if(1 == <%=from%>){
		<%if(!"".equals(callbkfun)){%>
			<%="parentWin." + callbkfun + "(returnjson);"%>
		<%}%>
	} else {
		if(dialog){
			try{
				  dialog.callback(returnjson);
			 }catch(e){}

			try{
				 dialog.close(returnjson);
			 }catch(e){}

		}else{ 
			window.parent.parent.returnValue  = returnjson;
			window.parent.parent.close();
		}
	}
	parentWin.closeBrwDlg();
}
function submitClear(){
    var rooms=$("input[name='roomchk']");
    for(var key=0;key<rooms.size();key++){
    	$(rooms[key]).attr("checked",false);
    }
    $("#selectedids").val("");
	$("#selectednames").val("");
}

function showImg(images){
	//showMDiv();
	 //$("#show_m_div").load("/meeting/a.jsp");
	//var Awin = window.open("/meeting/a.jsp", "newwindow", "height=300, width=400, top=200,left=200 toolbar =no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
	//Awin.hide();
	var imgPool=[];
	var imgids = images.split(",");
	for(var i=0;i<imgids.length;i++){
		if(imgids[i]!=""){
			imgPool.push("/weaver/weaver.file.FileDownload?fileid=" + imgids[i]);
		}
	}
	if(imgPool.length>0){
		IMCarousel.showImgScanner4Pool(true, imgPool, 0, null, window.top);
	}else{
		window.top.Dialog.alert("<%=SystemEnv.getHtmlLabelName(127276,user.getLanguage())%>");
	}
	
}
function showMDiv(){  
//    $("#bg_lock_div").show();  
    $("#show_m_div").show();  
}  
function hiddenMDiv(){  
    document.body.style.overflow="";  
    
    $("#show_m_div").hide();  
    $("#bg_lock_div").hide();  
}

var fromCheckBox=false;

//点击图片选择
//因美化后的控件与原checkbox控件onclick事件存在冲突,采用获取点击事件方式判断点击位置(图片 还是 checkbox框)
//该方法在点击checkbox时回被重复触发两次导致结果不正确,在getSelected()方法中做特殊取值判断
function selected(e,id){
	var eventSource = e.srcElement||e.target;
	var tarname = $(eventSource).attr('name'); 
	if(tarname=="roomchk"){
		$("#selectedids").val(getSelected());
		return;
	}

	var ids=(""+id).split(",");
	for(var i=0;i<ids.length;i++){
		if(ids[i]!=""){
			if($("#roomchk_"+ids[i]).attr("checked")){
				$("#roomchk_"+ids[i]).attr("checked",false);
				changeCheckboxStatus($("#roomchk_"+ids[i]),false);
			}else{
				$("#roomchk_"+ids[i]).attr("checked",true);
				changeCheckboxStatus($("#roomchk_"+ids[i]),true);
			}
		}
	}
	$("#selectedids").val(getSelected());
}


function showMore(){
	pageindex=pageindex+1;
	var selectedids=$("#selectedids").val();
	$.post("/meeting/Maint/MutilMeetingRoomBrowserChld.jsp",{method:'getroom',subcompany:'<%=subcompany%>',name:'<%=name%>',desc:'<%=desc%>',equipment:'<%=equipment%>',selectedids:selectedids,pageindex:pageindex,frommeeting:'<%=frommeeting%>'},function(data){
		$("#roomContent").html($("#roomContent").html()+data.html);
		changestyle(data.count);
		initSelected();
		bindFun();
	},"json");
}

function bindFun(){
$(".img_center").unbind("hover");
$('.img_center .showimg').unbind("click");
$('.img_center .room_chk').unbind("click");
	$(".img_center").hover(function(){
		if($(this).find(".desc").text().trim()!=""){
	  		$(this).find(".over").show();
	  		$(this).find(".over").animate({height:"60px"});
	  		$(this).find(".desc").show();
	  		$(this).find(".desc").animate({height:"60px"});
  		}
  		$(this).find(".showimg").show();
  		
  	},
  	function(){
  		$(this).find(".over").hide();
  		$(this).find(".over").animate({height:"0px"});
  		$(this).find(".desc").hide();
  		$(this).find(".desc").animate({height:"0px"});
  		$(this).find(".showimg").hide();
  		
  	});
  	$('.img_center .showimg').click(function(e){
	   e.stopPropagation();
	})
	$('.img_center .room_chk').click(function(e){
	  // e.stopPropagation();
	})
}
//自动计算样式布局
function changestyle(count){
	var size=6;
	if(<%=frommeeting%>==1){
		size=8;
	}
	var content_w=$("#roomContent").width();//总宽度
	var linenum=parseInt(content_w/182);//每行个数
	var empty_w=(content_w-linenum*182)/(linenum*2);//间隔
	$(".roomdiv").css("margin-left",empty_w+"px");
	$(".roomdiv").css("margin-right",empty_w+"px");
	
	if(count<=(pageindex+1)*size){
	$("#nextBtn").css("display","none");
		$("#roomContent").css("height",Math.ceil(count/linenum)*252+100+"px");
	}else{
		$("#nextBtn").css("display","");
		$("#roomContent").css("height",Math.ceil((pageindex+1)*size/linenum)*252+"px");
	}
	jQuery("#room").perfectScrollbar("update");
}
function toHtml(s){ 
    var i = 0;
    var buf="";
    var ch="";
    while(i<s.length){
    	ch=s[i];
    	if (ch == '\'')
                buf+=("\''");
            else if (ch == '<')
                buf+=("&lt;");
            else if (ch == '>')
                buf+=("&gt;");
            else if (ch == '"')
                buf+=("&quot;");
            else if (ch == '\n')
                buf+=("<br>");
            else
            	buf+=(ch);
    	i++;
    }
    return buf;
}
//获取以选择的值
function getSelected(){
	var roomids="";
	var rooms=$("input[name='roomchk']");
	var ids=[];
	var roomnames=[];
	if($("#selectedids").val()!=""){
		ids=$("#selectedids").val().split(",");
		roomnames=$("#selectednames").val().split(",");
	}
	for(var key=0;key<rooms.size();key++){//遍历当前选择项
		var index=ids.indexOf($(rooms[key]).val());
		//美化后的checkbox在点击时会触发两次,导致checkbox点击两次状态没改变
		//此处通过美化层的样式判断是否被选中
		var clazz=($(rooms[key]).next("span.jNiceCheckbox").attr("class"));	//获取选中控件美化层的样式 
		if(clazz.indexOf("jNiceChecked")>-1){	//该项为以选择项
			if(index<0){//不存在于历史选择项 添加至历史选择项中
			ids[ids.length]=$(rooms[key]).val();
			roomnames[roomnames.length]=$("#roomname_"+$(rooms[key]).val()).val();
			}
		}else{//该项为未选择项
			if(index>-1){//存在于历史选择项 从历史选择项中删除
				ids.splice(index,1);
				roomnames.splice(index,1);
			}
		}
	}
	$("#selectedids").val(ids);
	$("#selectednames").val(roomnames);
	return ids;
}
//初始化选择状态
function initSelected(){
	jQuery('body').jNice();
	var rooms=$("input[name='roomchk']");
	var ids=[];
	if($("#selectedids").val()!=""){
		ids=$("#selectedids").val().split(",");
	}
	for(var key=0;key<rooms.size();key++){
		if(ids.indexOf($(rooms[key]).val())>=0){
			$(rooms[key]).attr("checked",true);
			changeCheckboxStatus($(rooms[key]),true);
		}else{
			$(rooms[key]).attr("checked",false);
			changeCheckboxStatus($(rooms[key]),false);
		}
	}
	
}
//重写用于更改美化后的checkbox状态方法 防止获取更多后该方法失效
var changeCheckboxStatus = function(obj,checked){
		if(obj.attr("disabled")||obj.attr("readonly"))return;
		if(checked==true||checked==false){
			obj.attr("checked",checked);
		}
		if(checked){
			obj.next("span.jNiceCheckbox").addClass("jNiceChecked");
		}else{
			obj.next("span.jNiceCheckbox").removeClass("jNiceChecked");
		}
	}	
function preDo(){
	//tabSelectChg();
	$("#topTitle").topMenuTitle({searchFn:onBtnSearchClick});
	$(".topMenuTitle td:eq(0)").html($("#tabDiv").html());
	$("#tabDiv").remove();
	$("#hoverBtnSpan").hoverBtn();
}
</SCRIPT>