// ActiveX Server pxp_server
var pxp_server 		= null;
//var LOCALHOSTURLCOMMON=new String("http://192.168.0.178:8080/");
var LOCALHOSTURLCOMMON=new String("http://siena.ucantv.com/");
var error_msg="";
var cp_flag="unextv";
//定义推荐好友的IM名称
var CASE_MSN="msn";
var CASE_QQ="qq";
var CASE_ICQ="icq";
var CASE_GTALK="gtalk";
var CASE_SKYPE="skype";
var CASE_YAHOO="yahoo";
var CASE_ARRAY=new Array();
CASE_ARRAY=[CASE_MSN,CASE_QQ,CASE_ICQ,CASE_GTALK,CASE_SKYPE];
var r_xml="";

var init_html="";
  init_html+='\n<SCRIPT FOR="pxpServer" EVENT=ExitEvent()>';
  init_html+='\nwindow.opener = null;';
  init_html+='\nwindow.open("","_self");';
  init_html+='\nwindow.close();';
  init_html+='\n</SCRIPT>';
  init_html+='\n<div id="pxpContainer"></div>';
  init_html+='\n<script FOR="pxpServer" EVENT=SigninEvent()>';
  init_html+='\nvar code = pxp_server.GetLastError("");';
  init_html+='\nif(msg_flag){';
  init_html+='\nif( code == 0 )';
  init_html+='\n{ if(flagAllFile)';
  init_html+='\n download_diag_all(document.getElementById("surlname").value,document.getElementById("urlname").value);';
  init_html+='\nelse download_diag(document.getElementById("surlname").value); \n pxp_server.pgm_event_recommend();}';
  init_html+='\n else{';
  init_html+='\n if(flagAllFile) PGM_Wait_FireWall_All();';
  init_html+='\n else PGM_Wait_FireWall();\n PGM_Wait_FireWall_Recommend();';
  init_html+='\n}';
  init_html+='\nmsg_flag=false;';
  init_html+='\n}';
  init_html+='\n</script>';
  document.write(init_html);
 
  
//错误代码
var PXP_ERROR_ARRAY=new Array();
			PXP_ERROR_ARRAY=[["0","成功"],["1","非法参数"],["2","用户不存在"],["3","未登陆"],["4","格式不合法"],["5","服务器错误"],["6","数据库错误"],
			["7","网络错误"],["8","未知命令"],["9","节目不存在"],["10","目标不存在"],["11","重试"],["100001","功能未实现"],["100100","对象为空"],
			["100200","test指令测试不成功。无法连接到pxp服务，请检查网络"],["100201","作业线程为空"],["100202","网络类型标示错"],
			["100203","网络没有连接，不能发送"],["100210","udp服务Socket为空"],["100211","udp创建出错"],["100212","udp 邦定端口出错"],
			["100213","udp socket非法"],["100220","tcp服务Socket为空"],["100221","tcp创建出错"],["100222","tcp 邦定端口出错"],["100223","tcp socket非法"],
			["100224","tcp connect非法"],["100225","tcp socket send 错误"],["100250","用户未登录,不能发送指令"],["100300","帧数据错"],
			["100301","帧的长度不合法"],["100302","帧数据错无法解析"],["100400","节点为空"],["100401","节点为空或者未连接"],["100402","用户未登录"],
			["100403","用户节点，不可以自ping"],["100404","节点与节点网络类型不可匹配"],["100500","文件名为空,不能移动文件"],
			["100501","文件名未下载完成,不能移动文件"],["100502","非文件,不能写盘"],["100503","文件加载失败"],["100504","文件帧未找到"],
			["100600","节目停止或者暂停"],["100601","节目未找到"],["100602","节目id未找到"],["100700","XML解析出错"],["100701","XML Ping命令Step错"],
			["100702","XML 文档MSXML::IXMLDOMDocumentPtr出错"],["100703","XML加载出错"],["100704","XML转换非IsWnd(CCtrlTree)错"],
			["100706","XML的root节点非pxp"],["100708","PXP XML CMD 格式错"],["100709","XML的无内容节点"],["100710","ERR_DRIVER_XML_CREATEINSTANCE"],
			["100801","pxp命令发送出错"],["100802","连接负载均衡中心节点超时错"],["100803","测试网络类型网络错"],["100804","注销超时错误"]];
//错误描述取得
function doNothing(){
   return;
}
function getErrorDesc(errNum){
	for(var i=0;i<PXP_ERROR_ARRAY.length;i++){
		if(PXP_ERROR_ARRAY[i][0]==errNum.substr(1)){
		   return PXP_ERROR_ARRAY[i][1];
		}
	}
}
// 通用函数
function $(id)
{	 
 	var obj = document.getElementById(id)?document.getElementById(id):null;
	return obj;	
} 

//////////////////////////////////////////////////
// View Type
//////////////////////////////////////////////////
//	1 - 正在下载
//	2 - 已经下载
//  3 - 播放模式
var VT_DOWNLOADING=1;
var VT_DOWNLOADED=2;
var VT_PLAYING=3;

//////////////////////////////////////////////////
// Splitter variables
//////////////////////////////////////////////////
var PGM_SPLITTER		= "{\r*\r}";
var PGM_FIELD_SPLITTER		= "{*}";

//////////////////////////////////////////////////
// Task status defines
/////////////////////////////////////////////////

// 任务正在运行
//  0 未开始
//	1 正在连接
//  2 正在创建文件
//  3 正在下载数据
// 任务没有运行
// 10 暂停 
// 11 成功 
// 12 下载失败	
// 20 等待状态

