function showlicense(publicationid)
{var webroot=document.getElementById('webroot').value;var lic=webroot+"browse/license/"+publicationid;$("#license_pop").load(lic,function(){$("#license_pop").append("<br \><br \><div style='text-align: center;'><a href='#' onclick='closeVerify()' class='jqmClose'>Close</a></div>");});$('#license_pop').jqmShow();}
function closeVerify()
{$('#license_pop').jqmHide();}
$(document).ready(function(){iniTthumbDownLink();iniTthumbUpLink();initQuickComment();$('a.goToComments').click(function()
{$('html,body').animate({scrollTop:$('.quickCommentsWrapper').offset().top},'slow');});$('a.deleteComment img').fadeTo("fast",0.4);$('a.deleteComment').click(function()
{if(confirm('Do you want really want to delete this comment?'))
{$.get($('#webroot').val()+'browse/publication/'+$(this).attr('pubid')+'?commentdelete='+$(this).attr('element'));$(this).parents('div.commentElementWrapper').remove();}});});function iniTthumbUpLink()
{$('a#thumbUpLink').click(function(){$.get($('#webroot').val()+'browse/publication/'+$(this).attr('pubid')+'?thumbup=true');$('#thumbDownStatic').remove();$('#thumbDownLink').remove();$(this).after('<a style="cursor:pointer;"  pubid="'+$(this).attr('pubid')+'" id="thumbDownLink"><img border="0" src="'+$('#webroot').val()+'images/thumbdown.png"  alt="plus"/> </a>');iniTthumbDownLink();$(this).after('<img id="thumbUpStatic" border="0" src="'+$('#webroot').val()+'images/thumbupSelected.png"  alt="plus"/> ');$(this).remove();showThumbDialog();});}
function iniTthumbDownLink()
{$('a#thumbDownLink').click(function(){$.get($('#webroot').val()+'browse/publication/'+$(this).attr('pubid')+'?thumbdown=true');$('#thumbUpStatic').remove();$('#thumbUpLink').remove();$(this).before('<a style="cursor:pointer;"  pubid="'+$(this).attr('pubid')+'" id="thumbUpLink"><img border="0" src="'+$('#webroot').val()+'images/thumbup.png"  alt="plus"/> </a>');iniTthumbUpLink();$(this).after('<img id="thumbDownStatic" border="0" src="'+$('#webroot').val()+'images/thumbdownSelected.png"  alt="plus"/> ');$(this).remove();showThumbDialog();});}
function initQuickComment()
{$('.quickCommentText').click(function()
{if($('a.register').length==0)
{$(".quickCommentText").hide();$('.quickCommentTextFull').show().focus();$('.submitQuickComment').show();}
else
{window.location.replace($('#webroot').val()+'user/login');}});}
function showThumbDialog()
{var html='';html+="<b>Your rating has been saved</b><br/>";html+="Please leave a comment (Optional)<br/>";html+=$('div.addCommentWrapper').html();html+="<br \><br \><div style='text-align: center;'><a href='#' onclick='closeVerify()' class='jqmClose'>Close</a></div>";$("#rating_pop").html(html);$('#rating_pop').jqmShow();initQuickComment();}
