// JavaScript Document

	 	//复制标题和网址
	 	function copyUrl(){ 
	    	var clipBoardContent=this.document.title+"\n"+this.location.href; 
	    	window.clipboardData.setData("Text",clipBoardContent); 
	    	alert("复制成功!"); 
   		}
		
		//拷贝代码 参数说明：obj-文档元素id
		function copycode(obj) {
				var clipBoardContent=document.getElementById(obj).innerHTML; 
				if(clipBoardContent==''){
					clipBoardContent=this.document.title+"\n"+this.location.href; 
				}
				window.clipboardData.setData("Text",clipBoardContent);
				alert("复制成功!"); 
			}
			
			
		//时间差来显示，显示相差的时间
	    //1254125362 为世间格式
	   		function nodate(vardate)
		{
				var myinfo="";
			   	var dd=new Date();
			    var nowtime=dd.getTime();
			     nowtime=parseInt(nowtime/1000);			   
				var myshow=parseInt((nowtime-vardate));//秒
				var myshow1=parseInt((myshow/60));//分钟
				var myshow2=parseInt((myshow/3600));//小时
				var myshow3=parseInt((myshow/(3600*24)));//天
				var myshow4=parseInt((myshow/(3600*24*30)));//月
			  	if (myshow<=0){
			  		myinfo="1 秒钟前";
			  	}else if(myshow>0&&myshow<60){
			  		myinfo=myshow+" 秒钟前";
			  	}else if(myshow>=60&&myshow1<60){
			  		myinfo=myshow1+" 分钟前";
				}else if(myshow1>=60&&myshow2<24){
					myinfo=myshow2+" 小时前";
				}else if(myshow2>=24&&myshow3<31){
					myinfo=myshow3+" 天前";
				}else{
					myinfo=myshow4+" 月前";
				}
	        	document.write(myinfo);
		
		}
		
		
//网络版视频却换	
function quehuanplay(videosrc,vidid,typeid){
 var tempvd="<embed src=\"/flashapp/player_multiVideo.swf?flvPath="+videosrc+"&xmlurl";
 	  tempvd+="=/plus/playList.php?typeid="+typeid+"\" allowfullscreen=\"true\" ";
	  tempvd+="type=\"application/x-shockwave-flash\" width=\"415\" height=\"392\" charset=\"gb2312\"></embed>";
  document.getElementById(vidid).innerHTML=tempvd;
}

//网络版音频却换	
function quehuanmusplay(videosrc,vidid,typeid,picurl){
 var tempvd="<embed src=\"/flashapp/player_multimp3.swf?mp3url="+videosrc+"&xmlurl";
 	  tempvd+="=/plus/playList.php?typeid="+typeid+"\" allowfullscreen=\"true\" ";
	  tempvd+="type=\"application/x-shockwave-flash\" width=\"415\" height=\"50\" charset=\"gb2312\"></embed>";
 var myhtml="<table border=0 cellspacing=0 cellpadding=0 width=415 height=392><tr><td>";
 	  myhtml+="<img src="+picurl+" width=415 height=341>";
	  myhtml+="</td></tr><tr><td>"+tempvd+"</td></tr></table>";
  document.getElementById(vidid).innerHTML=myhtml;
}



//flash 和flash变量设置
//说明：src --flash文件 ，w=宽度，h=高度 flashvar=flash要传的参数串，
function flash_object(src,w,h,flashvar){
		if(w=='')w=300;
		if(h=='')h=300;
		 var objstr='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
		 objstr+='codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width=640 height=360>';
	     objstr+='<param name="movie" value="'+src+'"><param name="quality" value="high">';
		 objstr+='<param name="menu" value="false"><param name=wmode value="opaque">';
         objstr+='<param name="FlashVars" value="'+flashvar+'">';
         objstr+='<embed src="'+src+'" wmode="opaque" FlashVars="'+flashvar+'" quality="high" width="640" height="360" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'; 
		objstr+='</object>'; 
	document.write(objstr);
}
