document.oncontextmenu=document.onselectstart=document.oncopy=function(e){return   false;}

function checkadd(){
	edit_save();
	if($('title').value==""){
		$("announce").html("标题未填写");
	}else if($('cid').value==""){
		$("announce").html("没有选择分享的栏目");
	}else if($('ttHtmlEditor').value==""){
		$("announce").html("还没有填写内容呢");
	}else{
		return true;
	}
	return false;
}

digg={
	get:function(tid){
		$.ajax.request({url:siteurl,method:"post",oncomplete:function(returns){
			eval(returns.responseText);
			$("digggoodnum").html(digginit['yes']);
			$("diggsosonum").html(digginit['no']);
		}},"do=digg&tid="+tid+"&ac=getDigg");
	
},
	send:function(tid,stype,uid){
	$("loading").setStyle("display:block;");
	if(uid==userid){$("loading").html("您不能送鲜花给自己");}
	if($.cookies.read(tid+"digg")){$("loading").html("针对本文您已经投过票了");
	setTimeout(function(){
							$("loading").setStyle("display:none;").html("操作执行中 请稍后...");
						},4000);
		}
	else{
	$.ajax.request({url:siteurl,method:"post",oncomplete:function(returns){
		$.cookies.set(tid+'digg',tid,3600)
		$("digg"+stype+"num").html(returns.responseText)
			$("loading").setStyle("display:none;")
	  }},"do=digg&tid="+tid+"&ac=Digg"+stype+"&uid="+uid);

}
	
	 }

}

function share_comm(form){
	if($("commentmsg").value.trim()!=""){
		$("loading").setStyle("display:block;");
		$.ajax.request({url:siteurl+"cp.php",method:"post",oncomplete:function(returns){
				var lastTime = new Date();
				var time=lastTime.getFullYear()+"-"+(lastTime.getMonth()+1)+"-"+lastTime.getDate();
				var newcomm=document.createElement("li");
				newcomm.innerHTML='<p><span class="user-name"><a href="?do=space&uid='+userid+'">'+returns.responseText+'</a></span><span class="grey small">@'+time+'</span></p><h6>'+$("commentmsg").value.replace(/\[em:(.+?):\]/gi,'<img src="'+img_server+'face/$1.gif" />')+'</h6>';
				$("commentmsg").value='';
				$("commentlist").appendBefore(newcomm);
				$("loading").setStyle("display:none;");
				
		}},formToStr(form));
	}
	return false;
}

onready(function(){
	
	if($("artbox")!=null){
		digg.get(tid);
	$.c($("artbox").getElementsByTagName("img")).each(//图片大小控制;
		function(e,i){
		dashzhao.extend(e,dashzhao);
		if(e.Width()>600){
			e.removeAttribute("width");e.removeAttribute("height");e.style.width="600px";
		}
		else if(e.Height()>600){
			e.removeAttribute("width");e.removeAttribute("height");e.style.width="300px";
		}
	});}
	
})