var ResizeImageWidthMax=550 //图片最大宽度
var ResizeImageHeightMax=60 //签名档中图最大高度
var ResizeuserimgMax=120  //头像最大宽度
function resizeImagesByWidth(){
	var imgs=document.images
	for(var i=0;i<imgs.length;i++){
	    var w=imgs[i].width
		var h=imgs[i].height
		if(imgs[i].getAttribute("resize",false)=="1"&&w>=ResizeImageWidthMax){
		  imgs[i].width=ResizeImageWidthMax
		  imgs[i].outerHTML = "<a href='"+imgs[i].src+"' target=_blank>" +imgs[i].outerHTML+"</a>"
		}else if (imgs[i].getAttribute("resize",false)=="2"){
		  if (h>=ResizeImageHeightMax){
		     imgs[i].height=ResizeImageHeightMax
		     if (w>=ResizeImageWidthMax){imgs[i].width=ResizeImageWidthMax}
		   }
		}else if (imgs[i].getAttribute("resize",false)=="3"){
		  if (w>=ResizeuserimgMax){
		     imgs[i].width=ResizeuserimgMax
		   }
		}
	}
}
window.onload = resizeImagesByWidth

function check(form)
	{
    if (validate()==false) {
      return false;
    }
    else {
      if (form.isautocopy.checked) { 
        copyText1(form.remenu);
      }
      return true;
    }
  }	
function copyText(obj) {
	ie = (document.all)? true:false
	if (ie){
		var rng = document.remenu.createTextRange();
		rng.moveToElementText(obj);
		rng.scrollIntoView();
		rng.select();
		rng.execCommand("Copy");
		rng.collapse(false);
	}
}

function copyText1(obj) {
	clipboardData.setData('Text',obj.value);
}

function validate() {

	if (document.form1.remenu.value=="") {
		alert("没有填写内容");
		document.form1.remenu.focus();
		//document.all.ewe.focus();
		return false;
	}
	
 }
 
function yinyong(obj) {
	nl="[quote]"+obj+"[/quote]";
	var element = document.createElement("span");
	element.appendChild(document.createTextNode(nl));
	FtSelection();
	FtInsertItem(element);
}
function ftyy(obj) {
	nl="[ftquote]"+obj+"[/ftquote]";
	var element = document.createElement("span");
	element.appendChild(document.createTextNode(nl));
	FtSelection();
	FtInsertItem(element);
}

 function thisurl(str,str1)//本文地址
 {
  	//document.write("<a href=",str1," target=_blank>",str,"</a>");
	document.write("<a class=map href='javascript:' onclick='clipboardData.setData(\"Text\",\""+str+"\")' >复制链接</a>");  
 }
 function copyright(zhiye,clubuser_name,clubuser_nickname)//版权声明
 {
			if (zhiye=="2")
			{
			str="<font color=#808080 style='FONT-SIZE: 9pt;'>版权声明：本文由"+clubuser_nickname+"转载的他人文章，本网站《服务条款》享有相关权利。";
			}
			else
			{str="<font color=#808080 style='FONT-SIZE: 9pt;'>版权声明：本文为"+clubuser_nickname+"原创发表,本网站《服务条款》享有相关权利。";
			}	
			document.write(str+"&nbsp;"); 
 }