Status_UnStart			= 0;
Status_Wait		 		= 1;//下载队列中等待
Status_Connect			= 2;
Status_Download 		= 3;
Status_Pause			= 10;
Status_Complete			= 11;
Status_Fail 			= 12;


//////////////////////////////////////////////////
// Login status defines
//////////////////////////////////////////////////
var LoginStatus_NotLogin		= 1;
var LoginStatus_LoginProcess	= 2;
var LoginStatus_LoginOkay		= 3;
var LoginStatus_LoginFailed		= 4;

//////////////////////////////////////////////////
// Message icon defines
//////////////////////////////////////////////////
var ICON_NONE				= 0;
var ICON_INFORMATION		= 1;
var ICON_ALERT				= 2;
var ICON_ERROR				= 3;
var ICON_QUESTION			= 4;

//////////////////////////////////////////////////
//
//////////////////////////////////////////////////
var version 					= -1;

//////////////////////////////////////////////////
// 获取版本信息
//////////////////////////////////////////////////
function get_server_build_version()
{
	if(pxp_server == null)
	{
		try
		{
			pxp_server = new ActiveXObject("PXPSERVER.pxpServerCtrl.1");
		}
		catch(e)
		{
			return 0;
		}
	}
	var strVer = pxp_server.GetVersion();
	var arrayVer = strVer.split(".");
	
	version = parseInt(arrayVer[3]);
	
	return parseInt(arrayVer[3]);
}
function getVersion()
{
	if (version <= 0)
	{
		get_server_build_version();
	}
}

// 获取path
function get_server_path()
{
	if(pxp_server == null)
		return "";
		
	var strPath = pxp_server.GetServerPath();
	strPath = strPath.substr(0, strPath.length-1);
	return strPath;	
}


function Trim(sText)
{
	return sText.replace(new RegExp("(^[\\s]*)|([\\s]*$)", "g"), "");
}
function get_inner_text_from_html(strHtml)
{
	var strResult = strHtml.replace(/<(.*?)>/g,"");
	return strResult;
}

function number_to_string(theNumber, dotCount, bRound)
{
	var strResult;
	if(dotCount == 0)
	{
		theNumber = parseInt(theNumber);
		strResult = theNumber.toString();
	}
	else
	{
		if(bRound == true)
		{
			var nGene = Math.pow(10, dotCount);	
			theNumber *= nGene;
			theNumber = Math.round(theNumber);
			theNumber /= nGene;
			strResult = theNumber.toString();
		}
		else
		{
			var strNumber = theNumber.toString();
			var nDotIndex = strNumber.indexOf(".");
			if(nDotIndex != -1)
				strNumber = strNumber.substr(0, nDotIndex + dotCount + 1);
			strResult = strNumber;
		}
	}
	return strResult;
}

function cut_string(str, nLength)
{
	var nTheLength = 0;
	var len = str.length;
	for(nIndex=0; nIndex<len; nIndex++)
	{
		if( str.charCodeAt(nIndex) > 255 )
			nTheLength += 2;
		else
			nTheLength += 1;
		if(nTheLength >= nLength)
			break;
	}
	var strResult = str.substr(0, nIndex);
	if(strResult.length < str.length)
		strResult = strResult + "...";
	return strResult;
}


function number_to_description(theNumber, dotCount, bRound)
{
	var strUnit;
	var nM = 1024 * 1024;	
	var nG = 1024 * 1024 * 1024;	
	if(theNumber > nG)
	{
		theNumber = theNumber / nG;
		strUnit = "G";
	}
	else if(theNumber > nM)
	{
		theNumber = theNumber / nM;
		strUnit = "M";
	}
	else if(theNumber > 1024)
	{
		theNumber = theNumber / 1024;
		strUnit = "K";
	}
	else
	{
		strUnit = "";
	}
	
	var strResult = number_to_string(theNumber, dotCount, bRound) + strUnit;
	return strResult;
}


function dword_to_date(nSystemTime)
{
	if(nSystemTime < 1000)
		return "";

	var nTime = parseInt(nSystemTime * 1000);
	
	var theTime = new Date(nTime);
	var theYear = theTime.getYear();
	var theMon = theTime.getMonth() + 1;
	var theDay = theTime.getDate();
	var theHour = theTime.getHours();
	var theMin = theTime.getMinutes();
	var theSec = theTime.getSeconds();
	
	var nowTime = new Date();
	var nowYear = nowTime.getYear();
	var nowMon = nowTime.getMonth() + 1;
	var nowDay = nowTime.getDate();
	var nowHour = nowTime.getHours();
	var nowMin = nowTime.getMinutes();
	var nowSec = nowTime.getSeconds();
	
	if(nowYear > theYear)
	{
		return theYear + "-" + add_prefix_zero(theMon) + "-" + add_prefix_zero(theDay);
	}
	else if(nowMon > theMon || nowDay > theDay)
	{
		return theMon + "月" + theDay + "日";		
	}
	else
	{
		return add_prefix_zero(theHour) + ":" + add_prefix_zero(theMin) + ":" + add_prefix_zero(theSec);
	}
}


function second_to_time(nSecond)
{
	var nHour = parseInt(nSecond / 3600);
	nSecond -= nHour * 3600;
	var nMin = parseInt( nSecond / 60);
	nSecond -= nMin * 60;
	return add_prefix_zero(nHour) + ":" + add_prefix_zero(nMin) + ":" + add_prefix_zero(nSecond);
}


function add_prefix_zero(nNumber)
{
	strNumber = nNumber.toString();
	if(strNumber.length < 2)
		strNumber = "0" + strNumber;
	return strNumber;
}

