function ShowQiyeOrGeren(args)
{
	if (args == 1)
	{
		document.all.TitleQiyeOrGeren.src = "default/TitleQiye.gif";
		document.all.ContentGeren.style.display = "none";
		document.all.ContentQiye.style.display = "block";
	}
	else
	{
		document.all.TitleQiyeOrGeren.src = "default/TitleGeren.gif";
		document.all.ContentQiye.style.display = "none";
		document.all.ContentGeren.style.display = "block";
	}
}

function ShowQiyeOrGeren_new(args)
{
	if (args == 1)//
	{
		document.getElementById('qiehuan_qiye_geren').className = "qiehuan_qiye_geren1";
		document.getElementById('grqz').style.display = "none";
		document.getElementById('qyzp').style.display = "block";
	}
	else
	{
		document.getElementById('qiehuan_qiye_geren').className = "qiehuan_qiye_geren2";
		document.getElementById('qyzp').style.display = "none";
		document.getElementById('grqz').style.display = "block";
	}
}

function ShowQiyeOrGeren2(args)
{
	if (args == 1)
	{
		document.all.TitleQiyeOrGeren2.src = "default/TitleQiye.gif";
		document.all.ContentGeren2.style.display = "none";
		document.all.ContentQiye2.style.display = "block";
	}
	else
	{
		document.all.TitleQiyeOrGeren2.src = "default/TitleGeren.gif";
		document.all.ContentQiye2.style.display = "none";
		document.all.ContentGeren2.style.display = "block";
	}		
}

function ChgBG(len)
{
	for (var i=0; i< 4 ;i++)
	{
		document.all["sch"+i].className = "normalSearch";
		document.all["table"+i].style.display = "none";
	}
	document.all["sch"+len].className = "clickSearch";	
	document.all["table"+len].style.display = "block";
}
function ChgBG_2(len)
{
	for (var i=0; i< 4 ;i++)
	{
		document.all["sch"+i].className = "normalSearch_2";
		document.all["table"+i].style.display = "none";
	}
	document.all["sch"+len].className = "clickSearch_2";	
	document.all["table"+len].style.display = "block";
}
function ChgBG_3(len)
{
	for (var i=0; i<= 1 ;i++)
		document.all["com_pos_sel_"+i.toString()].className = "clickSearch_2";
	document.all["com_pos_sel_"+len.toString()].className = "normalSearch_2";
	document.SearchFrom2.ComOrPos.value = len;
}
//得到鼠标的位置设置悬浮层的位置
function GetMouseXY_ForLayer(div)
{
//	var obj_div = document.getElementById("Odiv_"+div)
	var obj_div = document.getElementById(div)
//	x = document.body.scrollLeft + event.clientX;
	y = document.body.scrollTop + event.clientY+30;
	x = (screen.width - obj_div.style.width.replace("px",""))/2;

	if (x < 200) 
	    x = 200
	obj_div.style.top = y;
	obj_div.style.left = x;
	obj_div.style.display = "block";
}

function CloseOdiv()
{
	var argArr = CloseOdiv.arguments;
	for(var i=0;i<argArr.length;i++)
		document.all[argArr[i]].style.display = "none";
}

function Dron_ScrollBox(uid)
{
	this.scrollBox = document.getElementById(uid);
	this.scrollBoxHeight = this.scrollBox.clientHeight;
	this.scrollBoxInner = this.scrollBox.innerHTML;
	this.scrollCol = this.scrolln = 0;
	this.setScroll = function ()
	{
		this.scrollBox.scrollTop = this.scrollCol + this.scrolln;
		if(this.scrolln==this.scrollBoxHeight)
			return this.addScroll()
		else
			this.scrolln ++;
		var o = this;
		function m()
		{
			o.setScroll();
		}
		setTimeout(m,20);
	}
	this.addScroll = function ()
	{
		this.scrollBox.innerHTML += "<br>" + this.scrollBoxInner;
		this.scrollCol = this.scrollBox.scrollTop;
		this.scrolln = 0;
		var o = this;
		function m(){o.setScroll();}
		setTimeout(m,3000);
	}
	this.init = this.addScroll;
}

