
$("document").ready(function()
{$('.reposSummary').hover(function()
{$(this).addClass('hovering');$('.projButton',this).slideDown('fast');},function()
{$(this).removeClass('hovering');$('.projButton',this).slideUp('fast');});$('#content .reposSummary h3 span.whiteHilightedIcon').live('click',function(){var pThis=$(this);var summary=pThis.closest('.reposSummary');var cont=summary.parent();var scrollTo=false;var pinned=$('.projPin1',cont);var setPin=false;if(summary.hasClass('projPin1')){summary.removeClass('projPin1');summary.addClass('projPin0');}
else{summary.removeClass('projPin0');summary.addClass('projPin1');scrollTo=true;setPin=true;}
var movedItem=null;if(pinned.length>0){if($('h3.ui-widget-header a',pinned[pinned.length-1]).attr('href')!=$('h3.ui-widget-header a',summary).attr('href'))
{movedItem=summary.insertAfter(pinned[pinned.length-1]);}}
else
{movedItem=summary.prependTo(cont);}
var rname=pThis.data('rname');var pid=parseInt(pThis.data('pid'));$.ajax({type:'POST',contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify({reposName:rname,projectId:pid,setPin:setPin}),url:_reposRoot+'/ProcessDefinition.asmx/SetRepositoryPin'});if(scrollTo)
{$('html, body').animate({scrollTop:movedItem.offset().top-30},150);}});});