function add_prefix_space(strString, nOutputLength)
{
	if(nOutputLength < strString.length)
		return;
	
	var nLength = nOutputLength - strString.length;
	var strSpace = "";
	for(var i=0; i<nLength; i++)
	{
		strSpace += "&nbsp;";
	}
	var strResult = strSpace + strString;
	return strResult;
}

/**邮箱检查函数 err_callback 错误回调匿名函数
*/
function validate_mail(v,err_callback){
	if(!v)return true;
	var a=/@+/g;
 	var b=/\.+/g;
 	if(a.test(v)&&b.test(v))
 		return true;
 	else{
 		alert("邮箱输入格式有误，请检查后再次输入");
		if(validate_mail.arguments.length==2)
			err_callback();
		return false;
	}	 			
}

/**日期检查函数 err_callback 错误回调匿名函数
*/
function validate_date(y,m,d,err_callback)
{
	if(y.length==4&&parseInt(y)<2100&&parseInt(y)>1900)
	{
		if(parseInt(m)<13&&parseInt(m)>0)
			return true;
		else
		{
			alert("月份输入有误，请检查后从新输入");
			return false;
		}	
	}else
	{
			alert("年份输入有误，请检查后从新输入");
			return false;
	}
}

/* 转换字符串中的反斜杠 */
function adjust_pathstring( path )
{
	return path.replace(/\\/g, "\\\\");
}

// 检测pxp server
function check_pxp()
{
	if( pxp_server != null )
		return true;
	
	try
	{
		pxp_server = new ActiveXObject("PXPSERVER.pxpServerCtrl.1");
	}
	catch(e)
	{
		// pxp not installed
		//parent.location = "download.htm"; 
		return false;
	}	
	return set_pxp();	
}

function set_pxp()
{
	try{
		var pxpServer = '<object id="pxpServer" style="width:0px;height:0px;display:none;" classid="CLSID:5DB1EADF-3357-4C61-B662-69A1A4A0EF70" >'
					+ '</object>';			
		$("pxpContainer").innerHTML = pxpServer;
		$("pxpContainer").style.display="none"
		pxp_server = $("pxpServer");
		if(pxp_server.Init()<0){
		  if(cp_flag=="default")
		  error_msg="优看影视本地服务启动失败！请刷新重试"
		  else
		  error_msg="WEBPXP本地服务启动失败！请刷新重试"
		  return false;
		}
		else{
		   pxp_server.SetVariable( "managerurl", LOCALHOSTURLCOMMON+"SPServ/webpxp/frameset.jsp" );
           pxp_server.SetVariable( "addpgmurl", LOCALHOSTURLCOMMON+"SPServ/webpxp/bottom/add_pgm.htm" );
           pxp_server.SetVariable( "managertitle", "WebPXP" );
		}

	}
	catch(e)
	{
		//
		//alert( "this web must hava a div ,just like:\r" + '<div id="pxpContainer"></div>' );
		error_msg= "您的浏览器禁用了ActiveX,请关闭禁用后尝试" ;
		return false;
	}
	return true;		
}

// 打开指定目录
function on_click_directory_pgm( dir )
{
	if( dir.length > 0 && pxp_server != null )
	{
		if( pxp_server.OpenFileName( dir ) != 0 )
		{
			alert( "打开指定目录错误!" );
		}
	}
}
//add by xym

function PXP_CreateBgDiv(a){
  var id = "logoutDiv";
  var offHeight = screen.height;
  var div = document.createElement("DIV");
  div.id = id;
  div.style.left = 0;
  div.style.top = 0;
  div.style.width=document.body.scrollWidth;
  div.style.height =document.body.scrollHeight;
  div.style.position = "absolute";
  div.style.display = "";
  div.style.zIndex = "999";
  div.style.filter = "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
  div.style.backgroundColor="#777";
  document.body.appendChild(div);
  hideSelectForm();
  PXP_ShowWait(a);
}
function PXP_ShowWait(a){
    var infoDiv = document.getElementById("logoutInfoDiv");
    infoDiv.innerHTML = PXP_WaitMsg(a);
    with(infoDiv.style){
        zIndex = 1000; 
        position = "absolute"; 
        width = "250px";
        top = 70
        left = (document.body.clientWidth-300)/2;
        border = "1px #4372A5 solid"; 
        padding = "10px"; 
        backgroundColor = "#ffffff"; 
        cc = "Alpha(Opacity=90)";
        display = "block";
       }
}
function PXP_ShowOver(a){
    var infoDiv = document.getElementById("logoutInfoDiv");
    infoDiv.innerHTML = PXP_WaitOver(a);
    with(infoDiv.style){
        zIndex = 1000; 
        position = "absolute"; 
        width = "400px";
        top = 70
        left = (document.body.clientWidth-300)/2;
        border = "1px #4372A5 solid"; 
        padding = "10px"; 
        backgroundColor = "#ffffff"; 
        cc = "Alpha(Opacity=90)";
        display = "block";
       }
}
function PXP_WaitMsg(a){
     var msg='';
	 msg=msg+'<div align="center"><table>';
	 msg=msg+'<tr ><td><font size="2">'+a+'</font></td><tr>'
	 msg=msg+'</table><div>';
	 return msg;
}
function PXP_WaitOver(a){
     var msg='';
	 msg=msg+'<div align="center"><table>';
	 if(cp_flag=="default")
	 msg=msg+'<tr align="center"><td><font size="2">优看影视初始化失败..错误:'+getErrorDesc(a+"")+' 代号:'+a+'请刷新重试！</font></td><tr>'
	 else
	 msg=msg+'<tr align="center"><td><font size="2">WEBPXP初始化失败..错误:'+getErrorDesc(a+"")+' 代号:'+a+'请刷新重试！</font></td><tr>'
	 msg=msg+'</table><div>';
	 return msg;
}
function PXP_Complete_Start(){
      var aa = document.getElementById("logoutDiv");
      var infoDiv = document.getElementById("logoutInfoDiv");
      infoDiv.style.display = "none";
      if (isObject(aa))
         document.body.removeChild(aa);     
       showSelectForm();
       PXP_Load_Complete();
}
function PXP_Load_Complete(){
    server_version = get_server_build_version();
	server_path = get_server_path();
    ie_version = pxp_server.GetIEMajorVersion();
    initialize_ui();
    start_timer();
	set_ui_size();	
}

