var zzid=0;
var max_Player_File="play.swf";//播放器款式
var playerw='720';//播放器宽度
var playerh='550';//播放器高度
var skinColor="000000,FFFFCC|000000,FFFFCC|000000,FFFFCC|000000,FFFFCC|000000,FFFFCC";//"背景颜色1,文字颜色1|背景颜色2,文字颜色2";
var autoPlay="1";//是否默认自动播放
var openMenu="1";//是否默认打开播放列表
var logoURL="logo.png";//logo地址,与播放器目录同级或使用绝对地址
var adsPage="/"+sitePath+"js/loading.html";//视频播放前广告页路径
var adsTime=5;//视频播放前广告时间，单位秒
var showFullBtn="1"; //是否显示全屏按钮
var rehref="1";//是否刷新页面点播节目
var alertwin="0";//是否弹窗播放
var btnName="上一集,下一集";
/////////////以上为设置项////////////////////////////////

try{top.moveTo(0,0);top.resizeTo(screen.availWidth,screen.availHeight);}catch(e){}

var w3c = (document.getElementById) ? true : false;
var agt = navigator.userAgent.toLowerCase();
var ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) && (agt.indexOf("omniweb") == -1));
var ie5 = (w3c && ie) ? true : false;
var ns6 = (w3c && (navigator.appName == "Netscape")) ? true : false;
var op8 = (navigator.userAgent.toLowerCase().indexOf("opera") == -1) ? false : true;

document.write('<iframe id="cciframe" style="width:0px;height:0px;overflow:hidden;position:absolute;top:0px;left:0px;z-index:9998;" frameborder="0" scrolling="no"></iframe>');

function Obj(o){
	return $(o) ? $(o) : o;
}

function GetXYWH(o){
	var nLt = 0;
	var nTp = 0;
	var offsetParent = o;
	while (offsetParent != null && offsetParent != document.body) {
		nLt += offsetParent.offsetLeft;
		nTp += offsetParent.offsetTop;
		if (!ns6) {
			parseInt(offsetParent.currentStyle.borderLeftWidth) > 0 ? nLt += parseInt(offsetParent.currentStyle.borderLeftWidth) : "";
			parseInt(offsetParent.currentStyle.borderTopWidth) > 0 ? nTp += parseInt(offsetParent.currentStyle.borderTopWidth) : "";
		}
		offsetParent = offsetParent.offsetParent;
	}
	//if (ie){nLt+=10;nTp+=15;}//定位不精确的时候可以在这里调整nLt左边距nTp上边距
   return  nTp + "," + nLt ;
}

function qvodCheck(){
	if(window.confirm('您的电脑未安装Qvodplayer播放软件,请点击下载安装后刷新本页面播放')){location.href='http://dl.qvod.com/QvodSetup360.exe';}
}

function viewplay(para1,para2){
	var urlAndFrom,doc,url,from
	urlAndFrom=handleParas(para1,para2)
	try{autoSubmitErr(urlAndFrom,para2)}catch(e){}
	url=escape(urlAndFrom[1]);from=urlAndFrom[2]
	doc =$("cciframe");
	document.write('<div id="qvodad" style="position:absolute;z-index:9999;"></div>');
	if(urlAndFrom[2].toLowerCase() == "qvod"){
		doc.src="/"+sitePath+"js/play.html?a="+url+"&b="+from+"&w="+playerw+"&h="+playerh;
	}else{
		doc.src=adsPage;
		setTimeout(function(){doc.src="/"+sitePath+"js/play.html?s=http://www.56.com/&a="+url+"&b="+from+"&w="+playerw+"&h="+playerh;},adsTime*1000);	
	}
	document.write('<div id="ccplay" style="width:'+playerw+'px;height:'+playerh+'px;"></div>');
	doc.style.width=playerw+"px";
	doc.style.height=playerh+"px";
	doc.style.top=GetXYWH(Obj('ccplay')).split(",")[0]+"px";
	doc.style.left=GetXYWH(Obj('ccplay')).split(",")[1]+"px";
}

function viewend(){
	var doc=$("cciframe");
	doc.style.top=GetXYWH(Obj('ccplay')).split(",")[0]+"px";
	doc.style.left=GetXYWH(Obj('ccplay')).split(",")[1]+"px";
}

function killErrors(){
	return true;
}

var resize=function(){
	var cObj=window.Obj('ccplay');
	orginLeft=window.GetXYWH(cObj).split(',')[1]+'px';
	var i=$('cciframe');
	i.style.left=orginLeft;
}

window.onresize=function(){resize();}
window.onerror = killErrors;
