<!--<?php
print <<<EOT
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=$db_charset" />
<link href="images/weibo.css" rel="stylesheet" type="text/css" />
<SCRIPT type="text/javascript" language="JavaScript" src="{$db_bbsurl}js/ajax.js"></SCRIPT>
<title>分享到微博-新浪微博-隨時隨地分享身邊的新鮮事兒</title>
</head>
<body>
<!--
EOT;
if ($action == 'isfollow'){
print <<<EOT
-->
<!--- 分享成功，關注官方 --->
<form action="share.php?type=sinaweibo&action=follow" method="POST">
	<div class="reg_wrap"> 
		<!-- 頂部 LOGO -->
		<div class="TopName">
			<div class="logo"></div>
			<a href="http://weibo.com" target="_blank" class="logoLink"></a>
			<div class="op" id="login_info"><span>正在使用 {$weiboName} 帳號</span></div>
		</div>
		
		<!-- /頂部 LOGO -->
		<div class="reg_main"><b class="bg_regTop"></b><b class="bg_deco_b"></b>
			<div class="reg_pub">
				<div class="notice">
					<h2>分享成功！</h2>
				</div>
				<div class="pw-weibo">
					<p class="pw-check"><input type="checkbox" name="isfollow" value="1" checked="checked" id="checkbox1"><label for="checkbox1">關注站點官方微博，及時獲取最新資訊︰</label></p>
					<p class="pw-concern">
						<span class="pw-avatar"><a href="{$weiboAccount['url']}"><img src="{$weiboAccount['avatar']}" width="50" height="50"></a></span>
						<a class="pw-name" href="{$weiboAccount['url']}">{$weiboAccount['name']}</a>
					</p>
					<p class="pw-action">
						<a class="MIB_bigBtn MIB_bigBtnB" href="javascript:void(0);" onClick="document.forms[0].submit();"><cite>確定</cite></a>
						<a class="pw-close" onclick="window.close();" href="javascript:;">關閉本頁</a>
					</p>
				</div>
			</div>
		<b class="bg_regBot"></b></div>
	</div>
</form>
<!--
EOT;
} else if ($action == 'followsuccess'){
print <<<EOT
-->
<!--- 關注成功 --->
<div class="reg_wrap"> 
	<!-- 頂部 LOGO -->
	<div class="TopName">
		<div class="logo"></div>
		<a href="http://weibo.com" target="_blank" class="logoLink"></a>
		<div class="op" id="login_info"><span>正在使用 {$weiboName} 帳號</span></div>
	</div>
	
	<!-- /頂部 LOGO -->
	<div class="reg_main"><b class="bg_regTop"></b><b class="bg_deco_b"></b>
		<div class="reg_pub">
			<div class="n_Box">
				<div class="n_login_sc2">
					<h2>關注成功！</h2>
					<p style="margin-bottom:15px;">你已關注站點官方微博<a href="{$weiboAccount['url']}">{$weiboAccount['name']}</a>，<br>可以第一時間獲取最新資訊。<p>
					<p>本頁面三秒內自動關閉</p>
					<div class="btn"><a class="MIB_bigBtn MIB_bigBtnB" onclick="window.close();" href="javascript:;"><cite>立即關閉本頁</cite></a></div>
				</div>
			</div>
		</div>
	<b class="bg_regBot"></b></div>
</div>
<script>
setTimeout(function() {
	window.close();
}, 3000);
</script>
<!--
EOT;
} else if ($action == 'followfail'){
print <<<EOT
-->
<!--- 關注失敗 --->
<div class="reg_wrap"> 
	<!-- 頂部 LOGO -->
	<div class="TopName">
		<div class="logo"></div>
		<a href="http://weibo.com" target="_blank" class="logoLink"></a>
		<div class="op" id="login_info"><span>正在使用 {$weiboName} 帳號</span></div>
	</div>
	
	<!-- /頂部 LOGO -->
	<div class="reg_main"><b class="bg_regTop"></b><b class="bg_deco_b"></b>
		<div class="reg_pub">
			<div class="n_Box">
				<div class="n_login_sc2">
					<h2>關注站點官方微博失敗</h2>
					<p style="margin-bottom:15px;"><p>
					<p>本頁面三秒內自動關閉</p>
					<div class="btn"><a class="MIB_bigBtn MIB_bigBtnB" onclick="window.close();" href="javascript:;"><cite>立即關閉本頁</cite></a></div>
				</div>
			</div>
		</div>
	<b class="bg_regBot"></b></div>
</div>
<script>
setTimeout(function() {
	window.close();
}, 3000);
</script>
<!--
EOT;
} else if ($action == 'sharesuccess'){
print <<<EOT
-->
<!--- 分享成功 --->
<div class="reg_wrap"> 
	<!-- 頂部 LOGO -->
	<div class="TopName">
		<div class="logo"></div>
		<a href="http://weibo.com" target="_blank" class="logoLink"></a>
		<div class="op" id="login_info"><span>正在使用 {$weiboName} 帳號</span></div>
	</div>
	
	<!-- /頂部 LOGO -->
	<div class="reg_main"><b class="bg_regTop"></b><b class="bg_deco_b"></b>
		<div class="reg_pub">
			<div class="n_Box">
				<div class="n_login_sc2">
					<h2>分享成功</h2>
					<p style="margin-bottom:15px;"><p>
					<p>本頁面三秒內自動關閉</p>
					<div class="btn"><a class="MIB_bigBtn MIB_bigBtnB" onclick="window.close();" href="javascript:;"><cite>立即關閉本頁</cite></a></div>
				</div>
			</div>
		</div>
	<b class="bg_regBot"></b></div>
</div>
<script>
setTimeout(function() {
	window.close();
}, 3000);
</script>
<!--
EOT;
} else if ($action == 'sharefail'){
print <<<EOT
-->
<!--- 分享失敗 --->
<div class="reg_wrap"> 
	<!-- 頂部 LOGO -->
	<div class="TopName">
		<div class="logo"></div>
		<a href="http://weibo.com" target="_blank" class="logoLink"></a>
		<div class="op" id="login_info"><span>正在使用 {$weiboName} 帳號</span></div>
	</div>
	
	<!-- /頂部 LOGO -->
	<div class="reg_main"><b class="bg_regTop"></b><b class="bg_deco_b"></b>
		<div class="reg_pub">
			<div class="n_Box">
				<div class="n_login_sc2">
					<h2>分享失敗</h2>
					<p style="margin-bottom:15px;">抱歉,您的分享沒有成功,請重試<p>
					<p>本頁面三秒內自動關閉</p>
					<div class="btn"><a class="MIB_bigBtn MIB_bigBtnB" onclick="window.close();" href="javascript:;"><cite>立即關閉本頁</cite></a></div>
				</div>
			</div>
		</div>
	<b class="bg_regBot"></b></div>
</div>
<script>
setTimeout(function() {
	window.close();
}, 3000);
</script>
<!--
EOT;
} else if ($action == 'bind'){
print <<<EOT
-->
<!--- 綁定引導 --->
<div class="reg_wrap"> 
	<!-- 頂部 LOGO -->
	<div class="TopName">
		<div class="logo"></div>
		<a href="http://weibo.com" target="_blank" class="logoLink"></a>
		<div class="op" id="login_info"><span>正在使用 {$windid} 帳號</span></div>
	</div>
	
	<!-- /頂部 LOGO -->
	<div class="reg_main"><b class="bg_regTop"></b><b class="bg_deco_b"></b>
		<div class="reg_pub">
			<div class="n_Box">
				<div class="n_login_sc2" style="width:400px;">
					<h2>綁定帳號，分享更方便</h2>
				    <p style="text-align:left;">將你的社區帳號{$windid}同新浪微博帳號綁定，可以更快的分享社區內容︰<p>
				    <p style="text-align:left;">1、只要社區帳號登錄，即可成功分享精彩帖子，無需單獨登錄新浪微博</p>
				    <p style="text-align:left;">2、你可以用新浪微博帳號登錄社區</p>
				    <p style="text-align:left;">3、你的帳號{$windid}在社區發布的帖子和新鮮事將可以同步到新浪微博</p>
				    <p style="text-align:left;">4、你發表的新浪微博也可以同步到社區</p>
					<div class="btn"><a style="vertical-align:middle;" class="MIB_bigBtn MIB_bigBtnB" href="javascript:(function(){window.open('$bindUrl','_blank','width=600,height=400');})()"><cite>立刻綁定</cite></a><a style="vertical-align:middle;" href="http://v.t.sina.com.cn/share/share.php?title={$title}&source=bookmark">直接分享</a></div>
				</div>
			</div>
		</div>
	<b class="bg_regBot"></b></div>
</div>
<!--
EOT;
}else{
print <<<EOT
-->
<form action="share.php?type=sinaweibo&action=share" method="POST">
	<div class="reg_wrap"> 
		<!-- 頂部 LOGO -->
		<div class="TopName">
			<div class="logo"></div>
			<a href="http://weibo.com" target="_blank" class="logoLink"></a>
			<div class="op" id="login_info"><span>正在使用 {$weiboName} 帳號 | <a href="http://v.t.sina.com.cn/share/share.php?title={$title}&source=bookmark">換個帳號?</a></span></div>
		</div>
		
		<!-- /頂部 LOGO -->
		<div class="reg_main"><b class="bg_regTop"></b><b class="bg_deco_b"></b>
			<div class="reg_pub reg_pub_new">
				<div class="notice" id="tab_btn">
					<ul>
						<li class="curr"><a href="#">分享到微博</a></li>
					</ul>
				</div>
				<div class="inputTxt">
					<textarea cols="20" rows="5" id="fw_content" name="shareContent">{$shareContent}</textarea>
					<dl>
						<dt><img title="" alt="" class="wbIcon iconImg" src="http://timg1.sjs.sinajs.cn/platformstyle/images/common/transparent.gif"><a id="btn_forward" href="javascript:share_img();" class="">分享圖片</a></dt>
						<!-- 附帶分享圖片 -->
						<dd style="display:none" id="pic_lst">
							<div class="picList">
<!--
EOT;
if ($attachImg) {
print <<<EOT
-->
								<ul id="pic_lst_ul">
<!--
EOT;
foreach ($attachImg as $key=>$img) {
print <<<EOT
-->
									<li imgUrl="{$img}" class="" id="li_img_{$key}" onclick="selected_img(this, 'li_img_{$key}');"><a onClick="return false;" href="javascript:void(0);" hidefocus="true"><em><img class="pic" src="{$img}" width="100" height="100"><img alt="" class="ico_slt" src="http://timg1.sjs.sinajs.cn/platformstyle/images/common/transparent.gif"></em></a></li>
<!--
EOT;
}
print <<<EOT
-->
								</ul>
<!--
EOT;
} else {
print <<<EOT
-->
								<p id="nopic" class="nopic"> <img width="14" height="14" title="" alt="" class="iconWarn" src="http://timg1.sjs.sinajs.cn/platformstyle/images/common/transparent.gif"> 沒有可分享的圖片. </p>
<!--
EOT;
}
print <<<EOT
-->
							</div>
							<div class="pageNum"> <a id="btn_cancel" class="cancel" href="javascript:cancel_share();">取消分享圖片</a>  
<!--
EOT;
if ($attachImg) {
print <<<EOT
-->							
							<span> 
							<a id="btn_prev"  href="javascript:prev_page();" style="display: none;">&lt;&lt;上一頁</a> 
							<strong id="pic_count">共{$photoCount}張</strong> 
							<a id="btn_next" href="javascript:next_page();" style="display: none;">下一頁&gt;&gt;</a> 
							</span>
<!--
EOT;
}
print <<<EOT
-->							
							</div>
						</dd>
						<input type="hidden" value="" name="photo" id="share_pic" imgKey="">
						<!-- //附帶分享圖片 -->
					</dl>
				</div>
				<div class="submit" id="share2blog">
					<span class="btn_turn"><a class="MIB_bigBtn MIB_bigBtnB" href="javascript:share();" id="btn_send"><cite>分享</cite></a></span>
				</div>
			</div>
		<b class="bg_regBot"></b></div>
	</div>
</form>
<script>
var photoCount = {$photoCount};
var page = 1;
var pageNum = 5;

function get_li() {
	var cacheLi = [];
	var pic_lst_ul = get_object("pic_lst_ul").childNodes;
	for(var iLoop = 0; iLoop < pic_lst_ul.length; iLoop ++) {    
		var li = pic_lst_ul[iLoop];
		if ("LI" == li.nodeName)  {
			li.style.display = 'none';
			cacheLi.push(li);
		}
	}
	return cacheLi;
}

function prev_page() {
	var arr_li = get_li();
	var li_length = arr_li.length;
	var photo_index = (page-2)*pageNum;
	if (photo_index < 0) photo_index = 0;

	for (var i=0; i<li_length; i++) {
		if (i< photo_index || i > photo_index + pageNum) continue;
		
		var li = arr_li[i];
		li.style.display = '';
	}
	page--;
	if (photo_index == 0) page = 1;
	
	if ((page-1)*pageNum <= 0)
	{
		get_object('btn_prev').style.display = 'none';
	}
	if (li_length > pageNum) get_object('btn_next').style.display = '';
}

function next_page() {
	var arr_li = get_li();
	var li_length = arr_li.length;
	var photo_index = (page)*pageNum;
	if (li_length < photo_index) return;

	for (var i=0; i<li_length; i++) {
		if (i< photo_index || i > photo_index + pageNum) continue;
		var li = arr_li[i];
		li.style.display = '';
	}
	page++;
	if (li_length < (page)*pageNum)
	{
		get_object('btn_next').style.display = 'none';
	}
	get_object('btn_prev').style.display = '';
}

function share() {
	document.forms[0].submit();
}

function share_img() {
	var pic_lst = get_object('pic_lst');
	pic_lst.style.display = '';
}

function cancel_share() {
	var pic_lst = get_object('pic_lst');
	pic_lst.style.display = 'none';
	var share_pic = get_object('share_pic');
	share_pic.value = '';
	var imgKey = share_pic.getAttribute('imgKey');
	var objImgKey = get_object(imgKey);
	objImgKey.className = '';
	share_pic.setAttribute('imgKey', '');
}

function selected_img(e, id) {
	var share_pic = get_object('share_pic');
	var imgKey = share_pic.getAttribute('imgKey');
	if (id == imgKey) return ;

	share_pic.value = e.getAttribute('imgUrl');
	share_pic.setAttribute('imgKey', id);
	e.className = 'on';
	var objImgKey = get_object(imgKey);
	objImgKey.className = '';
}

prev_page();
</script>
<!--
EOT;
}print <<<EOT
-->
</body>
</html>
<!--
EOT;
?>-->