//强制升级
function PXP_Update(){
   var locationStr = LOCALHOSTURLCOMMON+'SPServ/webpxp/bottom/update.htm';
   void(window.open(locationStr,null,"height=250,width=420,status=no,toolbar=no,menubar=no,location=no,scrollbars=no"));
}
function PXP_Update_Close(){
   window.parent.window.parent.opener=null;
   window.parent.window.parent.close();
}
function PXP_Check_Update(){
   var Versions="1.8.16.1";
   var version1=pxp_server.GetVersion();
   if(version1==null||version1=="")return true;
   var versionArray1=version1.split(".")
   if(versionArray1[0].length>1 && versionArray1[0].charAt('0')==1){
		versionArray1[0]=versionArray1[0].substring(1,versionArray1[0]);
	}
	for(var i=1;i<4;i++){
		if(versionArray1[i].length==1){
			versionArray1[i]="0"+versionArray1[i];
		}
	}
	var oldVersion=parseInt(versionArray1[0]+versionArray1[1]+versionArray1[2]+versionArray1[3]);
	
	
	var version2=Versions;
	var versionArray2=version2.split(".");
	if(versionArray2[0].length>1 && versionArray2[0].charAt('0')==1){
		versionArray2[0]=versionArray2[0].substring(1,versionArray2[0]);
	}
	for(var i=1;i<4;i++){
		if(versionArray2[i].length==1){
			versionArray2[i]="0"+versionArray2[i];
		}
	}
	var newVersion=parseInt(versionArray2[0]+versionArray2[1]+versionArray2[2]+versionArray2[3]);
	if(oldVersion<newVersion){
		
	   return true;
	}

	 return false;
}
//


