	var strUrl = "http://www.bbvod.net"; //定义默认URL
	var nSiteId = 11; //站点编号
	var strIframeUrl = "http://user.bbvod.net/usermanager/head.aspx"; //主站URL
	var nChannelId = 0; //频道编号
	var nDisplay = 0; //是否显示
	try
	{
	   //获取URL
	   strUrl = document.URL.toLowerCase();
	}
	catch(obj) {}
	
 	//获取对应的URL
	nChannelId = getChannelIdFromUrl();	
	//获取对应的是否显示
	nDisplay = getDisplayValue();
	//alert(nDisplay);

	//HomeUri
	//北京网通直通车
	if(strUrl.indexOf("cncadsl.bbvod.net")>=0)
	{
		strIframeUrl += "?channelid="+nChannelId+"&HomeUri=1&homesiteid=15";
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='124'></iframe>");		 	   
	}
	else if(strUrl.indexOf("adsl.bbvod.net")>=0)
	{
		if(strUrl.indexOf("indexSCADSL")>=0)
		 {
			   nSiteId = 7;
		 }
		 else if(strUrl.indexOf("indexSDADSL")>=0)
		 {
				 nSiteId = 9;
		 }
		 else if(strUrl.indexOf("indexSHADSL")>=0)
		 {
		     nSiteId = 10;
		 }
		 else if(strUrl.indexOf("indexGDADSL")>=0)
		 {
				 nSiteId = 11;
		 }
		 else
		 {
		     nSiteId = 11;
		 }
		 
		 if(getCookie("bbvodHomeSiteID")!=null)
		 {
		     //读取COOKIE值
		     nSiteId = getCookie("bbvodHomeSiteID");
		     //alert(nSiteId);
		 }
		 strIframeUrl += "?channelid="+nChannelId+"&HomeUri=1"+"&homesiteid="+nSiteId;
		 document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='124'></iframe>");		 
	}		
	//千龙新闻网
	else if(strUrl.indexOf("qianlong.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headQL.aspx?channelid="+nChannelId+"&display="+nDisplay;
		if(nDisplay=="N")
		{
			document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='56'></iframe>");	
		}
		else
		{
			document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='124'></iframe>");	
		}	 
	}
	//海峡网
	else if(strUrl.indexOf("xmnn.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headHX.aspx?channelid="+nChannelId+"&display="+nDisplay;
		if(nDisplay=="N")
		{
			document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='56'></iframe>");	
		}
		else
		{
			document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='124'></iframe>");	
		}	 
	}
	//荆楚网
	else if(strUrl.indexOf("cnhubei.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headJC.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='124'></iframe>");		 	   
	}
	//人民网
	else if(strUrl.indexOf("people.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headRM.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='292'></iframe>");		 	   
	}
	//泉州网
	else if(strUrl.indexOf("qzwb.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headQZ.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='127'></iframe>");		 	   
	}
	//阿哈导视
	else if(strUrl.indexOf("aaahaa.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headAH.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='980' height='192'></iframe>");		 	   
	}
	//金黔在线
	else if(strUrl.indexOf("gog.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headJQ.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='57'></iframe>");		 	   
	}
	//网通主站
	else if(strUrl.indexOf("cncvod.bbvod.net")>=0)
	{
		strIframeUrl += "?channelid="+nChannelId+"&HomeUri=0"+"&homesiteid=5";
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='124'></iframe>");		 	   
	}
	//东北新闻网
	else if(strUrl.indexOf("nen.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headDBXW.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='230'></iframe>");		 	   
	}
	//东莞网
	else if(strUrl.indexOf("dg.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headDG.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='128'></iframe>");		 	   
	}
	//广东茂名
	else if(strUrl.indexOf("kbvod.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headGDMM.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='106'></iframe>");		 	   
	}
	//看病网
	else if(strUrl.indexOf("jkang.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headKBW.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='223'></iframe>");		 	   
	}
	//本溪信息网
	else if(strUrl.indexOf("lnbx.bbvod.net")>=0)
	{
		strIframeUrl += "?channelid="+nChannelId+"&HomeUri=1"+"&homesiteid=43";
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='124'></iframe>");		 	   
	}
	//红摘网
	else if(strUrl.indexOf("hzhai.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headHZW.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='60'></iframe>");		 	   
	}
	//川农人
	else if(strUrl.indexOf("cnr5.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headCNR.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='284'></iframe>");		 	   
	}
	//酷客娱乐
	else if(strUrl.indexOf("kuco.bbvod.net")>=0)
	{
		//document.write("<script src='http://www.kuco.cn/smovie_head.js'></script>");		 	   
	}
	//滁州信息港
	else if(strUrl.indexOf("cz163.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headCZ.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='176'></iframe>");		 	   
	}
	//大江网
	else if(strUrl.indexOf("jxnews.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headDJ.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='123'></iframe>");		 	   
	}
	//青岛新闻网
	else if(strUrl.indexOf("qingdaonews.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headQDXW.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='81'></iframe>");		 	   
	}
	//容县之窗
	else if(strUrl.indexOf("inrx.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headINRX.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='266'></iframe>");		 	   
	}
	//大庆网
	else if(strUrl.indexOf("dqbbs.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headDQBBS.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='241'></iframe>");		 	   
	}
	//济宁之窗
	else if(strUrl.indexOf("jnzc.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headJNZC.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='120'></iframe>");		 	   
	}
	//岳西之窗
	else if(strUrl.indexOf("ahyx163.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headYX163.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='207'></iframe>");		 	   
	}
	//我爱摩托罗拉手机论坛
	else if(strUrl.indexOf("52moto.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/head52MOTO.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='157'></iframe>");		 	   
	}
	//我要娱乐网
	else if(strUrl.indexOf("51a.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/head51A.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='147'></iframe>");		 	   
	}
	//利海网
	else if(strUrl.indexOf("lihaiwang.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headLH.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='80'></iframe>");		 	   
	}
	//太湖明珠
	else if(strUrl.indexOf("thmz.bbvod.net")>=0||strUrl.indexOf("bbvod.thmz.com")>=0)
	{
		strIframeUrl = "/headfoot/headTHMZ.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='119'></iframe>");		 	   
	}
	//大连公共信息
	else if(strUrl.indexOf("www.dl.bbvod.net")>=0||strUrl.indexOf("vod.dl.net.cn")>=0)
	{
		strIframeUrl = "/headfoot/headDL.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='238'></iframe>");		 	   
	}
	//西南影院
	else if(strUrl.indexOf("bbvod.qnicp.com")>=0||strUrl.indexOf("qnicp.bbvod.net")>=0)
	{
		strIframeUrl = "/headfoot/headXNYY.aspx?channelid="+nChannelId;
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='996' height='102'></iframe>");		 	   
	}
	//主站
	else
	{
		strIframeUrl += "?channelid="+nChannelId+"&HomeUri=0";
		document.write("<iframe src='"+strIframeUrl+"' framespacing='0' frameborder='no' scrolling='no' width='966' height='126'></iframe>");		 	   
	}
	//window.status=strIframeUrl;

