﻿ function showNew4(n)
    {	        
        for(var i=1;i<=5;i++)
        {
	        var curCon=document.getElementById("new4_"+i);
	        var curBtn=document.getElementById("newc4_"+i);
	        if(n==i)
	        {
	            if(curBtn)
	            {
		            curBtn.style.display="block";
		        }
		        if(curCon)
		        {
		            curCon.className="one";			
		        }
	        }
	        else
	        {
	            if(curBtn)
	            {
		            curBtn.style.display="none";
		        }
		        if(curCon)
		        {
		            curCon.className="";
		        }
	        }
        }
    }    


//公共ajax取数据
function pubajax(url,actionstr,divID)
{
    var Action=actionstr; 
    var options={ 
                      method:'get', 
                      parameters:Action, 
                      onComplete:function(transport) 
                      { 
                          var returnvalue=transport.responseText; 
                          if (returnvalue.indexOf("??")>-1) 
                              document.getElementById(divID).innerHTML=''; 
                          else 
                              document.getElementById(divID).innerHTML=returnvalue; 
                      } 
                   }; 
       new  Ajax.Request(url+'?no-cache='+Math.random(),options);
}

function CommandSubmitContent(obj,userName,userMobile,userEmail,userQq,content,newsid)
{
    if(userName=="")
    {
        alert('姓名不能为空');
        return false;
    }
    if(content=="")
    {
        alert('评论内容不能为空');
        return false;
    }
    var Action='type=addComment&userName='+escape(userName)+'&userMobile='+escape(userMobile)+'&userEmail='+escape(userEmail)+'&userQq='+escape(userQq)+'&content='+escape(content)+'&newsId='+escape(newsid)
    var options={ 
                    method:'get', 
                    parameters:Action, 
                    onComplete:function(transport) 
                    { 
                        var returnvalue=transport.responseText; 
                        if (returnvalue == "0") 
                        { 
                           alert('评论发表失败!'); 
                           obj.Content.value='';
                        } 
                        else 
                        { 
                           alert('评论发表成功!'); 
                           location.href=location.href;
                           //GetCommentListContent(''+url+'',''+newsid+'','1');
                           //document.getElementById("CommentlistPage").innerHTML=arrreturnvalue[1]; 
                           //obj.Content.value='';
                        } 
                    } 
                 }; 
     new  Ajax.Request('http://www.dsdod.com/NewsComment.aspx?no-cache='+Math.random(),options);      
} 
function SystemCommandSubmitContent(obj,txtTitle,txtContent,newsid)
{
    if(txtContent=="")
    {
        alert('评论内容不能为空');
        return false;
    }
    var Action='type=addComment&userName=&userMobile=&userEmail=&userQq=&content='+escape(txtContent)+'&newsId='+escape(newsid)
    var options={ 
                    method:'get', 
                    parameters:Action, 
                    onComplete:function(transport) 
                    { 
                        var returnvalue=transport.responseText; 
                        if (returnvalue == "0") 
                        { 
                           alert('评论发表失败!'); 
                           obj.Content.value='';
                        } 
                        else 
                        { 
                           alert('评论发表成功!'); 
//                           location.href=location.href;
//                           
//                           
//                           
//                           
//                           
//                           history.go(0) 
location.reload() 
//   location=location 
//   location.assign(location) 
//    document.execCommand('Refresh') 
//   window.navigate(location) 
//   location.replace(location) 
//   document.URL=location.href
                           
                           
                           
                           
                           
                           
                           
                           //GetCommentListContent(''+url+'',''+newsid+'','1');
                           //document.getElementById("CommentlistPage").innerHTML=arrreturnvalue[1]; 
                           //obj.Content.value='';
                        } 
                    } 
                 }; 
     new  Ajax.Request('http://www.dsdod.com/NewsComment.aspx?no-cache='+Math.random(),options);      
}