function GetRequest(url)
{
	var xmlhttp;
	if(window.XMLHttpRequest) {
		//针对FireFox,Mozillar,Opera,Safari,IE7,IE8
		xmlhttp = new XMLHttpRequest();
		//针对某些特定版本mozillar浏览器的BUG进行修正
		if(xmlhttp.overrideMimeType) {
			xmlhttp.overrideMimeType("text/xml");	
		}
	}
	else if(window.ActiveXObject) {
		//针对IE6,5.5,5
		//两个可以创建XMLHttpRequest对象的空间名称，保存在一个JS数组中
		//排在前面的版本较新
		var activeName = ['MSXML2.XMLHTTP','Microsoft.XMLHTTP'];
		for(var i=0;i<activeName.length;i++) {
			try {
				//取出一个空间名进行创建，如果创建成功就终止循环
				//如果创建失败，会抛出异常，然后可以继续循环，继续尝试创建
				xmlhttp = new ActiveXObject(activeName[i]);
			}
			catch(e) {}
		}
	}
	xmlhttp.open("GET",url,false);
	xmlhttp.send(null);
	return xmlhttp.responseText;
}
function showmsg(id,msg)
{
	/*
	显示提示信息
	id:组件ID
	msg:显示内容
	*/
	document.getElementById(id).innerHTML=msg;
}
function trim(sString)
{
	/*
	去除空格
	str:字符串
	*/
    while (sString.substring(0,1) == ' ')
    {
        sString = sString.substring(1, sString.length);
    }
    while (sString.substring(sString.length-1, sString.length) == ' ')
    {
        sString = sString.substring(0,sString.length-1);
    }
    return sString;
}
function ovrTR(tr,color) 
{/*鼠标移上变背景色*/
	
	tr.bgColor = color;
}
function outTR(tr,color) 
{/*鼠标移开变背景色*/
	tr.bgColor = color;
}
//permit为0只禁止非法关键字，为1禁止关键字及联系方式，为2只禁止联系方式
function filtrate(str,permit)
{
	if (permit!=2)
	{
		var filtarr=new Array("骗","上当","http","www","妈的","共产党","上当","垃圾");
		for(var i=0;i<filtarr.length;i++)
		{
			var pat="/"+filtarr[i]+"+/";	
			if(eval(pat).test(str))
			return false;
		}
	}
	//如果要禁止联系方式
	if (permit!=0)
	{
		if ((str.indexOf("@")!=-1)||(str.indexOf(".com")!=-1)||(str.indexOf(".net")!=-1))
		return false;
		var j=0;l=str.length;
		var p=new Array(0,0,0,0,0,0,0);///数字的位置,最多算7位
		for (var i=l; i>0; i--)
		{  
			 if ((str.charCodeAt(i) >= 48)&&(str.charCodeAt(i) <= 57))
			 {
				 j++;
				 if (j<=7)//多于7位不检查了
				 p[j-1]=i;
			 }
		}
		//如果包含的数字大于7位，当成联系方式
		j=p[0]-p[6];//最前一位和最后一位位置不能小于10,即连续10位字符内包含7位数字		 
	 	if ((p[6]>0)&&(j>0)&&(j<=7))
		return false;
	}
	return true;
}

//收藏本站
function AddFavorite(sURL, sTitle)
{
    try
    {
        window.external.addFavorite(sURL, sTitle);
    }
    catch (e)
    {
        try
        {
            window.sidebar.addPanel(sTitle,sURL,"");
        }
        catch (e)
        {
            alert("加入收藏失败，请使用Ctrl+D进行添加");
        }
    }
}


//视频播放器js
function ShowMovie(width,height,livepath,movepath){

     //document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'"><param name="movie" value="'+livepath+'"><param name="quality" value="high"><param name="allowFullScreen" value="true" /><param name="FlashVars" value="vcastr_file='+movepath+'" /><embed src="'+livepath+'" allowFullScreen="true" FlashVars="vcastr_file='+movepath+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed></object>');

var swf_width=width
var swf_height=height
var texts='E家网视频播放'
var files=movepath
var config='0|1|100|0|2|0x000033|60|0x66ff00|0xffffff|0xffffff|||'


document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
document.write('<param name="movie" value="'+ livepath +'"><param name="quality" value="high">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="vcastr_file='+files+'&vcastr_title='+texts+'&vcastr_config='+config+'">');
document.write('<embed src="'+ livepath +'" wmode="opaque" FlashVars="vcastr_file='+files+'&vcastr_title='+texts+'&vcastr_config='+config+'" menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); 
document.write('</object>'); 
}