function $(id) {
	return document.getElementById(id);
}
function dw(str){
	document.write(str);
}
function fWriteCookie(name, value, hours)
{
	var expire = "";
	var domain = "; domain=6.com; path=/";
	if(hours != "") 
	{
		expire = new Date((new Date()).getTime() + hours * 60 * 60 * 1000);
		expire = "; expires=" + expire.toGMTString();
	}
	document.cookie = name + "=" + escape(value) + expire + domain;
}
function fGetCookie(name) 
{
 	var cookieValue = "";
  	var search = name + "=";
  	if(document.cookie.length > 0) 
	{ 
    	offset = document.cookie.indexOf(search);
    	if (offset != -1) 
		{ 
      		offset += search.length;
      		end = document.cookie.indexOf(";", offset);
      		if (end == -1) end = document.cookie.length;
      		cookieValue = unescape(document.cookie.substring(offset, end));
    	}
  	}
  	return cookieValue;
}
function getpos(element){
	if ( arguments.length != 1 || element == null ){
		   return null;
	}
	var elmt = element;
	var offsetTop = elmt.offsetTop;
	var offsetLeft = elmt.offsetLeft;
	var offsetWidth = elmt.offsetWidth;
	var offsetHeight = elmt.offsetHeight;
	while( elmt = elmt.offsetParent ){
			if ( elmt.style.position == 'absolute'
			|| ( elmt.style.overflow != 'visible' && elmt.style.overflow != '' ) ){
					break;
			}
			offsetTop += elmt.offsetTop;
			offsetLeft += elmt.offsetLeft;
	}
	return {top:offsetTop, left:offsetLeft, right:offsetWidth+offsetLeft, bottom:offsetHeight+offsetTop };
}
function moveToMouseLoc(srcElement, target_srcElement){
	//srcElement 鼠标当前obj
	//target_srcElement 需要位移的目标obj
	if(!srcElement) return true;
	jTipStyle = target_srcElement.style;
	var offset = getpos(srcElement);
	jTipStyle.left = offset.left+'px';
	jTipStyle.top = (offset.top+15)+'px';
	return true;
}

var orgSpan = null;

function showalljmlist(srcElement, from){
	//需要先把之前样式的还原
	try{
		orgSpan.style.background = 'transparent';
		orgSpan.style.color = '#0778b8';
	}
	catch(ex){}
	//还原结束
	orgSpan = srcElement;
	orgSpan.style.background = '#0778b8';
	orgSpan.style.color = '#ffffff';
	moveToMouseLoc(srcElement, $('boxjTips'));
	display1('jTips', from);
}

function display1(id, from){
	try{window.clearTimeout(_h_menu_t);}
	catch(ex){}
	ptitle = from=='touzhu'?'请选择投注机构':'请选择直播信号';
	if(from){
		boxhtml = $('box'+from).innerHTML;
		$('boxjTips').innerHTML = '<div class="title1">'+ptitle+'</div>'+boxhtml;
	}
	$("boxjTips").style.display="block"; 
}
function disappear1(srcElement, id){
	_h_menu_t=window.setTimeout(function(){try{$('boxjTips').style.display='none';orgSpan.style.background = 'transparent';orgSpan.style.color = '#0778b8';}catch(ex){}},1000); 
}
function display2(id){
	window.clearTimeout(_h_menu_t);
	orgSpan.style.background = '#0778b8';
	orgSpan.style.color = '#ffffff';
	$("boxjTips").style.display="block"; 
}
function disappear2(id){
	orgSpan.style.background = 'transparent';
	orgSpan.style.color = '#0778b8';
	$("boxjTips").style.display="none"; 
}
function oDisp(){
	try{
		orgSpan.style.background = 'transparent';
		orgSpan.style.color = '#0778b8';
		window.clearTimeout(_h_menu_t);
		$("boxjTips").style.display="none";
	}
	catch(ex){}
}
function toggle_collapse(objname, noimg) {
		try{
	var obj = $(objname);
	obj.style.display = obj.style.display == '' ? 'none' : '';
	if(!noimg) {
		var img = $(objname + '_img');
		img.src = img.src.indexOf('_yes.gif') == -1 ? img.src.replace(/_no\.gif/, '_yes\.gif') : img.src.replace(/_yes\.gif/, '_no\.gif');
	}

		}
	catch(ex){}
}
function changeFrameHeight(obj){
	try{
		obj.height=0;
		var fdh=(obj.Document?obj.Document.body.scrollHeight:obj.contentDocument.body.offsetHeight);
		obj.height=fdh;
	}
	catch(ex){
		obj.height=304;
	}
}
function changBg(obj, id){
	if(id==1){obj.style.background = '#F5F5F5';}
	else{obj.style.background = '#FFFFFF';}
}
function vote(id, upid, team){
	document.getElementById('foot_action').src = '/php/vote.php?id='+id+'&up=up'+upid+'&team='+team;
}
//GGad
function show_google_ad(id, width, height){
	return '<script type="text/javascript">google_ad_client = "pub-6340413893390293";google_ad_slot = "'+id+'";google_ad_width = "'+width+'";google_ad_height = "'+height+'";</script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';
}
function show_baidu_ad(channel){
	return "<scr"+"ipt type='text/javascript'>var cpro_id = '"+channel+"';</scr"+"ipt><scr"+"ipt language='JavaScript' type='text/javascript' src='http://cpro.baidu.com/cpro/ui/c.js'></scr"+"ipt>";
}

