').attr('src',$(this).attr('href'));maxHeight=Math.max(maxHeight,$(this).attr('data-bigImageHeight'));});$(bigImageId).css('height',maxHeight>0?maxHeight.toString()+'px':'auto');}$(galleryId+' li a').click(function(e){e.preventDefault();$(bigImageId+' span > img').attr('src',$(this).attr('href'));$(bigImageId+' span > img').attr('alt',$('>img',this).attr('src'));$(bigImageId+' span > div').html($('>img',this).attr('alt'));if($(bigImageId+' span > div').html()==''){$(bigImageId+' span > div').hide();}else{$(bigImageId+' span > div').show();}$(galleryId+' li a').removeClass('active');$(this).addClass('active');document.location.hash=galleryPrefix+'-'+$(this).attr('data-id');});var flag=false;if(document.location.hash.indexOf(galleryPrefix)>-1){var result=(new RegExp(galleryPrefix+'-([0-9]+)')).exec(document.location.hash);if(typeof(result[1])!='undefined'){$link=$('#gallery-'+galleryPrefix+'-link-'+result[1]);$('#gallery-'+galleryPrefix+'-link-'+result[1]).click();$(galleryId).data('jcarousel').scroll($(galleryId+' li').index($link.parents('li:first')));flag=true;}}if(flag===false){$(galleryId).find('li:first a').click();}}});