function plugin_html(){
  var inner_html='';
  //
  inner_html+='\n<input type="hidden" value="ucantv" id="urlname" >';
  inner_html+='\n<input type="hidden" value="ucantv" id="surlname">';
  inner_html+='\n</div>';
  inner_html+='\n<iframe style="display:none;" id="pxp_stat_proxy" name="pxp_stat_proxy"></iframe>';
  inner_html+='\n<form name="form1" target="pxp_stat_proxy" method="POST" id="pxp_stat_form"><input type="hidden" id="pxp_hc" name="hashcode"></form>'
  //inner_html+='\n<div id="pxpDiagDownload" style="display:none;width:330px;position:absolute;border:1px #4372A5 solid;padding:10px;">';
  inner_html+='\n<div id="pxpDiagDownload" style="display:none">';
  inner_html+='\n<div id="pxp_unextv_outside" style="height: 198px;width: 348px;background-image: url(http://siena.ucantv.com/SPServ/webpxp/images/default/bg.gif);">';
  inner_html+='\n<table width="348" height="198" border="0" align="center" cellpadding="0" cellspacing="0">'
  inner_html+='\n<tr>'
  inner_html+='\n<td width="348" height="198" background="http://siena.ucantv.com/SPServ/webpxp/images/default/bg.gif"><table width="280" height="140" border="0" align="center" cellpadding="0" cellspacing="0">'
  inner_html+='\n<tr>'
  inner_html+='\n<td width="280"><img src="http://siena.ucantv.com/SPServ/webpxp/images/default/download.gif" width="175" height="24" /></td>'
  inner_html+='\n</tr>'
  inner_html+='\n<tr>'
  inner_html+='\n<td align="left" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">'
  inner_html+='\n<tr>'
  inner_html+='\n<td align="left" style="font-size: 13px;font-style: normal;line-height: normal;font-weight: normal;color: #CCCCCC;font-family:"宋体" ;">保存路径:</td>'
  inner_html+='\n<td height="25" align="left" valign="top"><input name="pxp_txtpath" id="pxp_txtpath" readonly="true" type="text" style="height:20px;" size="18" /></td>'
  inner_html+='\n<td><a href="javascript:void(select_dir())" id="pxp_Submit2" ><img src="http://siena.ucantv.com/SPServ/webpxp/images/default/button-1.gif" width="55" height="21" border="0"/></a></td>'
  inner_html+='\n</tr>'
  inner_html+='\n<tr>'
  inner_html+='\n<td style="font-size: 13px;font-style: normal;line-height: normal;font-weight: normal;color: #CCCCCC;font-family: "宋体";">文件名称:</td>'
  inner_html+='\n<td><input name="pxp_txtfilename" type="text" id="pxp_txtfilename" style="height:20px;" size="18" /></td>'
  inner_html+='\n<td>&nbsp;</td>'
  inner_html+='\n</tr>'
  inner_html+='\n</table></td>'
  inner_html+='\n</tr>'
  inner_html+='\n<tr>'
  inner_html+='\n<td align="center"><table width="60%" border="0" cellspacing="0" cellpadding="0">'
  inner_html+='\n<tr>'
  inner_html+='\n<td align="center"><a href="javascript:void(addpgm());" id="pxp_Submit3" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'确定\',\'\',\'http://siena.ucantv.com/SPServ/webpxp/images/default/button-2-3.gif\',1)"><img src="http://siena.ucantv.com/SPServ/webpxp/images/default/button-2.gif" name="确定"  width="70" height="31" border="0" id="确定" /></a></td>'
  inner_html+='\n<td align="left"><a href="javascript:void(hid());" id="pxp_Submit4" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'取消\',\'\',\'http://siena.ucantv.com/SPServ/webpxp/images/default/button-3-2.gif\',1)"><img src="http://siena.ucantv.com/SPServ/webpxp/images/default/button-3.gif" name="取消"  width="70" height="31" border="0" id="取消" /></a></td>'
  inner_html+='\n</tr>'
  inner_html+='\n</table></td>'
  inner_html+='\n</tr>'
  inner_html+='\n</table></td>'
  inner_html+='\n</tr>'
  inner_html+='\n</table>'
  inner_html+='\n</div>';
  inner_html+='\n</div>';
  //inner_html+='\n</div>';
  //inner_html+='<iframe src="http://siena.ucantv.com/SPServ/webpxp/js/proxy.html" style="display:none;" id="iframeProxy"></iframe>';
  //inner_html+='\n</div>';
  //inner_html+='<iframe src="http://siena.ucantv.com/SPServ/webpxp/js/proxy.html" style="display:none;" id="iframeProxy"></iframe>';

  return inner_html;
}
function plugin_html_all(){
var inner_html='';
  //
  inner_html+='\n<input type="hidden" value="ucantv" id="urlname" >';
  inner_html+='\n<input type="hidden" value="ucantv" id="surlname">';
  inner_html+='\n</div>';
  inner_html+='\n<iframe style="display:none;" id="pxp_stat_proxy" name="pxp_stat_proxy"></iframe>';
  inner_html+='\n<form name="form1" target="pxp_stat_proxy" method="POST" id="pxp_stat_form"><input type="hidden" id="pxp_hc" name="hashcode"></form>'
  //inner_html+='\n<div id="pxpDiagDownload" style="display:none;width:330px;position:absolute;border:1px #4372A5 solid;padding:10px;">';
  inner_html+='\n<div id="pxpDiagDownload" style="display:none">';
  inner_html+='\n<div id="pxp_unextv_outside" style="height: 198px;width: 348px;background-image: url(http://siena.ucantv.com/SPServ/webpxp/images/default/bg.gif);">';
  inner_html+='\n<table width="348" height="198" border="0" align="center" cellpadding="0" cellspacing="0">'
  inner_html+='\n<tr>'
  inner_html+='\n<td width="348" height="198" background="http://siena.ucantv.com/SPServ/webpxp/images/default/bg.gif"><table width="280" height="140" border="0" align="center" cellpadding="0" cellspacing="0">'
  inner_html+='\n<tr>'
  inner_html+='\n<td width="280"><img src="http://siena.ucantv.com/SPServ/webpxp/images/default/download.gif" width="175" height="24" /></td>'
  inner_html+='\n</tr>'
  inner_html+='\n<tr>'
  inner_html+='\n<td align="left" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">'
  inner_html+='\n<tr>'
  inner_html+='\n<td align="left" style="font-size: 13px;font-style: normal;line-height: normal;font-weight: normal;color: #CCCCCC;font-family:"宋体" ;">保存路径:</td>'
  inner_html+='\n<td height="25" align="left" valign="top"><input name="pxp_txtpath" id="pxp_txtpath" readonly="true" type="text" style="height:20px;" size="18" /></td>'
  inner_html+='\n<td><a href="javascript:void(select_dir());" id="pxp_Submit2"><img src="http://siena.ucantv.com/SPServ/webpxp/images/default/button-1.gif" width="55" height="21" border="0"/></a></td>'
  inner_html+='\n</tr>'
  inner_html+='\n<tr>'
  inner_html+='\n<td style="font-size: 13px;font-style: normal;line-height: normal;font-weight: normal;color: #CCCCCC;font-family: "宋体";">文件名称:</td>'
  inner_html+='\n<td><input name="pxp_txtfilename" type="text" id="pxp_txtfilename" style="height:20px;" size="18" /></td>'
  inner_html+='\n<td>&nbsp;</td>'
  inner_html+='\n</tr>'
  inner_html+='\n</table></td>'
  inner_html+='\n</tr>'
  inner_html+='\n<tr>'
  inner_html+='\n<td align="center"><table width="60%" border="0" cellspacing="0" cellpadding="0">'
  inner_html+='\n<tr>'
  inner_html+='\n<td align="center"><a href="javascript:void(addpgmall());" id="pxp_Submit3" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'确定\',\'\',\'http://siena.ucantv.com/SPServ/webpxp/images/default/button-2-3.gif\',1)"><img src="http://siena.ucantv.com/SPServ/webpxp/images/default/button-2.gif" name="确定" width="70" height="31" border="0" id="确定" /></a></td>'
  inner_html+='\n<td align="left"><a href="javascript:void(hid());" id="pxp_Submit4" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'取消\',\'\',\'http://siena.ucantv.com/SPServ/webpxp/images/default/button-3-2.gif\',1)"><img src="http://siena.ucantv.com/SPServ/webpxp/images/default/button-3.gif" name="取消" width="70" height="31" border="0" id="取消" /></a></td>'
  inner_html+='\n</tr>'
  inner_html+='\n</table></td>'
  inner_html+='\n</tr>'
  inner_html+='\n</table></td>'
  inner_html+='\n</tr>'
  inner_html+='\n</table>'
  inner_html+='\n</div>';
  inner_html+='\n</div>';
  //inner_html+='\n</div>';
  //inner_html+='<iframe src="http://siena.ucantv.com/SPServ/webpxp/js/proxy.html" style="display:none;" id="iframeProxy"></iframe>';

  return inner_html;
}

