<%@ Page Language="C#" AutoEventWireup="true" Inherits="SuperWeibo.Page._Mobile_ProjectList" %>
<!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 style="padding:8px;">
<% =PageBuffer %>
</div>

<span id="blog_st4"></span>

<script language="javascript">


function JoinForm(id)
{
	//SearchCancel();
    var html = "<iframe src=\"/Computer/Include/ProjectJoin.aspx?id=" + id + "\" width=\"634\" height=\"292\" border=\"0\" bordercolor=\"#000000\" frameborder=\"no\" scrolling=\"no\" style=\"border-bottom:dotted 1px #CCCCCC;\"></iframe>";
	$("#prj_crt").html(html);
}

function IconAction() {}

function Goto(event)
{
	event = event || window.event;
	var y = event.clientY + this.scrollTop;

	var p = AbsolutePosition(this);

	window.location = "/Mobile/Project.aspx?y=" + (y - p.y);
}

LoadLargeImages3();

function ScrollOffset(dx)
{
	var vobj = document.getElementById("large_image_pad");
	vobj.scrollLeft = dx + vobj.scrollLeft;
}

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

//定义touchstart事件
document.getElementById("large_image_pad").addEventListener("touchstart", function(ev) {
	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("large_image_pad").addEventListener("touchmove", function(ev) {
	ev.preventDefault();
	var x = ev.touches[0].pageX;
	var y = ev.touches[0].pageY;
}, false);


//touchend  处理手势
document.getElementById("large_image_pad").addEventListener("touchend", function(ev) {
	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) ScrollOffset(-150); 
		else ScrollOffset(150); 
		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
	}

	if(offset_x < 5 && offset_y < 5) {
		var yt = y + $("#imgList")[0].scrollTop;
		var p = AbsolutePosition($("#imgList")[0]);
		window.location = "/Mobile/Project.aspx?y=" + (yt - p.y);
	}

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

setInterval("GetMessages_Mobile()", 2000);

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