//取得频道编号，根据URL
function getChannelIdFromUrl()
{
	var strResult = 0;
	var strRequestString = strUrl;
	var nPos = strUrl.indexOf("?");
	if(nPos>0)
		strRequestString = strUrl.substring(0,nPos);
	if(strRequestString.indexOf("/adult")>=0)//性教育
		strResult = 34;
	else if(strRequestString.indexOf("/tv")>=0)//电视剧
		 strResult = 30;
	else if(strRequestString.indexOf("/comic")>=0||strRequestString.indexOf("/cartoon")>=0)//动漫
		 strResult = 37;
	else if(strRequestString.indexOf("/film")>=0||strRequestString.indexOf("/movieinfo")>=0||strRequestString.indexOf("/zhuanti")>=0||strRequestString.indexOf("/hypc")>=0)//电影
		 strResult = 25;
	else if(strRequestString.indexOf("/music")>=0||strRequestString.indexOf("/mtv")>=0)//音乐
		 strResult = 31;
 	else if(strRequestString.indexOf("/zy")>=0)//综艺
		 strResult = 41;
 	else if(strRequestString.indexOf("forums.bbvod.net")>=0)//论坛
		 strResult = 102;
 	else if(strRequestString.indexOf("movdb.bbvod.net")>=0)//影库
		 strResult = 101;
 	else if(strRequestString.indexOf("live.bbvod.net")>=0)//直播
		 strResult = 300;
 	else if(strRequestString.indexOf("free.bbvod.net")>=0)//免费
		 strResult = 99;
	return strResult;
}  
  
//获取display参数
function getDisplayValue()
{
	if(strUrl.indexOf("indexql")>=0||strUrl.indexOf("indexhx")>=0)
	{
		return "N";
	}
	return "Y";
}

//取得GET的参数值
function getParamValue(name)
{
	var nPos = strUrl.indexOf("?"); 
	var strRequestString = strUrl.substring(nPos+1);
	//alert(strRequestString);
	var strParamValue = ""; //返回值
	if(nPos!=-1)
	{
		var params = strRequestString.split("&");
		//alert(params.length);
		for(nI=0;nI<params.length;nI++)
		{
			var strTemp = params[nI];
			nPos = strTemp.indexOf("=");
  		//alert(strTemp.substring(0,nPos));
			if(strTemp.substring(0,nPos)==name)
			{
				strParamValue = strTemp.substring(nPos+1);				
				break;
			}
		}
	}
	return strParamValue;
}
	
//取得COOKIE的KEY的VALUE
function getCookie (name) 
{
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}

//取得COOKIE值，根据长度
 function getCookieVal (offset)
 {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
 }
