﻿// JavaScript Document
document.domain="jxjyzy.com";
		function readCookieEx(name)
		{
		  var cookieValue = "";
		  var search = name + "=";
		  if(document.cookie.length > 0){ 		
			offset = document.cookie.indexOf(search);		
			if (offset != -1)		
			{ 		
			  offset += search.length;		
			  end = document.cookie.indexOf(";", offset);		
			  if (end == -1) end = document.cookie.length;		
			  cookieValue = decodeURI(document.cookie.substring(offset, end));		
			}		
		  }		
		  return cookieValue;		
		}
		
function InitPage()
		{
			//var url = "/WebService/ResourceService.svc/";
			document.getElementById("Prompt").innerHTML="";
			var param='';
			GetCurrency();//用从Cookies中获取金币数来代替从数据库中读取金币数
			//Call(url,"GetCurrency",param,OnGetCurrencyResult);
			//var param='{"ResID":'+document.getElementById("ResID").innerHTML+'}';
			//Call(url,"GetDownTimer",param,OnGetDownTimerResult);
			//Call(url,"GetSupport",param,OneSupportResult);
			//Call(url,"GetOpposition",param,OneOppositionResult);
			//Call(url,"GetCommentsCount",param,OnGetCommentsCountResult);
			//param='{"ResID":'+document.getElementById("ResID").innerHTML+',"ResName":"'+document.getElementById("ResName").innerHTML+'"}';
			//Call(url,"GetRelatedResource",param,OnGetRelatedResourceResult);
			//GetRelatedResource();//暂时去掉获取相关资源而消耗数据库
		}
		function GetCurrency()
		{
			var gold=0;
			var cook=readCookieEx("jxjyzy");
			if(cook!=null && cook!="")
			{
				var arr=cook.split("&");
				for(var i=0;i<arr.length;i++)
				{
					var xx=arr[i].split("=");
					if(xx[0]=="Gold")
					{
						gold=xx[1];
						break;
					}
				}
			}			
			else
			{
				document.getElementById("Prompt").innerHTML="您尚未登录，无法下载资源";
			}
			
			if (gold!=0)
			{
				var golde=gold-document.getElementById("Gold").innerHTML;
				document.getElementById("Prompt").innerHTML="您现有金币<span class='red' >"+gold+"</span>,下载后将剩<span class='red' >"+golde+"</span>";
			}
			else
			{
				document.getElementById("Prompt").innerHTML="您的金币不足，无法下载资源，请先收藏此资源，上传优质资源换取金币后再下载。";
			}
				
		}
		function GetRelatedResource()
		{
			document.getElementById("Relate").innerHTML="无";
		}

		function OnGetDownTimerResult(result)
		{
			if(result!=-1)
			document.getElementById("DownTimer").innerHTML=result;
		}
		
		function OnGetCurrencyResult(result)
		{
			if(result==-3)	
			{		
				document.getElementById("Prompt").innerHTML="您尚未登录，无法下载资源";
            	/*alert("请先登录！");*/
			}
			else
            if(result!=-1&&result!=-2)
			{
				var gold=result-document.getElementById("Gold").innerHTML;;
				document.getElementById("Prompt").innerHTML="你现有金币<span class='red' >"+result+"</span>,下载后将剩<span class='red' >"+gold+"</span>";
			}
			else
			if(result==-1)
			{
				document.getElementById("Prompt").innerHTML="出现错误，请及时联系管理员！"
			}
		}
		function OnGetRelatedResourceResult(result)
		{
			document.getElementById("Relate").innerHTML=result;
		}
		function OnGetCommentsCountResult(result)
		{
			document.getElementById("CommentCount").innerHTML=result;
		}
		function AddFavorite(value1)
		{
		
			var url = "/WebService/ResourceService.svc/";
			var param='{"ResID":'+value1+',"ResName":"'+document.getElementById("ResName").innerHTML+'"}';
		
			Call(url,"AddFavorite",param,OnAddFavoriteResult);
		}
		function OnAddFavoriteResult(result)
        {
 
			if(result==-1)			
            	alert("发生错误！请重试！");
			if(result==-3)			
            	alert("请先登录！");
			if(result==-4)			
            	alert("你已收藏过此资源！");				
            if(result==1)
				alert("收藏成功！");
        }
		function Support(value)
		{
			document.getElementById("Support").innerHTML=Number(document.getElementById("Support").innerHTML)+1;
			alert("感谢你顶！");
			var url = "/WebService/ResourceService.svc/";
			var param='{"ResID":'+value+',"Type":'+2308+'}';
			Call(url,"Support",param,OnSupportResult);
		}
		function OnSupportResult(result)
        {
			if(result==-2)			
            	alert("请先下载后再评论！");
			if(result==-3)			
            	alert("请先登录！");
			if(result==-4)			
            	alert("你已评论过此资源！");				
            if(result>=0)
			{
			//	document.getElementById("Support").innerHTML=result;
			//	alert("感谢你顶！");
			}
			
        }
		function OneSupportResult(result)
        {
			if(result==-2)			
            	alert("请先下载后再评论！");
			if(result==-3)			
            	alert("请先登录！");
			if(result==-4)			
            	alert("你已评论过此资源！");				
            if(result>=0)
			{
				document.getElementById("Support").innerHTML=result;
			}
        }

		function Opposition(value)
		{
			document.getElementById("Opposition").innerHTML=Number(document.getElementById("Opposition").innerHTML)+1;
			alert("感谢你踩！");
			var url = "/WebService/ResourceService.svc/";
			var  param='{"ResID":'+value+',"Type":'+2308+'}';
			Call(url,"Opposition",param,OnOppositionResult);
		}
		function OnOppositionResult(result)
        {
//			if(result==-2)			
//            	alert("请先下载后再评论！");
//			if(result==-3)			
//            	alert("请先登录！");
//			if(result==-4)			
//            	alert("你已评论过此资源！");
//            if(result>=0)
//			{
//				document.getElementById("Opposition").innerHTML=result;
//				alert("感谢你踩！");
//			}
        }
		function OneOppositionResult(result)
        {
			if(result==-2)			
            	alert("请先下载后再评论！");
			if(result==-3)			
            	alert("请先登录！");
			if(result==-4)			
            	alert("你已评论过此资源！");
            if(result>=0)
			{
				document.getElementById("Opposition").innerHTML=result;
			}
        }
		function Comment(value)
		{	
			document.getElementById("CommentCount").innerHTML=Number(document.getElementById("CommentCount").innerHTML)+1;
            showModalDialog("/RefComponent/ResComment.aspx?Type=2308&ID="+value,window, "dialogWidth:300px;dialogHeight:250px");
		}
		function SubmitComment(value)
		{	
			if(document.getElementById("Content").innerHTML=="")
				alert("请填写评论内容！");
				else
				{
					//alert(document.getElementById("hidden").value);
					//document.getElementById("CommentCount").innerHTML=Number(document.getElementById("CommentCount").innerHTML)+1;
					var url = "/WebService/ResourceService.svc/";
					var param='{"ResID":'+document.getElementById("ResID").innerHTML+',"Value":'+document.getElementById("hidden").value+',"Content":"'+document.getElementById("Content").innerHTML+'","Type":'+2308+'}';
					Call(url,"Comment",param,OnCommentResult);
				}
		}
		function OnCommentResult(result)
        {
        	if(result==-3)
        		alert("评论前请登录！");
        	else
        	{
				document.getElementById("CommentCount").innerHTML=Number(document.getElementById("CommentCount").innerHTML)+1;
				alert("谢谢评论！");
			}
        }
		function Change(obj)
		{

			document.getElementById("hidden").value=obj.value;

			
		}
		function DownLoad(value)
		{	
				document.getElementById("DownTimer").innerHTML=Number(document.getElementById("DownTimer").innerHTML)+1;
            	 window.open("/Resource/ResourceDownload.aspx?ID="+value);   
		}
		function   openUrl(src,AuditUserID)   
 		{   
		  var   strUrl=escape("这条资源有问题，编号为"+src);   
		  window.open("/User/UserInnerMessageEdit.aspx?Status=FindNew&ID="+AuditUserID+"&Subject="+strUrl);   
 		}  
		function show()
		{
			if(document.all("note").style.display=="none")
			document.all("note").style.display=""; 
			else
			document.all("note").style.display="none"
		} 
		
		
		function geturl(){
  if (!top.gAbsolutePath){
		var loc = document.location;
		top.protocal = loc.protocol;
		top.host = loc.host;
		top.hostname = loc.hostname;
		top.port = loc.port;
		top.gAbsolutePath = top.protocal + "//" + top.host + (top.port != '' ? ':' + top.port : '') 
  }
  top.path = top.gAbsolutePath;
  return top.gAbsolutePath + "//";
}

