
var IE = window.ActiveXObject?true:false;

//地址，null，回调函数
function http_get(xmlurl, content, retfun)
{
	var xhr = null;
    if (window.ActiveXObject)
        xhr = new ActiveXObject("Microsoft.XMLHTTP");
    else if (window.XMLHttpRequest)
        xhr = new XMLHttpRequest();

	xhr.onreadystatechange = function()
	{
		if(xhr.readyState == 4)
		{
			retfun(xhr.responseText,xhr.status);
		}
	};
	if(content!=null)
	{
		xhr.open ('POST', xmlurl, true);
		xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		xhr.send (content);
	}
	else
	{
		xhr.open ('GET', xmlurl, true);
		xhr.send (null);
	}
}
	


var divs="";
divs+='<div id="tanchu" style="display:none">';
divs+='<form action="http://app72.vodone.com/sendmail/sendmail.jsp" name="frm" id="frm" target="ifa">';
divs+='<table width="300" border="0" cellspacing="0" cellpadding="0"  >';
divs+='<tr>';
divs+='<td>';
divs+='<img src="http://v.vodone.com/sendmail/images/top.jpg" alt="" width="330" height="26" />';
divs+='</td>';
divs+='</tr>';
divs+='<tr>';
divs+='<td background="http://v.vodone.com/sendmail/images/bg.jpg">';
divs+='<label></label>';
divs+='<table width="100%" border="0" cellspacing="0" cellpadding="4">';
divs+='<tr>';
divs+='<td width="25%" align="right">邮件地址:</td>';
divs+='<td width="75%"><input name="to" id="to" type="text" id="textfield" size="28" /></td>';
divs+='</tr>';
divs+='<tr>';
divs+='<td align="right">&nbsp;</td>';
divs+='<td>多个地址请用“,”逗号隔开!</td>';
divs+='</tr>';
divs+='<tr>';
divs+='<td align="right">姓名:</td>';
divs+='<td><input name="from" id="from" type="text" id="textfield2" size="28" /></td>';
divs+='</tr>';
divs+='<tr>';
divs+='<td align="right" valign="top">留言:</td>';
divs+='<td><textarea name="msg" id="textarea" cols="23" rows="5"></textarea></td>';
divs+='</tr>';
divs+='<tr>';//"  
divs+='<td>&nbsp;</td>';
divs+='<td align="center"><input type="button" name="button" id="button" onclick="_submit()" value="发送"/>';
divs+='&nbsp;&nbsp;';
divs+='<input type="button" name="button2" id="button2" value="取消" onclick="_close()"/></td>';
divs+='</tr>';
divs+='</table></td>';
divs+='</tr>';
divs+='<tr>';
divs+='<td><img src="http://v.vodone.com/sendmail/images/b_1.jpg" width="330" height="2" /></td>';
divs+='</tr>';
divs+='</table>';
divs+='<input type="hidden" name="video" />';
divs+='</form>';
divs+='</div>';

var ifram='<iframe name="ifa" style="height:0"></iframe>'


//mu flash地址
//id 标签，若不调整位置大小，不和flash交互，随便传值，不要和页面有冲突
//w 宽 
//h 高
//wmode "opaque"--不透明 ；"transparent"--透明
//vars flash参数
//引入推荐表单
function getFlashHtml(mv,id,w,h,wmode,vars){
	if(IE)
		return '<object id="'+id+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0" width="'+w+'" height="'+h+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ><param name="movie" value="'+mv+'" /><param name="FlashVars" value="'+vars+'" /><param name="wmode" value="'+wmode+'" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>';
	else
		return '<embed name="'+id+'" width="'+w+'" height="'+h+'" src="'+mv+'" wmode="'+wmode+'" allowFullScreen="true" allowScriptAccess="always" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" FlashVars="'+vars+'" type="application/x-shockwave-flash"></embed>';
};
/**
说明：
	1，视频播放器代码为（即页面引用） ：
		<script>
		var video_contentid ="265846";
		</script>
		<script src="http://122.11.50.149/Program_management/video.js"></script>
	2， swf_path:播放视频路径
		swf_download:此参数中路径用于下载
	3， 如果video.js和swf文件在一起可以使用相对路径
		如果不在一起，那么路名必须是用绝对路径

*/
//265803
var _date = new Date(parseInt(video_contentid+""));
var _dir = _date.getFullYear();
if ((_date.getMonth()+1)<10){
	_dir += "0" + (_date.getMonth()+1);
}else{
	_dir += "" + (_date.getMonth()+1);
}
if (_date.getDate()<10){
	_dir += "0" + (_date.getDate());
}else{
	_dir += "" + (_date.getDate());
}
var swf_path="http://uflv.vodone.com/qinglv/cinemaPlayer.swf";
var swf_download = swf_path;
var swf_copy = swf_path;
var swf_show = swf_path;

