var http_request = false;   
//向服务器发起XMLHTTP请求。   
function send_request(url) {//初始化、指定处理函数、发送请求的函数   
	http_request = false;   
	//开始初始化XMLHttpRequest对象   

	if(window.XMLHttpRequest) { //Mozilla 浏览器   
		http_request = new XMLHttpRequest();   
		if (http_request.overrideMimeType) {//设置MiME类别   
			http_request.overrideMimeType('text/xml');   
		}   
	}   
	else if (window.ActiveXObject) { // IE浏览器   

		try {   
			http_request = new ActiveXObject("Msxml2.XMLHTTP");   
		} catch (e) {   
			try {   
				http_request = new ActiveXObject("Microsoft.XMLHTTP");   
			} catch (e) {}   
		}   
	}   
	if (!http_request) { // 异常，创建对象<SPAN class=hilite2>实例</SPAN>失败   
		window.alert("不能创建XMLHttpRequest对象<SPAN class=hilite2>实例</SPAN>.");   
		return false;   
	}   
	http_request.onreadystatechange = processRequest;   
	// 确定发送请求的方式和URL以及是否同步执行下段代码   

	http_request.open("GET", url, true);   
	http_request.send(null);   
}

// 处理返回信息的函数   
function processRequest() {  
	if (http_request.readyState == 4) { // 判断对象状态   
		if (http_request.status == 200 || http_request.status == 0) { // 信息已经成功返回，开始处理信息 
		} else { //页面不正常   
			alert("您所请求的页面有异常。");   
		}   
	}   
} 

function getCookie(Name) {   
   var search = Name + "=";
   if (window.document.cookie.length > 0) { // if there are any cookies
     offset = window.document.cookie.indexOf(search);
	 if (offset != -1) { // if cookie exists
       offset += search.length;          // set index of beginning of value
	   end = window.document.cookie.indexOf(";", offset)          // set index of end of cookie value
	   if (end == -1)
	     end = window.document.cookie.length;
	   return unescape(window.document.cookie.substring(offset, end));
     }
   }
   return null;
}

function setCookie(name, value, expire) {   
  window.document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
}



function CtoH(obj)
{ 
var str=obj.value;
var result="";
for (var i = 0; i < str.length; i++)
{
if (str.charCodeAt(i)==12288)
{
result+= String.fromCharCode(str.charCodeAt(i)-12256);
continue;
}
if (str.charCodeAt(i)>65280 && str.charCodeAt(i)<65375)
result+= String.fromCharCode(str.charCodeAt(i)-65248);
else result+= String.fromCharCode(str.charCodeAt(i));
} 
obj.value=result;
} 



/**
 * =========================================================================
 * 本程序可自由复制、修改、传播，不得删除以下信息。如用于商业用途须经原作者同意方可使用。
 * =========================================================================
 * 程序名称：ForceWindow(@iClass.JS)
 * 描　　述：“冲破”广告拦截软件，强制弹出窗口。
 * 版　　本：1.0.0
 * 创建时间：2004年1月19日
 * 修改时间：2004年1月19日
 * 文件名称：ForceWindow.iclass.js
 * 作　　者：钟钟
 * 邮箱地址：zz@iecn.net zz315@163.com
 * 版权声明：本程序属于iClass.JS，版权归作者所有。
 * 有关iClass计划详见：http://www.iecn.net/forum/showthread.php?threadid=14811
 * =========================================================================
 */

/**
 * 定义ForceWindow类构造函数
 * 无参数
 * 无返回值
 */
function ForceWindow ()
{
  this.r = document.documentElement;
  this.f = document.createElement("FORM");
  this.f.target = "_blank";
  this.f.method = "post";
  this.r.insertBefore(this.f, this.r.childNodes[0]);
}

/**
 * 定义open方法
 * 参数sUrl：字符串，要打开窗口的URL。
 * 无返回值
 */
ForceWindow.prototype.open = function (sUrl)
{
  this.f.action = sUrl;
  this.f.submit();
}

/**
 * 实例化一个ForceWindow对象并做为window对象的一个子对象以方便调用
 * 定义后可以这样来使用：window.force.open("URL");
 */
window.force = new ForceWindow();

/**
 * 用本程序弹出的窗口将不会被广告拦截软件拦截，但有一个缺点：你无法象对window.open弹出的窗口那样对外观进行定制。
 * 你当然也可以在使用前实例化一个ForceWindow对象：
 * var myWindow = new ForceWindow(); 
 * 这样来使用：
 * myWindow.open("URL");
 * 本程序测试通过的浏览器：IE 5+、Firefox 1.0、Mozilla 1.7.5、Netscape 7.2、Opera 7.23
 * 友情提示：如果你将本程序用于强制弹出广告，请更多的想想浏览者的感受！
 */