function Float_Div_onClick()
{
	document.all.PosBS.onclick=function()
	{
		CloseOdiv('div_G_pos','div_G_hangye','div_G_zone');
		document.all.PosBS.src = "Image/SearchF1.gif";
		document.all.HangYeBS.src = "Image/SearchF33.gif";
		document.all.ZoneBS.src = "Image/SearchF22.gif	";
		document.all.PosSearch.style.visibility = "visible";
	}
	document.all.ZoneBS.onclick=function()
	{
		CloseOdiv('div_G_pos','div_G_hangye','div_G_zone');
		document.all.PosBS.src = "Image/SearchF11.gif";
		document.all.HangYeBS.src = "Image/SearchF33.gif";
		document.all.ZoneBS.src = "Image/SearchF2.gif";
		document.all.PosSearch.style.visibility = "hidden";
		GetMouseXY_ForLayer("div_G_zone");
	}
	document.all.HangYeBS.onclick=function()
	{
		CloseOdiv('div_G_pos','div_G_hangye','div_G_zone');
		document.all.PosBS.src = "Image/SearchF11.gif";
		document.all.HangYeBS.src = "Image/SearchF3.gif";
		document.all.ZoneBS.src = "Image/SearchF22.gif";
		document.all.PosSearch.style.visibility = "hidden";
		GetMouseXY_ForLayer('div_G_hangye');
	}
}

function ShowCloseSrc()
{
	var Arg = ShowCloseSrc.arguments;
	var len = Arg.length;
	var obj;
	for (var i=0;i<len;i++)
	{
		obj = eval('document.all.'+Arg[i]);
		obj.style.display=(obj.style.display=="block")?"none":"block";
	}
}

var delta=0.5
var collection;
function floaters()
{
	this.items	= [];
	this.addItem	= function(id,x,y,content)
	{
		document.write('<DIV id='+id+' style="Z-INDEX: 10; POSITION: absolute;  width:80px; height:60px;left:'+(typeof(x)=='string'?eval(x):x)+';top:'+(typeof(y)=='string'?eval(y):y)+';visibility: visible;">'+content+'</DIV>');
		var newItem				= {};
		newItem.object			= document.getElementById(id);
		newItem.x				= x;
		newItem.y				= y;
		this.items[this.items.length]		= newItem;
	}
	this.play	= function()
	{
		collection				= this.items
		setInterval('play()',10);
	}
}

function play()
{
	if(screen.width<=640)
	{
		for(var i=0;i<collection.length;i++)
		{
			collection[i].object.style.display	= 'none';
		}
		return;
	}
	for(var i=0;i<collection.length;i++)
	{
		var followObj		= collection[i].object;
		var followObj_x		= (typeof(collection[i].x)=='string'?eval(collection[i].x):collection[i].x);
		var followObj_y		= (typeof(collection[i].y)=='string'?eval(collection[i].y):collection[i].y);

		if(followObj.offsetLeft!=(document.body.scrollLeft+followObj_x))
		{
			var dx=(document.body.scrollLeft+followObj_x-followObj.offsetLeft)*delta;
			dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx));
			followObj.style.left=followObj.offsetLeft+dx;
		}

		if(followObj.offsetTop!=(document.body.scrollTop+followObj_y)) 
		{
			var dy=(document.body.scrollTop+followObj_y-followObj.offsetTop)*delta;
			dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy));
			followObj.style.top=followObj.offsetTop+dy;
		}
		followObj.style.display	= '';
	}
}

//页面下载完毕  
//document.onreadystatechange = function()
//{   
//	if(document.readyState=="complete")  
//	{ 
//		try
//		{
//			document.all["urgentZP"].innerHTML = "<iframe scrolling='no' frameborder='0' src='urgentZP.aspx' width='470px' height='120px'></iframe>";
//			document.all["ZhiChangNews"].innerHTML = "<iframe scrolling='no' frameborder='0' src='ZhiChangNews.aspx' width='470px' height='120px'></iframe>";
//			document.all["ZPH1"].innerHTML = "<iframe scrolling='no' frameborder='0' src='ZPH.aspx' width='470px' height='120px'></iframe>";
//		}
//		catch(e)
//		{
//		}
//	}
//}   