if(video_contentid > new Date(2009,10,26,11,0,0).getTime())
{
//flash 引入
document.write(getFlashHtml(swf_path, "123", "407", "358", "Opaque", "video_contentid="+video_contentid+"&video_showLogo=none"));
//ocument.write("<br>");
//document.write(getFlashHtml("http://uflv.vodone.com/bigbusflv/player1/ff.swf", "123", "435", "23", "Opaque", ""));
}
else
{
swf_path="http://uflv.vodone.com/qinglv/"+_dir+"/"+video_contentid+".swf";
swf_download = swf_path;
swf_copy = swf_path;
swf_show = swf_path;

//flash 引入
document.write(getFlashHtml(swf_path, "123", "407", "355", "Opaque", ""));
//ocument.write("<br>");
//document.write(getFlashHtml("http://uflv.vodone.com/bigbusflv/player1/ff.swf", "123", "435", "23", "Opaque", ""));

}

//复制
function copyToClipboard(txt){
	if (window.clipboardData) {
	    window.clipboardData.clearData();
	    window.clipboardData.setData("Text", txt);
	}
	else 
	if (navigator.userAgent.indexOf("Opera") != -1) {
	    window.location = txt;
	}
	else 
	if (window.netscape) {
	    try {
	        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
	    } 
	    catch (e) {
	        alert("被浏览器拒绝！\n请在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true'");
	    }
	    var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
	    if (!clip) 
	        return;
	    var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
	    if (!trans) 
	        return;
	    trans.addDataFlavor('text/unicode');
	    var str = new Object();
	    var len = new Object();
	    var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
	    var copytext = txt;
	    str.data = copytext;
	    trans.setTransferData("text/unicode", str, copytext.length * 2);
	    var clipid = Components.interfaces.nsIClipboard;
	    if (!clip) 
	        return false;
	    clip.setData(trans, null, clipid.kGlobalClipboard);
	    //alert("复制成功！")
	}
}
function copyAddress() {
	if (arguments.length>0) {	
		copyToClipboard(arguments[0]);
	} else {
		var meintext=document.location.href;	
		copyToClipboard(meintext);
	}
	//alert("复制成功!!");
}

//推荐
function show(){

	var div_a =document.getElementById("tuijian");
	div_a.innerHTML=divs;
	div_a.innerHTML+=ifram;
	div_a.style.width= document.body.clientWidth;
	div_a.style.zIndex=10000;
	var video = swf_show;
	var f = document.getElementById("frm");
	f.video.value = video;
	var left = document.body.clientWidth/2-165;
	var top = document.body.clientHeight/2-123;
	
	
	var el = document.getElementById("tanchu");
	//el.style.top = top;
	//el.style.left = left;
	el.style.display = "";
	el.style.zIndex=10001;
}
function _close(){
	
	//alert("ddddd");
	var f = document.getElementById("frm");
	f.from.value = "";
	f.to.valule = "";
	f.msg.value = "";
	var el = document.getElementById("tanchu");
	el.style.display = "none";

}

function _submit(){
	var f = document.getElementById("frm");
	var a ="http://app72.vodone.com/sendmail/sendmail.jsp?to="+document.getElementById("to").value
		  +"&from="+document.getElementById("from").value
		  +"&msg="+document.getElementById("textarea").value;
	//alert(a);
	//http_get(a,null,function(aa,bb){alert(bb);});
	f.submit();
	//alert("1");
	_close();	
	//alert("@");	
}

//swf_copy=swf_copy.replace("//","\/\/");
//swf_copy=swf_copy.replace(":","\:");
//alert(swf_copy);
//复制
function flv_copy()
{

	copyAddress(swf_copy);
}
//下载
function flv_download()
{
	//location.href=swf_download;
	window.open(swf_download,'_blank')
}
//推荐
function flv_show()
{
	//alert('10');
	show();
}



//引入，下载，复制，推荐
//onmouseover="spell(\'1\');"onmouseover="spell(\'2\');"  onmouseover="spell(\'3\');"
//document.write('<div>');
//document.write('<ul class="menu">');
//document.write('<a id="" class=""   href='+swf_download+'>点击下载影片</a>');
//document.write('<a id="" class=""   href="#" onclick="show()">推荐给朋友</a>');
//document.write('<a id="" class=""   href="javascript:copyToClipboard('+swf_copy+')">复制本连接</a>');
//document.write('</ul>');
//document.write('</div>');