function getfullurl()
{
	var loc = document.location;
	var path=loc.pathname.substr(loc.pathname.indexOf('/')+1, loc.pathname.lenght).replace("//","/");
  	return path
}
function Login()
{
	var url = "/WebService/LoginService.svc/";
		param='{"account":"'+document.getElementById("labAccount").value+'","password":"'+document.getElementById("labPwd").value+'"}';//,"CheckCode":"'+document.getElementById("labCode").value+'"
	Call(url,"LoginIn",param,OnLoginResult);
}
function LoginOut()
{
	var url = "/WebService/LoginService.svc/";
	param='';
	Call(url,"LoginOut",param,OnLoginOutResult);
}
function OnLoginOutResult(result)
{
	if(result==1)
	{
		var s="";
		s+="<div id='help' style='float:right;padding-top:8px;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A href='"+geturl()+"login/Register.aspx?Type=HaveCard&amp;POS=HOME'><font color='#ffff00'>新用户注册</font></A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A href='"+geturl()+"login/GetPassword.aspx'><font color='#ccff00'>取回密码</font></A>>&nbsp;&nbsp;<A href='"+geturl()+"Help/Help.aspx?HelperID=14'><font color='#ccff00'>忘记帐号和密码</font></A></div>";
		s+="<div style='float:left;'><IMG  src='"+geturl()+"images/login_dot.png'  align='absMiddle' />&nbsp;&nbsp;用户名:";
		s+="<input type='text' id='labAccount' name='labAccount' style='size:10px;height:14px; width:80px;' maxlength='30' />&nbsp;&nbsp;密 码:";
		s+="<input type='password' style='size:10px;height:14px; width:80px;'id='labPwd' maxlength='8' name='labPwd'/>";
		//s+="&nbsp;&nbsp;验证码:<input type='text' style='size:10px;height:14px; width:40px;'id='labCode' maxlength='4' name='labCode'/><input type='image' src='"+geturl()+"Login/ValidateImage.aspx'  align='absmiddle'  border='0' value='验证码' />&nbsp;&nbsp;";
       s+=" <input type='image' src='"+geturl()+"images/index_07_r4_c8.gif' name='Submit' onclick='Login();' align='absmiddle' width='59' height='21' border='0' value='提交' /></div>		";
		document.getElementById("loginin").innerHTML=s;
	}
}
function OnLoginResult(result)
{var s="";
	if(result==1)			
    	  	{
	    		var cook=readCookieEx("jxjyzy");
			if(cook!=null && cook!="")
			{
				var Type="",Account,UserID,Licence,Name,Pwd,Point="",MsgCount="",EmailCount="";
				var arr=cook.split("&");
				for(var i=0;i<arr.length;i++)
				{
					var xx=arr[i].split("=");
					if(xx[0]=="Account")
					{
						Account=xx[1];
						continue;
					}
					if(xx[0]=="UserID")
					{
						UserID=xx[1];
						continue;
					}
					if(xx[0]=="Name")
					{
						Name=xx[1];
						continue;
					}
					if(xx[0]=="Pwd")
					{
						Pwd=xx[1];
						continue;			
					}
					if(xx[0]=="Licence")
					{
						Licence=xx[1];
						continue;
					}
					if(xx[0]=="Point")
					{
						Point=xx[1];
						continue;
					}
					if(xx[0]=="EmailCount")
					{
						EmailCount=xx[1];
						continue;
					}
					if(xx[0]=="MsgCount")
					{
						MsgCount=xx[1];
						continue;
					}
					if(xx[0]=="Type")
					{
						Type=xx[1];	
						continue;
					}
				}
				if(Type=="1")
				{				
					 s="  欢迎您!<font color=\"#FF0000\"><strong>"+Account+"</strong></font>";
					 s+="<span id=\"spanMsg\"></span>";
					 s+="<font color=\"#CCCCCC\">|</font> <a href=\"http://www.jxjyzy.com/User/Index_new.aspx\">会员中心</a><font color=\"#CCCCCC\">|</font> <a href=\"http://www.jxjyzy.com/User/Index_new.aspx?Url="+geturl()+"User/UserResEdits.aspx?EditMode=False\">上传资源</a><font color=\"#CCCCCC\">|</font> <a href=\"http://bbs.jxjyzy.com/space/\">我的博客</a><font color=\"#CCCCCC\">|</font> <a href=\"http://bbs.jxjyzy.com/showalbumlist.aspx?uid="+UserID+"\">我的相册</a><font color=\"#CCCCCC\">|</font> <a href=\""+geturl()+"Login/LoginOut.aspx\">退出</a>";
					document.getElementById("loginin").innerHTML=s;
					var url = "http://www.jxjyzy.com/WebService/ResourceService.svc/";
					var	param='';
				    Call(url,"GetMsgCount",param,OnGetMsgCountResult);
				}
				else
				{
					Deletecookie("jxjyzy");
					s="    <a href='http://auth.jxjyzy.com/Login.aspx?ReturnUrl="+window.location.href+"\'><img src='http://img.jxjyzy.com/images/baoming.gif' align=\"absmiddle\"/>登录</a>";
					s+="    &nbsp;&nbsp;&nbsp;&nbsp;<a href='http://auth.jxjyzy.com/Register.aspx'>新用户注册</a>&nbsp;&nbsp;<a href='http://auth.jxjyzy.com/GetPassword.aspx'>&nbsp;&nbsp;找回密码</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href='"+geturl()+"Help/Help.aspx?HelperID=14\'>忘记用户名</a>";
					document.getElementById("loginin").innerHTML=s;
				}
			}
			else
			{
				s="    <a href='http://auth.jxjyzy.com/Login.aspx?ReturnUrl="+window.location.href+"\'><img src='http://img.jxjyzy.com/images/baoming.gif' align=\"absmiddle\"/>登录</a>";
				s+="   &nbsp;&nbsp;&nbsp;&nbsp;<a href='http://auth.jxjyzy.com/Register.aspx'>新用户注册</a>&nbsp;&nbsp;<a href='http://auth.jxjyzy.com/GetPassword.aspx'>&nbsp;&nbsp;找回密码</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href='"+geturl()+"Help/Help.aspx?HelperID=14\'>忘记用户名</a>";
				document.getElementById("loginin").innerHTML=s;
			}
	  }
		
	if(result==-1)			
    	alert("登录失败");
}
		function readCookie(name)		
		{		
		  var cookieValue = "";		
		  var search = name + "=";		
		  if(document.cookie.length > 0)		
		  { 		
			offset = document.cookie.indexOf(search);		
			if (offset != -1)		
			{ 		
			  offset += search.length;		
			  end = document.cookie.indexOf(";", offset);		
			  if (end == -1) end = document.cookie.length;		
			  cookieValue = decodeURI(document.cookie.substring(offset, end));		
			}		
		  }		
		  return cookieValue;		
		};
		function Deletecookie (name) 
		{  
			var exp = new Date();    
			exp.setTime (exp.getTime() - 1);    
			var cval = readCookie (name);    
			document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();  
		}  
		function OnGetMsgCountResult(MsgCount)
{
	var html="";
	if(MsgCount=="0")
		html="<a href=\"http://www.jxjyzy.com/User/Index_new.aspx?Url="+geturl()+"User/UserInnerMessageList.aspx?Status=Receive\"><img src='http://img.jxjyzy.com/images/noMessage.gif' width=\"18\" height=\"11\" /></a>";
		else
			html="   <a href=\"http://www.jxjyzy.com/User/Index_new.aspx?Url="+geturl()+"User/UserInnerMessageList.aspx?Status=Receive\"><img src='http://img.jxjyzy.com/images/newMsg.gif' width=\"18\" height=\"11\" /></a>";
			html=html+"    短信<a href=\"http://www.jxjyzy.com/User/Index_new.aspx?Url="+geturl()+"User/UserInnerMessageList.aspx?Status=Receive\"><font color=\"#0000FF\">("+MsgCount+")</font></a>";
	document.getElementById("spanMsg").innerHTML=html;
		if(MsgCount!="0")
		{
		 var now= new Date();
		 var year=now.getYear();
		 var month=now.getMonth()+1;
		 var day=now.getDate();
		 var hour=now.getHours();
		 var minute=now.getMinutes();
		 var second=now.getSeconds();
		 var nowdate=year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second;
		ymPrompt.alert({message:"<P align=left>你有"+MsgCount+"条未读短消息，如需查看请点击<a href='http://www.jxjyzy.com/User/Index_new.aspx?Url=http://www.jxjyzy.com/User/UserInnerMessageList.aspx?Status=Receive' target='_blank'>这里</a>。</P></br>江西省基础教育资源中心</br>"+nowdate,title:'系统消息',winPos:'rb',width:280,height:230,showMask:false})
			}
}
//		function Head()
//		{
//	
//			var cook=readCookieEx("jxjyzy");
//			if(cook!=null && cook!="")
//			{
//				var Type="",Account,UserID,Licence,Name,Pwd,Point="",MsgCount="",EmailCount="";
//				var arr=cook.split("&");
//				for(var i=0;i<arr.length;i++)
//				{
//					var xx=arr[i].split("=");
//					if(xx[0]=="Account")
//					{
//						Account=xx[1];
//						continue;
//					}
//					if(xx[0]=="UserID")
//					{
//						UserID=xx[1];
//						continue;
//					}
//					if(xx[0]=="Name")
//					{
//						Name=xx[1];
//						continue;
//					}
//					if(xx[0]=="Pwd")
//					{
//						Pwd=xx[1];
//						continue;			
//					}
//					if(xx[0]=="Licence")
//					{
//						Licence=xx[1];
//						continue;
//					}
//					if(xx[0]=="Point")
//					{
//						Point="你的威望值是"+xx[1];
//						continue;
//					}
//					if(xx[0]=="EmailCount")
//					{
//						EmailCount=xx[1];
//						continue;
//					}
//					if(xx[0]=="MsgCount")
//					{
//						MsgCount=xx[1];
//						continue;
//					}
//					if(xx[0]=="Type")
//					{
//						Type=xx[1];					;
//						continue;
//					}
//				}
//				if(Type=="1")
//				{
//					document.write("<div id='loginin'><div id='help' style='float:right;padding-top:8px;'><font color='red'></font><A href='"+geturl()+"User/Index.aspx'><font color='#ffff00'>[会员中心]</font></A>&nbsp;&nbsp;");
//					document.write("<A href='"+geturl()+"User/UserResEdit.aspx?EditMode=False'><font color='#ffff00'>[上传资源]</font></A>&nbsp;&nbsp;");
//					document.write("&nbsp;&nbsp;<a href='javascript:LoginOut();'><strong><font color='#ffff00'>[退出]</font></strong></a></div>");
//					document.write("<div style='float:left;'><IMG src='"+geturl()+"images/login_dot.png' width='30' align='absMiddle'>欢迎您"+Account +",");
//					document.write(Point+"&nbsp;&nbsp;&nbsp;&nbsp;<img width='18' height='12' src='"+geturl()+"images/clip_image001.gif'>");
//					document.write("<a href='"+geturl()+"User/UserInnerMessageList.aspx?Status=Receive'><font color='#FFFF00'>待阅短信("+MsgCount+")</font></a>&nbsp;&nbsp;");
//					document.write("<a href='"+geturl()+"EMail/EMailLogin.aspx?ReturnUrl=http://mail.jxjyzy.com/webmailgov/mail.jsp'><font color='#FFFF00'>邮箱"+EmailCount+"</font></a></div></div>");
//				}
//				else
//				{
//					Deletecookie("jxjyzy");
//					//document.write("<form id='fff' style='margin:0' method='post' action='"+geturl()+"/login/login.aspx?Type=1&ReturnUrl="+getfullurl()+"'>");
//					document.write("		<div id='loginin'><div id='help' style='float:right;padding-top:8px;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A href='"+geturl()+"login/Register.aspx?Type=HaveCard&amp;POS=HOME'><font color='#ffff00'>新用户注册</font></A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A href='"+geturl()+"login/GetPassword.aspx'><font color='#ccff00'>取回密码</font></A>>&nbsp;&nbsp;<A href='"+geturl()+"Help/Help.aspx?HelperID=14'><font color='#ccff00'>忘记帐号和密码</font></A></div>");
//					document.write("		<div style='float:left;'><IMG  src='"+geturl()+"images/login_dot.png'  align='absMiddle' />&nbsp;&nbsp;用户名:");
//					document.write("		<input type='text' id='labAccount' name='labAccount' style='size:10px;' />&nbsp;&nbsp;密 码:");
//					document.write("		<input type='password' style='size:10px;'id='labPwd' name='labPwd'/>");
//					//document.write("		&nbsp;&nbsp;验证码:<input type='text' style='size:10px; height:14px; width:80px;'id='labCode' name='labCode'/><input type='image' src='"+geturl()+"Login/ValidateImage.aspx'  align='absmiddle'  border='0' value='验证码' />&nbsp;&nbsp;");
//			        document.write(" <input type='image' src='"+geturl()+"images/index_07_r4_c8.gif' name='Submit' onclick='Login();' align='absmiddle' width='59' height='21' border='0' value='提交' /></div></div>		");
//						//document.write("</form>");	
//					
//				}
//			}
//			else
//			{
//				//document.write("<form id='fff' style='margin:0' method='post' action='"+geturl()+"/login/login.aspx?Type=1&ReturnUrl="+getfullurl()+"'>");
//					document.write("		<div id='loginin'><div id='help' style='float:right;padding-top:8px;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A href='"+geturl()+"login/Register.aspx?Type=HaveCard&amp;POS=HOME'><font color='#ffff00'>新用户注册</font></A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A href='"+geturl()+"login/GetPassword.aspx'><font color='#ccff00'>取回密码</font></A>>&nbsp;&nbsp;<A href='"+geturl()+"Help/Help.aspx?HelperID=14'><font color='#ccff00'>忘记帐号和密码</font></A></div>");
//					document.write("		<div style='float:left;'><IMG  src='"+geturl()+"images/login_dot.png'  align='absMiddle' />&nbsp;&nbsp;用户名:");
//					document.write("		<input type='text' id='labAccount' name='labAccount' style='size:10px;height:14px; width:80px;' maxlength='30'/>&nbsp;&nbsp;密 码:");
//					document.write("		<input type='password' style='size:10px;height:14px; width:80px;'id='labPwd' name='labPwd' maxlength='8'/>");
//				//	document.write("		&nbsp;&nbsp;验证码:<input type='text' style='size:10px; height:14px; width:40px;'id='labCode' name='labCode' maxlength='4'/><input type='image' src='"+geturl()+"Login/ValidateImage.aspx'  align='absmiddle'  border='0' value='验证码' />&nbsp;&nbsp;");
//			        document.write(" <input type='image' src='"+geturl()+"images/index_07_r4_c8.gif' name='Submit' onclick='Login();' align='absmiddle' width='59' height='21' border='0' value='提交' /></div></div>		");
//					//document.write("</form>");
//			
//			}
//		}
function showWindow(FriendUserAccount, FriendUserID) {
        var option = {
            wid: "showAddFriend",
            div_class: 'layer_board',
            div_width: 540,
            //div_height: 600,
            no_modal: false,
            no_del: false,
            no_move: false
        };
        var src = "/User/FriendAdd.aspx?EditMode=false&FriendUserAccount=" + FriendUserAccount + "&FriendUserID=" + FriendUserID;
        popFrame("添加好友", src, option);
    }
    function popFrame(title, src, option) {
    var wid = (option && option.wid) ? option.wid: 'my_popFrame';
    var w = Fid(wid);
    var op = {
        div_class: 'layer_board',
        div_width: 350,
        div_height: 0,
        no_modal: false,
        zIndex: 999,
        no_del: false,
        no_move: false
    };
    $.extend(op, option);
    if (op.no_modal == false) {
        FsetModal(wid + '_modal')
    }
    if (w == undefined) {
        var w = document.createElement('DIV');
        w.id = wid;
        w.className = op.div_class;
        if (op.div_width) w.style.width = op.div_width + "px";
        w.style.position = "absolute";
        w.innerHTML = '<div class="layer_board_main"><div id="' + wid + '_head" class="layer_board_title"><h3>' + title + '</h3><button title="关闭" href="javascript:void(0)" id="' + wid + '_close"></button></div><div class="layer_board_content" style="display:block;"><iframe id="popFrame_iframe" width="100%" height="' + op.div_height + '" scrolling="no" frameborder="0"></iframe></div></div>';
        document.body.appendChild(w);
        var iframeObject = Fid("popFrame_iframe");
        iframeObject.src = src;
        if (op.div_height < 1) {
            iframeObject.onload = iframeObject.onreadystatechange = function() {
                if (! (this.readyState && this.readyState != 'complete')) {
                    iframeObject.setAttribute("height", iframeObject.contentWindow.document.body.scrollHeight)
                }
            }
        }
        if (op.div_width) {
            $("#" + wid + " > div").css("width", op.div_width - 2 + "px")
        }
        $("#" + wid + "_close").click(function() {
            popFrameClose(wid, op.no_del)
        });
        $("#" + wid).keydown(function(e) {
            var k = e.charCode || e.keyCode || 0;
            if (k == 27) $("#" + wid + "_close").click()
        });
        FsetOffsetWindowPostionByRate(w, 2, 3)
    }
    if (op.no_move == false) {
        try {
            FenableDrag(wid)
        } catch(e) {}
    }
}
function popFrameClose(wid, no_del) {
    if (Fempty(wid)) wid = 'my_popFrame';
    var w = Fid(wid);
    if (no_del) {
        if (w != undefined) w.style.display = "none"
    } else {
        if (w != undefined) document.body.removeChild(w)
    }
    try {
        FunsetModal(wid + '_modal')
    } catch(e) {}
}
		//加为收藏