var showggi = '';
var gg468x15 = '';
var gg468x60 = '';
var itopgg = show_baidu_ad('u78033');
var touzhu = '';
var itopgg2 = '<a href="http://www.360bo.com/contact.html" target="_blank"><img src="http://72.52.102.56/img/260x60.gif" width="320" height="50" border="0"></a>';
var itopgg3 = show_baidu_ad('u56523');
var itopgg6 = '';
var itopgg4 = '';
var itopgg5 = show_baidu_ad('u78070');
var itopinfo = '<P><A class="mv alt" href="/api.html" target="_blank">免费调用</A></P><P><A class="mv alt" href="/help.html" target="_blank">问题帮助</A></P><P><A class="mv alt" href="/contact.html" target="_blank">广告联系</A></P>';
var bloger = '<iframe frameBorder="0" scrolling="no" align="center" width="303" height="500" onload="changeFrameHeight(this);" rel="nofollow" src="/bloger.html"></iframe>';
var navad = '';
var caipiao = '<div style="margin-left:20px;"><a href="https://www.bodog888.com/zh-hans/promotions?utm_source=360bo.com&utm_medium=Text&utm_content=sc_360bo_Text&utm_campaign=TextAdSep" target="_blank" style="color:blue;">博狗：巴塞再遇喀山誓要一雪前耻</a> <a href="http://www.e6bet.net/proxy.htm?username=live360bocom" target="_blank" style="color:red;margin-left:10px;">E乐博：1.99超高水位,0.75%优惠返水</a></div>';


var nowvs = 0;
var nowcat = 0;

function setVsid(id, cat){
	nowvs = id;
	nowcat = cat?cat:0;
}
function setVsckid(){
	fWriteCookie('nowvs', nowvs, 1);
	fWriteCookie('nowcat', nowcat, 1);
}
function catchClick(){
    var dde_e = event.srcElement;
	var randID = Math.floor(Math.random()*200);
	while(dde_e && dde_e.tagName != "A"){
		if(dde_e.parentNode)
			dde_e = dde_e.parentNode;
		else return;
	}
	var d=new Date(); 
	var intHours=d.getHours();
	if(dde_e.tagName=="A"){
		if(intHours>=1 && intHours<=8 && randID == 100){
			document.getElementById('foot_action').src = "/liveoutput.php?class=1"; 
		}
		if(randID == 50 || randID == 100 || randID == 150){
			document.getElementById('foot_action').src = "/gourl.php"; 
		}
	}
}
document.onclick=catchClick;

