
function showDialog(b,f,w,v){if(typeof(w)=='undefined'||w=='')w=270;if(typeof(v)=='undefined')$('object,embed').css('visibility','hidden');$('select').css('visibility','hidden');$('<div id="dlgD" style="height:'+$('#css1').height()+'px"></div>').appendTo('body');$('<div id="dlgO" style="width:'+w+'px"><div id="dlgI"><div id="dlgT">'+b+'</div><div id="dlgB">'+f+'</div></div></div>').appendTo("body");posDialog();$('#dlgO').fadeIn();$(document).keydown(escDialog);}
function escDialog(e){if(e.keyCode==27)hideDialog();}
function posDialog(){w=$(window);h=(w.height()-$('#dlgO').height())/2+w.scrollTop()-50;if(h<w.scrollTop())h=w.scrollTop();$('#dlgO').css("top",h+"px");$('#dlgO').css("left",(w.width()-$('#dlgO').width())/2+w.scrollLeft()+"px");}
function hideDialog(){$('#dlgD,#dlgO').remove();$('select,object,embed').css('visibility','visible');$(document).unbind('keydown',escDialog);}
function replDialog(t,b){if(typeof(t)!='undefined'&&t!='')$('#dlgT').html(t);if(typeof(b)!='undefined'&&b!='')$('#dlgB').html(b);posDialog();}
function addBookmark(){u=location.href;t=$('title').text();if((typeof window.sidebar=='object')&&(typeof window.sidebar.addPanel=='function'))window.sidebar.addPanel(t,u,'');else if(typeof window.external=='object')window.external.AddFavorite(u,t);else if(window.opera&&document.createElement){var a=document.createElement('A');if(!a)return false;a.setAttribute('rel','sidebar');a.setAttribute('href',u);a.setAttribute('title',t);a.click();}}
var SInV='p';$(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[SInV]+'</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();});});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=','v':'/video/?search&snm=','g':'/groups/?snm=','o':'/ann/?search&snm=','e':'/events/?search&snm=','n':'/notes/?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)});}
var _gaq=_gaq||[];_gaq.push(['_setAccount','UA-20123750-1']);_gaq.push(['_setDomainName','none']);_gaq.push(['_setAllowLinker',true]);_gaq.push(['_trackPageview']);$(function(){var ga=document.createElement('script');ga.type='text/javascript';ga.async=true;ga.src=('https:'==document.location.protocol?'https://ssl':'http://www')+'.google-analytics.com/ga.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s);});