function plugin_html_nocss(){
  var inner_html='';
  inner_html+='\n<input type="hidden" value="ucantv" id="urlname">';
  inner_html+='\n<input type="hidden" value="ucantv" id="surlname">';
  inner_html+='\n</div>';
  inner_html+='\n<iframe style="display:none;" id="pxp_stat_proxy" name="pxp_stat_proxy"></iframe>';
  inner_html+='\n<form name="form1" target="pxp_stat_proxy" method="POST" id="pxp_stat_form"><input type="hidden" id="pxp_hc" name="hashcode"></form>'
  //inner_html+='\n<div id="pxpDiagDownload" style="display:none;width:330px;position:absolute;border:1px #4372A5 solid;padding:10px;">';
  inner_html+='\n<div id="pxpDiagDownload" style="display:none">';
  inner_html+='\n<table class="pxp_outside">';
  inner_html+='\n<tr>';
  inner_html+='\n<td colspan="2" class="pxp_td01"></td>';
  inner_html+='\n</tr>';
  inner_html+='\n<tr>';
  inner_html+='\n<td class="pxp_td02">保存路径：</td>';
  inner_html+='\n<td class="pxp_td03"><label>';
  inner_html+='\n<input name="pxp_txtpath" type="text" readonly="true" id="pxp_txtpath" class="pxp_input01" />';
  inner_html+='\n<input type="submit" name="pxp_Submit2" id="pxp_Submit2" onclick="select_dir();" value="浏 览" class="pxp_submit01" />';
  inner_html+='\n</label></td>';
  inner_html+='\n</tr>';
  inner_html+='\n<tr>';
  inner_html+='\n<td class="pxp_td02">保存名称：</td>';
  inner_html+='\n<td class="pxp_td03"><label>';
  inner_html+='\n<input name="pxp_txtfilename" type="text" id="pxp_txtfilename" class="pxp_input02" />';
  inner_html+='\n</label></td>';
  inner_html+='\n</tr>';
  inner_html+='\n<tr>';
  inner_html+='\n<td class="pxp_td03"></td>';
  inner_html+='\n<td class="pxp_td03"><label>';
  inner_html+='\n<input type="submit" name="pxp_Submit3" id="pxp_Submit3" value="确 定" onclick="addpgm();" class="pxp_submit01"/>';
  inner_html+='\n</label>';
  inner_html+='\n&nbsp;';
  inner_html+='\n<label>';
  inner_html+='\n<input type="submit" name="pxp_Submit4" id="pxp_Submit4" value="取 消" onclick="hid();" class="pxp_submit01"/>';
  inner_html+='\n</label></td>';
  inner_html+='\n</tr>';
  inner_html+='\n<tr>';
  inner_html+='\n<td colspan="2" class="pxp_td04"></td>';
  inner_html+='\n</tr>';
  inner_html+='\n</table>';
  inner_html+='\n</div>';
  //inner_html+='\n</div>';
  //inner_html+='<iframe src="http://siena.ucantv.com/SPServ/webpxp/js/proxy.html" style="display:none;" id="iframeProxy"></iframe>';
  alert(inner_html);
  return inner_html;
}

