﻿document.writeln(" <script type=\"text\/javascript\" language=\"javascript\" src=\"\/js\/ajax.js\"><\/script>");
function G(id)
{
	return document.getElementById(id);
}

function GetLoginState(AreaId)
{
	var a=new Ajax();
	a.GetRequest("/ajax/LoginState.aspx?ran="+Math.random(),function(rdata,status)
												  {
													  if(status=="success")
													  {
														  var rs=rdata.split("|");
														   G("ulogin_info").innerHTML="<li>状态：<span  style='color:green;'>已登录</span> <a href='/login.aspx?act=o&a="+AreaId+"' style='color:blue;'>登出</a></li><li>帐号：<a href='ubase.aspx?a="+AreaId+"'  style='color:red;'>"+rs[0]+"</a></li>";
													  }
												});
}

//以下是消息框方法
function SendMsg()
{
	
		co=G("dialogco").value;

				if(co=="")
				{
				alert("请填写留言内容");G("dialogco").focus();return false;
			 	}
				G("dialogok").value="正在提交留言中，请稍候...";
		G("dialogok").disabled="disabled";

		var XMsg=new Ajax();
		XMsg.PostRequest("/board.aspx?&t="+ Math.random(),escape(co),
							function MsgEnd(re)
							{
							   if(re.indexOf("error")==-1)
							   {
									closedialog(); 
								}
								else
								{
									G("dialogok").value="提交留言";
									G("dialogok").disabled="";
								}
							}
						);

	}
	

function addEvent(C,B,A){
	if(C.attachEvent){
		C.attachEvent(B,A)//window.attachEvent("resize",onResize);
	}else {
		C.addEventListener(B,A,false)
	}
};
	

function ShowBoard()
{
	var DialogHeight=220;
	var DialogWidth=400;
	
if(G("g_Dialog")==null)
	{
		var myJsVal = ""; 
myJsVal+="<div style=\"margin-bottom:3px;\"><textarea name=\"dialogco\" id=\"dialogco\" title=\"内容\" style=\"height:150px; width:396px;\"><\/textarea></div>";
myJsVal+="<div style=\"margin-left:15px;margin-bottom:5px;\"><input type=\"button\" id=\"dialogok\" class=\"bstyle\" value=\"提交留言\" onclick=\"return SendMsg();\" \/></div>";

var StrDialog='<div class="dialog" onclick="closedialog()"> 关闭 </div>';
StrDialog+=myJsVal;

var oDiv=document.createElement("div");
oDiv.id="g_Dialog";
oDiv.style.cssText ="BORDER-RIGHT: #9dccf6 1px solid; BORDER-TOP: #9dccf6 1px solid; Z-INDEX: 10002; BACKGROUND: #fff; FILTER: progid:DXImageTransform.Microsoft.DropShadow(color=#ffc3c3c3,offX=4,offY=4,positives=true); BORDER-LEFT: #9dccf6 1px solid; width:"+DialogWidth+"px;BORDER-BOTTOM: #9dccf6 1px solid; POSITION: absolute; TOP: 0px; LEFT: 0px;";

document.body.appendChild(oDiv);
id="g_Dialog";
G("g_Dialog").innerHTML=StrDialog;

var B=document.createElement("div");
			B.id="shadowDiv";
			B.style.cssText="Z-INDEX: 10001; LEFT: 0px; POSITION: absolute;width:100%; height:100%; TOP: 0px; BACKGROUND-COLOR: #fff;FILTER: alpha(opacity=60);  opacity: 0.6";
			document.body.insertBefore(G("g_Dialog"),document.body.firstChild);
			document.body.insertBefore(B,document.body.firstChild);
			addEvent(window,"onresize",onResize);
			onResize();
	}
	else
	{
		closedialog();
		ShowBoard();
	}
}

function onResize()
{
	var F=document.documentElement.scrollTop;
		var H=document.body.scrollWidth;
		var A=document.body.scrollHeight;
		var J=G("shadowDiv");
		var E=G("g_Dialog");
		var I=parseInt(E.style.width,10)||500;
		var B=parseInt(E.style.height,10)||500;
		J.style.width=H+"px";
		J.style.height=A+"px";
		J.style.left=J.style.top="0px";
		divLeft=(document.body.clientWidth-I)/2;
		var C=document.documentElement.clientHeight/2+F-E.offsetHeight/2;
		if(divLeft<1){
			divLeft=F;
		}if(C<1){
			C="20";
		}
		E.style.left=divLeft+"px";
		E.style.top=C+"px";
	}

function closedialog()
{
	document.body.removeChild(G("g_Dialog"));
	document.body.removeChild(G("shadowDiv"));
}
//信息框结束


function copyUrl()
{
	var url = unescape(window.location.href);
	var urlArray=url.split("/");
	var clipUrl = document.title+"\r\n"+urlArray[0]+"//"+urlArray[2]+"/"+urlArray[3]+"/"+urlArray[4]+"/"+urlArray[5];
	window.clipboardData.setData("Text",clipUrl);
	alert("您已复制链接及标题，您可以粘贴到QQ/MSN发送给好友与你一起开心!");
}


var swf_width=465;
var swf_height=157;
var config='5|0xffffff|0x0099ff|50|0xffffff|0x0099ff|0x000000';
// config 设置分别为: 自动播放时间(秒)|文字颜色|文字背景色|文字背景透明度|按键数字色|当前按键色|普通按键色

function ShowMovie()
{
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
document.write('<param name="movie" value="/js/focus.swf" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="menu" value="false" />');
document.write('<param name=wmode value="opaque" />');
document.write('<param name="FlashVars" value="config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'" />');
document.write('<embed src="/js/focus.swf" wmode="opaque" FlashVars="config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'& menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
}
