
var SInV='p';$(document).ready(function(){fS=new Image();fS.src='/tpl/img/tops.gif';var SShow=true,SBShow=true,SBSet=true;$("#SInS").hover(function(){SBShow=false;},function(){SBShow=true;$("#SInP").focus();if(($('#SInD').length)&&!$('#SInD').is(':hidden'))SIShow();});$("#SInP").hover(function(){if(!SShow){SBShow=true;$("#SInP").focus();if(($('#SInD').length)&&!$('#SInD').is(':hidden'))SIShow();}});$("#SInP").focus(function(){if(SShow){l=$(this).position().left;$(this).css('position','absolute').css('left',l-420).css('width','400px').css('border-right','none');$('#SInS').css('position','absolute').css('left',l+18);if($('#SInS').html()=='')$('#SInS').html('<div onclick="SIShow()" id="SInT">'+SiL['p']+'</div>');else $('#SInS').show();$('#SInD').remove();$('#SInT').css('border-bottom','1px solid #aaa');var a='<div id="SInD">';for(tip in SiL){a+='<a href="javascript:SiSel(\''+tip+'\')">'+SiL[tip]+'</a>';}$(a+'</div>').appendTo('#SInS');SShow=false;if(SBSet){$("#SInP").blur(function(){if(($(this).val()=='')&&SBShow&&!SShow){$(this).css('position','relative').css('left','0').css('width','130px').css('border-right','1px solid #aaa');$('#SInS').css('position','relative').hide();SShow=true;SBShow=true;}});SBSet=false;}
SBShow=false;}else SBShow=true;});$('#SInP').keypress(function(e){if(e.which==13)SISend();});$('#SInB').click(SISend);});function SIShow(){if($('#SInD').is(':hidden')){$('#SInT').css('border-bottom','none').css('color','#333');$('#SInD').slideDown('slow');}else $('#SInD').slideUp('slow',function(){$('#SInT').css('border-bottom','1px solid #aaa').css('color','#999');});}
function SiSel(tip){$('#SInT').text(SiL[tip]);SIShow();SInV=tip;}
function SISend(){var SInZ={'p':'/users/?snm=','a':'/audio/?search&snm=','v':'/video/?search&snm=','g':'/groups/?snm=','n':'/ann/?all&snm=','e':'/events/?search&snm=','f':'/app/?search&snm='};if($('#SInP').val()!='')window.location=SInZ[SInV]+$('#SInP').val();}
function PtSow(){$('#TpMenu').css('left',$('#TpMore').offset().left-10).unbind('mouseenter mouseleave').slideToggle("slow");var d=false;$('#TpMenu').hover(function(){d=true;},function(){d=false;window.setTimeout(function(){if(!d){$("#TpMenu").unbind('mouseenter mouseleave').slideUp("slow");}},1000)});}