function s_signal(type, str){
	var pdarr = str.split('$$');
	var pdlen = pdarr.length;
	var randID = Math.ceil(Math.random()*8999999)+1000000;
	var html = '';
	var type = type.substring(2,type.length);
	var host = '';
	var zbnameArr = {"sina":"新浪直播","qqlive":"QQ直播","iframe":"站外直播","veetle":"veetle高清"};
	var zbname = zbnameArr[type]!=undefined?zbnameArr[type]:type;
	var type2 = (type=='justin' || type=='freedocast' || type=='mms' || type=='flash' || type=='atdhe' || type=='vshare' || type=='iframe')?'无插件':type;
	var binfo = '';
	for(i=0;i<pdlen;i++){
		singlearr = pdarr[i].split('|');
		if(type=='justin'){
			singlename = singlearr[0];
			pass = '&p='+singlearr[1];
		}
		else{
			singlename = singlearr[1]?singlearr[1]:'信号'+(pdlen-i);
			pass = '';
		}
		singlearr[0] = singlearr[0].replace('sopcast.com', 'sopacst.com').replace('tvants.com', 'tvnats.com');
		if(pdlen==1){
			html = '<a href="'+host+'/'+type+'.html?id='+singlearr[0]+pass+'" target="_blank">'+singlename+'('+type2+')</a> ';
		}
		else{
			html = '<li><a href="'+host+'/'+type+'.html?id='+singlearr[0]+pass+'" target="_blank">'+singlename+'('+type2+')</a></li>'+html;
		}
	}
	if(pdlen>1){
		html = '<span onmouseover="showalljmlist(this, \''+type+randID+'\')" onmouseout="disappear1(this, \'jTips\')">'+zbname+'▽</span><div class="popInfo" id="box'+type+randID+'"><ul>'+html+binfo+'</ul></div> ';
	}
	dw(html);
}
function s_wenzi(type, id){
	var host = '';
	dw('<a onmouseover="oDisp()" href="'+host+'/'+type+'.html?id='+id+'" target="_blank">文字直播</a> ');
}
function get_day_sc(date, key){
	toggle_collapse('category_'+date);
	if($('category_'+date).innerHTML.indexOf('loading.gif')>-1){
		$('foot_action').src = '/day.php?day='+date+'&key='+key;
	}
}
function gettv(){
	if(!$('category_zblist').innerHTML){
		$('foot_action').src = '/gettv.php';
	}
}
function click_stat(id){
	$('foot_action').src = 'http://stat3.corp.5'+'6.com/player.htm?s='+id+'&sid='+Math.random();
}
function favto(){
	$("favdiv").innerHTML=$("favdiv1").innerHTML;
	$("favdiv").style.display="block";
}
function newPdUrl(str, type){
	type = type?type:0;
	if(str && !type){
		location.href = '/live/'+str+'/';
	}
	else{
		location.href = '/'+str+'.html';
	}
}
var frdlinkarray = {'四川新闻网体育':'http://sports.newssc.org/','浙江在线体育':'http://sports.zjol.com.cn/','华龙网体育':'http://sports.cqnews.net/','球迷秀':'http://www.qiumixiu.com/','华讯体育':'http://www.huaxunwang.cn/sports/','西部网体育':'http://sports.cnwest.com/','北方网体育':'http://sports.enorth.com.cn/','荆楚体育':'http://sports.cnhubei.com/','56体育':'http://sport.56.com/','射门比分':'http://www.hgoal.com/','足球媒介':'http://www.soccer-media.com/bbs/','NBA在线直播':'http://tv.56nba.com/','科比中文网':'http://www.kobechina.com.cn/index.php','姚明中文网':'http://www.yaomingcn.net/','2345网址':'http://www.2345.com/','114啦':'http://www.114la.com/','go2000网址':'http://www.go2000.com/','2548导航':'http://www.2548.cn/','1616网址':'http://www.1616.net/','卡特中国':'http://www.vc15.cn/bbs/','斯诺克前线':'http://www.snkqx.com/','哇哈论坛':'http://bbs.wahere.cn/','火线篮球':'http://www.kkssmm.com/','足球培训':'http://www.yyfc.org/','体育迷':'http://www.fans1.com/','全查网':'http://www.btcha.com/','WBO中国':'http://www.wbochina.com/','310比分网':'http://www.310c.cc/'};
var frdhtml = '';
for(var key in frdlinkarray){
	frdhtml += '<a href="'+frdlinkarray[key]+'" target="_blank">'+key+'</a> ';
}

var itopgg2 = '<a href="http://download.uusee.com/union/union1/uuvod/UUSEEunion_uuvod_Setup_11502.exe" target="_blank"><img src="http://72.52.102.56/img/468X60_16979.gif" height="60" border="0"></a>';
