﻿var Browser = new Object();
 
Browser.ua = window.navigator.userAgent.toLowerCase();
Browser.ie = /msie/.test(Browser.ua);
Browser.moz = /gecko/.test(Browser.ua);
 
var Position = {
	getElementLeft : function(o)
 
	{
		(typeof o == "string") ? o = document.getElementById(o) : "";
		var L = 0;
		while (o)
		{
			L += o.offsetLeft || 0;
			o = o.offsetParent;
		}
		return L;
	},
	getElementTop : function(o)
	{
		(typeof o == "string") ? o = document.getElementById(o) : "";
		var T = 0;
		while (o)
		{
			T += o.offsetTop || 0;
			o = o.offsetParent;
		}
		return T;
	}
};
function showTipsInfo(sID)
{
	document.getElementById("div"+sID).style.display = "block";
	if(sID != "9")
	{
	    document.getElementById("div"+sID).style.left = Position.getElementLeft('abrand'+sID) + 0+"px";
	}
	else
	{
	    document.getElementById("div"+sID).style.left = Position.getElementLeft('abrand'+sID)  -10 + "px";
	}
 
}
 
function hideTipsInfo(sID)
{
	document.getElementById("div"+sID).style.display = "none";
}

function searchUrl()
{
 if(document.all["textfield2"].value=="")
 {
 	alert("搜索关键字不能为空");
 	document.all["textfield2"].focus();
	 return false;
 }
 else
 {
 	window.open("/Search.html?type=news&tags="+document.all["textfield2"].value);
 	return false;
 }
}

function searchUrl()
{
 if(document.all["textfield2"].value=="")
 {
 alert("搜索关键字不能为空");
 document.all["textfield2"].focus();
 return false;
 }
 else
 {
 window.open("/Search.html?type=news&tags="+encodeURI(document.all["textfield2"].value));
 return false;
 }
}  


