// JavaScript Document
document.title = "广汽日野汽车有限公司";

//
function popWin(catid, id) 
{
	/*
	var _pop = window.open("/pop_news.jsp?catid=" + catid + "&id=" + id, "news", "width=766px,height=682,scrollbars=1,left=0,top=0");
	_pop.focus();
	*/
	window.open("/pop_news.jsp?catid=" + catid + "&id=" + id);
}

function popWinByLink(link) 
{
	var _pop = window.open(link, "news", "width=766px,height=682,scrollbars=1,left=0,top=0");
	_pop.focus();
}
function getChange(b)
{
	var _f = document.searchF.keyword;
	if (!b)
	{
		if (_f.value == "")
		{
			_f.value = "::请输入关键字::";
		}
	}
	else
	{
		_f.value = "";
	}
}

function submitSearch()
{
	var _v = document.searchF.keyword.value;
	if (typeof(_v) != "undefined" && _v.length > 0)
	{
		popWinByLink("search.jsp?keyword=" + _v);
	}
}

function BoxCreator()
{
	this._fragment = null;
	this._name = "__pic_";
	this._pic = "";
	this._link = "";
	if (typeof(BoxCreator._initialized) == "undefined")
	{
		var _bc = BoxCreator.prototype;
		_bc.getO = function(i) 
		{
			var _o = document.getElementById(this._name + i);
			return typeof(_o) == "undefined" ? null : _o;
		}
		_bc.addDIV = function(id, src, sLink)
		{
			if (this._fragment == null)
			{
				this._fragment = document.createDocumentFragment();
			}
			var _div = document.createElement("DIV");
			_div.id = this._name + id;
			_div.className = "pos_pic_s";
			_div.style.display = "none";
			var _btn = document.createElement("A");
			_btn.href = typeof(sLink) == "undefined" ? "#" : sLink;
			_btn.target = "_blank";
			_div.appendChild(_btn);
			var _pic = document.createElement("IMG");
			_pic.src = src;
			_div.appendChild(_pic);
			this._fragment.appendChild(_div);
		}
		_bc.create = function(id)
		{
			if (this._fragment != null)
			{
				var _o = document.getElementById(id);
				if (_o != null)
				{
					_o.appendChild(this._fragment);
				}
			}
		}
		_bc.hLayer = function(id,status)
		{
			var _o = this.getO(id);
			if (_o != null)
			{
				_o.style.display = status ? "block" : "none";
			}
		}
		BoxCreator._initialized = true;
	}
}
