<%@ Page Language="C#" AutoEventWireup="true" Inherits="SuperWeibo.Page._Mobile_Company" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>公共的事</title>
<% =Me.Css() %>
</head>
<body>

<SuperWeibo:header_blog id="header_blog" runat="server" />

<div class="blog_menu">
	<% =Z.C("公共的事") %>
	<div class="blog_menu_right2" onclick="window.location='Welcome.aspx';"></div>
</div>

<div style="clear:both;height:55px;"></div>
<div id="msg_pad" style="clear:both;width:100%;height:0px;"></div>

<% =PageNavigate %>
<div id="scroll_pad" style="min-height:600px;">
<% =PageBuffer %>
</div>

<div style="clear:both;height:45px;"></div>

<div class="nextpage">
	<table width="100%" cellpadding="0" cellspacing="0" border="0" bordercolor="#CCCCCC" style="border-collapse:collapse;text-align:left;">
	<tr id="tr_0" style="display:;">
	   <td style="font-size:16px;color:#FFFFFF;" valign="top" onclick="SayResize(0)">
		<% =Z.C("点击这里发布公告,通知等...") %>
	</tr>
	<tr id="tr_1" style="display:none;">
	   <td style="padding-bottom:1px;">
		  <textarea id="cContent" name="cContent" cols="78" rows="3" class="say_text" style="width:280px;" autocomplete="off"></textarea>
	   </td>
	</tr>
	<tr id="tr_2" style="display:none;">
	   <td>
		 <input type="hidden" id="from" name="from" value="0">
		 <input type="hidden" id="idstyle" name="idstyle" value="1">
		 <img src="/Images/submit.gif" onclick="Magic2Submit()">
		 <img src="/Images/cancel.gif" onclick="SayResize(1)">
	   </td>
	</tr>
	</table>
</div>

<script language="javascript">

function IconAction() {}

function SayResize(cmd)
{
	if(cmd==0) {
		$("div.nextpage").css("height", "135");
		$("tr#tr_0").css("display", "none");
		$("tr#tr_1").css("display", "");
		$("tr#tr_2").css("display", "");
	}
	else {
		$("div.nextpage").css("height", "29");
		$("tr#tr_0").css("display", "");
		$("tr#tr_1").css("display", "none");
		$("tr#tr_2").css("display", "none");
	}
}

function imageResize2(obj)
{
	if(obj.width > 250) 
	{
		obj.width = 250;
	}
}

<% =PageDate%>

var last_x = 0;
var last_y = 0;
var offset_x = 0;
var offset_y = 0;

//定义touchstart事件
document.getElementById("scroll_pad").addEventListener("touchstart", function(ev) {
	var obj = ev.srcElement ? ev.srcElement : ev.target;
	if(obj.tagName == "IMG") return; 
	ev.preventDefault();//一定要阻止默认事件
	var x = ev.touches[0].pageX;//获得手指触摸点的X坐标
	var y = ev.touches[0].pageY;//获得手指触摸点的Y坐标
	last_x = x;
	last_y = y;
}, false);

//定义touchmove事件
document.getElementById("scroll_pad").addEventListener("touchmove", function(ev) {
	var obj = ev.srcElement ? ev.srcElement : ev.target;
	if(obj.tagName == "IMG") return; 
	ev.preventDefault();
	var x = ev.touches[0].pageX;
	var y = ev.touches[0].pageY;
}, false);

//touchend  处理手势
document.getElementById("scroll_pad").addEventListener("touchend", function(ev) {
	var obj = ev.srcElement ? ev.srcElement : ev.target;
	if(obj.tagName == "IMG") return; 
	var x = ev.changedTouches[0].pageX;
	var y = ev.changedTouches[0].pageY;
		
	offset_x = Math.abs(x - last_x); 
	offset_y = Math.abs(y - last_y); 
	
	if(offset_x > offset_y  && offset_x > 5) {

		if(x > last_x) window.location = "/Mobile/Company.aspx?date=" + plast;
		else window.location = "/Mobile/Company.aspx?date=" + pnext;
		
		last_x = x;
		last_y = y;
		return;
	}
	
	if(offset_y > 10) {
		document.body.scrollTop = document.body.scrollTop + ((y > last_y) ? 0-offset_y : offset_y);
		last_x = x;
		last_y = y;
		return
	}

	last_x = x;
	last_y = y;
}, false);

function FileShow(obj,id)
{
	window.location = "/Mobile/Include/FileShow.aspx?id=" + id;
}
function VideoShow(obj) { alert("只有用电脑才能查看视频！"); }

setInterval("GetMessages_Mobile()", 2000);

</script>
</body>
</html>