function plugin_html_unextv(){
  

  var inner_html='';
  //
  inner_html+='\n<input type="hidden" value="ucantv" id="urlname" >';
  inner_html+='\n<input type="hidden" value="ucantv" id="surlname">';
  inner_html+='\n</div>';
  inner_html+='\n<iframe style="display:none;" id="pxp_stat_proxy" name="pxp_stat_proxy"></iframe>';
  inner_html+='\n<form name="form1" target="pxp_stat_proxy" method="POST" id="pxp_stat_form"><input type="hidden" id="pxp_hc" name="hashcode"></form>'
  //inner_html+='\n<div id="pxpDiagDownload" style="display:none;width:330px;position:absolute;border:1px #4372A5 solid;padding:10px;">';
  inner_html+='\n<div id="pxpDiagDownload" style="display:none">';
  inner_html+='\n<div id="pxp_unextv_outside" style="height: 210px;width: 360px;background-image: url(http://siena.ucantv.com/SPServ/webpxp/images/cp/unextv_bg.gif);">';
  inner_html+='\n<table class="pxp_unextv_outside"  style="height:180px;width:330px;padding:15px;margin: 15px;background-color: #FFFFFF;">';
  inner_html+='\n<tr>';
  inner_html+='\n<td colspan="2" class="pxp_unextv_td01" style="height:60px;background-image: url(http://siena.ucantv.com/SPServ/webpxp/images/cp/unextv_logo.jpg);background-repeat: no-repeat;background-position: center;"></td>';
  inner_html+='\n</tr>';
  inner_html+='\n<tr>';
  inner_html+='\n<td class="pxp_unextv_td02" style="height:19px;width:60px;text-align:right;left: 20px;margin-left: 30px;padding-left: 15px;font-family: "宋体";/*栏目字体*/font-size: 12px;line-height: 19px;color: #333333;"><font size="2">保存路径</font></td>';
  inner_html+='\n<td class="pxp_unextv_td03" style="text-align:left;left: 5px;margin-left: 5px;padding-left: 5px;"><label>';
  inner_html+='\n<input name="pxp_txtpath" type="text" readonly="true" id="pxp_txtpath" class="pxp_unextv_input01" style="width:150px;height:23px;font-size:12px;line-height:17px;border: 1px solid #CCCCCC;border-top-color:#999999;border-left-color:#999999;font-family: "宋体";color: #333333;"/>';
  inner_html+='\n<input type="submit" name="pxp_Submit2" id="pxp_Submit2" onclick="select_dir();" value="浏 览" class="pxp_unextv_submit01" style="font-family: "宋体";font-size: 12px;line-height: 17px;color: #333333;height: 19px;width:50px;"/>';
  inner_html+='\n</label></td>';
  inner_html+='\n</tr>';
  inner_html+='\n<tr>';
  inner_html+='\n<td class="pxp_unextv_td02" style="height:19px;width:60px;text-align:right;left: 20px;margin-left: 30px;padding-left: 15px;font-family: "宋体";/*栏目字体*/font-size: 12px;line-height: 19px;color: #333333;"><font size="2">保存名称</font></td>';
  inner_html+='\n<td class="pxp_unextv_td03" style="text-align:left;left: 5px;margin-left: 5px;padding-left: 5px;"><label>';
  inner_html+='\n<input name="pxp_txtfilename" type="text" id="pxp_txtfilename" class="pxp_unextv_input02" style="width:200px;height:23px;font-size:12px;line-height:17px;border: 1px solid #CCCCCC;border-top-color:#999999;border-left-color:#999999;font-family: "宋体";color: #333333;"/>';
  inner_html+='\n</label></td>';
  inner_html+='\n</tr>';
  inner_html+='\n<tr>';
  inner_html+='\n<td class="pxp_unextv_td03"></td>';
  inner_html+='\n<td class="pxp_unextv_td03"><label>';
  inner_html+='\n<input type="submit" name="pxp_Submit3" id="pxp_Submit3" value="确 定" onclick="addpgm();" class="pxp_unextv_submit01" style="font-family: "宋体";font-size: 12px;line-height: 17px;color: #333333;height: 23px;width:50px;"/>';
  inner_html+='\n</label>';
  inner_html+='\n&nbsp;';
  inner_html+='\n<label>';
  inner_html+='\n<input type="submit" name="pxp_Submit4" id="pxp_Submit4" value="取 消" onclick="hid();" class="pxp_unextv_submit01" style="font-family: "宋体";font-size: 12px;line-height: 17px;color: #333333;height: 23px;width:50px;"/>';
  inner_html+='\n</label></td>';
  inner_html+='\n</tr>';
  inner_html+='\n<tr>';
  inner_html+='\n<td colspan="2" class="pxp_unextv_td04" style="height:auto;"></td>';
  inner_html+='\n</tr>';
  inner_html+='\n</table>';
  inner_html+='\n</div>';
  inner_html+='\n</div>';
  //inner_html+='\n</div>';
  //inner_html+='<iframe src="http://siena.ucantv.com/SPServ/webpxp/js/proxy.html" style="display:none;" id="iframeProxy"></iframe>';

  return inner_html;
}
//TCLDEMO
function plugin_html_tcl(){
  

  var inner_html='';
  //
  inner_html+='\n<input type="hidden" value="ucantv" id="urlname" >';
  inner_html+='\n<input type="hidden" value="ucantv" id="surlname">';
  inner_html+='\n</div>';
  inner_html+='\n<iframe style="display:none;" id="pxp_stat_proxy" name="pxp_stat_proxy"></iframe>';
  inner_html+='\n<form name="form1" target="pxp_stat_proxy" method="POST" id="pxp_stat_form"><input type="hidden" id="pxp_hc" name="hashcode"></form>'
  //inner_html+='\n<div id="pxpDiagDownload" style="display:none;width:330px;position:absolute;border:1px #4372A5 solid;padding:10px;">';
  inner_html+='\n<div id="pxpDiagDownload" style="display:none">';
  inner_html+='\n<div id="pxp_tcl_outside" style="height: 210px;width: 360px;background-image: url(http://siena.ucantv.com/SPServ/webpxp/images/cp/tcl_bg.gif);">';
  inner_html+='\n<table class="pxp_tcl_outside"  style="height:180px;width:330px;padding:15px;margin: 15px;background-color: #FFFFFF;">';
  inner_html+='\n<tr>';
  inner_html+='\n<td colspan="2" class="pxp_tcl_td01" style="height:60px;background-image: url(http://siena.ucantv.com/SPServ/webpxp/images/cp/tcl_logo.jpg);background-repeat: no-repeat;background-position: center;"></td>';
  inner_html+='\n</tr>';
  inner_html+='\n<tr>';
  inner_html+='\n<td class="pxp_tcl_td02" style="height:19px;width:60px;text-align:right;left: 20px;margin-left: 30px;padding-left: 15px;font-family: "宋体";/*栏目字体*/font-size: 12px;line-height: 19px;color: #333333;"><font size="2">保存路径</font></td>';
  inner_html+='\n<td class="pxp_tcl_td03" style="text-align:left;left: 5px;margin-left: 5px;padding-left: 5px;"><label>';
  inner_html+='\n<input name="pxp_txtpath" type="text" readonly="true" id="pxp_txtpath" class="pxp_tcl_input01" style="width:150px;height:23px;font-size:12px;line-height:17px;border: 1px solid #CCCCCC;border-top-color:#999999;border-left-color:#999999;font-family: "宋体";color: #333333;"/>';
  inner_html+='\n<input type="submit" name="pxp_Submit2" id="pxp_Submit2" onclick="select_dir();" value="浏 览" class="pxp_tcl_submit01" style="font-family: "宋体";font-size: 12px;line-height: 17px;color: #333333;height: 19px;width:50px;"/>';
  inner_html+='\n</label></td>';
  inner_html+='\n</tr>';
  inner_html+='\n<tr>';
  inner_html+='\n<td class="pxp_tcl_td02" style="height:19px;width:60px;text-align:right;left: 20px;margin-left: 30px;padding-left: 15px;font-family: "宋体";/*栏目字体*/font-size: 12px;line-height: 19px;color: #333333;"><font size="2">保存名称</font></td>';
  inner_html+='\n<td class="pxp_tcl_td03" style="text-align:left;left: 5px;margin-left: 5px;padding-left: 5px;"><label>';
  inner_html+='\n<input name="pxp_txtfilename" type="text" id="pxp_txtfilename" class="pxp_tcl_input02" style="width:200px;height:23px;font-size:12px;line-height:17px;border: 1px solid #CCCCCC;border-top-color:#999999;border-left-color:#999999;font-family: "宋体";color: #333333;"/>';
  inner_html+='\n</label></td>';
  inner_html+='\n</tr>';
  inner_html+='\n<tr>';
  inner_html+='\n<td class="pxp_tcl_td03"></td>';
  inner_html+='\n<td class="pxp_tcl_td03"><label>';
  inner_html+='\n<input type="submit" name="pxp_Submit3" id="pxp_Submit3" value="确 定" onclick="addpgm();" class="pxp_tcl_submit01" style="font-family: "宋体";font-size: 12px;line-height: 17px;color: #333333;height: 23px;width:50px;"/>';
  inner_html+='\n</label>';
  inner_html+='\n&nbsp;';
  inner_html+='\n<label>';
  inner_html+='\n<input type="submit" name="pxp_Submit4" id="pxp_Submit4" value="取 消" onclick="hid();" class="pxp_tcl_submit01" style="font-family: "宋体";font-size: 12px;line-height: 17px;color: #333333;height: 23px;width:50px;"/>';
  inner_html+='\n</label></td>';
  inner_html+='\n</tr>';
  inner_html+='\n<tr>';
  inner_html+='\n<td colspan="2" class="pxp_tcl_td04" style="height:auto;"></td>';
  inner_html+='\n</tr>';
  inner_html+='\n</table>';
  inner_html+='\n</div>';
  inner_html+='\n</div>';
  //inner_html+='\n</div>';
  //inner_html+='<iframe src="http://siena.ucantv.com/SPServ/webpxp/js/proxy.html" style="display:none;" id="iframeProxy"></iframe>';

  return inner_html;
}
//备份无CSS的版本
function plugin_html_unextv_nocss(){
  

  var inner_html='';
  //
  inner_html+='\n<input type="hidden" value="ucantv" id="urlname" >';
  inner_html+='\n<input type="hidden" value="ucantv" id="surlname">';
  inner_html+='\n</div>';
  inner_html+='\n<iframe style="display:none;" id="pxp_stat_proxy" name="pxp_stat_proxy"></iframe>';
  inner_html+='\n<form name="form1" target="pxp_stat_proxy" method="POST" id="pxp_stat_form"><input type="hidden" id="pxp_hc" name="hashcode"></form>'
  //inner_html+='\n<div id="pxpDiagDownload" style="display:none;width:330px;position:absolute;border:1px #4372A5 solid;padding:10px;">';
  inner_html+='\n<div id="pxpDiagDownload" style="display:none">';
  inner_html+='\n<div id="pxp_unextv_outside">';
  inner_html+='\n<table class="pxp_unextv_outside">';
  inner_html+='\n<tr>';
  inner_html+='\n<td colspan="2" class="pxp_unextv_td01"></td>';
  inner_html+='\n</tr>';
  inner_html+='\n<tr>';
  inner_html+='\n<td class="pxp_unextv_td02">保存路径</td>';
  inner_html+='\n<td class="pxp_unextv_td03"><label>';
  inner_html+='\n<input name="pxp_txtpath" type="text" readonly="true" id="pxp_txtpath"/>';
  inner_html+='\n<input type="submit" name="pxp_Submit2" onclick="select_dir();" value="浏 览" class="pxp_unextv_submit01" />';
  inner_html+='\n</label></td>';
  inner_html+='\n</tr>';
  inner_html+='\n<tr>';
  inner_html+='\n<td class="pxp_unextv_td02">保存名称</td>';
  inner_html+='\n<td class="pxp_unextv_td03"><label>';
  inner_html+='\n<input name="pxp_txtfilename" type="text" id="pxp_txtfilename" class="pxp_unextv_input02"/>';
  inner_html+='\n</label></td>';
  inner_html+='\n</tr>';
  inner_html+='\n<tr>';
  inner_html+='\n<td class="pxp_unextv_td03"></td>';
  inner_html+='\n<td class="pxp_unextv_td03"><label>';
  inner_html+='\n<input type="submit" name="pxp_Submit3" value="确 定" onclick="addpgm();" class="pxp_unextv_submit01"/>';
  inner_html+='\n</label>';
  inner_html+='\n&nbsp;';
  inner_html+='\n<label>';
  inner_html+='\n<input type="submit" name="pxp_Submit4" value="取 消" onclick="hid();" class="pxp_unextv_submit01"/>';
  inner_html+='\n</label></td>';
  inner_html+='\n</tr>';
  inner_html+='\n<tr>';
  inner_html+='\n<td colspan="2" class="pxp_unextv_td04"></td>';
  inner_html+='\n</tr>';
  inner_html+='\n</table>';
  inner_html+='\n</div>';
  inner_html+='\n</div>';
  //inner_html+='\n</div>';
  //inner_html+='<iframe src="http://siena.ucantv.com/SPServ/webpxp/js/proxy.html" style="display:none;" id="iframeProxy"></iframe>';

  return inner_html;
}