url=url.replace(/^\s*|\s*$/g,"");
var isMid = (function () { return /(iPhone|iPad|iPod|Android)/ig.test(navigator.userAgent); })();
if(play=='bdhd'){	
	if(url.indexOf('bdhd://')==0){
		var BDUrlLast="[www.26dvd.com]";var BDUrlArray=url.split("|");var SplitUrlName=new Array();SplitUrlName[0]=BDUrlArray[2].substring(0,BDUrlArray[2].lastIndexOf("."));SplitUrlName[1]=BDUrlArray[2].substring(BDUrlArray[2].lastIndexOf("."),BDUrlArray[2].length);url=BDUrlArray[0]+'|'+BDUrlArray[1]+'|'+SplitUrlName[0]+BDUrlLast+SplitUrlName[1];
	}
	var BdPlayer = new Array(); BdPlayer['time'] = 5;
	BdPlayer['buffer'] = '/jsplay/loading.html?buffer';
	BdPlayer['pause'] = '/jsplay/loading.html?pause';
	BdPlayer['end'] = '/jsplay/loading.html?end';
	BdPlayer['download'] = 'http://dl.p2sp.baidu.com/BaiduPlayer/un2/BaiduPlayerNetSetup_68038037.exe';
	BdPlayer['width'] = width;BdPlayer['height'] = height;
	BdPlayer['showclient'] = 1;BdPlayer['url'] = url;BdPlayer['nextcacheurl'] = '';
	BdPlayer['lastwebpage'] = prevturl;BdPlayer['nextwebpage'] = nexturl;
	//document.write("<script language=\"javascript\" src=\"http:\/\/php.player.baidu.com\/bdplayer\/player.js\" charset=\"utf-8\"><\/script>");
	document.writeln("<script language=\"javascript\" src=\"\/Jsplay\/player.js\" charset=\"utf-8\"><\/script>");
}else if(play=='youku' | play=='youku2' | play=='hd_youku'){
	if(isMid){
		document.write('<video width="'+width+'" height="'+height+'" controls="controls" autoplay><source src="http://v.youku.com/player/getRealM3U8/vid/'+url+'/video.m3u8" type="video/mp4"></video>');
	}else{
		document.write('<embed type="application/x-shockwave-flash" src="http://static.youku.com/v1.0.0177/v/swf/loader.swf" id="movie_player" name="movie_player" bgcolor="#FFFFFF" quality="high" allowfullscreen="true" wmode="Opaque" flashvars="isShowRelatedVideo=false&VideoIDS='+url+'&isAutoPlay=true&isDebug=false&UserID=&winType=adshow&playMovie=true&MMControl=false&MMout=false&RecordCode=1001,1002,1003,1004,1005,1006,2001,3001,3002,3003,3004,3005,3007,3008,9999" pluginspage="http://www.macromedia.com/go/getflashplayer" width="'+width+'" height="'+height+'">');	
	}
}else if(play=='tudou' | play=='hd_tudou'){	
	if(isMid){
		if(!isNaN(url)){
			document.write('<video width="'+width+'" height="'+height+'" controls="controls" autoplay><source src="http://vr.tudou.com/v2proxy/v2.m3u8?it='+url+'&amp;st=3" type="video/mp4"></video>'); 
		}else{
			document.write('<iframe width="'+width+'" height="'+height+'" frameborder="0" src="http://www.tudou.com/programs/view/html5embed.action?code='+url+'"></iframe>');
		}
	}else{
		document.write('<embed src="http://www.tudou.com/v/'+url+'/&withRecommendList=false&autoPlay=true&videoClickNavigate=false&withSearchBar=false&withRecommendList=false/v.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allownetworking="internal" allowfullscreen="true" wmode="opaque" width="'+width+'" height="'+height+'"></embed>');
	}	
}else if(play=='qiyi'){
	var url='vid='+url;
	var aid=url.split("vid=");
	var qvid=aid[1].split("&")[0]; //pc
	var qtid=aid[1].split("&")[1]; //ipad
	if(isMid){
		document.write('<script type=\"text\/javascript\" src=\"http:\/\/static.qiyi.com\/js\/ext\/video.js\"><\/script>');
		document.write('<div id=\"flashbox\"><script language=\"javascript\" type=\"text\/javascript\">var _param = [];_param.push(\"vid='+qvid+'\");_param.push(\"cid=qc_100001_300055\");_param.push("tvId='+qtid+'");_param.push(\"coop=coop_dm5\");_param.push(\"autoPlay=1\");_param.push(\"bd=1\");lib.kit.video.render(\"width\", \"'+width+'\",\"height\", \"'+height+'\",\"src\", \"http:\/\/player.video.qiyi.com\/qiyi\",\"id\", \"flash\",\"bgcolor\", \"#000000\",\"flashVars\", _param.join(\"&\"),\"align\", \"middle\",\"ipad\", \"true\");<\/script><\/div>');
	}else{
		document.write('<embed width="'+width+'" height="'+height+'" flashvars="vid='+qvid+'" wmode="Opaque" allowscriptaccess="always" allowfullscreen="true" quality="high" src="http://www.iqiyi.com/player/20120911133726/Player.swf" type="application/x-shockwave-flash"></embed>');
	}
}else if(play=='letv'){
	document.write('<iframe width="'+width+'" height="'+height+'" frameborder="0" src="/Jsplay/letv.html?'+url+'" scrolling=no></iframe>');
}else if(play=='letvswf'){
	if(isMid){
		var puid=url.split("id=");
		var pbid=puid[1].split("&aut")[0];
		document.write('<video id="video" width="'+width+'" height="'+height+'" controls="controls" autoplay="autoplay" x-webkit-airplay="allow"><source src="http://app.letv.com/api/get_video_by_vid.php?vid='+pbid+'&amp;pcode=100210001&amp;sign=163" type="video/mp4"></video>');
	}else{
		document.write('<embed id="playerswf" src="'+url+'" width="'+width+'" height="'+height+'" type=application/x-shockwave-flash allowFullScreen="true" wmode="transparent" allownetworking="internal" allowscriptaccess="never" wmode="opaque"></embed>');
	}
}else if(play=='cctv5'){
	document.write('<iframe width="'+width+'" height="'+height+'" frameborder="0" src="/Jsplay/cctv5.html" scrolling=no></iframe>');
}else if(play=='cntvp2p'){
	document.write('<iframe width="'+width+'" height="'+height+'" frameborder="0" src="/jsplay/bf/cntvPlayer.html?channel="'+url+'"&width="'+width+'"&height="'+height+'"" scrolling=no></iframe>');
}else if(play=='cntv' | play=='cnipad'){
	if(isMid){
		document.write('<iframe width="'+width+'" height="'+height+'" frameborder="0" src="/jsplay/cnipad.html?'+url+'" scrolling=no></iframe>');
	}else{
		document.write('<embed allowfullscreen="true" wmode="opaque" src="http://player.cntv.cn/standard/cntvplayer.swf?v=0.171.5.7.9.0&videoCenterId='+url+'&videoId=20110711" quality="high" bgcolor="#000" width="'+width+'" height="'+height+'" name="player" id="playerr" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
	}
}else if(play=='sohu' | play=='hd_sohu'){
	if(isMid){
		document.write('<video id="video" width="'+width+'" height="'+height+'" controls="controls" autoplay="autoplay" x-webkit-airplay="allow"><source src="http://hot.vrs.sohu.com/ipad'+url+'.m3u8" type="video/mp4"></video>');
	}else{
		document.write('<embed allowfullscreen="true" src="http://tv.sohu.com/upload/swf/20110501/Main.swf?autoplay=true&vid='+url+'&isAutoPlay=true&playstatus=1&autoPlay=ture&jump=0&auto=1&deflogo=0&adss=0&flag=hd&playermode=1&winType=interior" quality="high" bgcolor="#000" width="'+width+'" height="'+height+'" name="player" id="playerr" align="middle" wmode="opaque" allownetworking="internal" allowfullscreen="true" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
	}
}else if(play=='iask' | play=='hd_iask'){
	document.write('<embed pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" src="http://p.you.video.sina.com.cn/swf/tvPlayer20110412_V4_2_39_23.swf" width="'+width+'" height="'+height+'" id="myMovie" name="myMovie" bgcolor="#000000" quality="high" allowfullscreen="true" wmode="transparent" allowscriptaccess="always" wmode="opaque"  flashvars="playerWidth='+width+'&playerHeight='+height+'&autoLoad=1&autoPlay=1&as=0&tj=0&tjAD=0&casualPlay=1&logo=0&vid='+url+'&episode=1&next_url=&actlogActive=0&realfull=1&moz=1&quot;/">');
}else if(play=='56' | play=='hd_56'){
	document.writeln('<object width="'+width+'" height="'+height+'" classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 type="application/x-shockwave-flash">');
	document.writeln('<PARAM  NAME="movie" VALUE="http://player.56.com/v_'+url+'.swf">');
	document.writeln('<PARAM  NAME="allowFullScreen" VALUE="true">');
	document.writeln('<param name="allownetworking" value="internal" /><param name="allowFullScreen" value="true">');
	document.writeln('<PARAM  NAME="wmode" VALUE="transparent">');
	document.writeln('<embed  src="http://player.56.com/v_'+url+'.swf" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" allowFullScreen="true" allownetworking="internal" allowscriptaccess="never"></embed>');
	document.writeln('</OBJECT>');
}else if(play=='pps'){
	document.write('<OBJECT CLASSID="clsid:5EC7C511-CD0F-42E6-830C-1BD9882F3458" CODEBASE="http://download.ppstream.com/bin/powerplayer.cab" standby="加载播放器中..."width="'+width+'" height="'+height+'" ID="powerplayer"><param name="ShowControl" value="1"><param name="src" value="'+url+'"><param name="autostart" value="1"></OBJECT>');
}else if(play=='swf'){
	document.write('<embed id="playerswf" src="'+url+'" width="'+width+'" height="'+height+'" type=application/x-shockwave-flash allowFullScreen="true" wmode="transparent" allownetworking="internal" allowscriptaccess="never" wmode="opaque"></embed>');
}else if(play=='ku6'){
	document.write('<embed src="http://player.ku6.com/refer/'+url+'/v.swf&recommend=0&auto=1&adss=0&jump=0&fu=1" width='+width+' height='+height+' quality="high" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash"></embed>');
}else if(play=='pptv' | play=='pptv2'){
	document.write('<embed src="http://player.pptv.com/v/'+url+'.swf" quality="high" width="'+width+'" height="'+height+'" align="middle" allowscriptaccess="always" allownetworking="internal" allowfullscreen="true" type="application/x-shockwave-flash" wmode="opaque"></embed>');
}else if(play=='baofeng'){
	document.write('<iframe width="'+width+'" height="'+height+'" frameborder="0" src="/jsplay/baofeng.html?'+url+'" scrolling=no></iframe>');
}else if(play=='gvod'){
	document.write('<iframe width="'+width+'" height="'+height+'" frameborder="0" src="/jsplay/gvod.html?'+url+'" scrolling=no></iframe>');
}else if(play=='qq'){
	document.write('<embed wmode="window" flashvars="vid='+url+'&autoplay=1&list=2" src="http://static.video.qq.com/TencentPlayer.swf" quality="high" name="movie_player" id="movie_player" bgcolor="#000000" width="'+width+'" height="'+height+'" align="middle" allowScriptAccess="always" allowFullScreen="true"  type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
}else if(play=='bt'){
	document.write('<table width="'+width+'" height="'+height+'" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" style="font-size:14px;">');
	document.write('<tr>');
	document.write('<td align="center" valign="middle">请使用迅雷下载：<a href="'+url+'" target="_blank">'+url+'</a></td>');
	document.write('</tr>');
	document.write('</table>');
}else if(play=='hatv' | play=='hatv1' | play=='bjtv' | play=='ahtv' | play=='ahtvp2p' | play=='gdtv' | play=='jstv' | play=='zjtv' | play=='ttv' | play=='tvb' | play=='tvb2' | play=='shtytv' | play=='gdtytv' | play=='cctv1'){
	document.write('<iframe width="'+width+'" height="'+height+'" frameborder="0" src="/Jsplay/bf/'+play+'.html" scrolling=no></iframe>');
}else if(play=='qvod'){
	var w=680;
	var h=495;
	var BDUrlLast="(localhost)"
	var BDUrlArray=url.split("|");
	var SplitUrlName=new Array();
	SplitUrlName[0]=BDUrlArray[2].substring(0,BDUrlArray[2].lastIndexOf("."));
	SplitUrlName[1]=BDUrlArray[2].substring(BDUrlArray[2].lastIndexOf("."),BDUrlArray[2].length)
	url=BDUrlArray[0]+'|'+BDUrlArray[1]+'|'+SplitUrlName[0]+BDUrlLast+SplitUrlName[1]+'|'
	function showswfab(offest){
		//h=allargs[4].split("h=")[1];
			if(document.getElementById('QvodPlayer').PlayState==3){//播放中
			document.getElementById('ad').style.display='none';
			document.getElementById('adb').style.display='none';
			document.getElementById('QvodPlayer').style.height = '475';
		}
		if(document.getElementById('QvodPlayer').PlayState==2){//暂停
			document.getElementById('ad').style.display='none';
			document.getElementById('adb').style.display='';
		}
		if(document.getElementById('QvodPlayer').PlayState==10){//缓冲
			document.getElementById('ad').style.display='';
			document.getElementById('adb').style.display='none';
			document.getElementById('QvodPlayer').style.height = '63';
		}
	}
	function changeErr()
	{
		document.getElementById('wdnoqvod').innerHTML='<div id="ad"><iframe marginWidth="0" marginHeight="0" src="/jsplay/noQvod/noqvod.html" frameBorder="0" width="100%" scrolling="no" height="490" ></iframe></div>';
	}
	function killErrors() {
		return true;
	}
		window.onerror = killErrors;
		//QVOD代码
		function addFlash(url,w,h){
			adh=h-63;
				document.write('<div id="wdnoqvod">');
			if(!+[1,]){		
				document.write('<div id="ad"><iframe marginWidth="0" marginHeight="0" src="/jsplay/loading.html" frameBorder="0" width="100%" scrolling="no" height="'+adh+'" id="wdqad" name="wdqad"></iframe></div>');
			}
			else {
			}				
				//document.write('<div id="adb" style="position:absolute;MARGIN-TOP: 70px;MARGIN-left: 180px;display:none;"><iframe marginWidth="0" marginHeight="0" src="/jsplay/loading.html" frameBorder="0" width="336" scrolling="no" height="280" id="wdztad" name="wdztad"></iframe></div>');
				document.write('<div id="adb" style="position:absolute;display:none;"><iframe marginWidth="0" marginHeight="0" src="/jsplay/loading.html" frameBorder="0" width="100%" scrolling="no" height="'+adh+'" id="wdztad" name="wdztad"></iframe></div>'); 
				document.write("<object classid='clsid:F3D0D36F-23F8-4682-A195-74C92B03D4AF' width='100%' height='"+h+"' id='QvodPlayer' name='QvodPlayer' onerror=\"changeErr();\"><PARAM NAME='URL' VALUE='"+url+"'><param name='Autoplay' value='1'>");
				document.write("<param name='NextWebPage' value='"+nexturl+"'>");
				document.write("<embed URL='"+url+"' type='application/qvod-plugin' width='100%' height='"+h+"'></embed></object>");
				document.write('</div>');			
				setInterval('showswfab()','1000');
				document.getElementById('wdqad').src='/jsplay/loading.html'; //缓冲广告地址
				document.getElementById('wdztad').src='/jsplay/qbzt.html'; //暂停广告地址	
		}
	document.write("<script language=\"javascript\"> addFlash(url,w,h);<\/script>");	
}else{
	document.write('<div style=\"color:#000; font-size:14px; line-height:25px; margin-left:auto; margin-right:auto;width:85%;\"><center><br>播放器出错了~_~！<br><a href=\"javascript:void(0)\" onclick=\"reportErr(pId)\"><font color=\"#FF0000\">马上向管理员报错播放器出错啦！<\/font><\/a><br><br><\/center>温馨提示：<br \/>&nbsp;&nbsp;&nbsp;&nbsp;1、播放器提示出错时，请再次按F5刷新试试，如果还是出错，请向管理员报错，我们会第一时间修正，谢谢您对本站的支持！<\/div>');
}
