function openPlayer(opurl,micp,channelid,mediaicpid,clipid,murl,type){
	var qs="?icp_id="+micp +"&channel_id="+channelid+"&mediaicp_id="+ mediaicpid+
		"&clip_id="+clipid+"&mu="+ murl +"&service_type="+type,u=opurl+qs,s;
	if(m.art.embedVideo){
		m.E("VPlayer").src=u;
		m.art.embedVideo=false;
	}else if(m.art.reshiping){
		s=m.art.tpl.iframe_vp.replace("><"," src='"+u+"'><");
		$("#Reship").html("请复制下方代码到支持HTML的网站、论坛<br/><textarea style='width:100%;height:80px;'>"+s+"</textarea>");
		m.art.reshiping=false;
	}else if(m.art.urlonly){
		m.art.urlonly=false;
		return u;
	}else{
		ga.track("/video/"+qs);
		window.open(u,"_blank","width=555,height=390");
	}
}
var m={d:document,e:{sf:null},libLoaded:typeof jQuery=="function"};
m.E=function(i){return m.d.getElementById(i);}
m.comment={upf:"/skin/action/comment.php?a=",iid:0,tl:{min:10,max:1000},tpl:"",s:10,_e:{},m:0,
	l:function(p){
		if(!p){p=0;}
		$.get(this.upf+"l&p="+p+"&s="+this.s+"&id="+this.iid,this.ol_l);
	},
	ol_l:function(d){
		eval("d="+d);
		var t="",i,o,ts,a,s=m.comment;
		for(i in d.rs){o=d.rs[i];
			ts=new Date(o.CreationDate*1000);
			a=o.Author;
			t+=s.tpl.replace("{n}",(a?a:"一点通网友")+" 于 "+ts.toLocaleString()+" ")
				.replace("{t}",o.Comment.replace(/</g,"&lt;"))
				.replace("{u}",o.URL).replace(/{comid}/g,o.CommentID);
		}
		d.pm=Math.ceil(d.m/d.s);
		if(d.pm>1){
			t+="<div align='center'>";
			for(i=0;i<d.pm;i++){
				t+="<a href='javascript:s.l("+i+")'"+(i==d.p?" style='font-weight:bold'":"")+">P"+(i+1)+"</a> ";
			}
			t+="</div>";
		}
		s._e.l.innerHTML=t;
	},
	onsubmit:function(){
try{
		var s=m.comment,t="",a={id:s.iid,n:this.n.value,t:this.t.value},l=a.t.length;
		if(a.id<=0){alert("未设定内容id，请联系管理员以修正问题");return false;}
		if(l<s.tl.min||l>s.tl.max){t+="评论内容长度需在"+s.tl.min+"至"+s.tl.max+"之间\n";}
		if(t){alert(t);}
		else{
			s.last=a;
			$.post(s.upf+"s",a,function(d){
				var id=parseInt(d),t="";
				if(id){t="您的评论已经保存成功";
					s._e.f.reset();}
				alert(t);
			});
		}
}catch(ex){alert(ex.message);}
		return false;
	},
	init:function(){
		var c=this,t="",e=m.E("Comments");
		e.innerHTML="<h4>评论列表</h4><div id='CommentList'></div><form name='commentPost'>\
<h4>发表评论</h4>\
<div>昵称：<input type='text' name='n'/> 评论内容：</div>\
<div><textarea name='t'></textarea></div>\
<div id='CommentTip'></div><button type='submit'>提交</button></form>";
		c._e.f=m.d.forms["commentPost"];c._e.l=m.E("CommentList");c._e.t=m.E("CommentTip");
		c._e.f.onsubmit=c.onsubmit;
		if(c.m==0){t="暂无评论";}
		else{t="<a class='showLink' onclick='m.comment.l()'>按此查看相关评论</a>";}
		c._e.l.innerHTML=t;
		c.tpl="<div class='c'><span class='n'>{n}</span>：{t}</div>";
//c.l();
	}
}
//內容頁
m.art={tpl:{iframe_vp:"<iframe id='VPlayer' style='width:100%;height:580px;' frameborder='no'></iframe>"}};
m.art.embedPlay=function(){
	m.E("VPOuter").innerHTML="<div style='text-align:center;font-weight:bold;color:black;'><div>点击下方的播放按钮即可播放<br/>如您不是北京联通ADSL用户，首次观看需在电话号码处输入6位任意数字</div>"+
		m.art.tpl.iframe_vp+"</div>";
	m.art.embedVideo=true;
	m.art.play();
}
m.art.reship=function(){
	m.art.reshiping=true;
	m.art.play();
}
m.art.init=function(){
//初始化評論數據
	var e=$(".content")[0],d;
	m.comment.iid=e.getAttribute("iid");
	m.comment.m=e.getAttribute("comments");
	m.comment.init();
	m.nid=parseInt(e.getAttribute("nid"));
	m.art.play=m.E("VPLink").onclick;
//在页内自动播放视频，仅当小窝diy自动播放
/*
	if(m.nid==35||location.href.indexOf("lhydt")>=0){
		m.art.embedPlay();
	}
//*/
	e=$(".artcontent")[0];
	d=m.d.createElement("div");d.id="Reship";
	d.innerHTML="<a onclick='m.art.reship()'>转载此内容</a>";
	e.parentNode.insertBefore(d,e.nextSibling);
}
//頁面初始化方法
m.init=function(){
	if(m.libLoaded)m.e.sf=$(".searchForm")[0];
	if(m.e.sf){
		m.e.sf.onsubmit=function(){var v=this.Keywords.value;
			if(v==''||v==' '){alert('请输入关键字');return false;}
			return true;
		}
		m.e.sf.so=function(k){this.Keywords.value=k;
			if(this.onsubmit()){this.submit();}
		}
		m.e.sf.kws=["抽奖","电视征婚","选择","一点通","小窍门","美容","征婚报名","养生","保健"];
		m.e.sf.init=function(){var h="",i,k,e=$("#SFKeywords")[0],f=this;
			f.action="/cms/CMSWare/publish/search.php?o=search&TableID=2";f.method="post";
			if(!e){
			}else if(e.innerHTML){
				for(i=0;i<e.childNodes.length;i++){
					k=e.childNodes[i];
					k.onclick=function(){m.e.sf.so(this.innerHTML);}
				}
			}else{
				for(i in this.kws){k=this.kws[i];
					h+="<a href='javascript:void(m.e.sf.so(\""+k+"\"))' class='bai-a1'>"+k+"</a>";}
				e.innerHTML=h;
			}
		}
		m.e.sf.init();
	}
//通过body的class来判断位于哪种页面
	var e=m.d.getElementsByTagName("body")[0],c=e.className;
//初始化内容页
	if(c.indexOf("art")>=0){m.art.init();}
	e=m.d.forms["pageTurner"];
	if(e){
		e.onsubmit=function(){
			var f=this,u=f.getAttribute("u"),p=parseInt(f.p.value),pm=parseInt(f.getAttribute("pm"));
			if(p>0&&p<=pm){location.href=u.replace(".","_"+(p-1)+".");}
			else{alert("输入的数字请在1至"+pm+"之间");}
			return false;
		}
	}
//非管理頁面就初始化google分析
	if(c.indexOf("mgr")==-1){ga.init(true);}
}
//Google
var ga={
	host:"https:"==m.d.location.protocol?"https://ssl.":"http://www.",account:"UA-28016852-2",inst:null,loaded:false,
	init:function(ll){
		if(ll){document.write("<script src='"+this.host+"google-analytics.com/ga.js' type='text/javascript'></script>");}
		this.loaded=typeof _gat!="undefined";
		if(this.loaded){
			var i;
			i=this.inst=_gat._getTracker(this.account);
			i._addOrganic("baidu","word");
			i._addOrganic("soso","q");
			i._addOrganic("vnet","kw");
			i._addOrganic("yodao","q");
			i._initData();
//只记录yidiantong.tv上的点击
			if(location.host.indexOf("yidiantong")>=0){
				i._setDomainName("yidiantong.tv");
				i._trackPageview();
			}
		}else{setTimeout('ga.init(false);', 500);}
	},
	track:function(url){if(this.inst){this.inst._trackPageview(url);}}
}
m.init();

