//设置首页
		function setHomeIndex(str,url) 
		{	
			if (window.sidebar)
			{
				alert("该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true");
			}
			str.style.behavior='url(#default#homepage)';
			str.setHomePage(url);return false;
		}

//创建 ajax 请求对象
		function getXMLHttpRequest()
		{ 
			if(window.ActiveXObject) {
				xmlHttp =  new ActiveXObject("Microsoft.XMLHTTP");
				xmlDOM =  new ActiveXObject("Microsoft.XMLDOM");  
			}
			else if(window.XMLHttpRequest) {
				xmlHttp =  new XMLHttpRequest();
			}
			return xmlHttp;
		}
		

//
		function getLink()
		{
			var url = 'http://www.yaofanzi.com/fengYun.htm'; 
			var xmlHttp = getXMLHttpRequest();
			xmlHttp.open("GET", url , true);
			xmlHttp.onreadystatechange = function(){
				if(xmlHttp.readyState==4 && xmlHttp.status==200){
					resultStr=xmlHttp.responseText;
					showResponse(resultStr);
				}
			}
			xmlHttp.send(null);
		}


//把内容写入目标
		function showResponse(originalRequest) 
		{ 
			var str = originalRequest;
			GetObj('linkcontent').innerHTML = str;
		} 

// 获取 Id 所在的目标
		function GetObj(objName)
		{
			if(document.getElementById)
			{
				return eval('document.getElementById("' + objName + '")');
			}
			else if(document.layers)
			{
				return eval("document.layers['" + objName +"']");
			}
			else
			{
				return eval('document.all.' + objName);
			}
		}
		

//弹出层模拟窗口

function msgBox() 
{ 
	this.container = "ads_14"; 
	this.dragArea = "drag"; 
	this.width = 282; 
	this.height = 180; 
	this.smallHeight = 27; 
	this.smallId = "small"; 
	this.closeId = "close"; 
	this.area = ( document.compatMode.toLowerCase()=="css1compat" ) ? document.documentElement : document.body; 
	this.space = 15; 
	this.timer; 
	this.timeOut = 150; 
	this.smalled = false; 
	window.msgBoxListener = this; 
	this.$(this.smallId).onclick= function(){msgBoxListener.toSmall()}; 
	this.$(this.closeId).onclick = function(){msgBoxListener.close()}; 
} 
msgBox.prototype.flow = function() 
{ 
	this.$(this.container).style.position = "absolute"; 
	this.$(this.container).style.zIndex = "1000"; 
	if(this.smalled) 
	{ 
		this.$(this.container).style.top = this.area.scrollTop + this.area.clientHeight - this.smallHeight - this.space + "px"; 
	}else{ 
		this.$(this.container).style.top = this.area.scrollTop + this.area.clientHeight - this.height - this.space + "px"; 
	} 
	this.$(this.container).style.left = this.area.scrollLeft + this.area.clientWidth - this.width - this.space + "px"; 
} 
msgBox.prototype.toSmall = function() 
{ 
	if(this.smalled) 
	{ 
		this.$(this.smallId).src = "img/small.gif"; 
		this.$(this.container).style.marginTop = -this.height + "px"; 
		this.$(this.container).style.height = this.height + "px"; 
		this.$(this.container).style.overflow = "hidden"; 
		this.smalled = false; 
		this.flow(); 
		this.$(this.container).style.marginTop = "0px"; 
	}else{ 
		this.$(this.smallId).src = "img/big.gif"; 
		this.$(this.container).style.height = this.smallHeight + "px"; 
		this.$(this.container).style.overflow = "hidden"; 
		this.smalled = true; 
		this.flow(); 
	} 
} 
msgBox.prototype.close = function() 
{ 
	document.body.removeChild(this.$(this.container)); 
} 
msgBox.prototype.auto = function() 
{ 
	this.flow(); 
	window["onresize"]=function(){msgBoxListener.flow();}; 
	window["onscroll"]=function(){msgBoxListener.flow();}; 
	document.onmousedown = function(){clearInterval(msgBoxListener.timer);msgBoxListener.drag(msgBoxListener.container, msgBoxListener.dragArea);}; 
} 
msgBox.prototype.drag = function(container, drag) 
{ 
	var IMOUSEDOWN = true; 
	var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; 
	container = document.getElementById(container); 
	drag = document.getElementById(drag); 
	if(drag) 
	{ 
		try{ 
			if(IMOUSEDOWN){ 
				drag.onmousedown=function(a){ 
					var d=document; 
					if(!a)a=window.event; 
					drag.style.cursor="move"; 
					var x=a.layerX?a.layerX:a.offsetX,y=a.layerY?a.layerY:a.offsetY; 
					if(drag.setCapture) 
					drag.setCapture(); 
					else if(window.captureEvents) 
					window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP); 
					d.onmousemove=function(a){ 
						if(!a)a=window.event; 
						if(!a.pageX)a.pageX = (a.clientX<0 ?0:a.clientX); 
						if(!a.pageY)a.pageY = (a.clientY <0 ?0:a.clientY); 
						var tx = a.pageX-x, ty = a.pageY-y; 
						if(isIE){ 
							ty = ty + document.documentElement.scrollTop - document.documentElement.clientTop; 
						} 
						container.style.position = "absolute"; 
						container.style.left = tx+"px"; 
						container.style.top = ty+"px"; 
					}; 
					d.onmouseup=function(){ 
						if(drag.releaseCapture) 
						drag.releaseCapture(); 
						else if(window.captureEvents) 
						window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP); 
						d.onmousemove=null; 
						d.onmouseup=null; 
					}; 
				}; 
			}else{ 
			container.style.cursor="pointer"; 
			drag.style.cursor="move"; 
			} 
		}catch(e){ 
			alert(e); 
		} 
	} 
} 
msgBox.prototype.$ = function(ele) 
{ 
	return document.getElementById(ele); 
} 
//var msgBox1 = new msgBox(); 
//msgBox1.auto(); 