$(function(){
		$.search({
		list:{google:['http://static.5258.net/5258page/img/google.gif','谷歌搜索']},
	    web:{
			se:{
				google:{
					action:'http://www.google.com.hk/search',
					query:'q',
					params:{
					    client:'aff-5258',
						channel:'searchbox',
						newwindow:'1'
					},
					type:21
				}
			},
			checked:'google'			
		},
	   mp3:{
	   	  se:{
		  	google:{
					action:'http://www.google.cn/music/search',
					query:'q',
					params:{								    
						hl:'zh-CN'
					},
					 type:24 
		   }
		  },
		  checked:'google'		  
	   },
	   video:{
	   	   se:{
		   	 google:{
			 	action:'http://www.google.com.hk/videohp',
				query:'q',
				params:{								    
					hl:'zh-CN'														
			    },
				type:26
		     }					   
	      },
	   checked:'google'	   
	   },
	    image:{
	   	   se:{
		   	 google:{
			 	action:'http://images.google.com.hk/images',
				query:'q',
				params:{								    
				    hl:'zh-CN'														
			    },
				type:25
		   }					   
	   },
	   checked:'google'	   
	},
	  tieba:{
	   	   se:{
		   	 google:{
			 	action:'http://laiba.tianya.cn/laiba/Glue',
				query:'q',
				params:{								    
				    hl:'zh-CN'														
			    },
				type:22
		   }					   
	   },
	   checked:'google'	   
	},
	wenda:{
	   	   se:{
		   	 google:{
			 	action:'http://wenda.tianya.cn/wenda/search',
				query:'q',
				params:{								    
				    hl:'zh-CN'														
			    },
				type:23
		   }					   
	   },
	   checked:'google'	   
	}
	},'tsearch','current','tablist','li', 'ff1', 'search-img', 'web', 'tsinput');
});
(function(){
function k(c,d,b){
	var a="on"+d;
	if(c.addEventListener)c.addEventListener(d,b,false);
	else if(c.attachEvent)c.attachEvent(a,b);
	else{var f=c[a];c[a]=function(){
		var g=f.apply(this,arguments),e=b.apply(this,arguments);
		return g==undefined?e:(e==undefined?g:e&&g)}}};
var l="http://static.5258.net/styles/google2/images/toolbar_animation_20070919.png",m=52,n=37,o=75,p=100;
function q(c,d,b,a,f){return{url:c,name:d,tooltip:b,color:a,yAdjust:f}}
var r=[q("http://www.google.com.hk/videohp","\u89C6\u9891","\u641C\u7D22\u70ED\u95E8\u7F51\u7EDC\u89C6\u9891","#54a70d",[2,5]),
	q("http://images.google.com.hk/imgcat/imghp?hl=zh-CN","\u56FE\u7247","\u641C\u7D22\u5168\u7403\u7684\u56FE\u7247","#3b79e7",[2,5]),
	q("http://www.google.com.hk/products?gl=cn&hl=zh-CN","\u8D2D\u7269","\u641C\u7D22\u5546\u54C1\u548C\u8D2D\u7269\u4FE1\u606F","#f3e76e",[3,7]),
	q("http://ditu.google.cn","\u5730\u56fe","\u67E5\u8BE2\u5730\u5740\u3001\u641C\u7D22\u5468\u8FB9\u548C\u89C4\u5212\u8DEF\u7EBF","#96cfec",[4,9]),
	q("http://www.google.cn/music/homepage","\u97F3\u4E50","\u641C\u7D22\u548C\u53D1\u73B0\u97F3\u4E50","#e6af36",[3,7]),
	q("http://translate.google.cn","\u7FFB\u8BD1","\u5728\u7EBF\u7FFB\u8BD1\u5916\u6587\u6BB5\u843D\u3001\u7F51\u9875\u3001\u641C\u7D22\u7ED3\u679C","#ff9202",[2,5]),
	q("http://www.5258.net/","\u7f51\u7ad9\u5bfc\u822a","\u6700\u4E13\u4E1A\u6743\u5A01\u7684\u4E0A\u7F51\u5BFC\u822A","#d93c08",[2,5])],s=[];
function t(c,d){while(d&&c!=d)d=d.parentNode;return d==c}
function v(c,d){
   return function(b){
	b=b||window.event;
	var a=s[d],
	f=c=="mouseover",
	g=b.target||b.srcElement,
	e=b.relatedTarget||(f?b.fromElement:b.toElement),
	h=!e||t(a.element,e),i=t(a.element,g);
	if(f&&!h||!f&&(!e||i&&!h)){
 	 var j=a.icon;j.mouseTimeout=window.clearTimeout(j.mouseTimeout);
 	 var u=f?1:-1;if(j.b!=u)j.mouseTimeout=window.setTimeout(j.e(u,undefined),f?p/3:p)}}}
function w(c,d,b){k(c,d,v(d,b))}
function x(c,d,b){
	this.c=c;
	var a=document.createElement("div"),
	f=c.color,g="background-color:"+f,
	e="width:1px;height:1px;"+g+";float:",
	h='<div style="height:1px;overflow:hidden"><div style="'+e+'left"></div><div style="'+e+'right"></div></div>',
	i="margin:0 1px;height:1px;overflow:hidden;"+g;a.innerHTML='<div style="display:none;position:absolute;top:0;left:0;z-index:2;background:#fff;cursor:pointer;cursor:hand"><a href="'+d+'" style="color:#444;text-decoration:none" target=_blank><div style="'+i+'"></div><div style="text-align:center;border-left:1px solid;border-right:1px solid;border-color:'+
f+'">'+h+'<div style="margin:0 auto;white-space:nowrap;padding:.2em 0 0"><font size=-1><span>'+b+"</span></font></div>"+h+'</div><div style="'+i+'"></div><div style="height:4px" align="center"><div style="position:relative;top:-1px;z-index:3;width:8px;overflow:hidden;margin:0 auto;height:4px;background:no-repeat -260px '+-c.spriteCoordinateList[0].y+'px"></div></div></a></div>';
	this.h=a.getElementsByTagName("span")[0];
	document.body.appendChild(a);a.firstChild.firstChild.lastChild.firstChild.style.backgroundImage="url("+l+")";
	this.element=a.firstChild;
	var j=s.length;s.push({icon:c,element:this.element});
		w(this.element,"mouseover",j);w(this.element,"mouseout",j)}
x.prototype.play=function(c){
	var d=this.c.element.firstChild,b={left:-d.offsetLeft,top:0};
    while(d){b.left+=d.offsetLeft;b.top+=d.offsetTop;d=d.offsetParent}
    var a=this.element.style;
    if(a.display=="none"){a.visibility="hidden";a.display="block"}
    var f=this.element.offsetHeight,g=this.h.offsetWidth+14;
    if(a.visibility=="hidden"){a.display="none";a.visibility="visible"}
    a.width=g+"px";
    b.left-=(g-this.c.element.parentNode.offsetWidth)/2;
    b.top-=f-3;b.top+=20*Math.pow(1-c/this.c.frames,3);
    a.left=b.left+"px";a.top=b.top+"px";
    if(c==0||this.c.b<0)a.display="none";
    else{
     a.display="";
     var e=c/this.c.frames;
     if("opacity"in a)a.opacity=e;
     	else if("MozOpacity"in a)a.MozOpacity=e;
     	else if("KhtmlOpacity"in a)a.KhtmlOpacity=e;
     	else if("filter"in a)a.filter="alpha(opacity="+e*100+")"}};
function y(c,d,b,a,f){
	this.element=c;
	this.mouseTimeout=null;
	this.frames=d.length-1;this.spriteCoordinateList=d;
	this.color=b;
	this.d=null;
	this.g=c.getElementsByTagName("div")[1];
	this.i=new x(this,a,f);
	this.b=-1;
	this.a=1;
	var g=s.length;s.push({icon:this,element:c});
		w(c,"mouseover",g);
		w(c,"mouseout",g)}
y.prototype.e=function(c,d){var b=this;return function(){b.f(c,d)}};
y.prototype.f=function(c,d){
	if(c){
		this.b=c;
		this.mouseTimeout=window.clearTimeout(this.mouseTimeout);
		this.d=window.clearTimeout(this.d)}
	if(typeof d!="undefined")
		this.a=d;
	    var b=this.spriteCoordinateList[this.a];
	    this.g.style.backgroundPosition=-b.x+"px "+-b.y+"px";
	    this.i.play(this.a);
	    var a=this.element.style;
	    if(this.b<0){a.color="#444";a.textDecoration="none"}
	    else{a.color=this.color;a.textDecoration="underline"}
	    this.a+=this.b;
	    if(this.a>this.frames)this.a=this.frames-1;else if(this.a<0)this.a=1;
	    else this.d=window.setTimeout(this.e(undefined,undefined),o)};
k(window,"load",function(){
  try{document.execCommand("BackgroundImageCache",false,true)}
  catch(c){}
  var d='<table style="margin:0 auto;border-collapse:collapse;line-height:1.4em" cellpadding="3" cellspacing="2" border="0"><tr>';
  for(var b=0;b<r.length;++b){
    var a=r[b];
    a.url=a.url;

  	var f=[],g=n*b;
  	for(var e=0;e<7;++e)
  	if(e>4)f.push({x:m*4,y:g-a.yAdjust[e-5]});
  	else f.push({x:m*e,y:g});
  	a.coordinates=f;d+='<td style="text-align:center;padding:0 .35em 0 .4em;margin:0;cursor:pointer;cursor:hand"><a style="color:#444;text-decoration:none;" href="'+a.url+'" onclick="out(event);" target=_blank><div><div style="width:52px;height:37px;margin:.5em auto;cursor:pointer;cursor:hand;background: no-repeat 0 '+
-g+'px"></div><span style="white-space:nowrap"><font size=-1>'+a.name+"</font></span></div></a></td>"}
  d+="</tr></table>";
  var h=document.getElementById("tb");
  h.innerHTML=d;
  var i=h.getElementsByTagName("a");
  for(var b=0;b<i.length;++b){i[b].firstChild.firstChild.style.backgroundImage="url("+l+")";
  new y(i[b],r[b].coordinates,r[b].color,r[b].url,r[b].tooltip)}});
})();
