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

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

<div class="blog_menu">
	<% =Z.C("易享") %><% =Z.C("首页") %>
	<div class="blog_menu_right2" onclick="window.location='Welcome.aspx';"></div>
</div>

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

<style>
#panel { float:left;width:100px;height:135px;text-align:left;font-size:10px;margin-left:10px;margin-right:5px;margin-bottom:20px;overflow-x:hidden;overflow-y:hidden; }
#filename { float:left;width:96px;height:22px;text-align:center;font-size:10px;line-height:16px; }
#blog_c img { margin-bottom:3px; }
</style>

<script language="javascript">

var current_path = "";
var file_count = 0;
var file_pre = 0;
var current_page = 0;
var current_index = 0;
var page_size = 15;

function PageShow()
{
	var page_count = page_size;
	if(current_page == 0) page_count -= file_pre;
	var html = "";
	var idx = 0;
	for(var i=0; i<page_count; i++) {
		idx = current_page * page_size + i;
		if(idx >= file_count) break;
		var finfo = fileNames[idx].split("|");

		html += "<div id=\"panel\">";
		if (fileArray[idx].substr(0,1) != "!")
		{
			html += "<div style=\"width:94px;height:94px;text-align:center;border:solid 1px #CCCCCC;margin-bottom:3px;\" onclick=\"PopupShow(" + idx + ")\">";
			if(fileArray[idx].substr(0,1) == "*") {
				html += "<img src=\"/Utility/FileShow.aspx?file=" + fileArray[idx].substr(1) + "\" width=\"94\" onload=\"imageAutoThumbs2(this)\">";
			}
			else {
				html += "<img src=\"/Utility/Thumbs.aspx?file=" + fileArray[idx].substr(1) + "\" onload=\"imageAutoThumbs2(this)\">";
			}
			html += "</div>";
		}
		else
		{
			html += "<a href=\"/Utility/FileShow.aspx?file=" + fileArray[idx].substr(1) + "\" target=\"_blank\">";
			html += "<img src=\"/images/folders/" + finfo[1] + "\">";
			html += "</a>";
		}
		html += "<div id=\"filename\">" + finfo[0] + "</div>";
		html += "</div>";
	}
	if(idx < file_count) {
		html += "<div style=\"clear:both;height:40px;padding-top:15px;border:solid 1px #CCCCCC;background-color:#FAFAFF;text-align:center;cursor:pointer;font-size:20px;color:#AAAAAA;\" onclick=\"PageNext(this)\">MORE...</div>";
	}

	document.getElementById("show_panel").innerHTML += html;
}

function PageNext(obj)
{
	obj.style.display = "none";
	current_page++;
	PageShow();
}

function imageAutoThumbs_slide(obj)
{
	if(obj.width > document.documentElement.clientWidth) 
	{
		obj.width = document.documentElement.clientWidth;
	}
}

function scroll_to(div){
	$('html, body').animate({
	scrollTop: $(div).offset().top + 40
	},1000);
}

var html_back = "";

function PopupShow(idx)
{
	current_index = idx;
	html_back = document.getElementById("show_panel").innerHTML;
	var html = "";
	html += "<div id=\"slide_panel\" style=\"clear:both;border:solid 1px #CCCCCC;background-color:#000000;text-align:center;cursor:pointer;\">";
	html += "<table width=\"100%\" height=\"40\" style=\"background-color:#B4D8FC;\">";
	html += "<tr>";
	html += "<td align=center><div style=\"width:70px;height:50px;background-image:url(/images/help/slide.jpg);background-position:-210px -0px;\" onclick=\"PageRestore()\"></div></td>";
	html += "<td align=center id=\"btn_last_1\"><div style=\"width:70px;height:50px;background-image:url(/images/help/slide.jpg);background-position:-0px -0px;\" onclick=\"ShowLast()\"></div></td>";
	html += "<td align=center id=\"btn_next_1\"><div style=\"width:70px;height:50px;background-image:url(/images/help/slide.jpg);background-position:-70px -0px;\" onclick=\"ShowNext()\"></div></td>";
	html += "<td align=center><div style=\"width:70px;height:50px;background-image:url(/images/help/slide.jpg);background-position:-140px -0px;\" onclick=\"PageDown()\"></div></td>";
	html += "</tr>";
	html += "</table>";
	html += "<img id=\"current_image\" src=\"/Utility/FileShow.aspx?file=" + fileArray[idx].substr(1) + "\" onload=\"imageAutoThumbs_slide(this)\">";
	html += "<table width=\"100%\" height=\"40\" style=\"background-color:#B4D8FC;\">";
	html += "<tr>";
	html += "<td align=center><div style=\"width:70px;height:50px;background-image:url(/images/help/slide.jpg);background-position:-210px -0px;\" onclick=\"PageRestore()\"></div></td>";
	html += "<td align=center id=\"btn_last_2\"><div style=\"width:70px;height:50px;background-image:url(/images/help/slide.jpg);background-position:-0px -0px;\" onclick=\"ShowLast()\"></div></td>";
	html += "<td align=center id=\"btn_next_2\"><div style=\"width:70px;height:50px;background-image:url(/images/help/slide.jpg);background-position:-70px -0px;\" onclick=\"ShowNext()\"></div></td>";
	html += "<td align=center><div style=\"width:70px;height:50px;background-image:url(/images/help/slide.jpg);background-position:-140px -0px;\" onclick=\"PageDown()\"></div></td>";
	html += "</tr>";
	html += "</table>";
	html += "</div>";
	document.getElementById("show_panel").innerHTML = html;

	ShowEcho();

	scroll_to("#slide_panel");
}

function ShowEcho()
{
	if(current_index==0) { $("#btn_last_1").css("display","none"); $("#btn_last_2").css("display","none"); }
	else { $("#btn_last_1").css("display",""); $("#btn_last_2").css("display",""); }

	if(current_index >= (file_count-1)) { $("#btn_next_1").css("display","none"); $("#btn_next_2").css("display","none"); }
	else { $("#btn_next_1").css("display",""); $("#btn_next_2").css("display",""); }
}

function ShowLast()
{
	while(current_index > 0) {
		current_index--;
		if(fileArray[current_index].substr(0,1) != "!") {
			document.getElementById("current_image").src = "/Utility/FileShow.aspx?file=" + fileArray[current_index].substr(1);
			scroll_to("#slide_panel");
			break;
		}
	}
	ShowEcho();
}

function ShowNext()
{
	while(current_index < (file_count-1)) { 
		current_index++;
		if(fileArray[current_index].substr(0,1) != "!") {
			document.getElementById("current_image").src = "/Utility/FileShow.aspx?file=" + fileArray[current_index].substr(1);
			scroll_to("#slide_panel");
			break;
		}
	}
	ShowEcho();
}

function PageRestore()
{
	document.getElementById("show_panel").innerHTML = html_back;
	scroll_to("#blog_c");
}

function PageDown()
{
	window.open("/Utility/FileShow.aspx?file=" + fileArray[current_index].substr(1));
}

</script>

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

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