document.write("<div id='LoadLayer'><img src=\"../image/dark/loading.gif\" align=\"absmiddle\" border=0/></div>");
function   killErrors()   {   
  return   true;   
}  
window.onerror   =   killErrors;
function avaPlay(ch_id)
{
	writewatch(ch_id);
	writecookie(ch_id);
	if(ocxstatus())
	{
		location.href="ava://"+ch_id;
	}else
	{
		//mask.style.visibility='visible';
		//ssAlert();
		//new dialog().init();
		new dialog().event('^_^  A better version is available!^_^<br><font color=red>Please download and install!</font>  ',1,1,1,'Avarena',300,150,'download.php');
		//location.href="viewer_download.php";
	}

}
var xmlplayHttp;
function createplayxml(){//创建请求对象
	if(window.XMLHttpRequest){//其它浏览器
		//other browser
		xmlplayHttp = new XMLHttpRequest();
		return xmlplayHttp;
	}else if(window.ActiveXObject){//IE浏览器
		//IE browser
		xmlplayHttp = new ActiveXObject("Microsoft.XMLHTTP");
		return xmlplayHttp;
	}
	throw new Error("XMLHttp object coulde be created!");
}
function writewatch(guid){
	xmlplayHttp = createplayxml();
	xmlplayHttp.open("POST","watch.php?guid="+guid,true);//
	xmlplayHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	xmlplayHttp.send(null);	
}
function writecookie(ch_id)
{
	document.cookie="ProgramItem="+ch_id+";expires="+new Date(new Date().getTime()+60*1000*30).toGMTString();
}
function ocxstatus()
{
	var ocx;
	try{
		ocx = new ActiveXObject("AvaIePlugin.AvaPlus.1");
		return ocx.IsInstalled();
	}catch(e)
	{
		return false;
	}
}
function writeNavPosition(obj){//写Cookie，显示所管理的分类
	document.cookie="nav="+obj;
}