﻿            var currentpos,timer;
            function initialize() 
            {
               timer=setInterval("scrollwindow()",10);
            }
            function sc()
            {
               clearInterval(timer);
            }
            function scrollwindow()
            {
               currentpos=document.body.scrollTop;
               window.scroll(0,++currentpos);
               if (currentpos != document.body.scrollTop)
                 sc();
            }
            document.onmousedown=sc
            document.ondblclick=initialize
		    //发表评论
		    function savaData()
		    {
		       var ct=Editor.document.frames["HtmlEditor"].document.getElementsByTagName("BODY")[0].innerHTML;
		       var str=MyResource.firm.v1.Topic.ExecSettingSavaData(document.getElementById("username").value,document.getElementById("commtitle").value,ct,document.getElementById("topic_id").value,document.getElementById("userip").value,document.getElementById("hn_uname").value).value;
		       switch(str)
			   {
			      case "当前不能发表评论!":
					alert("当前不能发表评论!");
					break;
				  case "昵称不能为空!":
					alert("昵称不能为空!");
				    break;
				  case "标题不能为空!":
					alert("标题不能为空!");
				    break;
				  case "验证码不能为空!":
					alert("验证码不能为空!");
					break;
			      case "评论内容不能为空!":
					alert("评论内容不能为空!");
					break;
				  case "验证码错误!":
					alert("验证码错误!");
					break;
				  case "评论发表成功!":
					document.getElementById("username").value="";
		            //document.getElementById("validate").value="";
		            Editor.document.frames["HtmlEditor"].document.getElementsByTagName("BODY")[0].innerHTML="";
		            document.location.reload();
					break;
			      case "评论发表失败!":
					alert("评论发表失败!");
					break;
			   }
		    }		   
		    
	        function addnums(obj,obj2)
	        {
	            var str=MyResource.firm.v1.Topic.ExecSettingAddNums(obj,document.getElementById("hn_uname").value).value;
		        if(str)
		           window.open(obj2,'Download','height=235, width=450, top='+(screen.height-200)/2+', left='+(screen.width-100)/3+', toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
		        else
		           document.location.href="default.aspx";
	        }