function addFav()
{
window.external.AddFavorite('http://www.jxjyzy.com',' ');
}


//设为首页
function addHome()
{
document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage('http://www.jxjyzy.com');
}
function AdvertisementMiddle()
{
	document.write("<div id='ad_article_cotent' style='margin:0 0 5px 5px; float:right;'>文章内容--广告位--</div>");
}
function ShareToFriend(ID)
{
	var url="http://www.jxjyzy.com/user/index_new.aspx?Url=http://www.jxjyzy.com/User/UserInnerMessageEdit.aspx?ID=&Status=FindNew&Subject=资源推荐(资源编号为"+ID+")";
	window.open(url);
}
function PostTopic(ID,Name,SegmentID,SubjectID)
{

		var url = "/WebService/ResourceService.svc/";
		var param='{"ResID":'+ID+',"ResName":"'+Name+'","SegmentID":'+SegmentID+',"SubjectID":'+SubjectID+'}';		
		Call(url,"PostTopic",param,OnPostTopicFavoriteResult);
}
	function OnPostTopicFavoriteResult(result)
    {
		window.open(result);
    } 
//文档查看调用
        function AsToJStoLogin(logininfo)
		{	
			//alert("开始调用js"+"account:"+logininfo.account+",password:"+logininfo.password);
			var url = "/WebService/LoginService.svc/";
			param='{"account":"'+logininfo.account+'","password":"'+logininfo.password+'"}';
			//param='{"account":"'+logininfo.account+'","password":"'+logininfo.password+'","ExpiresDays":"'+logininfo.ExpiresDays+'"}';//记住密码
			Call(url,"LoginIn",param,AsToJStoLoginResult);
		}
		
		function AsToJStoLoginResult(result)
		{	
			//alert(result);
			 if(result==1)
			 {
			 	OnLoginResult(result);	
			 }
			 var movieName = "docapisample";
			 thisMovie(movieName).JsToAsResult(result);	
		}
		
		function thisMovie(movieName)		
		{
			 if (navigator.appName.indexOf ("Microsoft") !=-1)		
			 {
		
				return window[movieName];
			 }
			 else
			 {
				 return document[movieName];
			 }
		}
