// Java Document



function ctext(copy_name){
var addrs=document.location.href;
addrs=addrs+" 这本漫画"+copy_name+" 很有趣";
clipboardData.setData('text',addrs);
alert("复制成功!");
}

function add_cookie(obj_name,obj_value,obj_days){
	var expre=new Date();
	    expre.setTime(expre.getTime()+obj_days*24*3600*1000);//ff expre.getTime ie expre.getTime()
	var str=obj_name+"="+escape(obj_value)+";  expires="+(expre.toGMTString())+"; path=/";
//	cookie.setPath("/");
	   document.cookie=str;
}



function check_cookie(obj_name){
	//alert(document.cookie);
//alert("cookie名字"+obj_name);
var ches=0;
if (document.cookie.indexOf(obj_name)>0) {ches=1;}
else{ches=0;}
return ches;

}







function usrDigg(newsid,selector,types){
	
if  (check_cookie("hit_manmankan"+newsid)==1){alert("您已经顶过了！");}
else{
       add_cookie("hit_manmankan"+newsid,newsid,1);
          if( newsid !=0){ 
 $.getJSON("http://hit.manmankan.com/hit.asp?rnd="+Math.random()+"&action=up&flashid="+newsid+"&jsoncallback=?", function(data){ 
 //alert("共有"+data.value+"人顶过");
 document.getElementById(selector).innerHTML="<strong>人气指数："+data.value+"</strong>";
	　　 } 
	 );

		  
/*	
&rnd=" + Math.random()
$.ajax({
		type:"post", 
		url:"/hit/hit.asp", 
		dataType: "html", 
		data:"action="+types+"&flashid=" + newsid, 
		error:function(msg){ $('#'+selector).html(msg);},
		success:function(result){ 	
		alert("共有"+result+"人顶过了");
		//  $('#'+selector).html(result);
		   //$('#'+uptxt).html("<a href='http://www.balew.com/digg.aspx' href=_blank>查看</a>");
		                            }
		    });*/
  //$.ajax end      
}//if end 
}//else end


}



function getVoteNum(newsid,selector,types){
          if( newsid !=0){ 
 $.getJSON("http://hit.manmankan.com/hit.asp?rnd="+Math.random()+"&action=hit&flashid="+newsid+"&jsoncallback=?", function(data){ 
 //alert("共有"+data.value+"人顶过");
 document.getElementById(selector).innerHTML="<strong>人气指数："+data.value+"</strong>";
	　　 } 
	 );

		  
}//if end 

}//end function







