
$(document).ready(function(){$("#tabs").tabs();jQuery.extend(jQuery.expr[":"],{isImageHref:function(a,i,m){var hrefao=a.getAttribute('href');if(hrefao!=null&&hrefao!=undefined){var hrefa=hrefao.toUpperCase();if(hrefa.length>4){var lastFour=hrefa.substring(hrefa.length-4,hrefa.length).toUpperCase();if((lastFour=='.GIF')||(lastFour=='.PNG')||(lastFour=='.JPG')){return true;}}
if(hrefa.length>5){var lastFive=hrefa.substring(hrefa.length-5,hrefa.length).toUpperCase();if(lastFive=='.JPEG'){return true;}}}
return false;}});$(".postBody a:isImageHref:has(>img)").fancybox();var dParams={processId:processId,processHistoryId:tprocHistoryId,useFrozen:false};$.ajax({type:'POST',contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(dParams),url:_reposRoot+'/ProcessDefinition.asmx/GetProcessRelationshipsJson',success:function(data){onGotRelationshipJson(data);}});$("#ldNext").click(function(){if(currentChange!=null)
{currentChange=$(currentChange).nextALL('span.DiffAdded,span.DiffRemoved').first();}
if(currentChange==null||currentChange.length==0)
{currentChange=$('span.DiffAdded,span.DiffRemoved').first();}
if(currentChange!=null&&currentChange.length>0){if(!isElementInView(currentChange))
$('html,body').animate({scrollTop:currentChange.offset().top},500);if($('#ldToggle').text()=='Show changes'&&$(currentChange).hasClass('DiffRemoved')){currentChange.effect("highlight",function(){$(currentChange).fadeOut(1000);},1500);}
else{currentChange.effect("highlight",{},1500);}}});$("#ldPrev").click(function(){if(currentChange!=null)
currentChange=$(currentChange).prevALL('span.DiffAdded,span.DiffRemoved').first();if(currentChange==null||currentChange.length==0)
currentChange=$('span.DiffAdded,span.DiffRemoved').last();if(currentChange!=null&&currentChange.length>0){if(!isElementInView(currentChange))
$('html,body').animate({scrollTop:currentChange.offset().top},500);if($('#ldToggle').text()=='Show changes'&&$(currentChange).hasClass('DiffRemoved')){currentChange.effect("highlight",function(){$(currentChange).fadeOut(1000);},1500);}
else{currentChange.effect("highlight",{},1500);}}});$('#ldToggle').click(function(){if($(this).text()=='Show changes'){$('.DiffRemoved').show();$('.DiffAdded').css({background:'#e0ffe0'});$(this).text('Hide changes');}
else{$('.DiffRemoved').hide();$('.DiffAdded').css({background:'#FFFFFF'});$(this).text('Show changes');}});$(window).scroll(function(){$('#ldChanges').stop().animate({"marginTop":($(window).scrollTop()+30)+"px"},"slow");});});function isElementInView(elem){var docViewTop=$(window).scrollTop();var docViewBottom=docViewTop+$(window).height();var elemTop=$(elem).offset().top;var elemBottom=elemTop+$(elem).height();return((elemBottom>=docViewTop)&&(elemTop<=docViewBottom)&&(elemBottom<=docViewBottom)&&(elemTop>=docViewTop));}
var currentChange=null;