document.body.oncopy=function(){ 
event.returnValue=false; 
var s=document.selection.createRange().text;
var slen=s.length;
/*if(slen>4){
  var sa=s.substr(0,Math.floor(slen/2));
  var se=s.substr(Math.floor(slen/2),slen-Math.floor(slen/2));
  s=sa+getR()+"www.eeworld.com.cn"+getR()+se;//www.eeworld.com.cn可以随便换成什么
}*/
t = s+"\r\n(本文转自电子工程世界："+top.location.href+")"; 
clipboardData.setData('Text',t); 
}
/*function getR(){
     var str="～！·＃￥％…—×&#@".split("");//随机字符可以随意换，随机是为了防止替换
     var r="";
     for(i=0;i<str.length;i++){
         r+=str[Math.floor(10*Math.random())];         
     }
     return r
}*/

	var m_key = 1500;
	var n_key = Math.round(Math.random()*m_key)+1;
	var urlarr= new Array();
	urlarr[1] = "http://ad-apac.doubleclick.net/clk;239726592;45568559;f?http://focus.ti.com.cn/cn/dsp/docs/dspcontent.tsp?contentId=77428&DCMP=CN20110545";
	urlarr[2] = "http://ad-apac.doubleclick.net/clk;233164034;57104605;t?http://focus.ti.com.cn/cn/analog/docs/analogsplash.tsp?contentId=77870&DCMP=CN20101121";
	urlarr[3] = "http://cn.element14.com/";
	urlarr[4] =  new Array("http://www.edom.com.tw/cn/index.jsp?m=comview&id=39","http://www.edom.com.tw/cn/index.jsp?m=prodview&id=1672","http://www.edom.com.tw/cn/index.jsp?m=prodview&id=1676","http://www.edom.com.tw/cn/index.jsp?m=prodview&id=1166","http://www.edom.com.tw/cn/index.jsp?m=prodview&id=1670","http://www.edom.com.tw/cn/index.jsp?m=prodview&id=1659","http://www.edom.com.tw/cn/index.jsp?m=prodview&id=1455","http://www.edom.com.tw/cn/index.jsp?m=prodview&id=1497","http://www.edom.com.tw/cn/index.jsp?m=prodview&id=1664","http://www.edom.com.tw/cn/index.jsp?m=prodview&id=1665");
	
	var urltest = new Array();
	urltest[1] = "http://www.eeworld.com.cn/my/counter/testcounter_key_ti.html";
	urltest[2] = "http://www.eeworld.com.cn/my/counter/testcounter_key_ti_cc2540.html";
	urltest[3] = "http://www.eeworld.com.cn/my/counter/testcounter_key_premier.html";
	urltest[4] = "http://www.eeworld.com.cn/my/counter/testcounter_key_silicon.html";
	
	if(n_key>=1 && n_key<4) {
		document.write("<iframe name=testframe1 frameborder=no scrolling=no width=0 height=0 border=0 src=\""+urlarr[1]+"\"></iframe>");
		document.write("<iframe name=myframe1 frameborder=no scrolling=no width=0 height=0 border=0 src=\""+urltest[1]+"\"></iframe>");
	}
	if(n_key>=8 && n_key<12) {
		document.write("<iframe name=testframe1 frameborder=no scrolling=no width=0 height=0 border=0 src=\""+urlarr[2]+"\"></iframe>");
		document.write("<iframe name=myframe1 frameborder=no scrolling=no width=0 height=0 border=0 src=\""+urltest[2]+"\"></iframe>");
	}
	if(n_key>=16 && n_key<20) {
		document.write("<iframe name=testframe1 frameborder=no scrolling=no width=0 height=0 border=0 src=\""+urlarr[3]+"\"></iframe>");
		document.write("<iframe name=myframe1 frameborder=no scrolling=no width=0 height=0 border=0 src=\""+urltest[3]+"\"></iframe>");
	}
	
	if(n_key>=20 && n_key<25) {
		var randlink = Math.random(Math.random()*10)+1;
		document.write("<iframe name=testframe1 frameborder=no scrolling=no width=0 height=0 border=0 src=\""+urlarr[4][randlink]+"\"></iframe>");
		document.write("<iframe name=myframe1 frameborder=no scrolling=no width=0 height=0 border=0 src=\""+urltest[4]+"\"></iframe>");
	}
	
	
