1 2;AlbBaseObj.prototype.RenderCaptcha=function(t,e){var a=this;if(typeof grecaptcha==='undefined'){if($('head #captcha_script').length==0){var i=$('<script/>').attr('id','captcha_script').attr('src',t);$('head').append(i)};setTimeout(function(){a.RenderCaptcha(t,e)},500)} 3else{grecaptcha.ready(function(){grecaptcha.render(a.GetElId('recaptcha'),{"sitekey":e})})}};AlbBaseObj.prototype.SubmitWithCaptcha=function(e,t){if(typeof t=='undefined')t=this.GetRenderContainer();var a=$('textarea[name=g-recaptcha-response]',t).val();e(a)};AlbBaseObj.prototype.DoneActionsAfterCaptcha=function(){if(window.grecaptcha){grecaptcha.reset()}}; 4;$$.tmpl_oCheckPwdProps={iMinLength: 58,bUpperAndLower: 6true,bNumeric: 7true,bSpecialChars: 8true,sMsgLength:'Password must be at least 8 characters',sMsgUpperLower:'Password must contain at least one uppercase and one lowercase letter',sMsgNumeric:'Password must contain at least one number',sMsgSpecial:'The password must contain at least one special character ($,&,%,...)',sMsgSpaces:'User password cannot contain spaces',sMsgUserName:'User password cannot match username',sMsgDifferent:'The new password cannot match the current password',sMsgRepeatPwd:'Password confirmation is not correct',sMsgRepeat:'Confirmation does not match'};$$.tmpl_oValidationMsgs[$$.tmpl_oCheckResults.CHECK_OK]='';$$.tmpl_oValidationMsgs[$$.tmpl_oCheckResults.CHECK_ERR_REPETITION]='Confirmation does not match';$$.tmpl_oValidationMsgs[$$.tmpl_oCheckResults.CHECK_ERR_REQUIRED]='Required value';$$.tmpl_oValidationMsgs[$$.tmpl_oCheckResults.CHECK_ERR_SELECT_ONE]='Choose at least one';$$.tmpl_oValidationMsgs[$$.tmpl_oCheckResults.CHECK_ERR_BAD_FORMAT]='Invalid format';$$.tmpl_oValidationMsgs[$$.tmpl_oCheckResults.CHECK_ERR_COMBO_TEXT_NO_SELECTION]='Text does not correspond to any element';$$.tmpl_oValidationMsgs[$$.tmpl_oCheckResults.CHECK_ERR_LESS_THAN]='The number must be less than or equal to $1';$$.tmpl_oValidationMsgs[$$.tmpl_oCheckResults.CHECK_ERR_GREATER_THAN]='The number must be greater than or equal to $1';$$.tmpl_sTxtYes='Yes';$$.tmpl_sTxtNo='No';$$.tmpl_sTxtClose='Close';$$.tmpl_aMonths=['January','February','March','April','May','June','July','August','September','October','November','December'];;$.ajaxSetup({GetErrorMessage:function(s,a){var e='Error executing request to server:\n';if(s.status==0){e+='You are offline\n Please Check Your Network.'} 9else if(s.status==404){e+='Requested URL not found.'} 10else if(s.status==500){e+='Internal Server Error.'} 11else if(a=='parsererror'){e+='Internal error. Try again.'} 12else if(a=='timeout'){e+='Request Time out.'} 13else{e+='Unknow Error:\n'+s.responseText};return e}});AskServer=function(s){AskServer.TipShown=!1;if(s.bAsync==null)s.bAsync=!0;if(s.sMethod==null)s.sMethod='POST';if(s.bShowProgress==null)s.bShowProgress=!0;if(s.sProgressMsg==null)s.sProgressMsg='Comunicando con el servidor...';if(s.bShowProgress){if($('#AlbAjaxMsg').length==0){$('body').append('<div id="AlbAjaxMsg" '+' style="z-index: 100; background-color: yellow; border: solid black 1px; position: fixed; top: 10px; left: 10px; vertical-align: center">'+'</div>')};$('#AlbAjaxMsg').text(s.sProgressMsg);$('#AlbAjaxMsg').hide();$('#AlbAjaxMsg').show();AskServer.TipShown=!0};if(typeof s.sParams=='undefined')s.sParams='';if(s.sMethodHash){if(s.sParams.length>0)s.sParams+='&';s.sParams+='aA='+s.sMethodHash};for(var e in s.oParams){if(s.sParams.length>0)s.sParams+='&';if(typeof s.oParams[e]=='object')s.sParams+='aj_'+e+'='+encodeURIComponent(JSON.stringify(s.oParams[e]));else s.sParams+='aj_'+e+'='+encodeURIComponent(s.oParams[e])};if(s.iUIH==0){if(s.sParams.length>0)s.sParams+='&';s.sParams+='bUIH=0'};window.setTimeout(function(){$.ajax({async:s.bAsync,cache:!1,type:s.sMethod,url:s.sUrl,data:s.sParams,dataType:'json',success:function(e){AskServer.TipShown=!1;if(s.fPostActions)s.fPostActions(e);else if(e.sMsg){alert(e.sMsg)};if(!AskServer.TipShown)$('#AlbAjaxMsg').hide()},error:function(e,a){if(e.status!=0){if(s.fPostActions){var o={};o.bOk=!1;o.sMsg=this.GetErrorMessage(e,a);s.fPostActions(o)} 14else{alert(this.GetErrorMessage(e,a))};$('#AlbAjaxMsg').hide()}}})}
14,0)};PrepareAjaxFileUpload=function(s){if(typeof s.bMulti=='undefined')s.bMulti=!1;return $('#'+s.sInputFileId).fileupload({url:s.sUrl,dataType:'json',singleFileUploads:!s.bMulti,add:function(a,e){if(!s.bHiddenBtn)$('#'+s.sUploadBtnId).show();if(!s.bAllowMultipleEvents)$('#'+s.sUploadBtnId).off('click.fileupload');$('#'+s.sUploadBtnId).on('click.fileupload',function(){if(e.files.length==0)return;if(s.fSubmitCheck){if(!s.fSubmitCheck(e))return};PrepareAjaxFileUpload.TipShown=!1;if(s.bAsync==null)s.bAsync=!0;if(s.sMethod==null)s.sMethod='POST';if(s.bShowProgress==null)s.bShowProgress=!0;if(s.sProgressMsg==null)s.sProgressMsg='Comunicando con el servidor...';if(s.bShowProgress){if($('#AlbAjaxMsg').length==0){$('body').append('<div id="AlbAjaxMsg" '+' style="z-index: 100; background-color: yellow; border: solid black 1px; position: fixed; top: 10px; left: 10px; vertical-align: center">'+'</div>')};$('#AlbAjaxMsg').text(s.sProgressMsg);$('#AlbAjaxMsg').hide();$('#AlbAjaxMsg').show();PrepareAjaxFileUpload.TipShown=!0};e.formData={};if(s.sMethodHash){e.formData.aA=s.sMethodHash};if(s.bMulti)e.formData['aj__upload_several']=1;else e.formData['aj__upload_file']=1;for(var a in s.oParams){if(s.oParams[a]instanceof jQuery){if(s.oParams[a].is("input")||s.oParams[a].is("select"))e.formData['aj_'+a]=s.oParams[a].val();if(s.oParams[a].is("checkbox"))e.formData['aj_'+a]=s.oParams[a].is(':checked')?1:0} 15else{if(typeof s.oParams[a]=='object')e.formData['aj_'+a]=JSON.stringify(s.oParams[a]);else e.formData['aj_'+a]=s.oParams[a]}};if(s.iUIH==0){e.formData.bUIH=0};e.submit()})},done:function(e,a){var o=a.result;PrepareAjaxFileUpload.TipShown=!1;if(s.fPostActions)s.fPostActions(o);else if(o.sMsg){alert(o.sMsg)};if(!PrepareAjaxFileUpload.TipShown)$('#AlbAjaxMsg').hide()},error:function(s,e){alert("Error uploading file");$('#AlbAjaxMsg').hide()}})};;$.datePicker.prepareElements=function(e){$(e).each(function(){var e=$
15(this);if(e[0].tagName=='INPUT'){e.attr('autocomplete','off');e.on('click',function(){var t=e.val(),P=t?$.datePicker.defaults.dateParse(t):null,a={views:{month:{show:t?P:'',selected:t?[P]:[]}},element:e};if(e.attr('alb-rd'))a.restrictDates=e.attr('alb-rd');var r=$.datePicker.api.show(a);e.data('widget',r)})}})};function configureDatePicker(){var e=['January','February','March','April','May','June','July','August','September','October','November','December'],t=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];$.datePicker.defaults.strings.months=e;$.datePicker.defaults.strings.days=t;$.datePicker.defaults.views.month.firstDayOfWeek=1;$.datePicker.defaults.dateFormat=function(e){return(e.getDate()<10?'0':'')+e.getDate()+'/'+((e.getMonth()+1)<10?'0':'')+(e.getMonth()+1)+'/'+e.getFullYear()};$.datePicker.defaults.dateParse=function(P){if(typeof P=='string'){var e=P.split('/'),t=!0,r=null;if(e.length==3){for(var a=0;a<e.length&&t;a++){if(parseInt(e[a])!=e[a])t=!1};if(t){r=new Date(e[2],e[1]-1,e[0]);if(r.getDate()!=e[0])t=!1}} 16else{t=!1};if(t)return r;return null};return P}};configureDatePicker();;class AlbGalleryPhoto extends AlbBaseObj{constructor(t,e,i){super(t,e,i)};LoadInfo(t){if(!t.iWidthPixelsThumb&&!t.iHeightPixelsThumb){t.iWidthPixelsThumb=350;t.iHeightPixelsThumb=350};super.LoadInfo(t);this.ParseNumericFields();this.iWidthPixelsThumb=parseInt(this.iWidthPixelsThumb);this.iHeightPixelsThumb=parseInt(this.iHeightPixelsThumb);this.closeAllLightboxContent=!1;this.lightboxBtnClicked=!1};AdjustPos(){this.GetEl("ph").css('margin-right',this.iPaddingRight).css('width',this.GetWidth()).css('height',this.GetHeight());var e=this.GetWidth()/this.GetHeight(),i=this.iWidthPixelsThumb/this.iHeightPixelsThumb;if(this.fPostScale!=1){var t=Math.round(this.GetHeight()/this.fPostScale);this.GetEl("ph").css('background-color','#EEEEEE');this.GetEl("cont").css('overflow','hidden').css('margin-right',this.iPaddingRight).css('width',this.GetWidth()).css('background-color','#EEEEEE').css('overflow','hidden').css('height',(t+Math.floor(this.GetHeight()-t)/2));this.GetEl('theimage').css('border-top','solid #EEEEEE '+(Math.floor(this.GetHeight()-t)/2)+'px').css('border-bottom','solid #EEEEEE '+(Math.floor(this.GetHeight()-t)/2)+'px').css('height',Math.ceil((this.iHeightPixelsThumb+this.iBMS)*t/this.iHeightPixelsThumb))} 17else{this.GetEl("cont").css('margin-right',this.iPaddingRight).css('width',this.GetWidth()).css('height',this.GetHeight()).css('overflow','hidden').css('background-color','#EEEEEE');this.GetEl('theimage').css('width','100%').css('padding','').css('border','').css('height',Math.ceil((this.iHeightPixelsThumb+this.iBMS)*this.GetHeight()/this.iHeightPixelsThumb))}};SetFinalDimensions(t,e){if(t>this.iWidthPixelsThumb&&(this.iHeightPixelsThumb>200||this.iWidthPixelsThumb>200))this.iFinalWidth=this.iWidthPixelsThumb;else this.iFinalWidth=t;this.iFinalHeight=e};GetInitialWidth(){return this.fInitialScale*(this.iWidthPixelsThumb?this.iWidthPixelsThumb:550)};GetWidth(){return this.iFinalWidth};GetHeight(){return this.iFinalHeight};SetClickEvent(t){this.GetEl("ph").find('.detailink').addBack('.detailink').click(t)};GetThumbUrl(){if(this.iIdAssetType== 182){return this.sUrlVideoPosterThumb} 19else{return this.sUrlThumb}};CalcAddLightboxContentOffset=function(){if($(window).width()-this.GetEl('addLightboxContent').offset().left-100<this.GetEl('addLightboxContent').width()){this.GetEl('addLightboxContent').addClass('offsetAddLightboxContent');if(this.GetParent().sRenderView=='classic'){this.GetEl('addLightboxContent').addClass('stillRightBottomArrow')} 20else{this.GetEl('addLightboxContent').addClass('stillMiddleBottomArrow')};this.GetEl('addLightboxContent').removeClass('stillLeftBottomArrow');this.GetEl('addLightboxContentTransparent').addClass('offsetAddLightboxContentTransparent')} 21else{this.GetEl('addLightboxContent').removeClass('offsetAddLightboxContent');if($(window).width()-this.GetEl('addLightboxContent').offset().left-100<this.GetEl('addLightboxContent').width()){this.GetEl('addLightboxContent').addClass('offsetAddLightboxContent');return};if(this.GetParent().sRenderView=='classic'){this.GetEl('addLightboxContent').removeClass('stillRightBottomArrow')} 22else{this.GetEl('addLightboxContent').removeClass('stillMiddleBottomArrow')};this.GetEl('addLightboxContent').addClass('stillLeftBottomArrow');this.GetEl('addLightboxContentTransparent').removeClass('offsetAddLightboxContentTransparent')}};CalcRemoveLightboxContentOffset=function(){if($(window).width()-this.GetEl('removeLightboxContent').offset().left-100<this.GetEl('removeLightboxContent').width()){this.GetEl('removeLightboxContent').addClass('offsetAddLightboxContent');if(this.GetParent().sRenderView=='classic'){this.GetEl('removeLightboxContent').addClass('stillRightBottomArrow')} 23else{this.GetEl('removeLightboxContent').addClass('stillMiddleBottomArrow')};this.GetEl('removeLightboxContent').removeClass('stillLeftBottomArrow');this.GetEl('removeLightboxContentTransparent').addClass('offsetAddLightboxContentTransparent')} 24else{this.GetEl('removeLightboxContent').removeClass('offsetAddLightboxContent');if($(window).width()-this.GetEl('removeLightboxContent').offset().left-100<this.GetEl('removeLightboxContent').width()){this.GetEl('removeLightboxContent').addClass('offsetAddLightboxContent');return};if(this.GetParent().sRenderView=='classic'){this.GetEl('removeLightboxContent').removeClass('stillRightBottomArrow')} 25else{this.GetEl('removeLightboxContent').removeClass('stillMiddleBottomArrow')};this.GetEl('removeLightboxContent').addClass('stillLeftBottomArrow');this.GetEl('removeLightboxContentTransparent').removeClass('offsetAddLightboxContentTransparent')}};ShowAddToLightboxTip(t){if(this.GetCurrentLightboxName()){this.GetEl("addLightboxContentName").html('Add to $1'.replace(' $1',' <span style="font-weight: bold">'+this.GetCurrentLightboxName()+'</span>'));this.GetEl("addLightboxContentName2").html('Remove from $1'.replace(' $1',' <span style="font-weight: bold">'+this.GetCurrentLightboxName()+'</span>'));this.GetEl('otherLightBox').show();this.GetEl('otherLightBox2').show()} 26else{this.GetEl("addLightboxContentName").html('Add to new lightbox');this.GetEl('otherLightBox').hide();this.GetEl('otherLightBox2').hide()};if(t){this.GetEl('addLightboxContent').show();this.CalcAddLightboxContentOffset();this.GetEl('removeLightboxContent').hide()} 27else{this.GetEl('addLightboxContent').hide();this.GetEl('removeLightboxContent').show();this.CalcRemoveLightboxContentOffset()};var e=this.GetEl("btnAddLightbox");if(!t)e=this.GetEl("btnRemoveLightbox");if(t){this.GetEl("addLightboxContent").css('left',e.position().left-15+(e.width()/2)).show()} 28else{this.GetEl("removeLightboxContent").css('left',e.position().left-15+(e.width()/2)).show()}};SetMoveTopPhotoEvent=function(){var t=this;this.SetClickEvent(function(t){t.stopPropagation();$('#contents').scrollTop(0);return!1})};
28SetClickEventOpenPhoto(){var t=this;this.SetClickEvent(function(e){e.stopPropagation();if($(window).width()>=768){if(t.GetParent()._options.bWithinOtherPhotoDetail){document.location.href=t.GetParent().oNavigation.GetPhotoDetailUrl(t.sUrl,!1,t.GetParent()._options.bOpenPhotosInline)} 29else{t.GetParent().oNavigation.OpenPhotoDetail(t.sUrl)};return!1} 30else{return!0}})};SetEvents(){var t=this,e=!1;this.GetEl('theimage').on('load',function(){t.GetEl('loading').hide()});this.GetEl('video').on('canplay',function(){t.GetEl('loading').hide()});this.SetClickEventOpenPhoto();this.GetEl("ph").find('.hover').addBack('.hover').on('mouseenter',this.ShowInfo.bind(this)).on('mouseleave',this.HideInfo.bind(this));this.GetEl("btnDownload").click(function(e){e.stopPropagation();if(t.GetParent()._options.bWithinOtherPhotoDetail){document.location.href=t.GetParent().oNavigation.GetPhotoDetailUrl(t.sUrl,!0,t.GetParent()._options.bOpenPhotosInline)} 31else{t.GetParent().oNavigation.OpenPhotoDetail(t.sUrl,!0,t.GetParent()._options.bOpenPhotosInline)};return!1});this.GetEl("btnAddToCartDisabled").click(function(e){e.stopPropagation();t.GetParent().oNavigation.RemoveFromCart(t.iId,function(){t.GetEl("btnAddToCart").show();t.GetEl("btnAddToCartDisabled").hide()});return!1});this.GetEl("btnAddToCart").click(function(e){e.stopPropagation();t.GetParent().oNavigation.AddToCart(t.iId,function(){t.GetEl("btnAddToCart").hide();t.GetEl("btnAddToCartDisabled").show()});return!1});this.GetEl("btnRemoveLightbox").click(function(i){t.closeAllLightboxContent=!1;t.lightboxBtnClicked=!0;i.stopPropagation();e=!1;t.GetParent().oNavigation.LightboxRemovePhoto(t.iId);return!1});this.GetEl("btnRemoveLightbox").mouseout(function(){e=!1;t.closeAllLightboxContent=!0;setTimeout(function(){if(!e){if(!t.lightboxBtnClicked)t.closeAllLightboxContent=!0;t.GetEl("removeLightboxContent").hide();t.GetEl("addLightboxContent").hide()}},10)});this.GetEl("btnRemoveLightbox").mousemove(function(e){if(!t.GetEl("removeLightboxContent").is(':visible'))t.ShowAddToLightboxTip(!1)});this.GetEl("btnRemoveLightbox").mouseover(function(i){e=!0;t.ShowAddToLightboxTip(!1)});this.GetEl("btnAddLightbox").click(function(i){t.lightboxBtnClicked=!0;t.closeAllLightboxContent=!1;e=!1;if(typeof top.oNavigation.oLeftArea.oCurLightbox.iId=='undefined'||!top.oNavigation.oLeftArea.oCurLightbox.iId||top.oNavigation.oLeftArea.oCurLightbox.iId<0){t.GetEl("addLightboxContent").hide();top.oNavigation.OpenCreateLightboxRightpanel(t.iId)} 32else{t.GetParent().oNavigation.LightboxAddPhoto(t.iId)};i.stopPropagation();return!1});this.GetEl("btnAddLightbox").mousemove(function(){if(!t.GetEl("addLightboxContent").is(':visible'))t.ShowAddToLightboxTip(!0)});this.GetEl("btnAddLightbox").mouseout(function(){t.closeAllLightboxContent=!0;e=!1;setTimeout(function(){if(!e){if(!t.lightboxBtnClicked)t.closeAllLightboxContent=!0;t.GetEl("removeLightboxContent").hide();t.GetEl("addLightboxContent").hide()}},10)});this.GetEl("btnAddLightbox").mouseover(function(i){e=!0;t.ShowAddToLightboxTip(!0)});this.GetEl("addLightboxContent").mouseover(function(){e=!0});this.GetEl("removeLightboxContent").mouseover(function(){e=!0});this.GetEl("otherLightBox").click(function(e){if(typeof top.oNavigation.oLeftArea.oCurLightbox.iId=='undefined'||!top.oNavigation.oLeftArea.oCurLightbox.iId||top.oNavigation.oLeftArea.oCurLightbox.iId<0){top.oNavigation.OpenCreateLightboxRightpanel(t.iId)} 33else{top.oNavigation.oLeftArea.ShowRightPanelUrl('Choose lightbox','/web/views/forms/v_choose_lightbox_right_panel.php?iIdPhoto='+t.iId+'&sUrl='+t.GetThumbUrl(),!0)};e.stopPropagation();return!1});this.GetEl("otherLightBox2").click(function(e){if(typeof top.oNavigation.oLeftArea.oCurLightbox.iId=='undefined'||!top.oNavigation.oLeftArea.oCurLightbox.iId||top.oNavigation.oLeftArea.oCurLightbox.iId<0){top.oNavigation.OpenCreateLightboxRightpanel(t.iId)} 34else{top.oNavigation.oLeftArea.ShowRightPanelUrl('Choose lightbox','/web/views/forms/v_choose_lightbox_right_panel.php?iIdPhoto='+t.iId+'&sUrl='+t.GetThumbUrl(),!0)};e.stopPropagation();return!1});this.GetEl("addLightboxContent").click(function(e){t.GetEl("btnAddLightbox").click();t.GetEl("addLightboxContent").hide();t.GetEl("removeLightboxContent").show();t.CalcRemoveLightboxContentOffset();e.stopPropagation();return!1});this.GetEl("removeLightboxContent").click(function(e){t.GetEl("btnRemoveLightbox").click();t.GetEl("removeLightboxContent").hide();t.GetEl("addLightboxContent").show();t.CalcAddLightboxContentOffset();e.stopPropagation();return!1});
34this.GetEl("addLightboxContent").mouseout(function(){t.closeAllLightboxContent=!0;t.lightboxBtnClicked=!1;e=!1;setTimeout(function(){if(!e){t.closeAllLightboxContent=!0;t.GetEl("removeLightboxContent").hide();t.GetEl("addLightboxContent").hide()}},10)});this.GetEl("removeLightboxContent").mouseout(function(){t.closeAllLightboxContent=!0;e=!1;t.lightboxBtnClicked=!1;setTimeout(function(){if(!e){t.closeAllLightboxContent=!0;t.GetEl("removeLightboxContent").hide();t.GetEl("addLightboxContent").hide()}},10)}); 35};IsInLightbox(){return this.GetParent().oNavigation.IsPhotoInCurLightbox(this.iId)};PrepareLightboxBtn(t){var e=this;if(this.IsInLightbox()){this.GetEl("btnRemoveLightbox").show();this.GetEl("btnAddLightbox").hide();if(t&&!this.closeAllLightboxContent){setTimeout(function(){e.ShowAddToLightboxTip(!1)},20)}} 36else{this.GetEl("btnRemoveLightbox").hide();this.GetEl("btnAddLightbox").show();if(t&&!this.closeAllLightboxContent){setTimeout(function(){e.ShowAddToLightboxTip(!0)},20)}};return!1};IsInCart(){return this.GetParent().oNavigation.IsPhotoInCart(this.iId)};PrepareCartBtn(){if(this.IsInCart()){this.GetEl("btnAddToCart").hide();this.GetEl("btnAddToCartDisabled").show()} 37else{this.GetEl("btnAddToCart").show();this.GetEl("btnAddToCartDisabled").hide()};return!1};PrepareDownloadLightboxView(){var t=this;t.GetEl('chkSelect').click(function(e){t.GetParent().GetParent().SelectPhoto(t.iId,$(this).is(':checked'));e.stopPropagation();return!1});this.SetClickEvent(function(){t.GetEl('chkSelect').prop('checked',!t.GetEl('chkSelect').prop('checked'));t.GetParent().GetParent().SelectPhoto(t.iId,t.GetEl('chkSelect').is(':checked'));return!1})};ShowOverlap(t){if(t)this.GetEl('overlap').show();else this.GetEl('overlap').hide()};ShowInfo(){this.PrepareLightboxBtn();this.PrepareCartBtn();this.GetEl("info").show();if(this.iIdAssetType== 382){try{this.PlayVideo()}catch(t){myslf.GetEl('video_loading').hide();myslf.GetEl('video_playing').hide()}}};HideInfo(){this.GetEl("info").hide();if(this.iIdAssetType== 392){this.StopVideo()}};SetDescrs(t,e,i){this.sHtmlDescr=t.replace(/<BR><br>/ig,'<br>');this.GetEl("htmldescr").html(this.sHtmlDescr);this.bHasFilm=i;this.GetEl('clapperboard').toggle(this.bHasFilm);this.sDescr=e;this.GetEl("descr").html(this.sDescr);$('.tip',this.GetEl('ph')).attr('attAlbTooltip',t)};
39AdjustRender(){if(this.dEndActiveLicense){var t;if(this.GetParent().sRenderView=='classic')t='/common/images/info-small.svg';else t='/common/images/info.svg';var i=$('<img>').addClass("icon").addClass("cursorarrow").attr('src',t).attr('attAlbTooltip','<div class="tooltipReusages">'+'<div>Current license</div>'+'<div>End of license: '+this.GetFormattedDate('dEndActiveLicense')+'</div>'+'</div>');$('.actions',this.GetEl('ph')).append(i);$("img.theimage",this.GetEl("ph")).addClass('reusage').addClass('case')};if(this.iIdAssetType== 402){this.GetEl("ph").on('mousemove',()=>{if(!this.IsVideoPlaying())this.PlayVideo()});this.GetEl("video").on('canplay',(e)=>{this.GetEl('video_loading').hide()}).on('waiting',(e)=>{this.GetEl('video_loading').show()}).on('playing',(e)=>{this.GetEl('video_playing').show()}).on('pause',(e)=>{this.GetEl('video_playing').hide()})}};GetSpecialCaseClass(){if(this.sSpecialCase)return'case '+this.sSpecialCase;return''};playingFrom=0;timeoutStop=null;timeoutPlay=null;numVideoPlayAttempts=0;PlayVideo(){var t=this.GetEl('video')[0];if(t){clearTimeout(this.timeoutStop);this.timeoutStop=null;if(this.timeoutPlay===null){let waitTime=Math.floor(Math.random()*(600-400+1))+400;this.timeoutPlay=setTimeout(()=>{t.muted=!0;if(!this.IsVideoPlaying()){let ok=!0;t.play().catch(err=>{if(err.name==="NotSupportedError"&&this.numVideoPlayAttempts<2){console.warn("Video "+this.sWebCode+" not ready, retrying...");this.GetEl('loading').show();t.load();this.timeoutPlay=null;this.numVideoPlayAttempts++;this.PlayVideo()} 41else{console.error("Other video error ("+this.sWebCode+"):",err)}});if(ok)this.numVideoPlayAttempts=0;this.playingFrom=Date.now()};this.timeoutPlay=null},waitTime)}}};IsVideoPlaying(){if(this.timeoutPlay!==null)return!1;const oVideo=this.GetEl('video')[0];return(oVideo&&oVideo.currentTime>0&&!oVideo.paused&&!oVideo.ended&&oVideo.readyState>2)};StopVideo(){clearTimeout(this.timeoutPlay);this.timeoutPlay=null;if(this.IsVideoPlaying()){if(Date.now()-this.playingFrom<500){this.timeoutStop=setTimeout(()=>{this.StopVideo();this.timeoutStop=null},Date.now()-this.playingFrom+1);return};const oVideo=this.GetEl('video')[0];try{oVideo.pause()}catch(t){console.log('EXCEPTION pause()',t);this.GetEl('video_loading').hide();this.GetEl('video_playing').hide()};if(navigator.vendor.indexOf('Apple')!=-1){if(navigator.userAgent.match(/Version\/1[24]\./)){oVideo.load()}}}};GetAltText(){if(!this.sDescr)return'';return this.sDescr.replace('"','\\"')};GetReusageTip(){if(this.dEndLicense>0){return'<div class="tooltipReusages"><div>Current license</div><div>End of license: '+this.GetFormattedDate('dEndLicense')+'</div></div>'};return''};GetCurrentLightboxName(){return this.GetParent().oNavigation.oLeftArea.oCurLightbox.sName}};;class AlbGallery extends AlbBaseObj{constructor(t,e,i,o){super(t,e,o);this.oNavigation=i};LoadInfo(t){this._options={max_height: 42350,next_page_width:150,next_page_max_width:300,padding_horiz:5,bIncremental:!1,bScrollLoading:!1,bScrollLoadingClassic:!1,iScrollHiddenPixelsLoadMore:1000,aMosaicViews:['mosaic','lightbox_download','detail_ris','lightbox_right_panel'],oFocusElement:!1,iContainerMargin:-1,mScrollContainer:$('#contents'),bWithinOtherPhotoDetail:!1,bOpenPhotosInline:!1,iItemsPerPageScrolling:100,sBaseUrl:'/en/search',iIdAssetType: 430};if(t.aPhotos&&t.aPhotos.length){for(var e=0;e<t.aPhotos.length;e++){if(this._options.iIdAssetType== 440){this._options.iIdAssetType=t.aPhotos[e].iIdAssetType} 45else{if(this._options.iIdAssetType!=t.aPhotos[e].iIdAssetType){this._options.iIdAssetType== 460;break}}}};if(this._options.iIdAssetType== 472){this._options.max_height= 48240};if(t.options){$.extend(this._options,t.options);delete t.options}; 49;if(!Cookies.get('resview'))Cookies.set('resview','mosaic',{expires:365}); 50;this.bFromRis=!1;super.LoadInfo(t);if(this.bFromRis){this.oSearchParams={ 51bR:1, 52iIS:this.iIdSearch}};if('aPhotos' in this){this.iCurPage=1;this.SetChildObjects('aPhotos',AlbGalleryPhoto,!0)} 53else{this.iCurPage=0;this.aPhotos=[]};this.lastWindowHeight=$(window).height();this.lastWindowWidth=$(window).width();var i=this;$(window).on('resize.gallery',this.ResizeEvent.bind(this));this.iLastScrollPos=0;this.iLastScrollCheckTs=0;this.iScrollTimeoutId=null;if(this.oPagination)this.iCurPage=parseInt(this.oPagination.iPage);this.tmpl_sTmplBasePath='/common/javascript/';this.iVideoPreloadPos=0;this.aVideoPosPreloadQueue=[];this.videoPreloadScrollTimeout=null};SetAsTemporary(){this._options.mScrollContainer.off('scroll.albgallery');clearTimeout(this.iScrollTimeoutId);this.iScrollTimeoutId=null};ScrollLoading(t){if(typeof t=='undefined')t=this.sRenderView;if(t=='classic')return this._options.bScrollLoadingClassic;return this._options.bScrollLoading};ResizeEvent(){var t=this;if($(window).height()==t.lastWindowHeight&&$(window).width()==t.lastWindowWidth){setTimeout(function(){if($(window).height()!=t.lastWindowHeight||$(window).width()!=t.lastWindowWidth){t.lastWindowHeight=Math.floor($(window).height());t.lastWindowWidth=Math.floor($(window).width());t.Recalc()}},100)} 54else{if($(window).height()!=t.lastWindowHeight||$(window).width()!=t.lastWindowWidth){t.lastWindowHeight=Math.floor($(window).height());t.lastWindowWidth=Math.floor($(window).width());t.Recalc()}}};Recalc(t){if(this._options.aMosaicViews.indexOf(this.sRenderView)!=-1){this.Calculate(this.GetRenderContainer());for(var e=0;e<this.aPhotos.length;e++){this.aPhotos[e].AdjustPos()};for(var e=0;e<3;e++){if(this.iMosaicSize==e)this.GetEl('photoscont').addClass('size'+e);else this.GetEl('photoscont').removeClass('size'+e)}};this.AdjustHeightForFooter();
54if(this._options.oFocusElement){if(!this.IsMobileDevice()){try{this._options.oFocusElement[0].focus({preventScroll:!0})}catch(i){}}};if(t>0&&this.sRenderView=='mosaic'){this._options.mScrollContainer.scrollTop(t)}};GetScrollWidth(){if(typeof this.iScrollWidth=='undefined'){var t=$('<div style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"><div style="height:100px;"></div>');$('body').append(t);var i=$('div',t).innerWidth();t.css('overflow-y','scroll');var e=$('div',t).innerWidth();$(t).remove();this.iScrollWidth=(i-e)};return this.iScrollWidth};GetMosaicScale(){return this.iMosaicSize*0.25+0.5};GetNextPageWidth(){return this._options.next_page_width*this.GetMosaicScale()};GetNextPageMaxWidth(){return this._options.next_page_max_width*this.GetMosaicScale()};Calculate(t){var a=Math.floor(t.width());if(this._options.iContainerMargin>0)a-=this._options.iContainerMargin*2;var c=this._options.max_height*this.GetMosaicScale();for(var e=0;e<this.aPhotos.length;e++){var s=this.aPhotos[e];s.fInitialScale=c/s.iHeightPixelsThumb;s.fPostScale=1;if(s.fInitialScale>1){s.fPostScale=s.fInitialScale;s.fInitialScale=1}};var o=0,d=0;for(var e=0;e<this.aPhotos.length;e++){var h=0;for(var i=o;i<=e;i++){h+=this.aPhotos[i].GetInitialWidth()};var l=(e-o)*this._options.padding_horiz,u=this.HasNextPage()&&e==this.aPhotos.length-1;if(u){h+=this.GetNextPageWidth();l+=this._options.padding_horiz};if(h>=a-l){d=o;var g=(a-l)/h,p=Math.round(c*g),n=0;for(var i=o;i<=e;i++){this.aPhotos[i].SetFinalDimensions(Math.round(this.aPhotos[i].GetInitialWidth()*g),p);if(i!=e)this.aPhotos[i].iPaddingRight=this._options.padding_horiz;else this.aPhotos[i].iPaddingRight=0;n+=this.aPhotos[i].GetWidth()+this.aPhotos[i].iPaddingRight};if(!u&&e>0){if(n!=a){this.aPhotos[e-1].iPaddingRight+=(a-n)}};o=e+1}};if(o<this.aPhotos.length)d=o;for(var e=o;e<this.aPhotos.length;e++){this.aPhotos[e].iPaddingRight=this._options.padding_horiz;this.aPhotos[e].SetFinalDimensions(Math.round(this.aPhotos[e].GetInitialWidth()),c)};if(!this._options.bIncremental&&!this.ScrollLoading()&&this.HasNextPage()){var P=this.aPhotos[this.aPhotos.length-1];P.iPaddingRight=this._options.padding_horiz;this.oNextPageDim={height:P.GetHeight()};var r=0;for(var e=d;e<this.aPhotos.length;e++){r+=this.aPhotos[e].GetWidth()+this.aPhotos[e].iPaddingRight};if(a-r<this.GetNextPageMaxWidth()){this.oNextPageDim.width=a-r} 55else{this.oNextPageDim.width=this.GetNextPageMaxWidth()};$('.next',this.GetRenderContainer()).css('width',this.oNextPageDim.width).css('height',this.oNextPageDim.height)}};SwitchView(t){if(t==this.sRenderView)return;if(this._options.bScrollLoadingClassic!=this._options.bScrollLoading){ 56;Cookies.set('resview',t,{expires:365}); 57;this.sRenderView=t;if(this.ScrollLoading(t))this.GotoPage(1,this._options.iItemsPerPageScrolling);else this.GotoPage(1)} 58else{$('.viewtype',top.document).removeClass('selected');$('.viewtype.'+t,top.document).addClass('selected');this.sRenderView=t;var e=this.GetRenderContainer();if(e)e.empty();window.scrollTo(0,0);if(this.ScrollLoading()){if(this.aPhotos.length>this.oPagination.iItemsPerPage){this.aPhotos.length=this.oPagination.iItemsPerPage;this.bAllScrollLoaded=!1};this.iCurPage=1}; 59;Cookies.set('resview',t,{expires:365}); 60;this.Render()}};RenderPagination(t,e){if(this.aPhotos.length==0){$(t).empty();return};if(typeof e=='undefined'){e=Cookies.get('resview')};this.sRenderView=e;var h=this.GetRenderContainer();this.Render2(t,'alb_gallery_pagination',{bNotAForm:!0});this.oPagRenderContainer=this.GetRenderContainer();this.SetRenderContainer(h);this.GetEl('pageForm',top.document).on('submit',this.Paginate.bind(this));var i=this;this.GetEl('mosaicsize',top.document).on('input',function(){i.iMosaicSize=parseInt($(this).val()); 61;if(i.oSearchParams. 62iPP>2){i.AppendMoveTopPhoto()};i.Recalc();var t=i.GetRenderContainer().width();setTimeout(function(){if(!0||t!=i.GetRenderContainer().width()){i.Recalc()}},800)});var s=[50,100,150],a=[];for(var o=0;o<s.length;o++){a.push({event:this.ItemsPerPage.bind(this,s[o]),text:s[o]})};this.oNavigation.AddDropDownMenu($('.options .numitems > div',top.document),a,!1,!1); 63};AdjustHeightForFooter(){if(this.bShowFooter){var t=$("footer").outerHeight();$('.albgallery').css('box-sizing','border-box').css('min-height',$(window).height()-t)}};Render(t,e,i,o){if(typeof i=='undefined'||i==''){if(typeof this.sRenderView=='undefined')i=Cookies.get('resview');else i=this.sRenderView;if(typeof i=='undefined'||i==''){i='mosaic'}} 64else{if(i=='classic'&&this._options.iIdAssetType== 652){i='mosaic'}};this.sRenderView=i;this.iMosaicSize=2;switch(i){case'mosaic':if(Cookies.get('mosaicsize'))this.iMosaicSize=parseInt(Cookies.get('mosaicsize'));else this.iMosaicSize=2;this.GetEl('mosaicsize',top.document).val(this.iMosaicSize);this.GetEl('mosaicsize',top.document).show();this.bShowFooter=!0;this.RenderMosaic(t,e);break;case'detail_ris':this.bShowFooter=!1;this.RenderRisDetail(t,e);break;case'lightbox_download':this.bShowFooter=!1;
65this.RenderLightboxDownload(t,e);break;case'lightbox_right_panel':this.bShowFooter=!1;this.RenderLightboxRightPanel(t);break;default:this.GetEl('mosaicsize',top.document).hide();this.bShowFooter=!0;this.RenderClassic(t,e);break};this.GetEl('margin').css('margin-right',this._options.iContainerMargin).css('margin-left',this._options.iContainerMargin);if(this._options.oFocusElement){if(!this.IsMobileDevice())try{this._options.oFocusElement.focus()}catch(a){}};for(var s=0;s<this.aPhotos.length;s++){this.aPhotos[s].AdjustRender()};this.VideoPreloadProcessQueue();this.AdjustHeightForFooter();this.PreparePagination();if(this.oNavigation)this.oNavigation.RefreshCartStatus();this.Recalc(o);var h=this,r=this.GetRenderContainer().width();setTimeout(function(){if(r!=h.GetRenderContainer().width()){h.Recalc(o)}},400)};RenderRisDetail(t,e){this.Render2(t,'alb_gallery_detail_ris',{bAppend:!e,bNotAForm:!0});for(var i=0;i<this.aPhotos.length;i++){this.aPhotos[i].SetEvents(!0)}};LoadMoreScrollResults(){if(!this.bCalculatingScroll&&!this.bAllScrollLoaded){this.bCalculatingScroll=!0;var t=this,e=this._options.mScrollContainer.scrollTop(),o=this._options.mScrollContainer.prop('scrollHeight'),h=this._options.mScrollContainer.height(),s=o-e;if(this.iLastScrollPos!=e){var a=Date.now();this.iLastScrollPos=e;clearTimeout(this.iScrollTimeoutId);this.iScrollTimeoutId=setTimeout(()=>{var i=[['iSp',e]];if(this.sRenderView)i.push(['sGs',this.sRenderView]);top.oNavigation.setHistoParams(i,!0);this.iLastScrollPos=this.iLastScrollPos;this.iLastScrollCheckTs=Date.now();this.iScrollTimeoutId=null},100)};this.oSearchParams. 66iPP=this.iCurPage+1;if(s<=this._options.iScrollHiddenPixelsLoadMore){if(this.ScrollLoading())$('.albgallery div.loadingscroll').show();AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',sMethodHash:'',bShowProgress:!1,oParams:{oSearchParams:this.oSearchParams},fPostActions:function(e){if(e.bOk){t.AppendPhotos(e.mResults.aPhotos,!1);if(e.mResults.oPagination){t.oPagination=e.mResults.oPagination;top.oNavigation.oTextSummary.UpdateTotalAmount(e.mResults.oPagination.iTotalNumItems,e.mResults.oPagination.bRS)};t.iCurPage=parseInt(e.mResults.iCurPage);if(e.mResults.aPhotos.length==0){t.bAllScrollLoaded=!0;if(t.oSearchParams. 67iPP>2){t.AppendMoveTopPhoto()}};if(t.oSearchParams&&('replaceState' in window.history)){top.oNavigation.setHistoParam('iPP',t.iCurPage,!0)};t.bCalculatingScroll=!1;$('.albgallery div.loadingscroll').hide();t.LoadMoreScrollResults()} 68else{console.log('error loading results')}}})} 69else{t.bCalculatingScroll=!1}}};LoadVideoPosterWithRetry(t,i,retries=3){function attempt(o){return new Promise((resolve,reject)=>{const img=new Image();img.onload=()=>{t.poster=i;resolve()};img.onerror=(e)=>{if(o>1){let waitTime=Math.floor(Math.random()*(800-200+1))+200;setTimeout(()=>attempt(o-1).then(resolve).catch(reject),waitTime)} 70else{reject(new Error("Failed to load poster ["+i+"] after retries"))}};img.src=i})};return attempt(retries)};SetScrollEvent(){this._options.mScrollContainer.off('scroll.albgallery').on('scroll.albgallery',(event)=>{this.LoadMoreScrollResults();clearTimeout(this.videoPreloadScrollTimeout);this.videoPreloadScrollTimeout=setTimeout(()=>{let videos=document.querySelectorAll("video");videos.forEach(video=>{if(video.poster&&video.preload!='none')return;const rect=video.getBoundingClientRect();let dist;if(rect.top<0)dist=-rect.top;else dist=rect.top-window.innerHeight;if(dist<1500){if(!video.poster){this.LoadVideoPosterWithRetry(video,video.dataset.poster)}};if(dist<700){if(video.preload=='none'){this.aVideoPosPreloadQueue.push(video.dataset.pos);this.VideoPreloadProcessQueue()}}});this.videoPreloadScrollTimeout=null},200)})};RenderClassic(t,e){this.Render2(t,'alb_gallery_classic',{bAppend:!e,bNotAForm:!0});if(this.ScrollLoading()){this.SetScrollEvent();this.LoadMoreScrollResults()};for(var i=0;i<this.aPhotos.length;i++){if(this.aPhotos[i].iIdAssetType== 712){if(i>=AlbGallery.VIDEO_FIRST_PRELOAD){if(this.aPhotos[i].iIdAssetType== 722){this.#videoObserver.observe(this.aPhotos[i].GetEl('video')[0])}}};this.aPhotos[i].SetEvents()};$(window).off('resize.gallery')};RenderLightboxRightPanel(t){this.Calculate(t);this.Render2(t,'alb_gallery_lightbox_right_panel',{bAppend:!1,bNotAForm:!0});for(var e=0;e<this.aPhotos.length;e++){this.aPhotos[e].SetClickEventOpenPhoto()}};
72RenderLightboxDownload(t,e){var i=!1;if(typeof t=='undefined'){i=this.GetRenderContainer()} 73else{if(e==null)e=!0;if(typeof t=='string')i=$('#'+t);else i=t};this.Calculate(i);this.Render2(i,'alb_gallery_lightbox_download',{bAppend:!e,bNotAForm:!0});for(var o=0;o<this.aPhotos.length;o++){this.aPhotos[o].PrepareDownloadLightboxView()}};RenderMosaic(t,e){var o=!1,s=this;if(typeof t=='undefined'){o=this.GetRenderContainer()} 74else{if(e==null)e=!0;if(typeof t=='string')o=$('#'+t);else o=t};this.Calculate(o);this.Render2(o,'alb_gallery_mosaic',{bAppend:!e,bNotAForm:!0,oExtraParams:{VIDEO_FIRST_PRELOAD:AlbGallery.VIDEO_FIRST_PRELOAD}});if(this.HasNextPage()){$('.next',this.GetRenderContainer()).css('width',this.oNextPageDim.width).css('height',this.oNextPageDim.height).show().on('click',function(){s.GotoPage(parseInt(s.oPagination.iPage)+1)})} 75else{$('.next',this.GetRenderContainer()).hide()};if(this.ScrollLoading()){this.SetScrollEvent();this.LoadMoreScrollResults()};for(var i=0;i<this.aPhotos.length;i++){const oPhoto=this.aPhotos[i];oPhoto.GetEl('theimage').on('load',function(){const $theimg=$(this);const targetRatio=$theimg.closest('div').width()/$theimg.closest('div').height();const srcImgWidth=$theimg[0].naturalWidth;const srcImgHeight=$theimg[0].naturalHeight-oPhoto.iBMS;const frameWidth=$theimg.closest('div').width();const frameHeight=$theimg.closest('div').height();let currentScaledWidth=frameWidth;let currentScaledHeight=srcImgHeight*currentScaledWidth/srcImgWidth;let marginX=0;let marginY=0;let scale=1;if(currentScaledHeight>frameHeight){currentScaledHeight=frameHeight;currentScaledWidth=srcImgWidth*currentScaledHeight/srcImgHeight;if(frameHeight<srcImgHeight)scale=srcImgHeight/frameHeight;marginX=(frameWidth-currentScaledWidth)/2} 76else{if(frameWidth<srcImgWidth)scale=srcImgWidth/frameWidth;marginY=(frameHeight-currentScaledHeight)};if(Math.abs(currentScaledHeight-frameHeight)<3&&Math.abs(currentScaledWidth-frameWidth)<3){return};currentScaledHeight=currentScaledHeight+oPhoto.iBMS*(currentScaledHeight/srcImgHeight);const canvas=document.createElement("canvas");canvas.width=(currentScaledWidth+marginX*2)*scale;canvas.height=(currentScaledHeight+marginY)*scale;const ctx=canvas.getContext("2d");ctx.drawImage(this,marginX,marginY);$(this).attr('src',canvas.toDataURL())});if(i>=AlbGallery.VIDEO_FIRST_PRELOAD){if(this.aPhotos[i].iIdAssetType== 772){this.#videoObserver.observe(this.aPhotos[i].GetEl('video')[0])}};this.aPhotos[i].SetEvents()}};GetPhotoTemplate(){switch(this.sRenderView){case'mosaic':return'alb_gallery_photo_mosaic';case'detail_ris':return'alb_gallery_photo_detail_ris';case'lightbox_download':return'alb_gallery_photo_lightbox_download';default:return'alb_gallery_photo_classic'}};AppendMoveTopPhoto=function(){var o=this.GetEl('photoscont'),s={bEndResults:!0,iWidthPixelsThumb:175};var i=new AlbGalleryPhoto(this.GetMyName()+'.'+this.aPhotos.length,s,this);this.aPhotos.push(i);$('.endphoto').remove();var e;try{e=$($.render['alb_gallery_photo_mosaic_end_results'](i))}catch(t){t.xtrainfo='[AppendMoveTopPhoto] Error rendering template "alb_gallery_photo_mosaic_end_results"';throw(t)};o.append(e);this.aPhotos[this.aPhotos.length-1].SetMoveTopPhotoEvent();this.Recalc()};AppendPhotos(t,e){if(typeof e=='undefined')e=!0;var h=this.GetEl('photoscont');for(var i=0;i<t.length;i++){if(e&&this.HasPhoto(t[i].iId))continue;var s=new AlbGalleryPhoto(this.GetMyName()+'.'+this.aPhotos.length,t[i],this);s.SetPositionInParent(this.aPhotos.length);this.aPhotos.push(s);var a;try{a=$($.render[this.GetPhotoTemplate()](this.aPhotos[this.aPhotos.length-1]))}catch(o){o.xtrainfo='[AppendPhotos] Error rendering template "'+this.GetPhotoTemplate()+'"';throw(o)};h.append(a);this.aPhotos[this.aPhotos.length-1].tmpl_oFormContainer=h;this.aPhotos[this.aPhotos.length-1].AdjustRender();this.aPhotos[this.aPhotos.length-1].SetEvents();this.aPhotos[this.aPhotos.length-1].PrepareLightboxBtn();this.aPhotos[this.aPhotos.length-1].PrepareCartBtn();if(i>=AlbGallery.VIDEO_FIRST_PRELOAD){if(t[i].iIdAssetType== 782){this.#videoObserver.observe(s.GetEl('video')[0])}}};this.Recalc()};SetDescrs(t,e,i,o){this.aPhotos[t].SetDescrs(e,i,o)};HasNextPage(){if(this._options.bIncremental)return!1;if(this.ScrollLoading())return!1;if(!this.oPagination)return!1;return this.oPagination.iPage!=this.oPagination.iTotalNumPages};HasPhoto(t){for(var e=0;e<this.aPhotos.length;e++){if(this.aPhotos[e].iId==t)return!0};return!1};ShowOverlap(t,e){for(var i=0;i<this.aPhotos.length;i++){if(this.aPhotos[i].iId==t){this.aPhotos[i].ShowOverlap(e);break}}};PreparePagination(){var t=this;$('.options img.viewtype',top.document).click(function(){t.SwitchView($(this).attr('view'))});if(!this.oPagination)return;if(this._options.bIncremental)return;if(this.ScrollLoading())return;if(this.oPagination.iPage==1)this.GetEl("prevPage",top.document).hide();else this.GetEl("prevPage",top.document).show();if(this.HasNextPage())this.GetEl("nextPage",top.document).show();else this.GetEl("nextPage",top.document).hide();if(this.oSearchParams){this.GetEl("prevPage",top.document).click(function(){t.GotoPage(parseInt(t.oPagination.iPage)-1);return!1})};this.GetEl("prevPage",top.document).attr('href',t.GetPageUrl(parseInt(t.oPagination.iPage)-1));if(this.oSearchParams){this.GetEl("nextPage",top.document).click(function(){t.GotoPage(parseInt(t.oPagination.iPage)+1);return!1})};this.GetEl("nextPage",top.document).attr('href',t.GetPageUrl(parseInt(t.oPagination.iPage)+1))};Paginate(){var e=this.GetEl("pageno",top.document),t=e.val();if(isNaN(parseInt(t))||parseInt(t)>this.oPagination.iTotalNumPages||parseInt(t)<1){e.val('')} 79else{this.GotoPage(t)}};GetPageUrl(t){var i=[];for(var e in this.oSearchParams){if(e!='iPP'&&e!='iIS'){i.push(encodeURIComponent(e)+'='+encodeURIComponent(this.oSearchParams[e]))}};i.push('iPP='+t);if(this.iIdSearch)i.push('iIS='+this.iIdSearch);return this._options.sBaseUrl+'?'+i.join('&')};GotoPage(t,e){if(t>this.oPagination.iTotalNumPages||t<1)return;this.oSearchParams. 80iPP=t;this.oSearchParams. 81iIS=this.iIdSearch;if(this.sRenderView)this.oSearchParams. 82sGs=this.sRenderView;if(typeof e!='undefined')this.oSearchParams. 83iPPP=e;top.oNavigation.ExecSearch(this.oSearchParams,!1)};ItemsPerPage(t){this.oNavigation.HideMenu();if(this.oPagination.iItemsPerPage!=t&&t>0){var e=1;if(this.oPagination.iTotalNumItems>0){var i=(this.oPagination.iPage-1)*this.oPagination.iItemsPerPage+1;e=Math.floor((i-1)/t)+1}; 84;Cookies.set('resitems',t,{expires:365}); 85;this.oSearchParams. 86iPP=e;this.oSearchParams. 87iIS=this.iIdSearch;this.oSearchParams. 88iPPP=t;top.oNavigation.ExecSearch(this.oSearchParams)}};PrepareLightboxBtns(){for(var t=0;t<this.aPhotos.length;t++){this.aPhotos[t].PrepareLightboxBtn()}};PrepareCartBtns(){for(var t=0;t<this.aPhotos.length;t++){this.aPhotos[t].PrepareCartBtn()}};GetNumPhotos(){return this.aPhotos.length};CheckAll(t){for(var e=0;e<this.aPhotos.length;e++){this.aPhotos[e].GetEl('chkSelect').prop('checked',t)}};GetPaginationHtml(){if(this.oSearchParams){return'$1 of $2'.replace('$1','<input aria-label="Page" id="'+this.GetElId("pageno")+'" class="pageno" type="text" value="'+this.oPagination.iPage+'"/>').replace('$2',this.oPagination.iTotalNumPages)} 89else{return'$1 of $2'.replace('$1',this.oPagination.iPage).replace('$2',this.oPagination.iTotalNumPages)}};#videoObserver=new IntersectionObserver(entries=>
89{entries.forEach(entry=>{if(entry.isIntersecting){const video=entry.target;if(!video.poster)video.poster=video.dataset.poster;this.#videoObserver.unobserve(video);if(video.preload=='none'){this.aVideoPosPreloadQueue.push(video.dataset.pos)};this.VideoPreloadProcessQueue()}})},{rootMargin:"400px",});static VIDEO_MAX_PRELOADS=5;static VIDEO_FIRST_PRELOAD=10;VideoPreloadProcessQueue(){if(this.iVideoPreloadPos>=AlbGallery.VIDEO_MAX_PRELOADS||this.aVideoPosPreloadQueue.length===0){let myslf=this;setTimeout(function(){myslf.VideoPreloadProcessQueue()},500);return};const oVideoObj=this.aPhotos[this.aVideoPosPreloadQueue.shift()];const videoEl=oVideoObj.GetEl('video')[0];this.iVideoPreloadPos++;if(!oVideoObj.IsVideoPlaying()&&videoEl.preload=='none'){videoEl.preload="metadata";videoEl.load();let myslf=this;videoEl.addEventListener("loadedmetadata",()=>{myslf.iVideoPreloadPos--;myslf.VideoPreloadProcessQueue()})} 90else{this.iVideoPreloadPos--};this.VideoPreloadProcessQueue()}};;class AlbRisResults extends AlbBaseObj{constructor(e,s,t){super(e,s,t)};LoadInfo(e){super.LoadInfo(e);if('oRisResultsaSearchedPhotos' in this){this.SetChildObjects('aSearchedPhotos',AlbRisResultsSearchedImg,!0)} 91else{this.aSearchedPhotos=[]}};GetNumSearchedPhotosWithResults(){return this.aSearchedPhotos.length};GetIdsSearchedImgs(){var s=[];for(var e=0;e<this.aSearchedPhotos.length;e++){s.push(this.aSearchedPhotos[e].iIdSearchedImage)};return s};UpdateStatus(e){this.AppendResults(e.aSearchedPhotos);this.oNavigation.oRisSummary.RenderRisApiStatus(e,this)};HasIdSearchedImage(e){for(var s=0;s<this.aSearchedPhotos.length;s++){if(this.aSearchedPhotos[s].iIdSearchedImage==e)return!0}};AppendResults(e){for(var s=0;s<e.length;s++){if(!this.HasIdSearchedImage(e[s].iIdSearchedImage)){var t=new AlbRisResultsSearchedImg(this.GetMyName()+'.aSearchedPhotos['+(s+this.aSearchedPhotos.length)+']',e[s],this);t.Render(this.GetEl('list'));this.aSearchedPhotos.push(t)}}};Render(e){this.Render2(e,'alb_ris_results',{bAppend:!0,bNotAForm:!0});var t=this.GetEl('matches');for(var s=0;s<this.aSearchedPhotos.length;s++){this.aSearchedPhotos.Render(this.GetEl('list'))}}};;class AlbRisResultsSearchedImg extends AlbBaseObj{constructor(t,s,o){super(t,s,o);this.oNavigation=o.oNavigation;this._options={bWithinOtherPhotoDetail:!1}};LoadInfo(t){super.LoadInfo(t);this.SetChildObjects('aFoundPhotos',AlbGalleryPhoto,!0)};Render(t){this.Render2(t,'alb_ris_results_searched_img',{bAppend:!0,bNotAForm:!0});var s=this.GetEl('matches');for(var o=0;o<this.aFoundPhotos.length;o++){this.aFoundPhotos[o].SetEvents(!0)}}};;class Lightbox extends AlbBaseObj{LoadInfo(t){super.LoadInfo.call(this,t);this.tmpl_sTmplBasePath='/common/javascript/obj/';this.tmpl_aSegments=[];this.SetChildObjects('aWebPhotos',AlbBaseObj,!1);if(this.aWebPhotos){for(var e=0;e<this.aWebPhotos.length;e++){this.aWebPhotos[e].bSelected=!1;this.aWebPhotos[e].iId=parseInt(this.aWebPhotos[e].iId)}};this.UncheckVi();this.tmpl_iCurPage=1;this.tmpl_iPageSize= 92100};HideRow(){this.GetEl('llist_'+this.iId).hide()};ShowRow(){this.GetEl('llist_'+this.iId).show()};SavePhotoToLightbox(t,e,o){var s;if(t>0){this.GetParent().LightboxAddPhoto(t,s,e)} 93else{this.AddPhotosFromSearch(o)};this.GetParent().HideRightPanel()};SelectAll(t){for(var e=0;e<this.aWebPhotos.length;e++){this.aWebPhotos[e].bSelected=t};this.oGallery.CheckAll(t);$('.numSelected',this.GetRenderContainer()).html(t?this.aWebPhotos.length:0)};GetNumSelected(){var e=0;for(var t=0;t<this.aWebPhotos.length;t++){if(this.aWebPhotos[t].bSelected)e++};return e};SelectPhoto(t,e){for(var o=0;o<this.aWebPhotos.length;o++){if(this.aWebPhotos[o].iId==t){this.aWebPhotos[o].bSelected=e;break}};$('.numSelected',this.GetRenderContainer()).html(this.GetNumSelected())};DownloadHiresZip(t){ 94;var e=-1;if(this.tmpl_aSegments.length>1)e=parseInt(this.GetEl("iZIPSegment").val());if(this.IsViOk(e)){$('input',this.GetEl('select_resolution')).prop('disabled',!0);this.GetEl('confirm-vi').hide();this.GetEl('downloadBtns').hide();this.RenderProgress();this.GetEl('downloading').show();if(e>0){var o=this;this.CheckDownloadableSelectedPhotos(e,function(){if(o.GetNumSelectedNoHires()>0){o.Render2(o.GetEl("NoHiresAnnotation"),'lightbox_download_nohires',{bNotAForm:!0,iSegment:e})} 95else{o.GetEl("NoHiresAnnotation").empty()};o.GotoDownloadURL(t,e)})} 96else{this.GotoDownloadURL(t,e)}} 97else{alert('Please accept the conditions to download the images')}};DownloadLoresZip(t){if(this.IsViOk(-1)){$('.download_button').hide();$('.download_button_msg').show();this.GotoDownloadURL(t,-1)} 98else{alert('Please accept the conditions to download the images')}};GotoDownloadURL(t,o){var l=this,r=[];for(var h=0;h<this.aWebPhotos.length;h++){if(this.aWebPhotos[h].bSelected){if(t!= 993||this.aWebPhotos[h].bIsDownloadable){r.push(this.aWebPhotos[h].iId)}}};var n='/web/controllers/downloads/c_download_lightbox_zip.php',i='__cdlz_aiIncludePhotoIds='+r.join('|')+'&__cdlz_iIdLightbox='+this.iId+'&__cdlz_iResolution='+t; 100;if(this.IsViChecked())i+='&__cdlz_bViAccepted=1';if(t== 1013||t== 1027){if(o>0){var e,s=0;for(e=0;e<this.aWebPhotos.length;e++){if(this.aWebPhotos[e].bSelected&&s>=((o-1)* 10340))break;if(this.aWebPhotos[e].bSelected){s++}};var d=e;s=0;var a=0;for(;e<this.aWebPhotos.length;e++){if(this.aWebPhotos[e].bSelected){s++;a=e};if(s== 10440){break}};if(a>this.aWebPhotos.length)a=this.aWebPhotos.length-1;i+='&__cdlz_slZIPSegment='+o+'|'+d+'|'+a};this.GetEl('hiddenframe').attr('src',n+'?'+i);setTimeout(function(){l.CheckDownloadStatus()},500)} 105else{var l=this;this.ShowPopupHtml('<div class="popup_msg">ZIP file generation and download in progress...</div>',{iWidth:250,iHeight:80,bAllowCloseIt:!1,bClosePrevious:!0});$.fileDownload(n,{data:i,httpMethod:"POST"}).done(function(){l.ClosePopup();$('.download_button').show();$('.download_button_msg').hide()}).fail(function(){l.ClosePopup();alert('Error en la descarga');$('.download_button').show();$('.download_button_msg').hide()})}};GetSelectedDownloadResolution(){var t=-1,e=$("input[name='"+this.GetElId("iResolutionRadio")+"']:checked");if(e.length>0)t=e.val();return t};DownloadZip(){var t=this.GetSelectedDownloadResolution();if(t== 1063||t== 1077){this.DownloadHiresZip(t)} 108else{this.DownloadLoresZip(t)}};Back(){document.location.reload()};RenderEdit(t){super.Render2(t,'lightbox_edit');this.RenderEditPhotos()};RenderEditPhotos(t){var e=0;if(t)e=this.GetEl('editLightboxLowContainer').scrollTop();
108this.Render2(this.GetEl('photos'),'lightbox_edit_photos',{bNotAForm:!0});if(t)this.GetEl('editLightboxLowContainer').scrollTop(e);this.SetEventsRenderEdit();this.CheckLightboxEditBtn()};PrepareBtn(t){if(top.oNavigation.IsPhotoInCart(t.iId)){$('#btnAddToCart_'+t.sWebCode).hide();$('#btnAddToCartDisabled_'+t.sWebCode).show()} 109else{$('#btnAddToCart_'+t.sWebCode).show();$('#btnAddToCartDisabled_'+t.sWebCode).hide()}};editLightboxName(){this.GetEl('lightboxNameDiv').hide();this.GetEl('editLightboxNameDiv').show();this.GetEl('sLightboxName').focus().select()};PrepareAllBtns(){for(var t=0;t<this.aWebPhotos.length;t++){this.PrepareBtn(this.aWebPhotos[t])}};LightboxAddAllToCart(){top.oNavigation.LightboxAddToCart(this.iId,!1,this.PrepareAllBtns.bind(this))};LightboxAddToCart(){var e=[];for(var t=0;t<this.aWebPhotos.length;t++){if(this.aWebPhotos[t].bSelected){e.push(this.aWebPhotos[t].iId)}};top.oNavigation.LightboxAddToCart(this.iId,e,this.PrepareAllBtns.bind(this))};CheckLightboxEditBtn(){var t=0;for(var e=0;e<this.aWebPhotos.length;e++){if(this.aWebPhotos[e].bSelected){++t}};if(t){if(t==1){this.GetEl('addPhotoCart').html('Add 1 image to the cart');this.GetEl('removePhoto').html('Delete 1 image');this.GetEl('copyPhotos').html('Copy 1 image to another lightbox');this.GetEl('downloadLightbox').html('Download 1 image')} 110else{this.GetEl('addPhotoCart').html('Add $1 images to cart'.replace('$1',t));this.GetEl('removePhoto').html('Delete $1 images'.replace('$1',t));this.GetEl('copyPhotos').html('Copy $1 images to another lightbox'.replace('$1',t));this.GetEl('downloadLightbox').html('Download $1 images'.replace('$1',t))};this.GetEl('addAllPhotoToCartLi').hide();this.GetEl('addPhotoToCartLi').show();this.GetEl('addAllPhotoToCartLi').removeClass('lastColumn');this.GetEl('addPhotoToCartLi').addClass('lastColumn');this.GetEl('addPhotoToCart').removeClass('disabled');this.GetEl('removePhoto').removeClass('disabled');this.GetEl('copyPhotos').removeClass('disabled')} 111else{this.GetEl('removePhoto').html('Delete images');this.GetEl('copyPhotos').html('Copy images to another lightbox');this.GetEl('addAllPhotoToCartLi').show();this.GetEl('addPhotoToCartLi').hide();this.GetEl('addAllPhotoToCartLi').addClass('lastColumn');this.GetEl('addPhotoToCartLi').removeClass('lastColumn');this.GetEl('removePhoto').addClass('disabled');this.GetEl('copyPhotos').addClass('disabled');this.GetEl('downloadLightbox').html('Download images');this.GetEl('SelectAllLi').show();this.GetEl('UnselectAllLi').hide()};if(!this.aWebPhotos||this.aWebPhotos.length<=0){this.GetEl('addAllPhotoToCart').addClass('disabled').removeAttr('href');this.GetEl('addAllPhotoToCart').addClass('disabled').removeAttr('href');this.GetEl('SelectAll').addClass('disabled').removeAttr('href');this.GetEl('addAllPhotoToCart').addClass('disabled').removeAttr('href');this.GetEl('LightboxSendByEmail').addClass('disabled').removeAttr('href');this.GetEl('downloadLightbox').addClass('disabled').removeAttr('href');this.GetEl('editLightboxLow').css('height','482px');this.GetEl('editLightboxLowMsg').html('This lightbox is empty').show()};if(this.GetNumByType( 1121)==0){this.GetEl('downloadLightbox').addClass('disabled').removeAttr('href')}};GetNumByType(t){var o=0;for(var e=0;e<this.aWebPhotos.length;e++){if(this.aWebPhotos[e].iIdAssetType==t){o++}};return o};CopyPhotos(){var e=[];for(var t=0;t<this.aWebPhotos.length;t++){if(this.aWebPhotos[t].bSelected){e.push(this.aWebPhotos[t])}};if(e.length){var o='/web/views/forms/v_choose_lightbox_right_panel.php?iLightboxToExclude='+this.iId+'&aIdPhoto=';for(var t=0;t<e.length;t++){if(t!=0)o+='|';o+=e[t].iId};top.oNavigation.oLeftArea.ShowRightPanelUrl('Choose lightbox',o,!0)}};SetEventRenderEdit(t){var e=this;t.GetEl('bSelected').click(function(){if($(this).is(':checked')){$(this).closest('.lightboxElemDiv').addClass('selected')} 113else{$(this).closest('.lightboxElemDiv').removeClass('selected')};t.bSelected=$(this).is(':checked');e.CheckLightboxEditBtn()});t.GetEl('btnDelete').click(function(){top.oNavigation.LightboxRemovePhoto(t.iId);e.RemovePhoto(t.iId);e.RenderEditPhotos(!0)});t.GetEl('thephoto').click(function(e){e.stopPropagation();if($(window).width()>=768){var s=top.oNavigation.GetPhotoDetailUrl(t.sUrl),o=top.oNavigation.GetPopupWindowDims();top.oNavigation.OpenPopupWindow(s,'photo_detail',o[0],o[1]);return!1} 114else{return!0}});
114t.GetEl('btnAddToCart').click(function(){top.oNavigation.AddToCart(t.iId,function(){t.GetEl('btnAddToCart').hide();t.GetEl('btnAddToCartDisabled').show()})});t.GetEl('btnDownload').click(function(){var o=top.oNavigation.GetPhotoDetailUrl(t.sUrl),e=top.oNavigation.GetPopupWindowDims();top.oNavigation.OpenPopupWindow(o,'photo_detail',e[0],e[1])});t.GetEl('btnAddToCartDisabled').click(function(){top.oNavigation.RemoveFromCart(t.iId,function(){t.GetEl('btnAddToCart').show();t.GetEl('btnAddToCartDisabled').hide()})});this.PrepareBtn(t)};LightboxDownloadZIP(){var e=[];for(var t=0;t<this.aWebPhotos.length;t++){if(this.aWebPhotos[t].bSelected){e.push(this.aWebPhotos[t].sWebCode)}};if(e.length){top.oNavigation.LightboxDownloadZIP(this.iId,e)} 115else{top.oNavigation.LightboxDownloadZIP(this.iId)}};RemoveSelectedPhotos(){var t=[];for(var o=0;o<this.aWebPhotos.length;o++){if(this.aWebPhotos[o].bSelected){t.push(this.aWebPhotos[o].iId)}};if(t.length){var s='';if(t.length>1)s='Do you want to remove the $1 selected images from the lightbox $2?'.replace('$1',t.length).replace('$2','<b>"'+this.sName+'"</b>');else s='Do you want to remove the selected image from the lightbox $1?'.replace('$1','<b>"'+this.sName+'</b>"');var e=this;$$.ShowDialogYesNo(s,function(o){e.ClosePopup();if(o==1){top.oNavigation.LightboxRemovePhotos(t,function(){for(var o=0;o<t.length;o++)e.RemovePhotos(t[o]);e.RenderEditPhotos(!0)},e.iId)}},{sTitle:'Remove images from the lightbox',sTxtYes:'Accept',sTxtNo:'Cancel'})}};UnselectAllPhotos(){this.GetEl('UnselectAllLi').hide();this.GetEl('SelectAllLi').show();for(var t=0;t<this.aWebPhotos.length;t++){this.aWebPhotos[t].GetEl('bSelected').prop('checked',!1);this.aWebPhotos[t].bSelected=!1};this.CheckLightboxEditBtn()};SelectAllPhotos(){this.GetEl('UnselectAllLi').show();this.GetEl('SelectAllLi').hide();for(var t=0;t<this.aWebPhotos.length;t++){this.aWebPhotos[t].GetEl('bSelected').prop('checked',!0);this.aWebPhotos[t].bSelected=!0};this.CheckLightboxEditBtn()};SetEventsRenderEdit(){for(var e=0;e<this.aWebPhotos.length;e++){this.SetEventRenderEdit(this.aWebPhotos[e])};this.SetNumPhotosSpan();var t=this;this.GetEl('nextPage').on('click',function(){t.GotoPage(t.tmpl_iCurPage+1)});this.GetEl('prevPage').on('click',function(){t.GotoPage(t.tmpl_iCurPage-1)});this.GetEl('pageNum').on('change',function(){if(parseInt($(this).val())==$(this).val()){t.GotoPage($(this).val())}})};SetNumPhotosSpan(){var t='';if(this.aWebPhotos.length<=1)t='imagen';else t='imágenes';this.GetEl('numPhotoSpan').html(' ('+this.aWebPhotos.length+' '+t+')')};CancelLightboxName(){this.GetEl('sLightboxName').val(this.sName);this.GetEl('lightboxNameDiv').show();this.GetEl('editLightboxNameDiv').hide()};SaveLightboxName(){var e=this,t=this.GetEl('sLightboxName').val().trim();if(t.length>0){var e=this;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{iIdLightbox:this.iId,sNewName:t},sMethodHash:'',bShowProgress:!1,fPostActions:function(t){if(t.bOk){document.location.reload()} 116else{$$.ShowDialogNotification(t.sMsg,{sTitle:'Edit lightbox'})}}})}};RenderDownload(t){ 117};ShowOrderPhotos(){if(this.GetNumSelected()==0){alert('Please, select some images in the lightbox');return}};ShowRequestLightbox(){if(this.GetNumSelected()==0){alert('Please, select some images in the lightbox');return};this.GetEl('selectionbtns').hide();this.GetEl('selectimages').hide();this.GetEl('request').show()};ShowResolutions(){if(this.GetNumSelected()==0){alert('Please, select some images in the lightbox');return};this.DownloadResolutionChange();this.GetEl('selectionbtns').hide();this.GetEl('selectimages').hide();this.GetEl('select_resolution').show()};ActivateDownloadBtns(t){var e=this;if(t){this.GetEl("btnDownload").css('opacity',1).addClass('hand').addClass('hoverdark');this.GetEl("btnOrder").css('opacity',1).addClass('hand').addClass('hoverdark');$('.checkingAvail').hide();this.GetEl("btnDownload").click(function(){e.ShowResolutions()});this.GetEl("btnOrder").click(function(){e.ShowRequestLightbox()})} 118else{this.GetEl("btnDownload").css('opacity',0.5).removeClass('hand').removeClass('hoverdar
118k');this.GetEl("btnOrder").css('opacity',0.5).removeClass('hand').removeClass('hoverdark');this.GetEl("btnDownload").off('click');this.GetEl("btnOrder").off('click');$('.checkingAvail').show()}};GetViWebCodes(t){var i=[];if(t==-1){for(var e=0;e<this.aWebPhotos.length;e++){if(this.aWebPhotos[e].bSelected&&this.aWebPhotos[e].bIsVI){i.push(this.aWebPhotos[e].sWebCode)}}} 119else{var s=this.GetSelectedPhotos(),h=(t-1)* 12040;for(var e=0;e< 12140;e++){var o=h+e;if(o>=s.length)break;if(s[o].bIsVI){i.push(s[o].sWebCode)}}};return i};ShowViMessage(){var o=-1;if(this.GetSelectedDownloadResolution()== 1223){if(this.tmpl_aSegments.length>1)o=parseInt(this.GetEl("iZIPSegment").val())};var t=this.GetViWebCodes(o);if(t.length>0){var e;if(t.length>1)e='Please review the following copyright message for the images <span class="AlbumCodigoFoto">'+t.join('</span>, <span class="AlbumCodigoFoto">')+'</span>:';else e='Please review the following copyright message for this image <span class="AlbumCodigoFoto">'+t.join('</span>, <span class="AlbumCodigoFoto">')+'</span>:';this.GetEl("chkVi").prop('checked',!1);this.GetEl('confirm-msg').html(e);this.GetEl('confirm-vi').show()} 123else{this.GetEl('confirm-vi').hide()};return(t.length>0)};DownloadResolutionChange(){ 124};HasPhoto(t){if(this.aWebPhotos){for(var e=0;e<this.aWebPhotos.length;e++){if(this.aWebPhotos[e].iId==t)return!0}};return!1};RemovePhoto(t){for(var e=0;e<this.aWebPhotos.length;e++){if(this.aWebPhotos[e].iId==t){this.aWebPhotos.splice(e,1);break}};this.SetNumPhotosSpan()};RemovePhotos(t){for(var e=0;e<this.aWebPhotos.length;e++){if(t.indexOf(this.aWebPhotos[e].iId)>=0){this.aWebPhotos.splice(e,1)}};this.SetNumPhotosSpan()};GetSelectedPhotos(t){if(typeof t=='undefined')t=!0;var o=[];for(var e=0;e<this.aWebPhotos.length;e++){if(this.aWebPhotos[e].bSelected==t){o.push(this.aWebPhotos[e])}};return o};CheckDownloadableSelectedPhotos(t,o){this.ShowProgressTip('Checking images availability...',!0,{iWidth:600});var i=[];if(t>=0){var h=this.GetSelectedPhotos();for(var e=((t-1)* 12540);e<(t* 12640)&&e<this.aWebPhotos.length;e++){if(typeof this.aWebPhotos[e].bIsDownloadable=='undefined'){i.push(this.aWebPhotos[e].iId)}}} 127else{for(var e=0;e<this.aWebPhotos.length;e++){if(this.aWebPhotos[e].bSelected&&typeof this.aWebPhotos[e].bIsDownloadable=='undefined'){i.push(this.aWebPhotos[e].iId)}}};var s=this;if(i.length>0){this.ActivateDownloadBtns(!1);AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{aPhotoIds:i},sMethodHash:'',bShowProgress:!1,fPostActions:function(t){s.HideProgressTip();if(t.bOk){for(var i=0;i<t.mResults.aAvailablilities.length;i++){for(var e=0;e<s.aWebPhotos.length;e++){if(s.aWebPhotos[e].iId==t.mResults.aAvailablilities[i].iIdPhoto){s.aWebPhotos[e].bIsDownloadable=t.mResults.aAvailablilities[i].bIsDownloadable;break}}};o()}}})} 128else{o()}};GetSelectedPhotosNoHires(t){if(typeof t=='undefined')t=-1;var s=[];if(t>=0){var o=this.GetSelectedPhotos(),h=(t-1)* 12940;for(var e=0;e< 13040;e++){var i=h+e;if(i>=o.length)break;if(o[e].bSelected&&(typeof o[e].bIsDownloadable!='undefined'&&!o.bIsDownloadable)){s.push(o[e])}}} 131else{for(var e=0;e<this.aWebPhotos.length;e++){if(this.aWebPhotos[e].bSelected&&(typeof this.aWebPhotos[e].bIsDownloadable!='undefined'&&!this.aWebPhotos[e].bIsDownloadable)){s.push(this.aWebPhotos[e])}}};return s};GetNumSelectedNoHires(t){return this.GetSelectedPhotosNoHires(t).length};RenderProgress(t){if(typeof t=='undefined'){this.GetEl('progressColor').width(0);this.GetEl('progressMsg').html('');this.GetEl('progressText').html('');this.GetEl('progressText').hide();return};this.GetEl('progressColor').width(this.GetEl('progressBar').width()*t.iPercent/100);if(t.iPercent>15)this.GetEl('progressText').show();else this.GetEl('progressText').hide();this.GetEl('progressText').html(t.iPercent+' %');this.GetEl('progressMsg').html(t.sMsg)};CheckDownloadStatus(){var t=this;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{},sMethodHash:'',bShowProgress:!1,fPostActions:function(e){if(e.bOk){if(e.mResults.iStatus=='6'||e.mResults.iStatus=='1'||e.mResults.iStatus==0){setTimeout(function(){t.CheckDownloadStatus()},500);t.GetEl('downloadingMsg').html(e.mResults.sMsg);t.RenderProgress(e.mResults)} 132else{$('input',t.GetEl('select_resolution')).prop('disabled',!1);t.GetEl('downloading').hide();t.GetEl('downloadBtns').show();
132t.ShowViMessage()}}}})};ShowRequestFormNoHires(t){this.GetEl("requestNoHires").show();$(t).hide()};SendRequest(t,e,o){if(o.length==0){alert("No image selected");return};var a=t.val();if(!this.CheckEmail(a)){alert("Invalid email format");t.focus().select();return};var l=e.val().trim();if(l.length==0){alert("Please, enter project and usage");e.focus().select();return};var h={iIdLightbox:this.iId,sEmail:t.val(),sWorkUsage:e.val()};if(typeof o!='undefined'){var i=[];for(var s=0;s<o.length;s++){i.push(o[s].iId)};h.aPhotoIds=i};$('.requestDiv .fields').hide();$('.requestDiv .requesting').show();AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:h,sMethodHash:'',bShowProgress:!1,fPostActions:function(t){$('.requestDiv .requesting').hide();if(t.bOk){$('.requestDiv .done').show()} 133else{alert(t.sMsg);$('.requestDiv .fields').show()}}})};SendRequestNoHiresImages(){var e=[];for(var t=0;t<this.aWebPhotos.length;t++){if(this.aWebPhotos[t].bSelected&&!this.aWebPhotos[t].bIsDownloadable){e.push(this.aWebPhotos[t])}};this.SendRequest(this.GetEl('requestNoHiresEmail'),this.GetEl('requestNoHiresUsage'),e)};SendRequestLightbox(){this.SendRequest(this.GetEl('requestEmail'),this.GetEl('requestUsage'),this.GetSelectedPhotos())};UncheckVi(){this.GetEl('chkVi').prop('checked',!1)};IsViChecked(){return this.GetEl('chkVi').prop('checked')};IsViOk(t){var e=this.GetViWebCodes(t);if(e.length>0){return this.GetEl('chkVi').prop('checked')} 134else{return!0}};GetNumSelectedDownloadable(){return this.GetNumSelected()-this.GetNumSelectedNoHires()};AddPhotosFromSearch(t,o){var e=this;this.ShowProgressTip("Adding images to the lightbox",!0,{iWidth:500,iHeight:40,iFontSize:20});AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{iIdLightbox:this.iId,iIdSearch:t,iNumPhotos:o},sMethodHash:'',bShowProgress:!1,fPostActions:function(t){e.HideProgressTip();if(t.bOk){var o=t.mResults.iNumAdded+' images added to the lightbox '+t.mResults.sLightboxName;if(t.mResults.aNotAddedIdsPhotos.length>0){o+=' '+t.mResults.aNotAddedIdsPhotos.length+' Images not added (';for(var s=0;s<10&&s<t.mResults.aNotAddedIdsPhotos.length;s++){if(s>0)o+=', ';o+=t.mResults.aNotAddedIdsPhotos[s]};if(t.mResults.aNotAddedIdsPhotos.length>10)o+='...';o+=')'};$$.ShowDialogNotification(o,{sTitle:'Warning'},function(){var h=t.mResults.iIdNewLightbox,s=!1,i=!1;e.GetParent().aLightboxes=[];for(var o=0;o<t.mResults.aLightboxes.length;o++){e.GetParent().aLightboxes.push(new Lightbox(e.GetParent().GetMyName()+'.aLightboxes['+e.GetParent().aLightboxes.length+']',t.mResults.aLightboxes[o],e.GetParent()));if(t.mResults.aLightboxes[o].iId==h){s=!0;i=o}};if(!s&&e.GetParent().aLightboxes.length==1){e.GetParent().oCurLightbox=new Lightbox(e.GetParent().GetMyName()+'.oCurLightbox',e.GetParent().aLightboxes[0],e.GetParent());e.GetParent().LightboxSetActive(e.GetParent().oCurLightbox.iId)} 135else if(!s){e.GetParent().oCurLightbox=new Lightbox(e.GetParent().GetMyName()+'.oCurLightbox',e.GetParent().oCurLightbox,e)} 136else{e.GetParent().oCurLightbox=new Lightbox(e.GetParent().GetMyName()+'.oCurLightbox',t.mResults.aLightboxes[i],e.GetParent());e.GetParent().LightboxSetActive(e.GetParent().oCurLightbox.iId)};e.ClosePopup()})} 137else{$$.ShowDialogNotification(t.sMsg,{sTitle:'Warning'})}}})};GetNumPages(){return Math.ceil(this.aWebPhotos.length/this.tmpl_iPageSize)};GotoPage(t){var e=this.GetNumPages();if(t>e)t=e;if(t<0)t=1;this.tmpl_iCurPage=t;this.RenderEditPhotos()};HasPagination(){return this.GetNumPages()>1};GetPhotosInCurPage(){var o=(this.tmpl_iCurPage-1)*this.tmpl_iPageSize,s=Math.min(this.aWebPhotos.length,this.tmpl_iCurPage*this.tmpl_iPageSize);if(o==0&&s==this.aWebPhotos.length){return this.aWebPhotos};var e=[];for(var t=o;t<s;t++){e.push(this.aWebPhotos[t])};return e};GetLightboxesList(){return this.GetParent().aLightboxes}};;class LeftArea extends AlbBaseObj{constructor(t,i,e){super(t,i,e)};LoadInfo(t){this.bCleanUrl=!1;super.LoadInfo(t);this.SetChildObjects('aLightboxes',Lightbox);this.oCurLightbox=new Lightbox(this.GetMyName()+'.oCurLightbox',this.oCurLightbox,this);this.tmpl_sTmplBasePath='/web/views/javascript/obj/'};
137LightboxDownloadZIP(t,i){var e=null;if(typeof t=='undefined'){e=this.oCurLightbox} 138else{e=this.GetLightbox(t)};if(e&&(e.iNumPhotos>0||(e.aWebPhotos&&e.aWebPhotos.length>0))){var h= 139'menubar=0,toolbar=0,resizable=1,scrollbars=1,status=1,width=960,height=710,left=' + (screen.availWidth-960)/2 + ',top=' + (screen.availHeight-710)/2;if(typeof i=='undefined'){var s=window.open('/web/views/lightboxes/v_download_lightbox.php?iIdLightbox='+e.iId,'zip_lightbox',h)} 140else{var o=$('<form id="'+this.GetElId('tmpform')+'" action="/web/views/lightboxes/v_download_lightbox.php" method="post"></form>');o.append('<input type="hidden" name="aCodes" value="'+i.join('|')+'">');o.append('<input type="hidden" name="iIdLightbox" value="'+e.iId+'">');$('body').append(o);s=this.PopupForm(o,'zip_download',960,710)};if(s.opener!=this.window)s.opener=this.window;if(window.focus)s.focus()}};LightboxAddToCart(t,i,e){if(typeof i=='undefined'||i.length<=0){i=[]};var o=null;if(typeof t=='undefined'){o=this.oCurLightbox} 141else{o=this.GetLightbox(t)};if(o&&o.iNumPhotos>0){AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{iIdLightbox:o.iId,aIdPhoto:i},sMethodHash:'',bShowProgress:!1,fPostActions:function(t){if(t.bOk){switch(t.mResults){case 0:$$.ShowDialogNotification('Cart not modified:\nThe images in this lightbox were already in the cart',{sTitle:'Warning'});break;case 1:$$.ShowDialogNotification('An image has been added to the cart',{sTitle:'Warning'});break;default:$$.ShowDialogNotification(t.mResults+' images added to cart',{sTitle:'Warning'});break};top.oNavigation.RefreshCartStatus(!0,e)} 142else{$$.ShowDialogNotification(t.sMsg,{sTitle:'Warning'})}}})}};LightboxSendByEmail(t){var i=null;if(typeof t=='undefined'){i=this.oCurLightbox} 143else{i=this.GetLightbox(t)};this.ShowRightPanelUrl('Send lightbox by email','/web/controllers/lightboxes/c_send_lightbox_email.php?__csle_iIdLightbox='+i.iId,!0)};LightboxDelete(t,i){if(typeof t=='undefined')t=this.oCurLightbox.iId;var s=this.GetLightbox(t),o;if(s.bIsTemp)o="¿Do you want to empty the temporary lightbox?";else o="Do you want to remove the lightbox? ("+s.sName+")";var e=this;$$.ShowDialogYesNo(o,function(i){if(i==1){AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{iIdLightbox:t},sMethodHash:'',bShowProgress:!1,fPostActions:function(i){if(i.bOk){for(var o=0;o<e.aLightboxes.length;o++){if(e.aLightboxes[o].iId==t){if(e.aLightboxes[o].bIsTemp){e.aLightboxes[o].iNumPhotos=0} 144else{e.aLightboxes.splice(o,1)};break}};if(t==e.oCurLightbox.iId){e.oCurLightbox=new Lightbox(e.GetMyName()+'.oCurLightbox',i.mResults,e)};document.location='/lightboxes'} 145else{$$.ShowDialogNotification(i.sMsg,{sTitle:'Warning'})}}})};e.ClosePopup()},{sTxtYes:'Delete',sTxtNo:'Cancel',sTitle:'Delete lightbox'})};LightboxRemovePhoto(t,i,e){this.LightboxRemovePhotos([t],i,e)};LightboxRemovePhotos(t,i,e){if(typeof e=='undefined'){e=this.oCurLightbox.iId};var s=(e==this.oCurLightbox.iId),o=this;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{iIdLightbox:e,aIdsPhotos:t},sMethodHash:'',bShowProgress:!1,fPostActions:function(e){if(e.bOk){if(s){o.oCurLightbox.RemovePhotos(t);o.GetParent().CheckLightboxIcons()};if(typeof i!='undefined')i()} 146else{$$.ShowDialogNotification(e.sMsg,{sTitle:'Warning'})}}})}; 147;LightboxAddPhotosFromSearch(t,i,e){if(typeof this.oCurLightbox.iId=='undifined'||!this.oCurLightbox.iId||this.oCurLightbox.iId<0){this.ShowRightPanelUrl('Create lightbox','/web/views/forms/v_create_new_lightbox_right_panel.php?iIdSearch='+t+'&iNumPhotos='+e,!0)} 148else{if(i){this.oCurLightbox.AddPhotosFromSearch(t,e)} 149else{this.ShowRightPanelUrl('Choose lightbox','/web/views/forms/v_choose_lightbox_right_panel.php?iIdSearch='+t,!0)}}};ShowFilmPhotos(t){this.GetParent().SearchFilmPhotos(t);this.HideRightPanel()};LightboxCurHasPhoto(t){if(this.oCurLightbox.aWebPhotos){for(var i=0;i<this.oCurLightbox.aWebPhotos.length;i++){if(this.oCurLightbox.aWebPhotos[i].iId==t)return!0}};return!1};LightboxCopyPhotos(t,i){var e=this;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{iIdLightbox:t,},sMethodHash:'',bShowProgress:!1,fPostActions:function(t){if(t.bOk){if(t.mResults>0){e.GetLatestLightboxesList()};if(i){i(t.mResults)}} 150else{$$.ShowDialogNotification(t.sMsg,{sTitle:'Warning'})}}})};CopyPhotosToNewLightbox(t,i){if(t.length>0){var e=this;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{sNewName:t},sMethodHash:'',bShowProgress:!1,fPostActions:function(t){if(t.bOk){e.LightboxCopyPhotos(t.mResults.iId,i);e.HideRightPanel()} 151else{$$.ShowDialogNotification(t.sMsg,{sTitle:'Save to new lightbox'})}}})}};LightboxAddPhoto(t,i,e){if(typeof e=='undefined'){if(typeof this.oCurLightbox.iId=='undifined'||!this.oCurLightbox.iId||this.oCurLightbox.iId<0){this.RenderNewLightbox(!1,!0,t);return};e=this.oCurLightbox.iId};if(e==this.oCurLightbox.iId){if(this.LightboxCurHasPhoto(t))return};var o=this;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{iIdLightbox:e,iIdPhoto:t},sMethodHash:'',bShowProgress:!1,fPostActions:function(e){if(e.bOk){if(e.mResults){if(e.mResults.iIdLightbox!=o.oCurLightbox.iId){o.LightboxSetActive(e.mResults.iIdLightbox)} 152else{e.mResults.iId=parseInt(e.mResults.iId);o.oCurLightbox.aWebPhotos.push(e.mResults);o.GetParent().CheckLightboxIcons();if(typeof i!='undefined')i()}} 153else{o.RenderNewLightbox(!1,!0,t)}} 154else{$$.ShowDialogNotification(e.sMsg,{sTitle:'Warning'})}}})};LightboxExists(t){for(var i=0;i<this.aLightboxes.length;i++){if(this.aLightboxes[i].iId==t){return!0}};return!1};GetLightbox(t){for(var i=0;i<this.aLightboxes.length;i++){if(this.aLightboxes[i].iId==t){return this.aLightboxes[i]}};return!1};
154OpenLightbox=function(){top.oNavigation.ShowEditLightbox(this.oCurLightbox.iId);this.HideRightPanel()};LightboxSetActive(t,i){var e=this;this.GetEl('lightboxPhotosDiv').html('Loading images...');AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{iIdLightbox:t},sMethodHash:'',bShowProgress:!1,fPostActions:function(t){if(t.bOk){e.oCurLightbox=new Lightbox(e.GetMyName()+'.oCurLightbox',t.mResults,e); 155;e.GetParent().CheckLightboxIcons();$('option',e.GetEl('cbolightboxes')).each(function(){if($(this).val()==e.oCurLightbox.iId){$(this).prop('selected',!0)} 156else{$(this).prop('selected',!1)}});if(i){i()}} 157else{$$.ShowDialogNotification(t.sMsg,{sTitle:'Warning'})}}})};AddPhotoToNewLightbox(t,i,e,s){if(e.length>0){var o=this;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{sNewName:e},sMethodHash:'',bShowProgress:!1,fPostActions:function(h){if(h.bOk){o.oCurLightbox=new Lightbox(o.GetMyName()+'.oCurLightbox',h.mResults,o);var n=!1;for(var a=0;a<o.aLightboxes.length;a++){if(!o.aLightboxes[a].bIsTemp&&o.aLightboxes[a].sName>e){o.aLightboxes.splice(a,0,o.oCurLightbox);n=!0;break}};if(!n){o.aLightboxes.push(o.oCurLightbox)};o.GetParent().CheckLightboxIcons();var l;if(t>0){o.LightboxAddPhoto(t,l,o.oCurLightbox.iId)} 158else{o.LightboxAddPhotosFromSearch(i,!0)};if(s){s()};o.HideRightPanel()} 159else{$$.ShowDialogNotification(h.sMsg,{sTitle:'Save to new lightbox'})}}})}};LightboxNew(){sNewName=this.GetEl("sNewName").val().trim();if(sNewName.length>0){var t=this;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{sNewName:sNewName},sMethodHash:'',bShowProgress:!1,fPostActions:function(i){if(i.bOk){t.oCurLightbox=new Lightbox(t.GetMyName()+'.oCurLightbox',i.mResults,t);var o=!1;for(var e=0;e<t.aLightboxes.length;e++){if(!t.aLightboxes[e].bIsTemp&&t.aLightboxes[e].sName>sNewName){t.aLightboxes.splice(e,0,t.oCurLightbox);o=!0;break}};if(!o){t.aLightboxes.push(t.oCurLightbox)};t.GetParent().CheckLightboxIcons();t.GetEl("renamectrls").hide();t.GetEl("lightboxlist").show()} 160else{$$.ShowDialogNotification(i.sMsg,{sTitle:'Warning'})}}})}};LightboxRename(){var e=this.oCurLightbox.iId,o=this.oCurLightbox.bIsTemp,i=this.GetEl("sNewName").val().trim();if(i.length>0){var t=this;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{iIdLightbox:e,sNewName:i},sMethodHash:'',bShowProgress:!1,fPostActions:function(s){if(s.bOk){if(s.mResults.iId!=t.oCurLightbox.iId){t.oCurLightbox=new Lightbox(t.GetMyName()+'.oCurLightbox',s.mResults,t);var a=!1;for(var h=0;h<t.aLightboxes.length;h++){if(!t.aLightboxes[h].bIsTemp&&t.aLightboxes[h].sName>i){t.aLightboxes.splice(h,0,t.oCurLightbox);a=!0;break}};if(!a){t.aLightboxes.push(t.oCurLightbox)};if(o){for(var h=0;h<t.aLightboxes.length;h++){if(t.aLightboxes[h].bIsTemp)t.aLightboxes[h].iNumPhotos=0}};t.GetParent().CheckLightboxIcons()} 161else{for(var h=0;h<t.aLightboxes.length;h++){if(t.aLightboxes[h].iId==e){t.aLightboxes[h].sName=i;break}};t.oCurLightbox.sName=s.mResults.sName};t.GetEl("renamectrls").hide();t.GetEl("lightboxlist").show()} 162else{$$.ShowDialogNotification(s.sMsg,{sTitle:'Warning'})}}})}};HideRightPanel(){this.rightPanelOpened=!1;
162if(this.bWelcomeRetailOpen){var t=this;this.bWelcomeRetailOpen=!1;$(window).unbind('beforeunload.register');AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',sMethodHash:'',bShowProgress:!1,fPostActions:function(t){if(t.bOk){document.location.reload()} 163else{$$.ShowDialogNotification('Error sending the welcome email',{sTitle:'Email sending'})}}})} 164else{if(typeof this.bActiveBudget!='undefined'&&this.bActiveBudget){document.location.reload()} 165else{if(!this.bCleanUrl){if(this.fPostCloseAction){this.fPostCloseAction()} 166else{$('#rightpanelBack').animate({opacity:'0%'},500);$('#rightPanel').animate({right:-450},500);var t=this;setTimeout(function(){$('body').css('overflow','auto');$('#rightPanel').hide();$('#rightpanelBack').hide();$('div[id="rightPanel"]').hide()},500)}} 167else{document.location='/'}}}};RenderRightPanelHtml(t,i,e,o,s){this.PrepareRightPanel(t);this.GetEl('rightPanelContent').html(i);this.ShowRightPanel(e,o,s)};PrepareRightPanel(t){var i=this;if($('#rightpanelBack').length==0){$('<div>').attr('id','rightpanelBack').on('click',function(){i.HideRightPanel()}).appendTo('body')} 168else{$('#rightpanelBack').show()};if($('#rightPanel').length==0){$('<div>').attr('id','rightPanel').css('z-index',1000).addClass('std').appendTo('body')};this.Render2($('#rightPanel'),'right_panel');this.GetEl('rightPanelTitleTxt').html(t)};ShowRightPanel(t,i,e){if(typeof t=='undefined')t=!0;$('div[id="rightPanel"]').show();$('body').css('overflow','hidden');if(t&&!this.rightPanelOpened){this.rightPanelOpened=!0;$('#rightpanelBack').css('opacity',0);$('#rightPanel').css({right:-450});$('#rightpanelBack').animate({opacity:'40%'},500);$('#rightPanel').animate({right:0},500)} 169else{$('#rightPanel').css({right:0});$('#rightpanelBack').css('opacity','40%')};this.fPostCloseAction=e;this.SetRightPanelEvents();if(i)i()};RenderRightPanel(t,i,e,o){var s=this;this.PrepareRightPanel(t);this.Render2(this.GetEl('rightPanelContent'),i,{oExtraParams:o});this.ShowRightPanel(e);this.GetEl('rightPanelTitleTxt').parent().textfill({maxFontPixels:22,explicitWidth:370,explicitHeight:27})};MustDisplayAllLightboxesOption(){return(typeof this.aLightboxes!='undefined'&&this.aLightboxes&&this.aLightboxes.length>0)};CreateLightbox(){var i=trim(this.GetEl('sNewLightbox').val());if(!i)return;var t=this;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{sNewName:trim(t.GetEl('sNewLightbox').val()),bGetUpdatedLightboxList:!0},sMethodHash:'',bShowProgress:!1,fPostActions:function(e){if(e.bOk){t.RefreshLightboxes(e.mResults);t.GetEl('msgCreated').html('Lightbox $1 created and selected as current lightbox.'.replace('$1','<b>'+i+'</b>')).show()} 170else{$$.ShowDialogNotification(e.sMsg,{sTitle:'Create lightbox'})}}})};SetLightboxCreatedTxt=function(t){this.GetEl('msgCreated').html('Lightbox $1 created and selected as current lightbox.'.replace('$1','<b>'+t+'</b>')).show()};GoToLightboxes(){this.HideRightPanel();this.GetParent().ShowLightboxesContent()};ShowRightPanelContents(t,i,e){this.RenderRightPanelHtml(t,i,e)};ShowRightPanelUrl(t,i,e,o,s,h){if(typeof h=='undefined')h=!1;if(typeof s=='undefined')this.bCleanUrl=!1;else this.bCleanUrl=s;var l=this,n=function(i){$(document).scrollTop(0);l.RenderRightPanelHtml(t,i,e,o,h)};if(i.length>500&&i.indexOf('?')>0){var a=i.indexOf('?');$.post(i.substr(0,a),i.substr(a+1),n)} 171else{$.get(i,n)}};RefreshLightboxes(t,i){if(typeof i=='undefined')i=!0;var h=t.iIdNewLightbox,o=!1,s=!1;this.aLightboxes=[];for(var e=0;e<t.aLightboxes.length;e++){this.aLightboxes.push(new Lightbox(this.GetMyName()+'.aLightboxes['+this.aLightboxes.length+']',t.aLightboxes[e],this));if(t.aLightboxes[e].iId==h){o=!0;s=e}};if(!o&&this.aLightboxes.length==1){this.oCurLightbox=new Lightbox(this.GetMyName()+'.oCurLightbox',this.aLightboxes[0],this);this.LightboxSetActive(this.oCurLightbox.iId)} 172else if(!o){this.oCurLightbox=new Lightbox(this.GetMyName()+'.oCurLightbox',this.oCurLightbox,this)} 173else{this.oCurLightbox=new Lightbox(this.GetMyName()+'.oCurLightbox',t.aLightboxes[s],this);this.LightboxSetActive(this.oCurLightbox.iId)};if(i){this.RenderLightboxesRightPanel(!1)}};RenderLightboxesRightPanel(t){this.RenderRightPanel('Lightboxes','lightboxes_right_panel',t);this.oGallery=new AlbGallery(this.GetMyName()+'.oGallery',{aPhotos:this.oCurLightbox.aWebPhotos,_options:{max_height:200}},this.GetParent(),this);if(this.oCurLightbox&&this.oCurLightbox.iId)$('option[value='+this.oCurLightbox.iId+']',this.GetEl("iIdLightbox")).prop('selected',!0);var i=this;this.GetEl('iIdLightbox').change(function(){i.LightboxSetActive(i.GetEl('iIdLightbox').val(),function(){i.RenderLightboxesRightPanel()})});setTimeout(function(){i.oGallery.Render(i.GetEl("lightboxPhotosDiv"),!0,'lightbox_right_panel');i.CheckPhotoIsInCart()},400)};CheckPhotoIsInCart=function(){if(this.oCurLightbox.aWebPhotos){for(var t=0;t<this.oCurLightbox.aWebPhotos.length;t++){if(top.oNavigation.IsPhotoInCart(this.oCurLightbox.aWebPhotos[t].iId)){var i=this.oCurLightbox.aWebPhotos[t].iId;$('#btnAddToCart_'+i).hide();$('#btnAddToCartDisabled_'+i).show()}}}};ShowRightPanelLightboxes(){var t=this;this.GetLatestLightboxesList(function(){t.RenderLightboxesRightPanel(!0)})};ShowLogIn(t,i){this.bLogInFromCart=i;this.RenderRightPanel('Sign in','log_in_right_panel',t);var e=this;e.GetEl('sUser').val('');e.GetEl('sPwd').val('');setTimeout(function(){e.GetEl('sUser').focus()},500)};LogInFromForm(t){if(this.FillFromForm()){this.LogIn(this.GetEl('sUser').val(),this.GetEl('sPwd').val(),this.GetEl('bKeepSession').is(':checked'),this.GetEl('theMsg'),t)}};LogIn(t,i,e,o,s,a){var h=this;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{sUserName:t,sPwd:i,bKeepSession:e},sMethodHash:'',bShowProgress:!1,fPostActions:function(t){if(t.bOk&&t.mResults.bOk){if(!t.mResults.bIsRetail&&t.mResults.bChangeCartToLightbox){if
173(h.bLogInFromCart){h.GetParent().setHistoUrl('/lightbox/'+t.mResults.iIdLightbox);h.ShowRightPanelUrl('Lightbox created','/web/views/forms/v_cart_to_lightbox.php?sLightboxName='+t.mResults.sLightboxName,!1,undefined,!1,function(){location.reload()})} 174else{h.ShowRightPanelUrl('Lightbox created','/web/views/forms/v_cart_to_lightbox.php?iIdLightbox='+t.mResults.iIdLightbox+'&sLightboxName='+t.mResults.sLightboxName,!1,undefined,!1,function(){location.reload()})};if(s)s()} 175else{if(s)s();location.reload()}} 176else{o.html('Wrong username and/or password.');o.show();if(a){a.show()} 177else{h.GetEl('errorMsgRow').show()}}}})};GetLatestLightboxesList(t){var i=this;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',sMethodHash:'',bShowProgress:!1,fPostActions:function(e){if(e.bOk){var h=0;if(i.oCurLightbox)h=i.oCurLightbox.iId;var s=!1;i.aLightboxes=[];for(var o=0;o<e.mResults.length;o++){i.aLightboxes.push(new Lightbox(i.GetMyName()+'.aLightboxes['+i.aLightboxes.length+']',e.mResults[o],i));if(e.mResults[o].iId==h){s=!0}};if(!s)i.oCurLightbox=new Lightbox(i.GetMyName()+'.oCurLightbox',i.oCurLightbox,i);if(t)t()} 178else{$$.ShowDialogNotification(e.sMsg,{sTitle:'Warning'})}}})};SetRightPanelEvents(){var t=this;this.GetEl('rightPanelClose').click(function(i){t.HideRightPanel()})};RenderFilmTitlesRightPanel(t,i){var s;if(i)s='Available filmography';else s='Films';this.RenderRightPanel(s,'film_titles_right_panel',!0,{aFilmTitles:t});var a=this;for(var e=0;e<t.length;e++){var o=t[e].sText.toUpperCase();if(t[e].sDate.length>0)o+=' ('+t[e].sDate+')';o=o.replace('"','"');var h=this.GetEl('filmtitles');(function(t){$('<li>').html(o).attr('attAlbTooltip',o).addClass('film').appendTo(h).click(function(){a.ShowFilmPhotos(t)})})(t[e])}};OpenContactUsRightPanel(t,i,e){$(document).scrollTop(0);var o=undefined;if(i||e)o=function(){if(i){oContactUsForm.setMessage(i)};if(e){oContactUsForm.setSubject(e);oContactUsForm.setSubjectUnAvailable(!0)}};if(typeof t=='undefined')this.ShowRightPanelUrl('Contact us','/web/views/forms/v_contact_us.php',!0,o);else this.ShowRightPanelUrl(t,'/web/views/forms/v_contact_us.php',!0,o)}};;class RisUploader extends AlbBaseObj{constructor(t,e,s){super(t,e,s);this.bIsSearching=!1;this.bUploading=!1;this.bCanSearch= 179true};LoadInfo(t){this.tmpl_sTmplBasePath='/web/views/javascript/obj/';this._options={ajaxURL:'/web/controllers/ajax/a_ris.php',ajaxSearchUrlMethodHash:'',action:'/web/controllers/ajax/upload/a_ris_upload_and_search.php',multiple:!1,maxConnections:1,debug:!1,autoUpload:!0,messages:{invalidurl:'Error getting image from URL.',searching:"There is already a search in progress.\nTo start a new search, please wait until current search is completed.",multipleFileDropNotAllowedMessage:'Please drag only one file.'}};this.oDragStatus={bDragging:!1,bDoingIt:!1,oInitPos:{x:-1,y:-1},bVisualSearchShown:!1,reset:function(){this.bDragging=!1;this.bDoingIt=!1;this.oInitPos={x:-1,y:-1}}};var e=this;$(document).ready(function(){$('<div>').addClass('visualsearch').addClass('fulloverlay').css('position','absolute').css('background-color','transparent').css('width','0').css('height','0').css('top',0).css('left',0).css('z-index',10000000).appendTo('body');e.SetEvents();e.CreateFileInput(); 180 181})};RelaunchBinarySearch(){this.SetSearching(!0);this.GetParent().oRisSummary.StartUpload();var t=this;AskServer({sUrl:t._options.ajaxURL,sMethodHash:'',bShowProgress:!1,fPostActions:function(e){t.bUploading=!1;t._onDone(!1,e)}})};Render(t,e){this.Render2(t,e);if(this.GetEl('recaptcha').length>0){var s=this;this.RenderCaptcha('https://www.recaptcha.net/recaptcha/api.js?hl= en','6LeLSMweAAAAAFQm2x1GxmseP0rzabvkoFlgGN1G')}};_error(t){alert(t)};_onDone(t,e){this.bUploading=!1;if(this.bCanSearch){ 182;var s=e;if(typeof e.result!='undefined')s=e.result;if(s.bOk){if(s.mResults.sImage){this.GetParent().oRisSummary.RenderThumbBase64(s.mResults.sImage)};if(s.mResults.bInProgress){this.GetParent().oRisSummary.Searching()} 183else{this.GetParent().oRisSummary.SearchEnd(s.mResults.iNumFound);this.SetSearching(!1)};this.showListOfresults(s)} 184else{var i=s.sMsg?s.sMsg:'Unknown error';this.GetParent().oRisSummary.Error(i);this.SetSearching(!1)}; 185}};_onChange(t,e){ 186};_onFail(t,e){};checkNumFiles(t,e){if(typeof t.originalEvent.dataTransfer!='undefined'&&t.originalEvent.dataTransfer.files.length>1){if(t.originalEvent.dataTransfer.files.length==2){if(t.originalEvent.dataTransfer.files[0].size==t.originalEvent.dataTransfer.files[1].size){if(typeof e=='undefined'){return!0} 187else{if(t.originalEvent.dataTransfer.files[0].name==e)return!0;return!1}};var i=0,a=0;for(var s=0;s<t.originalEvent.dataTransfer.files.length;s++){if([".bmp",".png"].includes(t.originalEvent.dataTransfer.files[s].name.substr(-4)))i++;else a++};if(i==1&&a==1){if(typeof e=='undefined'){return!0} 188else{if(![".bmp",".png"].includes(e.substr(-4))){return!0} 189else{return!1}}} 190else{return!1}} 191else{return!1}} 192else{return!0}};_onSend(t,e){if(this.bCanSearch){if(t.originalEvent.type=="paste")return!1;if(!this.checkNumFiles(t,e.files[0].name)){return!1};if(this.bUploading){this._error('2'+this._options.messages.searching);return!1}; 193;this.SetSearching(!0);this.GetParent().oRisSummary.StartUpload();return!0; 194}};_onDrop(t,e){return(this.bCanSearch)};_isValidImageUrl(t,e){var s=new Image();s.onerror=function(){e(t,!1)};s.onload=function(){e(t,!0)};s.src=t};_uploadURL(t,e){if(this.bCanSearch){ 195;this.SetSearching(!0);this.GetParent().oRisSummary.StartUpload();this.GetParent().ClosePopup();var s=this;AskServer({sUrl:s._options.ajaxURL,oParams:{'sUrlPlain':t,'sUrlHtml':e},sMethodHash:s._options.ajaxSearchUrlMethodHash,bShowProgress:!1,fPostActions:function(t){s.bUploading=!1;s._onDone(!1,t)}}); 196}};SetSearching(t){this.ClosePopup();this.bIsSearching=t;this.bUploading=t;top.oNavigation.ShowTopSearchBox()};MouseUp(t){if(this.oDragStatus.bDoingIt){$('.visualsearch.fulloverlay').css('width','0').css('height','0');this.oDragStatus.reset()}};DragLeave(t){ 197;this.HighlightDropArea(!1); 198;this.oDragStatus.reset();t.preventDefault();t.stopPropagation()};DragOver(t){if(this.oDragStatus.bDoingIt){t.preventDefault();t.stopPropagation();return};var e=!1;if(!this.oDragStatus.bDragging){this.oDragStatus.oInitPos.x=t.originalEvent.screenX;this.oDragStatus.oInitPos.y=t.originalEvent.screenY;this.oDragStatus.bDragging=!0;if(this.oDragStatus.oInitPos.x<10||this.oDragStatus.oInitPos.y<111||this.oDragStatus.oInitPos.x>$(window).width()-10||this.oDragStatus.oInitPos.y>$(window).height()-10){e=!0}};
198if(!e){if(Math.abs(this.oDragStatus.oInitPos.x-t.originalEvent.screenX)+Math.abs(this.oDragStatus.oInitPos.y-t.originalEvent.screenY)>200){e=!0}};if(e){this.oDragStatus.bDoingIt=!0; 199;if(!this.oDragStatus.bVisualSearchShown){this.ShowPopup(!0)} 200else{this.HighlightDropArea(!0)}; 201};t.preventDefault();t.stopPropagation()};Drop(t){if(this.oDragStatus.bDoingIt&&this.bCanSearch){this.oDragStatus.reset(); 202 203;var e=!0;if(t.originalEvent.dataTransfer.files.length==0){e=!1} 204else{if(t.originalEvent.dataTransfer.types instanceof Array){if(t.originalEvent.dataTransfer.types.indexOf('text/plain')>=0||t.originalEvent.dataTransfer.types.indexOf('text')>=0)e=!1} 205else{if(t.originalEvent.dataTransfer.types.contains('text/plain')||t.originalEvent.dataTransfer.types.contains('text'))e=!1}};if(e){if(!this.checkNumFiles(t)){this._error(this._options.messages.multipleFileDropNotAllowedMessage);$('.visualsearch.fulloverlay').css('width','0').css('height','0');return!1}} 206else{var s=!1;if(t.originalEvent.dataTransfer.types instanceof Array){if(t.originalEvent.dataTransfer.types.indexOf('text/plain')>=0)s=!0} 207else{if(t.originalEvent.dataTransfer.types.contains('text/plain'))s=!0};if(s)this._uploadURL(t.originalEvent.dataTransfer.getData('text/plain'),t.originalEvent.dataTransfer.getData('text/html'));else this._uploadURL(t.originalEvent.dataTransfer.getData('text'),t.originalEvent.dataTransfer.getData('URL'));return!1}; 208 209;t.preventDefault();t.stopPropagation()};return!1};CloseDragLoginPopup(){this.bLoginShown=!1;this.oDragStatus.reset();$('.visualsearch.fulloverlay').css('width','0').css('height','0')};SetEvents(){$(document).on('dragover',this.DragOver.bind(this));var t=this;$('.visualsearch.fulloverlay').on('dragover',this.DragOver.bind(this));$('.visualsearch.fulloverlay').on('drop',this.Drop.bind(this));$('.visualsearch.fulloverlay').on('dragleave',this.DragLeave.bind(this));$(document).on('mouseup',this.MouseUp.bind(this))};ClosePostActions(){this.oDragStatus.reset();this.HighlightDropArea(!1);this.oDragStatus.bVisualSearchShown=!1};ShowPopup(t){if(typeof t=='undefined')t=!1; 210;var e=this;this.GetParent().ShowInnerPopup('/web/views/top_menu/v_visual_search.php',{iWidth:740,iHeight:390,fActionsPostClosingPopup:this.ClosePostActions.bind(this),bClosePrevious:!0},function(){e.HighlightDropArea(t)});this.oDragStatus.bVisualSearchShown=!0; 211};HighlightDropArea(t){if(t){$('.visualsearch.fulloverlay').css('width','100%').css('height','100%');$('.visualsearch .instructions').hide();$('.visualsearch .dropinstructions').show()} 212else{$('.visualsearch.fulloverlay').css('width','0').css('height','0');$('.visualsearch .instructions').show();$('.visualsearch .dropinstructions').hide()}};CreateFileInput(){var t=this;$('<input id="elfileupload" aria-label="File upload" type="file" style="position:fixed; left: -100em;">').appendTo('body').fileupload({url:this._options.action,dataType:'json',send:this._onSend.bind(this),done:this._onDone.bind(this),fail:this._onFail.bind(this),change:this._onChange.bind(this),drop:this._onDrop.bind(this),dropZone:$('.visualsearch.fulloverlay'),pasteZone:null}).click(function(e){ 213;if(this.bUploading){this._error('1'+t._options.messages.searching);return!1};return!0; 214})};ClosePopup(){this.GetParent().ClosePopup()};VerifyCaptcha(){var t=this;this.SubmitWithCaptcha(function(e){AskServer({sUrl:'/web/controllers/ajax/a_ris.php',sMethodHash:'',bShowProgress:!1,oParams:{sCaptchaResponse:e},fPostActions:function(e){if(e.bOk){t.ShowPopup()} 215else{t.GetEl('errMsg').html(e.sMsg).show()}}})})};showListOfresults(t){$('#contentarea').empty();var s=$('<div>').appendTo('#contentarea'),e=this;this.oRisResults=new RisSearchResults(e.GetMyName()+'.oRisResults',t.mResults.iIdSearch,t.mResults.sIdRunningSearch,{fOnWholeSearchComplete:function(t,s){e.GetParent().oRisSummary.SearchEnd(s,t.mResults.iNumImgsToSearch);e.SetSearching(!1);if(s==0){e.GetParent().ShowContent('/web/views/v_tips.php')}},fOnSearchError:function(t){e.GetParent().oRisSummary.Error(t.sMsg);e.SetSearching(!1)}},s,e.GetParent());this.oRisResults.bInProgress=t.mResults.bInProgress;this.oRisResults.GetMoreResults()}};;class Navigation extends AlbBaseObj{constructor(e){super(e);this.tmpl_sTmplBasePath='/web/views/javascript/obj/';var t=this;window.setInterval(function(){t.KeepSession()}, 2161200*1000);this.oTextSummary=new TextSummary(this.GetMyName()+'.oTextSummary',{sContainer:'summresults'},this);this.oRisSummary=new RisSummary('summresults');this.oRisUploader=new RisUploader(this.GetMyName()+'.oRisUploader',{},this)};static tmpl_F={IMAGES:'1',CREATIVE_IMAGES:'2',VIDEOS:'3',CREATIVE_VIDEOS:'4',};_ShowHideSearchSummary(e){if(e){$('#webmain #summary').removeClass('risresutls');$('#contents').css('margin-top',0);$('#webmain #summary').show()} 217else{$('#webmain #summary').hide()}};ShowEditLightbox(e){this.ShowTopSearchBox(!0);this.ShowContent('/web/views/lightboxes/v_edit_lightbox.php?iIdLightbox='+e,!0,'/lightbox/'+e)};ShowContent(e,t,o,i,s){if(typeof s=='undefined')s='Album';if(s)$('head title').html(s);this.HideMenu();if(this.oGallery)this.oGallery.SetAsTemporary();if(o)this.setHistoUrl(o);var n=this;$('#contentarea').load(e,function(){if(t)n._ShowHideSearchSummary(!1);$('#contents').scrollTop(0);if(i)i()})};Logout(){AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{},sMethodHash:'',bShowProgress:!1,fPostActions:function(e){if(e.bOk){document.location.href='/'}}})};HideSummary(){this._ShowHideSearchSummary(!1)};ShowSummaryTitle(e){this.oTextSummary.PrintSummary({bJustDescr:!0,searchDescr:e});this._ShowHideSearchSummary(!0)};LogInToDownload(e,t){this.oLeftArea.ShowRightPanelUrl('Indentification','/web/views/forms/v_login_download_cart.php?sUrlCode='+e+'&bLogin='+(t?'1':'0'),!0,undefined,
217!0)};ShowRisSummary(e){if(e){$('#webmain #summary').addClass('risresutls');$('#contents').css('margin-top',0);$('#webmain #summary').show()} 218else $('#webmain #summary').hide()};ShowSummarySearchError(e,t){this.ShowContent('/web/views/v_tips.php');this.oTextSummary.PrintNoResults('');if($('head meta[name="robots"][content="noindex"]').length==0){this.bNoIndexSetWithJs=!0;$('<meta name="robots" content="noindex">').appendTo('head')};AlbJsErr({message:'[AlbumWeb] Got an error executing a search',error:{xtrainfo:'Search params: '+JSON.stringify(e)+'; Result: '+JSON.stringify(t)}})};ShowTextSearchInProgress(e){this.oTextSummary.PrintSearching(e);this._ShowHideSearchSummary(!0)};ShowRISError(e){e=decodeURIComponent(e);this.ShowContent('/web/views/photos/v_ris_error.php',!1,!1,function(){$('#themsg').html(e)})};KeepSession(){var e=this;AskServer({sUrl:'/web/controllers/ajax/a_session.php',sMethodHash:'8c44210249aaca25548e0493e2882b13',bShowProgress:!1,iUIH:0,fPostActions:function(t){if(t.bOk){if(!t.mResults)e.SessionExpired()}}})};SessionExpired(){$$.ShowDialogNotification('Your session has expired.',{sTitle:'Warning'},function(){top.document.location.href='/'})};ShowCookiesBanner(e){ 219};OpenResetPwd(e){this.oLeftArea.ShowRightPanelUrl('Change password','/reset_pwd_form/'+e,!0)};setHistoParams(e,t){for(var o=0;o<e.length;o++){this.setHistoParam(e[o][0],e[o][1],t)}};ShowCookiesConfig(){this.ShowInnerPopup('/web/views/info/v_cookies_accept.php',{iWidth:860,iHeight:800,bClosePrevious:!0,bAllowCloseIt:!1},function(){$('#firstFocus').focus()})};CookiesAccept(e){this.ClosePopup();$('#cookies').hide();var o=[],i=[];if(typeof e=='undefined'){ 220;o.push( 2211);if(typeof window['gtag']==='function'){gtag('consent','update',{'analytics_storage':'granted'})}; 222;o.push( 2232);if(typeof window['gtag']==='function'){gtag('consent','update',{'analytics_storage':'granted'})}; 224;o.push( 2253);if(typeof window['gtag']==='function'){gtag('consent','update',{'analytics_storage':'granted'})}; 226} 227else{for(var t=0;t<e.length;t++){o.push(e[t]);if(typeof window['gtag']==='function'){if(e[t]== 2282){gtag('consent','update',{'analytics_storage':'granted'})}}}}; 229;i.push( 2301); 231;i.push( 2322); 233;i.push( 2343); 235;Cookies.set('cookiesType',i,{expires:3650});Cookies.set('acceptCookies',o,{expires:3650});AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',sMethodHash:'',bShowProgress:!1})};setHistoParam(e,t,o){if(e=='iAT'&&t=='1')return;try{var i=new URL(window.location);i.searchParams.set(e,t);if(typeof o=='undefined'||!('replaceState' in window.history))o=!1;if(o)window.history.replaceState({},null,i.toString());else $.history.push(i.toString())}catch(s){}};setHistoUrl(e,t,o){try{if(typeof t=='undefined')t={};if(typeof o=='undefined'||!('replaceState' in window.history))o=!1;if(Object.keys(t).length>0){var i=[];for(const property in t){if(property=='iAT'&&t[property]== 2361)continue;if(Array.isArray(t[property])){i.push(property+'='+t[property].join('|'))} 237else{i.push(property+'='+encodeURIComponent(t[property]))}};if(i.length>0)i=i.sort();e+='?'+i.join('&')};if($.history.url()!=e){if(e.length<4000){if(o){window.history.replaceState({},null,e)} 238else{ 239;if('replaceState' in window.history)window.history.replaceState({},null,document.location.href);if($.history.url()!=e)$.history.push(e)}}}}catch(s){}};ExecSearchReloadAll(){if(this.oGallery&&this.oGallery.oMainSearchParams){if(this.oGallery.oSearchParams. 240iSSF)this.oGallery.oMainSearchParams. 241iSF=this.oGallery.oSearchParams. 242iSSF;this.ExecSearch(this.oGallery.oMainSearchParams,!1)}};SearchFilmPhotos(e){var t={};t. 243iSF= 2442;t. 245aiIM=e.iIdMeta;if(e.iIdTrans)t. 246aiIT=e.iIdTrans;t. 247aiMT= 24832;this.ExecSearch(t,!0,'',!1)};ExecSearch(e,t,o,i){if(typeof i=='undefined')i=!0;if(e. 249iSF!= 2504){if(this.oGallery&&this.oGallery.sRenderView&&this.oGallery.sRenderView!='detail_ris'){e. 251sGs=this.oGallery.sRenderView};var r=['/anniversary_selection/','/photonews_article_selection/','/promo/'],n=!1;for(var s=0;s<r.length&&!n;s++){n=(document.location.href.indexOf(r[s])>=0)};this.setHistoUrl("/en/search",e,n)};this.DoExecSearch(e,t,o,i)};ExecSearchNewOrder(e){var t=$.extend({},this.oGallery.oMainSearchParams);t. 252iPP=1;t. 253iSo=e;var o='';if(t. 254sT)o=t. 255sT.toUpperCase();this.ShowTextSearchInProgress(o);
255this.ExecSearch(t,!1,undefined,!1)};SearchIsAFilter(e){if(e. 256iICF)return!0;if(e. 257aiIMF)return!0;return!1};ReExecSearchAfterCaptcha(){this.DoExecSearch(this.tmpl_oExecParamsParams,this.tmpl_oExecParamsShowSearchingMsg,this.tmpl_oExecParamsSearchBoxText,this.tmpl_oExecParamsShowFoundFilms)};DoExecSearch(e,t,i,n){if(typeof t=='undefined')t=!0;if(typeof n=='undefined')n=!0;if(typeof i!='undefined'&&trim(i).length>0){$('.search-box input[name="__cps_sT"]').val(i.trim())} 258else{if(typeof e. 259sT!='undefined'){$('.search-box input[name="__cps_sT"]').val(decodeURIComponent((e. 260sT.trim()).replace(/\+/g,'%20')))}};this.ShowTopSearchBox();let sSearchTitle='';let bColor=!1,bBw=!1,bLandscape=!1,bPortrait=!1;let iScrollPos=-1;let sGalleryType='';for(var s in e){if(s=='iSp')iScrollPos=e[s];if(s=='sGs'&&e[s]!='detail_ris')sGalleryType=e[s];if(s=='sT')sSearchTitle=e[s].toUpperCase();if(s=='bC'&&e[s]==1)bColor=!0;if(s=='bBW'&&e[s]==1)bBw=!0;if(s=='bV'&&e[s]==1)bPortrait=!0;if(s=='bH'&&e[s]==1)bLandscape=!0;if(s=='iSF'&&e[s]== 2616)sSearchTitle='lightbox'};this.SelectSearchType(e['iAT'],e['iCr']);let sFilter='';if(bColor&&!bBw)sFilter+=' color';if(!bColor&&bBw)sFilter+=' BW';if(bPortrait&&!bLandscape)sFilter+=' portrait';if(!bPortrait&&bLandscape)sFilter+=' landscape';if(sFilter!='')sSearchTitle+=' ('+trim(sFilter)+')';let from=e['iSF'];let refreshLeftA=(from== 2621||from== 2634||from== 2647||from== 2653||from== 2669||e.bForceRefreshLeftArea==!0);let refreshContentA=(from!= 2674);if(t)this.ShowTextSearchInProgress(sSearchTitle);else if(refreshContentA)$('#summary').contents().find('#summarySearchSpin').show();var o=this;if(e. 268iSF!= 2694&&o.oGallery){o.oGallery.SetAsTemporary();o.oTmpGallery=o.oGallery;o.oGallery.SetMyName(o.GetMyName()+'.oTmpGallery');delete o.oGallery};AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{oSearchParams:e},sMethodHash:'',bShowProgress:!1,fPostActions:function(s){if(s.bOk){if(s.mResults.bDontNeedCaptcha){if(e. 270iSF!= 2714){s.mResults.oSearchResult.options={};s.mResults.oSearchResult.options.oFocusElement=$('#contentarea',top.document);s.mResults.oSearchResult.options.bScrollLoading=!0;s.mResults.oSearchResult.options.bScrollLoadingClassic=!1;s.mResults.oSearchResult.options.iContainerMargin=5;if(s.mResults.oSearchResult.oSummaryInfo.iAT){e. 272iAT=s.mResults.oSearchResult.oSummaryInfo.iAT;o.SelectSearchType(s.mResults.oSearchResult.oSummaryInfo.iAT,e['iCr'])};var r=null;if(o.SearchIsAFilter(e)){if(o.oTmpGallery){r=o.oTmpGallery.oMainSearchParams} 273else{r=$.extend({},e);delete r. 274iICF;delete r. 275aiIMF;r. 276iSF=r. 277iSSF;delete r. 278iSSF}} 279else{r=e};delete o.oTmpGallery;s.mResults.oSearchResult.oSearchParams=e;if(s.mResults.oSearchResult.aPhotos.length==0&&$('head meta[name="robots"][content="noindex"]').length==0){o.bNoIndexSetWithJs=!0;$('<meta name="robots" content="noindex">').appendTo('head')} 280else{if(o.bNoIndexSetWithJs){o.bNoIndexSetWithJs=!1;$('head meta[name="robots"][content="noindex"]').remove()}};o.oGallery=new AlbGallery(o.GetMyName()+'.oGallery',s.mResults.oSearchResult,o);o.oGallery.oMainSearchParams=r;o.oGallery.oSearchParams=e;o.oGallery.RenderPagination($('#summpagination'));$('#contentarea').empty();$('#contents').scrollTop(0);if(s.mResults.oSearchResult.oPagination.iTotalNumItems==0){o.ShowContent('/web/views/v_tips.php?sT='+encodeURIComponent(e. 281sT))} 282else{o.oGallery.Render('contentarea',!0,sGalleryType,iScrollPos);$('#contentarea').focus(); 283};let bHideSort=!1;if(e. 284iSF){if(parseInt(e. 285iSF)== 2866){bHideSort=!0}};o.oTextSummary.PrintSummary(s.mResults.oSearchResult.oSummaryInfo,s.mResults.oSearchResult.oFilms,bHideSort);o.tmpl_oExecParamsParams=!1;o.tmpl_oExecParamsShowSearchingMsg=!1;o.tmpl_oExecParamsSearchBoxText=!1;o.tmpl_oExecParamsShowFoundFilms=!1} 287else{o.oLeftArea.RenderFilmTitlesRightPanel(s.mResults.oSearchResult.oFilms.aResults,!0)};if(s.mResults.oSearchResult.sTitle){$('head title').html(s.mResults.oSearchResult.sTitle)};$(document).off('.photodetail');$(window).off('.photodetail')} 288else{o.tmpl_oExecParamsParams=e;o.tmpl_oExecParamsShowSearchingMsg=t;o.tmpl_oExecParamsSearchBoxText=i;o.tmpl_oExecParamsShowFoundFilms=n;o.RenderPopup2('text_search_captcha',{iWidth:550,iHeight:330,bAllowCloseIt:!0,bCenter:!1});if(o.GetEl('recaptcha').length>0){o.RenderCaptcha('https://www.recaptcha.net/recaptcha/api.js?hl= en','6LeLSMweAAAAAFQm2x1GxmseP0rzabvkoFlgGN1G')};o.GetEl('visualSearchVerifyBtn').on('click',function(){o.VerifyCaptchaForTextSearch();return!1})}} 289else{o.ShowSummarySearchError(e,s)}}})};VerifyCaptchaForTextSearch(){var e=this;this.SubmitWithCaptcha(function(t){AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',sMethodHash:'',bShowProgress:!1,oParams:{sCaptchaResponse:t},fPostActions:function(t){if(t.bOk){e.ClosePopup();e.ReExecSearchAfterCaptcha()} 290else{e.GetEl('errMsg').html(t.sMsg).show()}}})})};FilterColl(e,t){var o=$.extend({},this.oGallery.oMainSearchParams);o. 291iSSF=o. 292iSF;o. 293iSF= 29440;o. 295iICF=t;o. 296iPP=1;o. 297iISS=e;o. 298iPP=1;
298this.ExecSearch(o,!1,undefined,!1)};FilterMeta(e,t){var o=$.extend({},this.oGallery.oMainSearchParams);o. 299iSSF=o. 300iSF;o. 301iSF= 30241;if(o. 303aiIMF){if(Array.isArray(o. 304aiIMF))o. 305aiIMF.push(t);else o. 306aiIMF=[o. 307aiIMF,t]} 308else{o. 309aiIMF=t};o. 310iPP=1;o. 311iISS=e;this.ExecSearch(o,!1,undefined,!1)};SearchAssetType(e){var t=$.extend({},this.oGallery.oMainSearchParams);t. 312iAT=e;t. 313iPP=1;this.ExecSearch(t,!0,undefined,!0)};ExecSearchFromForm(e,t){var i={};var t=$(t)[0];for(var o=0;o<t.length;o++){if(t[o].name.indexOf(e)==0){if($(t[o]).attr('type')=='radio')i[t[o].name.substr(e.length,t[o].name.length)]=$('input[name="'+t[o].name+'"]:checked',t).val();else i[t[o].name.substr(e.length,t[o].name.length)]=t[o].value.trim()} 314else{if(t[o].name=='asset_type'){switch(t[o].value){case Navigation.tmpl_F.CREATIVE_IMAGES:case Navigation.tmpl_F.IMAGES:i['iAT']= 3151;if(t[o].value==Navigation.tmpl_F.CREATIVE_IMAGES)i['iCr']=1;break;case Navigation.tmpl_F.CREATIVE_VIDEOS:case Navigation.tmpl_F.VIDEOS:i['iAT']= 3162;if(t[o].value==Navigation.tmpl_F.CREATIVE_VIDEOS)i['iCr']=1}}}};this.ExecSearch(i)};GetPopupWindowDims(){ 317;if(!Cookies.get('detailw'))Cookies.set('detailw',1070,{expires:365});if(!Cookies.get('detailh'))Cookies.set('detailh',878,{expires:365});var e=parseInt(Cookies.get('detailw')),t=parseInt(Cookies.get('detailh')); 318;if(e<900)e=990;if(e<700)t=700;if(e>screen.width*0.9)e=screen.width*0.9;if(t>screen.height*0.9)t=screen.height*0.9;return[e,t]};GetPhotoDetailUrl(e,t,o){if(typeof t=='undefined')t=!1;if(typeof o=='undefined')o=!1;var i=[];if(t)i.push('iPop=1');if(!o)i.push('bPo=1');if(e.indexOf('?')>=0){e+='&'+i.join('&')} 319else{e+='?'+i.join('&')};return e};OpenPhotoDetail(e,t,o){e=this.GetPhotoDetailUrl(e,t,o);if(o){document.location.href=e} 320else{var i=this.GetPopupWindowDims();this.OpenPopupWindow(e,'photo_detail',i[0],i[1])}};LogInRightPanel(e,t){this.oLeftArea.ShowLogIn(e,t)};GotoLightboxes(){this.oLeftArea.ShowRightPanelLightboxes()};ShowCartCheckout(){this.ShowContent('/web/views/shopping_cart/v_checkout_shopping_cart.php',!0,'/checkout')};ShowBudget(e){this.ShowContent('/web/views/shopping_cart/v_checkout_budget.php?sUrlCode='+e,!0,'/budget/'+e)};ShowBudgetFailed(e,t){this.ShowBudget(e);$$.ShowDialogNotification('The payment could not be processed.'+"<br>"+t,{sTitle:'Warning'})};ShowCartFailed(e){this.ShowContent('/web/views/shopping_cart/v_checkout_shopping_cart.php',!0,'/checkout');$$.ShowDialogNotification('The payment could not be processed.'+"<br>"+e,{sTitle:'Warning'})};ShowCart(e,t,o,i){if(e){this.ShowContent('/web/views/shopping_cart/v_shopping_cart_paid.php?sUrlCode='+e+'&bJustBought='+(t?1:0)+'&bExtendPhotoNumDownload='+(o?1:0),!0,'/cart/'+e)} 321else{if(!i&&this.oCart.getNumItems()<=0)this.OpenNoticeRightpanel('Empty cart','<p>Your cart does not contain any images.</p>');else this.ShowContent('/web/views/shopping_cart/v_shopping_cart.php',!0,'/cart')}};ShowOrders(){ 322};ShowLightboxesContent(){this.ShowContent('/web/controllers/lightboxes/c_lightboxes_list.php',!0,'/lightboxes')};GotoSeeDeliveries(){this.ShowContent('/web/views/delivery_info/v_see_delnotes_info_summary.php')};
322OpenAdvSearchPopup(){var e=$('.search-box input[name="__cps_sT"]').val();top.oNavigation.ShowInnerPopup('/web/views/top_menu/v_adv_search.php',{iWidth:800,iHeight:830,bClosePrevious:!0},function(){if(e.length>0){$('#searchText').val(e)}})};ActiveExpiredBudget(e){this.oLeftArea.ShowRightPanelUrl('Request quote','/web/views/forms/v_active_budget.php?iIdBudget='+e,!0)};RequestBudget(e,t){if(typeof t=='undefined')t=!1;this.aRequestedWebCodes=e;this.oLeftArea.ShowRightPanelUrl('Request quote','/web/views/forms/v_request_budget.php?iIdBudgetCancelled='+t,!0)};OpenRegisterWindow(e){this.oLeftArea.ShowRightPanelUrl('Registration','/web/views/forms/v_register_corporate.php'+(e?'?sCo='+e:''),!1)};OpenWelcomeRetailUser(){this.oLeftArea.bWelcomeRetailOpen=!0;this.oLeftArea.ShowRightPanelUrl('Welcome','/web/views/forms/v_welcome_retails.php',!1);var e=this;$(window).bind('beforeunload.register',function(){AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',sMethodHash:'',bShowProgress:!1,fPostActions:function(e){if(e.bOk){} 323else{$$.ShowDialogNotification('Error sending the welcome email',{sTitle:'Email sending'})}}})})};OpenContactUsRightPanel(e,t,o){this.oLeftArea.OpenContactUsRightPanel(e,t,o)};OpenRegisterRetailUser(){this.oLeftArea.ShowRightPanelUrl('Registration','/web/views/forms/v_register_retails.php',!1)};OpenCreateLightboxRightpanel(e){this.oLeftArea.ShowRightPanelUrl('Create lightbox','/web/views/forms/v_create_new_lightbox_right_panel.php?iIdPhoto='+e,!0)};OpenNoticeRightpanel(e,t){this.oLeftArea.ShowRightPanelContents(e,t,!0)};OpenMyAccount(){this.oLeftArea.ShowRightPanelUrl('My account','/web/views/forms/v_my_account_right_panel.php',!0)};GotoDetailLink(e,t,i,s){var a=e;if(s== 32432){if(e.charAt(e.length-1)==')'){var n=e.split("(");if(n.length>1){var r=n[n.length-1].substr(0,n[n.length-1].length-1);if(r==parseInt(r)){n.pop();a=n.join('(')}}}};var o={};o. 325iSF= 3263;o. 327aiIT=[];o. 328aiMT=[];o. 329aiIM=[];o. 330aiIMF=[];o. 331sT=e;if(s== 33230){o. 333iSF= 3347;o. 335iIR=t} 336else{if(t){if(s>0||s== 337-22){if(i){o. 338aiIT.push(i);o. 339aiMT.push(s)} 340else{o. 341aiIM.push(t);o. 342aiMT.push(s)}}}};if(o.
343aiIT.length==0)delete o. 344aiIT;if(o. 345aiMT.length==0)delete o. 346aiMT;if(o. 347aiIMF.length==0)delete o. 348aiIMF;if(o. 349aiIM.length==0)delete o. 350aiIM;this.ExecSearch(o,!0,a)};OpenRemindPwdPopUp(e){if(typeof e=='undefined')e=!1;this.oLeftArea.ShowRightPanelUrl('Password recovery','/web/views/forms/v_request_pwd_reset.php',e)};SeeAnniversaryPhotos(e){var t={};t. 351iSF= 35224;t. 353iIAn=e;this.ExecSearch(t)};SeePhotonewsArticle(e){var t={};t. 354iSF= 35530;t. 356sPA=e;this.ExecSearch(t)};ChangeCountry(e){ 357};ForceRetail(e){ 358};isNear(e,t,o){var i=e.offset().left-t,s=e.offset().top-t,a=i+e.width()+2*t,l=s+e.height()+2*t,n=o.pageX,r=o.pageY;return(n>i&&n<a&&r>s&&r<l)};ChangeLang(e){if(location.href.substr(-3)=='/en'){document.location=location.href.substr(0,location.href.length-3)+'/'+e;return};if(location.href.indexOf('/en/')>=0){document.location=location.href.replace('/en/','/'+e+'/');return};AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{sLangCode:e},sMethodHash:'',bShowProgress:!1,fPostActions:function(e){if(e.bOk){document.location.reload()}}})};HideMenu(){this.GetEl('menuoptions').remove();if(this.oMenuActiveElement)this.oMenuActiveElement.removeClass('open');$(window).off('click.menu');$('body',top.document).off('mousemove.menu');this.oMenuActiveElement=null};ShowDropDownMenu(e,t){var i=this;this.GetEl('menuoptions').remove();this.oMenuActiveElement=e;var n=$('<div id="'+this.GetElId('menuoptions')+'">').css('left',-1000).addClass('menuoptions');for(var o=0;o<t.length;o++){var s=$('<div>').addClass('menuoption');if(t[o].url||t[o].event){var l=$('<a>').html(t[o].text);if(t[o].url)l.attr('href',t[o].url);if(t[o].event){s.on('click',t[o].event).addClass('event')};s.append(l)} 359else{s.html(t[o].text).addClass('nolink')};if(t[o].classes){for(var r=0;r<t[o].classes.length;r++){s.addClass(t[o].classes[r])}};s.appendTo(n)};$('html',top.document).append(n);var a=e.position().left;a=e.position().left+e.outerWidth()-n.outerWidth()-5;n.css('left',a).css('top',e.position().top+e.height()+1);e.addClass('open');$(window).on('click.menu',i.MenuOutsideClick.bind(i));$("iframe").contents().find("body").on('click.menu',i.MenuOutsideClick.bind(i));if(e.hasClass('menuhoverout')){$('body',top.document).on('mousemove.menu',i.MenuMouseMove.bind(i));$("iframe").contents().find("body").on('mousemove.menu',i.MenuMouseMove.bind(i))}};MenuMouseMove(e){if(this.oMenuActiveElement&&!this.isNear(this.oMenuActiveElement,20,e)){this.HideMenu()}};MenuOutsideClick(e){if(this.oMenuActiveElement&&!$(e.target).closest('#'+this.GetElId('menuoptions')).length&&!$(e.target).closest(this.oMenuActiveElement).length){this.HideMenu(this.oMenuActiveElement)}};AddDropDownMenu(e,t,o,i){if(typeof o=='undefined')o=!0;if(typeof i=='undefined')i=!0;var s=this;if(o)e.append('<div class="arrow arrowdown">');if(i){e.hover(function(){s.ShowDropDownMenu($(this),t)})} 360else{e.click(function(){s.ShowDropDownMenu($(this),t)})}};CheckLightboxIcons(){if(typeof this.GetGallery()!='undefined'){this.GetGallery().PrepareLightboxBtns();this.oTextSummary.UpdateSearchLightboxName()}};IsPhotoInCurLightbox(e){if(typeof this.oLeftArea!='undefined'&&typeof this.oLeftArea.oCurLightbox!='undefined'&&this.oLeftArea.oCurLightbox){return this.oLeftArea.oCurLightbox.HasPhoto(e)};return!1};LightboxShowPhotos(e){if(this.oLeftArea.LightboxExists(e)){this.oLeftArea.LightboxShowPhotos(e)}};LightboxSendByEmail(e){this.oLeftArea.LightboxSendByEmail(e)};LightboxAddToCart(e,t,o){this.oLeftArea.LightboxAddToCart(e,t,o)};LightboxSetActive(e){this.oLeftArea.LightboxSetActive(e)};LightboxAddPhoto(e,t,o){this.oLeftArea.LightboxAddPhoto(e,t,o)};LightboxRemovePhoto(e,t,o){this.oLeftArea.LightboxRemovePhoto(e,t,o)};LightboxRemovePhotos(e,t,o){this.oLeftArea.LightboxRemovePhotos(e,t,o)};LightboxDelete(e){this.oLeftArea.LightboxDelete(e)};LightboxDownloadZIP(e,t){ 361};LightboxAddPhotosFromSearch(e,t,o){this.oLeftArea.LightboxAddPhotosFromSearch(e,t,o)};GetGallery(){return this.oGallery};IsPhotoInCart(e){return(this.oCart.HasPhoto(e))};AddToCart(e,t){if(!this.IsPhotoInCart(e)){var o=this;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{iIdPhoto:e},sMethodHash:'',bShowProgress:!1,fPostActions:function(e){if(e.bOk){o.oCart=new ShoppingCart(o.GetMyName()+'.oCart',e.mResults);o.RefreshCartStatus();if(t)t()} 362else{$$.ShowDialogNotification(e.sMsg,{sTitle:'Warning'})}}})}};RemoveFromCart(e,t){if(this.IsPhotoInCart(e)){var o=this;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{iIdPhoto:e},sMethodHash:'',bShowProgress:!1,fPostActions:function(e){if(e.bOk){o.oCart=new ShoppingCart(o.GetMyName()+'.oCart',e.mResults);o.RefreshCartStatus();if(t)t()} 363else{$$.ShowDialogNotification(e.sMsg,{sTitle:'Warning'})}}})}};RefreshCartStatus(e,t){var i=!1;if(typeof e=='boolean')i=e;if(typeof e=='object')this.oCart=new ShoppingCart(this.GetMyName()+'.oCart',e);if(i){var o=this;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{},sMethodHash:'',bShowProgress:!1,fPostActions:function(e){if(e.bOk){o.oCart=new ShoppingCart(o.GetMyName()+'.oCart',e.mResults);o.RefreshCartStatus(!1,t)} 364else{console.log('Could not get current shopping cart')}}})} 365else{if(this.oCart.getNumItems()>0){$('#topcartnumber').html(this.oCart.getNumItems()).show()} 366else{$('#topcartnumber').hide()};if(typeof this.GetGallery()!='undefined'){this.GetGallery().PrepareCartBtns()};if(t){t()}}};ShowRequestPwdPopup(e){this.tmpl_fPostPwdPopupActions=e;this.oLeftArea.ShowRightPanelUrl('Authentication','/web/views/forms/v_remind_pwd_right_panel.php',!0)};
366RequestPwd(){if(this.FillFromForm(undefined,!0,'oTmpPwd')){var e=this;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{sPwd:e.oTmpPwd.sPwd},sMethodHash:'',bShowProgress:!1,fPostActions:function(t){if(t.bOk){e.tmpl_fPostPwdPopupActions();delete e.tmpl_fPostPwdPopupActions;e.ClosePopup()} 367else{$$.ShowDialogNotification(t.sMsg,{sTitle:'Warning'})}}})}};ExtractParams(e){var o=e.substring(e.indexOf('?')+1).split('&'),i={};for(var t=0;t<o.length;t++){o[t]=o[t].split('=');i[o[t][0]]=decodeURIComponent(o[t][1])};return i};ShowLoading(e){this.ShowContent('/web/views/frames/loading.php',!1,!1,e,!1)};ExecHistoCmd(e){if(e.substr(0,8)=='/search?'||e.substr(3,8)=='/search?'){this.ShowLoading();this.DoExecSearch(this.ExtractParams(e))} 368else{document.location=e}};initHisto(){var e,t=this;$.history.on('load change',function(e,o,i){if(e.type==='change'||(e.type==='load'&&i==='hash')){t.ExecHistoCmd(o)}}).listen();e=$.history.type();if(e==='hash'&&location.pathname.length>1){location.href='/#'+location.pathname} 369else if(e==='pathname'&&location.hash.substr(1,1)==='/'){location.href=location.hash.substr(1)}};ShowFilmTitles(e){this.oLeftArea.RenderFilmTitlesRightPanel(e)};ShowTopSearchBox(show=!0){$('#webmain').removeClass('home');$('#banner .search-box').hide();if(show){$('#top_form').css('display','table-cell');$('.home_options').hide();$('#topbar').removeClass('twolines')} 370else{$('#top_form').hide();$('.home_options').css('display','table-cell');$('#topbar').addClass('twolines')}};SelectSearchType(e,t){if(this.aDropdowns&&this.aDropdowns.length>0){let filter=this.aDropdowns[0].getValue();if(e!==undefined){ 371;filter=(parseInt(e)== 3722?Navigation.tmpl_F.VIDEOS:Navigation.tmpl_F.IMAGES); 373};for(let i=0;i<this.aDropdowns.length;i++){this.aDropdowns[i].setFilterValue(filter)}} 374else{let text='Search images';$('.search-box input[name="__cps_sT"]').each(function(e,t){$(t).attr('placeholder',text)})}}};;class GenericForm extends AlbBaseObj{constructor(t,e,i){super(t,e,i)};Render(t,e,i){this.Render2(t,e,i);if(this.GetEl('recaptcha').length>0){this.RenderCaptcha('https://www.recaptcha.net/recaptcha/api.js?hl= en','6LeLSMweAAAAAFQm2x1GxmseP0rzabvkoFlgGN1G')};var l=this;this.GetEl('theform').on('submit',function(){event.preventDefault();l.Submit()})};SetSubmitFunc(t){this.tmpl_fCallback=t.bind(this)};Validate(){return(this.FillFromForm())};SetValidateFunc(t){this.Validate=t.bind(this)};Submit(){if(this.Validate()){if(this.GetEl('recaptcha').length>0){this.SubmitWithCaptcha(this.tmpl_fCallback)} 375else{this.tmpl_fCallback()}}}};;function RisSearchResults(e,i,n,a,t,o,s,h){this.tmpl_sMyName=e;this.iIdSearch=i;this.sIdRunningSearch=n;this.aFoundPhotos=[];this.bInProgress=!0;this.iFromPhotoId=!0;if(typeof s=='undefined')s=!1;this.bWithinOtherPhotoDetail=s;this._actions=a;this.iNumPhotosWeHave=0;if(this.sIdRunningSearch){this.oRisResults=new AlbRisResults(e+'.oRisResults',{oNavigation:o},this);this.oRisResults.Render(t)} 376else{this.oGallery=new AlbGallery(e+'.oGallery',{bFromRis:!0,iIdSearch:this.iIdSearch,_options:{bIncremental:!0,bWithinOtherPhotoDetail:s,bOpenPhotosInline:h}},o);if(this.bWithinOtherPhotoDetail){this.oGallery.sRenderView='detail_ris';this.oGallery._options.max_height=180;this.oGallery._options.padding_horiz=2};this.oGallery.Render(t)}};RisSearchResults.prototype={GetMyName:function(){return this.tmpl_sMyName},DelayedMoreResults:function(){var e=this;function timerRelay(){e.GetMoreResults()};setTimeout(timerRelay,500)},CancelSearch:function(){if(confirm('Do you want to cancel the search?')){var e=this;AskServer({sUrl:'/web/controllers/ajax/a_ris.php',sMethodHash:'',bShowProgress:!1,oParams:{iIdSearch:e.iIdSearch,sIdRunningSearch:e.sIdRunningSearch},fPostActions:function(e){if(e.bOk){} 377else{}}})}},GetMoreResults:function(){var e=this;AskServer({sUrl:'/web/controllers/ajax/a_ris.php',sMethodHash:'',bShowProgress:!1,oParams:{iIdSearch:e.iIdSearch,sIdRunningSearch:e.sIdRunningSearch,aIdsSearchWeHave:e.oRisResults?e.oRisResults.GetIdsSearchedImgs():[],iNumPhotosWeHave:e.iNumPhotosWeHave},fPostActions:function(s){if(s.bOk){if(e.sIdRunningSearch){e.oRisResults.UpdateStatus(s.mResults,e.sIdRunningSearch);e.iNumPhotosWeHave+=s.mResults.aSearchedPhotos.length} 378else{for(var t=0;t<s.mResults.aFoundPhotos.length;t++){if(s.mResults.aFoundPhotos[t].iId==e.iFromPhotoId){s.mResults.aFoundPhotos.splice(0,1);break}};e.iNumPhotosWeHave+=s.mResults.aFoundPhotos.length;e.oGallery.AppendPhotos(s.mResults.aFoundPhotos);if(!this.bWithinOtherPhotoDetail){e.oGallery.RenderPagination($('#summpagination',top.document));e.oGallery.PreparePagination()}};e.bInProgress=s.mResults.bInProgress;if(e.bInProgress){e.DelayedMoreResults()} 379else{if(typeof e._actions!='undefined'&&typeof e._actions.fOnWholeSearchComplete!='undefined'){if(!e.sIdRunningSearch){e._actions.fOnWholeSearchComplete(s,e.oGallery.GetNumPhotos())} 380else{e._actions.fOnWholeSearchComplete(s,e.oRisResults.GetNumSearchedPhotosWithResults())}}};if(e.iNumPhotosWeHave==s.mResults.aFoundPhotos.length){if(typeof e._actions!='undefined'&&typeof e._actions.fOnHaveResults!='undefined')e._actions.fOnHaveResults(e.iNumPhotosWeHave)}} 381else{if(typeof e._actions!='undefined'&&typeof e._actions.fOnSearchError!='undefined')e._actions.fOnSearchError(s)}}})}};;
381class TextSummary extends AlbBaseObj{LoadInfo(t){super.LoadInfo(t);this.printed=!1;this.iNumPhotosSelected=!1;$.templates( 382{"text_summary":"\n{{if ~oS.bMyLightboxes}}\n\t<div class=\"active\">{{:~oS.totalNum}} lightboxes</div> \n{{else}}\n\t{{if ~oS.bJustDescr}}\n\t\t<div class=\"regular\">\n\t\t\t{{if ~oS.totalNum>0}}<div class=\"total active\"><span class=\"thetotal\">{{:~oS.totalNum}}{{if ~oS.bRS}}+{{/if}}</span> {{:~oS.mainTypeName}}</div> <div>></div>{{/if}}<h1 style=\"margin:0\">{{:~oS.searchDescr}}</h1>\n\t\t</div>\n\t\t\n\t\t<div class=\"icon\" id=\"addSearchToLightboxBtn\" style=\"margin-left: 10px\">\n\t\t\t\t\t<a href=\"javascript:{{:GetMyName()}}.AddResultsToLightbox()\">\n\t\t\t\t\t\t<img class=\"icon\" src=\"/common/images/add_item_black.svg\" style=\"height:20px;\">\n\t\t\t\t\t</a>\n\t\t\t\t\t<div id=\"saveSearchLightboxContent\" style=\"display:none;\" class=\"stillLeftTopArrow addSearchLightboxDiv mosaic\">\n\t\t\t\t\t\t<div id=\"saveSearchLightboxTransparent\" style=\"height: 29px;top:-20px; width: 60px; background-color: transparent; position: absolute;\"></div>\n\t\t\t\t\t\t<div style=\"padding-left:0px; padding-right:0px;\">\n\t\t\t\t\t\t\t<table class=\"addLightboxOptionsTbl\">\n\t\t\t\t\t\t\t\t<tr id=\"saveSearchLightboxFirstOptionTr\" class=\"firstOption\">\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<p style=\"color:black\">{{:~sFm}}</p>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr id=\"saveSearchLightboxSecondOptionTr\" class=\"secondOption\">\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t{{:~sSm}}\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t{{else}}\n\t\t{{if ~oS.iIdSearch<0}}\n\t\t\t<div class=\"active\">{{:~oS.searchDescr}} - <span class=\"thetotal\">{{:~oS.totalNum}}{{if ~oS.bRS}}+{{/if}}</span> {{:~oS.mainTypeName}}</div>\n\t\t{{else}}\n\t\t\t{{if ~oS.isReport}}\n\t\t\t\t<div>{{:~oS.title}} (<span class=\"thetotal\">{{:~oS.totalNum}}</span> {{:~oS.mainTypeName}})</div>\n\t\t\t{{else}}\n\t\t\t\t{{if ~oS.sTitle.length>0}}<table><tr><td><h1>{{:~oS.sTitle}}</h1>{{/if}}\n\t\t\t\t\n\t\t\t\t<div class=\"regular\">\n\t\t\t\t\t{{if ~oS.selectedMeta || ~oS.selectedColl}}\n\t\t\t\t\t\t<a class=\"total\" href=\"javascript:{{:GetMyName()}}.SeeAllPhotos({{:~oS.iIdSrcSearch}})\"><span class=\"thetotal\">{{:~oS.totalNum}}{{if ~oS.bRS}}+{{/if}}</span> {{:~oS.mainTypeName}}</a>\n\t\t\t\t\t{{else}}\n\t\t\t\t\t\t<div class=\"total active\"><span class=\"thetotal\">{{:~oS.totalNum}}{{if ~oS.bRS}}+{{/if}}</span> {{:~oS.mainTypeName}}</div>\n\t\t\t\t\t{{/if}}\n\t\t\t\t\t{{if ~oS.collections.length}}\n\t\t\t\t\t\t<div>></div>\n\t\t\t\t\t\t{{for ~oS.collections ~oTs=#data}}\n\t\t\t\t\t\t\t{{if iId==~oS.selectedColl}}\n\t\t\t\t\t\t\t\t<div class=\"active\">{{:sName.toLowerCase()}} {{:iNumPhotos}}</div>\n\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t<a href=\"javascript:{{:~oTs.GetMyName()}}.FilterColl({{:~oS.iIdSrcSearch}},{{:iId}})\">{{:sName.toLowerCase()}} {{:iNumPhotos}}</a> \n\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t{{if iId==1 && (~oS.numFilmTitles>0 || ~oS.numScenes>0 || ~oS.numPortraits >0 || ~oS.numFilms > 0)}}\n\t\t\t\t\t\t\t\t<div class=\"cinema\"><div>[</div><div>\n\t\t\t\t\t\t\t\t\t\t{{if ~oS.numFilmTitles>0}}\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"javascript:{{:~oTs.GetMyName()}}.ShowFilmTitles()\">titles {{:~oS.numFilmTitles}}</a>\n\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t\t{{if ~oS.numScenes>0}}\n\t\t\t\t\t\t\t\t\t\t\t{{if ~oS.numFilmTitles>0}}<div>·</div>{{/if}}\n\t\t\t\t\t\t\t\t\t\t\t{{if ~oS.selectedMeta!=617655}}\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"javascript:{{:~oTs.GetMyName()}}.FilterMeta({{:~oS.iIdSrcSearch}},617655)\">stills {{:~oS.numScenes}}</a>\n\t\t\t\t\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"active\">stills {{:~oS.numScenes}}</div>\n\t\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t\t{{if ~oS.numPortraits>0}}\n\t\t\t\t\t\t\t\t\t\t\t{{if ~oS.numScenes>0}}<div>·</div>{{/if}}\n\t\t\t\t\t\t\t\t\t\t\t{{if ~oS.selectedMeta!=617708}}\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"javascript:{{:~oTs.GetMyName()}}.FilterMeta({{:~oS.iIdSrcSearch}},617708)\">portraits {{:~oS.numPortraits}}</a>\n\t\t\t\t\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"active\">portraits {{:~oS.numPortraits}}</div>\n\t\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t\t{{if ~oS.numFilms>0}}\n\t\t\t\t\t\t\t\t\t\t\t{{if ~oS.numScenes+~oS.numPortraits>0}}<div>·</div>{{/if}}\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"javascript:{{:~oTs.GetMyName()}}.ShowFilmography({{:~oS.iIdSrcSearch}})\">available filmography {{:~oS.numFilms}}</a>\n\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t</div><div>]</div></div>\n\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t{{if #index<~oS.collections.length-1}}<div>·</div>{{/if}}\n\t\t\t\t\t\t{{/for}}\n\t\t\t\t\t{{/if}}\n\t\t\t\t{{/if}}\n\t\t\t\t\n\t\t\t\t<div class=\"icon\" id=\"addSearchToLightboxBtn\">\n\t\t\t\t\t<a href=\"javascript:{{:GetMyName()}}.AddResultsToLightbox()\">\n\t\t\t\t\t\t<img class=\"icon\" src=\"/common/images/add_item_black.svg\" style=\"height:20px;\">\n\t\t\t\t\t</a>\n\t\t\t\t\t<div id=\"saveSearchLightboxContent\" style=\"display:none;\" class=\"stillLeftTopArrow addSearchLightboxDiv mosaic\">\n\t\t\t\t\t\t<div id=\"saveSearchLightboxTransparent\" style=\"height: 29px;top:-20px; width: 60px; background-color: transparent; position: absolute;\"></div>\n\t\t\t\t\t\t<div style=\"padding-left:0px; padding-right:0px;\">\n\t\t\t\t\t\t\t<table class=\"addLightboxOptionsTbl\">\n\t\t\t\t\t\t\t\t<tr id=\"saveSearchLightboxFirstOptionTr\" class=\"firstOption\">\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<p style=\"color:black\">{{:~sFm}}</p>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr id=\"saveSearchLightboxSecondOptionTr\" class=\"secondOption\">\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t{{:~sSm}}\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<img class=\"loading\" src=\"/web/views/images/wait.gif\" />\n\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t{{if ~oS.sTitle.length>0}}</td></tr></table>{{/if}}\n\t\t\t\n\t\t\t<div class=\"narrow\">\t\n\t\t\t\t{{if ~oSf}}\n\t\t\t\t\t<div class=\"active\">{{:~oSf.sName.toLowerCase()}} ({{:~oSf.iNumPhotos}})</div>\n\t\t\t\t{{else}}\n\t\t\t\t\t{{if ~oS.selectedMeta==617655}}\n\t\t\t\t\t\t<div class=\"active\">stills ({{:~oS.numScenes}})</div>\n\t\t\t\t\t{{else}}\n\t\t\t\t\t\t{{if ~oS.selectedMeta==617708}}\n\t\t\t\t\t\t\t<div class=\"active\">portraits ({{:~oS.numPortraits}})</div>\n\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t<div class=\"active\"><span class=\"thetotal\">{{:~oS.totalNum}}</span> {{:~oS.mainTypeName}}</div>\n\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t{{/if}}\n\t\t\t\t{{/if}}\n\t\t\t\t\n\t\t\t\t{{if ~oS.collections.length}}\n\t\t\t\t<div class=\"icon\">\n\t\t\t\t\t<img id=\"showFilters\" src=\"/common/images/filter.svg\">\n\t\t\t\t\t<div id=\"\" class=\"stillLeftTopArrow filterResultsMenu mosaic\">\n\t\t\t\t\t\t{{if ~oS.selectedMeta || ~oS.selectedColl}}\n\t\t\t\t\t\t\t<a href=\"javascript:{{:GetMyName()}}.SeeAllPhotos({{:~oS.iIdSrcSearch}})\"><span class=\"thetotal\">{{:~oS.totalNum}}</span> {{:~oS.mainTypeName}}</a>\n\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t<div class=\"active\"><span class=\"thetotal\">{{:~oS.totalNum}}</span> {{:~oS.mainTypeName}}</div>\n\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t<div style=\"margin-left: 10px\">\n\t\t\t\t\t\t\t{{for ~oS.collections ~oTs=#data}}\n\t\t\t\t\t\t\t\t{{if iId==~oS.selectedColl}}\n\t\t\t\t\t\t\t\t\t<div class=\"active\">{{:sName.toLowerCase()}} ({{:iNumPhotos}})</div>\n\t\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t\t<a href=\"javascript:{{:~oTs.GetMyName()}}.FilterColl({{:~oS.iIdSrcSearch}},{{:iId}})\">{{:sName.toLowerCase()}} ({{:iNumPhotos}})</a> \n\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t{{if iId==1 && (~oS.numFilmTitles>0 || ~oS.numScenes>0 || ~oS.numPortraits >0 || ~oS.numFilms > 0)}}\n\t\t\t\t\t\t\t\t\t<div class=\"cinema\"><div>\n\t\t\t\t\t\t\t\t\t\t\t{{if ~oS.numFilmTitles>0}}\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"javascript:{{:~oTs.GetMyName()}}.ShowFilmTitles()\">titles ({{:~oS.numFilmTitles}})</a>\n\t\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t\t\t{{if ~oS.numScenes>0}}\n\t\t\t\t\t\t\t\t\t\t\t\t{{if ~oS.selectedMeta!=617655}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"javascript:{{:~oTs.GetMyName()}}.FilterMeta({{:~oS.iIdSrcSearch}},617655)\">stills ({{:~oS.numScenes}})</a>\n\t\t\t\t\t\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"active\">stills ({{:~oS.numScenes}})</div>\n\t\t\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t\t\t{{if ~oS.numPortraits>0}}\n\t\t\t\t\t\t\t\t\t\t\t\t{{if ~oS.selectedMeta!=617708}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"javascript:{{:~oTs.GetMyName()}}.FilterMeta({{:~oS.iIdSrcSearch}},617708)\">portraits ({{:~oS.numPortraits}})</a>\n\t\t\t\t\t\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"active\">portraits ({{:~oS.numPortraits}})</div>\n\t\t\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t\t\t{{if ~oS.numFilms>0}}\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"javascript:{{:~oTs.GetMyName()}}.ShowFilmography({{:~oS.iIdSrcSearch}})\">available filmography ({{:~oS.numFilms}})</a>\n\t\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t\t</div></div>\n\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t{{/for}}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t</div>{{/if}}<div class=\"icon\" id=\"addSearchToLightboxBtn2\">\n\t\t\t\t\t<a>\n\t\t\t\t\t\t<img class=\"icon\" src=\"/common/images/add_item_black.svg\" style=\"border:0; height:20px;margin-top:-1px; position:absolute\">\n\t\t\t\t\t</a>\n\t\t\t\t\t\n\t\t\t\t\t<div id=\"saveSearchLightboxContent2\" style=\"display:none;\" class=\"stillLeftTopArrow addSearchLightboxDiv mosaic\">\n\t\t\t\t\t\t<div id=\"saveSearchLightboxTransparent\" style=\"height: 29px;top:-20px; width: 60px; background-color: transparent; position: absolute;\"></div>\n\t\t\t\t\t\t<div style=\"padding-left:0px; padding-right:0px;\">\n\t\t\t\t\t\t\t<table class=\"addLightboxOptionsTbl\">\n\t\t\t\t\t\t\t\t<tr id=\"saveSearchLightboxFirstOptionTr2\" class=\"firstOption\">\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<p style=\"color:black\">{{:~sFm}}</p>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr id=\"saveSearchLightboxSecondOptionTr2\" class=\"secondOption\">\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<span class=\"saveSearchLightboxNameSpan\">{{:~sSm}}</span>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\n\t\t\t\t<div>\n\t\t\t\t\t<img class=\"loading\" src=\"/web/views/images/wait.gif\" />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t{{/if}}\n\t\t\n\t{{/if}}\n{{/if}}\n\n\n","text_summary_searching":"<div class=\"searching\">\n\tsearching<span class=\"searchedtext\">{{:sSearchTitle}}</span>... <img class=\"loading\" src=\"/web/views/images/wait.gif\" />\n</div>\n\n"})};PrintSearching(t){this.sSearchTitle='';if(t)this.sSearchTitle=' '+t;if(this.sSearchTitle.length>100)this.sSearchTitle=this.sSearchTitle.substring(0,100);this.Render2(this.GetContainer(),'text_summary_searching',{oExtraParams:{iSo:this.GetIdOrder()}})};SeeAllPhotos(t){$('img.loading',this.GetContainer()).show();top.oNavigation.ExecSearchReloadAll()};FilterColl(t,e){$('img.loading',this.GetContainer()).show();top.oNavigation.FilterColl(t,e)};FilterMeta(t,e){$('img.loading',this.GetContainer()).show();top.oNavigation.FilterMeta(t,e)};SearchAssetType(t){$('img.loading',this.GetContainer()).show();top.oNavigation.SearchAssetType(t)};ShowFilmTitles(){top.oNavigation.ShowFilmTitles(this.oFilms.aResults)};ShowFilmography(t){top.oNavigation.ExecSearch({"iSF": 3834,"iISS":t},!1)};UpdateTotalAmount(t,e){$('span.thetotal',this.GetRenderContainer()).html(t+(e?'+':''))};PrintNoResults(t,e){this.printed=!0;this.lastNoResults=!0;this.lastText=t;this.oSummary=e;if(typeof t=='undefined')t='';var i;if(this.GetParent().oGallery&&this.GetParent().oGallery.oSearchParams&&this.GetParent().oGallery.oSearchParams. 384iAT&&this.GetParent().oGallery.oSearchParams. 385iAT== 3862){if(this.GetParent().oGallery.oSearchParams.
387iCr){i='no creative video found'} 388else{i='no video found'}} 389else{if(this.GetParent().oGallery&&this.GetParent().oGallery.oSearchParams&&this.GetParent().oGallery.oSearchParams. 390iCr){i='no creative image found'} 391else{i='no images found'}};var o='';if(e){ 392};this.GetContainer().html($('<div class="regular"><div>'+i+'<b>'+t+'</b></div>'+o+'</div>'))};PrintSummary(t,a,n){this.printed=!0;this.lastNoResults=!1;this.oSummary=t;this.oFilms=a;if(t.totalNum==0){this.PrintNoResults(t.title,t)} 393else{var i=!1,e=!1;t.iIdSearch=parseInt(t.iIdSearch);if(t.sTitle&&t.sTitle.length>0){this.GetContainer().parent().addClass('withtitle')};this.iNumPhotosSelected=t.totalNum;if(t.collections){for(var o=0;o<t.collections.length;o++){var s=t.collections[o];if(s.iId==t.selectedColl){this.iNumPhotosSelected=s.iNumPhotos;if(s.iNumPhotos==1){i='Add one image to another lightbox';e='Add one image to LIGHTBOX'} 394else{i='Add NUMIMAGE images to another lightbox';i=i.replace('NUMIMAGE',s.iNumPhotos);e='Add NUMIMAGE images to LIGHTBOX';e=e.replace('NUMIMAGE',s.iNumPhotos)};break}}};if(!i){if(this.oSummary.totalNum==1){i='Add one image to another lightbox';e='Add one image to LIGHTBOX'} 395else{i='Add NUMIMAGE images to another lightbox';i=i.replace('NUMIMAGE',this.oSummary.totalNum);e='Add NUMIMAGE images to LIGHTBOX';e=e.replace('NUMIMAGE',this.oSummary.totalNum)}};e=e.replace(' LIGHTBOX'," <span class='saveLightboxName' style='font-weight:bold'></span>");var h=!1;if(t.selectedColl){for(var o=0;o<t.collections.length;o++){if(t.selectedColl==t.collections[o].iId){h=t.collections[o]}}};this.Render2(this.GetContainer(),'text_summary',{oExtraParams:{oS:t,sFm:i,sSm:e,oSf:h}});var r=this;this.GetEl('cbSort').on('change',function(){top.oNavigation.ExecSearchNewOrder($(this).val())});this.SetAddToLightboxEvent();this.UpdateSearchLightboxName();if(typeof(this.iNumPhotosSelected)=='undefined'||this.iNumPhotosSelected> 3961500){$('#addSearchToLightboxBtn').hide();$('#addSearchToLightboxBtn2').hide()}};if(typeof n!='undefined'&&n)$('#summSort').hide()};
396UpdateSearchLightboxName(){if(typeof top.oNavigation.oLeftArea.oCurLightbox.iId=='undifined'||!top.oNavigation.oLeftArea.oCurLightbox.iId||top.oNavigation.oLeftArea.oCurLightbox.iId<0){$('.saveLightboxName').html('new lightbox');$('.saveLightboxName').attr('style','')} 397else{$('.saveLightboxName').html(top.oNavigation.oLeftArea.oCurLightbox.sName);$('.saveLightboxName').attr('style','font-weight:bold')}};SetAddToLightboxEvent(){var t=this;$('#addSearchToLightboxBtn2 > a').on('click',function(e){$('.filterResultsMenu',t.GetContainer()).hide();if($('#saveSearchLightboxContent2').is(':visible')){$('#saveSearchLightboxContent2').hide()} 398else{$('#saveSearchLightboxContent2').show();if(top.oNavigation.oLeftArea.oCurLightbox.sName){$('#saveSearchLightboxFirstOptionTr2').show()} 399else{$('#saveSearchLightboxFirstOptionTr2').hide()}};e.preventDefault();e.stopPropagation()});$(window).on('click.addSearchToLightboxBtn2',function(t){$('#saveSearchLightboxContent2').hide()});$('#addSearchToLightboxBtn > a').on('click',function(e){$('.filterResultsMenu',t.GetContainer()).hide();if($('#saveSearchLightboxContent').is(':visible')){$('#saveSearchLightboxContent').hide()} 400else{$('#saveSearchLightboxContent').show();if(top.oNavigation.oLeftArea.oCurLightbox.sName){$('#saveSearchLightboxFirstOptionTr').show()} 401else{$('#saveSearchLightboxFirstOptionTr').hide()}};e.preventDefault();e.stopPropagation()});$('#saveSearchLightboxFirstOptionTr').click(function(e){t.AddResultsToLightbox(!1)});$('#saveSearchLightboxSecondOptionTr').click(function(e){t.AddResultsToLightbox(!0)});$('#saveSearchLightboxFirstOptionTr2').click(function(e){t.AddResultsToLightbox(!1)});$('#saveSearchLightboxSecondOptionTr2').click(function(e){t.AddResultsToLightbox(!0)});$('#showFilters').on('click',function(e){$('#saveSearchLightboxContent2').hide();if($('.filterResultsMenu',t.GetContainer()).is(':visible')){$('.filterResultsMenu',t.GetContainer()).hide()} 402else{$('.filterResultsMenu',t.GetContainer()).css('display','inline')};e.stopPropagation()});$(window).on('click.filterResultsMenu',function(e){$('.filterResultsMenu',t.GetContainer()).hide();$('#saveSearchLightboxContent2').hide();$('#saveSearchLightboxContent').hide()})};Error(t){};GetContainer(){return $('#'+this.sContainer)};AddResultsToLightbox(t){if(typeof t=='undefined')t=!0;if(this.iNumPhotosSelected> 4031500){var e='Too many results to add to the lightbox (maximum NUMMAX)';e=e.replace('NUMMAX', 4041500);$$.ShowDialogNotification(e,{sTitle:'Warning'})} 405else{top.oNavigation.LightboxAddPhotosFromSearch(this.oSummary.iIdSearch,t,this.iNumPhotosSelected)}};GetIdOrder(){return this.GetEl('cbSort').val()}};;function RisSummary(t){this.tmpl_oThumbContainer=null;this.tmpl_oProgress=null;this.sContainer=t};RisSummary.prototype={StartUpload:function(t){$('#summpagination').empty();var e=$(' <div id="sumimg" style="padding-top: 0px; padding-left: 5px; min-width: 40px"></div> '+' <div id="sumprg" style="padding-left: 10px; width: 100%;">'+this._getMsg(!0,'Uploading file...')+' </div>');this.GetContainer().empty().append(e);this.tmpl_oThumbContainer=$('#sumimg',this.GetContainer());this.tmpl_oProgress=$('#sumprg',this.GetContainer());if(t!=null){this.SetThumbUrl(t)};top.oNavigation.ShowRisSummary(!0)},SetThumbUrl:function(t){if(t.substring(0,4)!='data:'){this.tmpl_oThumbContainer.append('<a href="'+t+'" target="_blank"><img src="'+t+'" style="max-height:50px; border: 0"></a>')} 406else{this.tmpl_oThumbContainer.append('<img src="'+t+'" style="max-height:50px">')};this.tmpl_oThumbContainer.show()},HideThumbnail:function(){$('img',this.tmpl_oThumbContainer).hide()},RenderThumbBase64:function(t){if(this.tmpl_oThumbContainer){this.tmpl_oThumbContainer.show();if(t.length){this.tmpl_oThumbContainer.html('<img style="max-height: 40px" src="data:image/jpeg;base64,'+t+'">');this.tmpl_oThumbContainer.show()} 407else{this.tmpl_oThumbContainer.empty()}}},SearchEnd:function(t,e){var i;if(t>0){if(t==1)i='One image found';else i='$1 images found'.replace('$1',t)} 408else{i='No images found'};if(e>0){i+=' ($1 searched)'.replace('$1',e)};if(e){this.tmpl_oThumbContainer.hide()};this.tmpl_oProgress.html(this._getMsg(!1,i))},_getMsg:function(t,e){if(t)return'<img style="position:relative; top:5px; padding-right: 5px" src="/web/views/images/wait.gif" /><span style="line-height: 50px">'+e+'</span>';else return'<span style="line-height: 50px">'+e+'</span>'},_formatSize:function(t){var e=-1;do{t=t/1024;e++} 409while(t>99);return Math.max(t,0.1).toFixed(1)+['kB','MB','GB','TB','PB','EB'][e]},UploadCompleted:function(t,e){}
409,UploadProgress:function(t,e,i){var h,s=Math.round(e/i*100);this.tmpl_oProgress.html(this._getMsg(!0,'Uploading image '+t+', '+s+'%'))},RenderRisApiStatus:function(t,e){if(t.bInProgress){if(t.sThumbBeingSearched){this.RenderThumbBase64(t.sThumbBeingSearched)} 410else{this.HideThumbnail()};var i;if(t.iNumImgsToSearch<=0){this.tmpl_oProgress.html(this._getMsg(!0,'Reading file'))} 411else{this.tmpl_oProgress.html(this._getMsg(!0,'Searching image'+' '+(t.iNumSearchedImgs+1)+'/'+t.iNumImgsToSearch+' <input style="margin-left: 20px" type="button" class="white small" value="Cancel" id="RisSummaryCancelRisSearch">'));$('#RisSummaryCancelRisSearch').on('click',function(){e.GetParent().CancelSearch()})}} 412else{this.HideThumbnail();if(t.aSearchedPhotos.length>0){if(t.aSearchedPhotos.length==1)this.tmpl_oProgress.html(this._getMsg(!1,'One image with results'));else this.tmpl_oProgress.html(this._getMsg(!1,'$1 images with results'.replace('$1',t.aSearchedPhotos.length)))} 413else{this.tmpl_oProgress.html(this._getMsg(!1,'No images found'))}}},Searching:function(){this.tmpl_oProgress.html(this._getMsg(!0,'Searching visually'+'...'))},Error:function(t){this.tmpl_oProgress.html(this._getMsg(!1,'Error: '+t));top.oNavigation.ShowRISError(t)},GetContainer:function(){return $('#'+this.sContainer)}};;class ShoppingCartLine extends AlbBaseObj{LoadInfo(e){super.LoadInfo(e);this.bRemoved=!1;this.tmpl_sTmplBasePath='/web/views/javascript/obj/';this.ParseNumericFields(!0)};setUsageBold(){this.GetEl('usageBtn').css('font-weight','bold')};HasMinSalePrice=function(){if(this.oPhotoForWeb.fMinSalePrice&&this.oPhotoForWeb.fMinSalePrice!=0){$('.descr',this.GetEl('line')).hide();$('.minPriceDescr',this.GetEl('line')).show();this.GetEl('withoutMinPriceOptions').hide();this.GetEl('withMinPriceOptions').show()}};IsPhotoSalableInRetail=function(){if(!this.oPhotoForWeb.bHasRetailUses){$('.descr',this.GetEl('line')).hide();$('.minPriceDescr',this.GetEl('line')).show();this.GetEl('withoutMinPriceOptions').hide();this.GetEl('withMinPriceOptions').show()}};GetFormattedPrice(){return parseFloat(this.fPrice).toLocaleString(undefined,{useGrouping:!0,minimumFractionDigits:2,maximumFractionDigits:2,style:'currency',currency:this.GetParent().sCurrency})};PrintPhotoInfo=function(){$('span.notVisible',$('#line_'+this.iId)).html('');$('div.notVisible',$('#line_'+this.iId)).hide();$('.visible',$('#line_'+this.iId)).show()};PrintErrorMsg=function(){$('div.notVisible',$('#line_'+this.iId)).show();$('.visible',$('#line_'+this.iId)).hide();var e='Image not available in $1';e=e.replace('$1',this.GetParent().oCountry.sName);$('.errMsg',$('#line_'+this.iId)).html(e);if(this.GetParent().aLines.length-this.GetParent().iNotVisiblePhoto>0){$('.deleteMsg',$('#line_'+this.iId)).show()} 414else{$('.withoutDeleteMsg',$('#line_'+this.iId)).show()}};OpenPhotoNotVisibleForm=function(){this.GetParent().OpenPhotoNotVisibleForm()};EnablePartialPurchase=function(){if(this.GetParent().oRetailBudget.bPartialPurchase){return!0} 415else return!1};RefreshPrice(){this.GetEl('fPrice').html(this.GetFormattedPrice())};HasLinkExpired(){return this.GetParent().HasLinkExpired()};GetDownloadUrl(e){if(this.oPhotoForWeb.iIdAssetType== 4162){return'/cart/'+this.GetParent().sUrlCode+'/video/'+this.oPhotoForWeb.sWebCode} 417else{return'/cart/'+this.GetParent().sUrlCode+'/'+this.oPhotoForWeb.sWebCode+(e?'.tif':'.jpg')}};HideDeleteBtns=function(){this.GetEl('budgetDeleteBtn').hide()};ReSendExtendEmail(){this.GetParent().ShowProgressTip("Sending email again",!0,{iWidth:250,iFontSize:20});var e=this;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{iIdShoppingCart:e.GetParent().iId,iIdSoldShoppingCartLine:e.iId,sWebCode:e.oPhotoForWeb.sWebCode,bFirstTime:!0},sMethodHash:'',bShowProgress:!1,fPostActions:function(t){if(t.bOk){e.GetParent().HideProgressTip();$$.ShowDialogNotification('Email sent successfully.<br>Please check your inbox',{sTitle:'Email sent'})}}})};SetDownloading=function(e){var t=e?'tiff':'jpg';$('.'+t+' .container .btn',this.GetEl('line')).removeAttr('onclick');$('.'+t+' .container',this.GetEl('line')).addClass('downloading')};Download(e){this.SetDownloading(e);var i=this,t;if(this.oPhotoForWeb.iIdAssetType== 4182){t='An error occurred while delivering the video'} 419else{t='There was an error delivering the image'};$.fileDownload(this.GetDownloadUrl(e)).done(function(){i.GetParent().RefreshCart(!1,!0)}).fail(function(){$$.ShowDialogNotification(t,{sTitle:'Warning'})})};Details(){this.GetEl('Details').show();
419this.GetEl('ShowDetailsButton').hide();this.GetEl('HideDetailsButton').show()};CloseDetails(){this.GetEl('Details').hide();this.GetEl('ShowDetailsButton').show();this.GetEl('HideDetailsButton').hide()};Remove(){this.GetParent().RemoveLine(this.tmpl_iPos)};RemoveBudgetLine(e){this.bRemoved=!0;$('#line_'+e).hide();this.GetParent().RenderCheckoutPriceSummary();this.GetParent().RenderPhotoAvailability()};HasUsage(){return this.fPrice>0};IsBudgetView(){return this.GetParent().bBudgetView};ChangeUsage(){var t=this,e;if(this.oPhotoForWeb.iIdAssetType== 4202){e=this.GetParent().oEcvPriceCalculator;e.sVideoFormat=this.oPhotoForWeb.sVideoFormat;e.bHas4K=this.oPhotoForWeb.bHas4K} 421else{e=this.GetParent().oPriceCalculator};e.fPostAddPhotoAction=function(e){t.GetParent().RefreshCart(e);t.ClosePopup()};e.oCartSettings=this.oUsageSettings;e.iIdPhoto=this.iIdPhoto;e.RenderPopup('ec_price_calculator',!0)};GetMsgValidateEmail(){return'To continue downloading this image, follow the link in the email we have sent you to $1'.replace('$1','<u>'+this.GetRetailEmail()+'</u>')};GetRetailEmail(){return this.GetParent().sEmail};BuyAgain(){if(!top.oNavigation.IsPhotoInCart(this.iIdPhoto)){top.oNavigation.AddToCart(this.iIdPhoto,function(){top.oNavigation.ShowCart()})} 422else{top.oNavigation.ShowCart()}};IsStillDownloadable(){if(this.dEndLicence==0||this.dEndLicence>Date.now()/1000)return!0;return!1};openContactUsExtendDownloads(){var t='I have reached the download limit for the IMAGECODE image of the INVOICE invoice. I request extension of the download limit.';t=t.replace('IMAGECODE',this.oPhotoForWeb.sWebCode);t=t.replace('INVOICE',this.GetParent().iInvoiceNumber);var e='Download extension request. Image: $1, invoice $2';e=e.replace('$1',this.oPhotoForWeb.sWebCode);e=e.replace('$2',this.GetParent().iInvoiceNumber);top.oNavigation.OpenContactUsRightPanel('Extension request',t,e)};RenderCheckoutLine(e){this.Render2(e,'shopping_cart_line_checkout',{bNotAForm:!0,bAppend:!0});var t=this;$('.ancNotvisibleForm',$('#line_'+this.iId)).on('click',function(){t.OpenPhotoNotVisibleForm()})};SetEvents(){var t=this.GetEl('btnDwnJpg'),e=this;t.on('mouseenter',function(){e.GetEl('dowloadTip').css('position','absolute').show()});t.on('mouseleave',function(){e.GetEl('dowloadTip').hide()});$('.btnBuyAgain',this.GetEl('line')).on('click',function(){e.BuyAgain()});$('.btnDwnJpg',this.GetEl('line')).on('click',function(){e.Download()});$('.btnDwnTif',this.GetEl('line')).on('click',function(){e.Download(!0)});$('.ancContactExtend',this.GetEl('line')).on('click',function(){e.openContactUsExtendDownloads();return!1})}; 423};;class PaymentCard extends AlbBaseObj{LoadInfo(t){super.LoadInfo(t);this.SetSaveSubobject('oEditedFields');this.tmpl_sTmplBasePath='/web/views/javascript/obj/';$.templates( 424{"payment_card_edit":"<style nonce=\"LAtEZPO3cRYPD2fXqWnz7gXQ\">\n.infoFieldLast {\n\tbackground-color: #DCDCDC;\n\tdisplay:inline-block;\n\tcolor: #808080;\n\theight:20px;\n}\n.field > label {\n\tdisplay: inline-block;\n\twidth: 175px;\n\tfont-weight: bold;\n}\n.field {\n\tmargin-bottom: 10px;\n}\n\n.field input {\n\tfont-size: 14px;\n\tmargin-bottom: 10px;\n\tvertical-align:middle;\n}\n\n.field span {\n\tfont-size: 14px;\n\tvertical-align:middle;\n}\n\n</style>\n\n<div style=\"padding-top:10px; padding-left:10px; width: min(470px,80vw);\" class=\"infoClass std\">\n\t<div class=\"title\" style=\"margin-bottom:20px;\">Card details</div>\n\t\t<input type=\"text\" alb-req alb-embedstyle=\"width: 100%\" alb-embedtitle=\"Caption\" alb-field=\"sDescription\"> \n\t\t<input type=\"text\" disabled alb-req alb-embedstyle=\"width: 100%\" alb-embedtitle=\"Type\" alb-field=\"sBrand\"> \n\t\t<input type=\"text\" disabled alb-req alb-embedstyle=\"width: 100%\" alb-embedtitle=\"Card number\" alb-field=\"sPan\"> \n\t\t<input type=\"text\" disabled alb-req alb-embedstyle=\"width: 100%\" alb-embedtitle=\"Expiration date\" alb-field=\"tExpirationDate\"> \n\t<div style=\"text-align:right; margin-top:20px;\">\n\t\t<a class=\"link big\" href=\"javascript: {{:GetMyName()}}.Save({{:iId}})\" style=\"cursor:pointer;\">Save</a>\n\t</div>\n</div>\n"})};ShowRow(){$('#'+this.GetParent().GetElId('userCardRow')+'_'+this.iId).css("background-color","#efefef")};HideRow(){$('#'+this.GetParent().GetElId('userCardRow')+'_'+this.iId).css("background-color","white")};DeleteUserCard(t){var s="<p> You are going to delete the $1 card </p>".replace('$1',this.sBrand);s+="<p style='margin-top:15px;'><table><tr><td style='width:125px;'>Caption:</td><td>"+this.sDescription+"</td></tr><tr><td>Number:</td><td>"+this.sPan+"</td></tr></table></p>";var e=this;$$.ShowDialogYesNo(s,function(s){e.ClosePopup();if(s==1){e.GetParent().DeleteUserCard(t)}},{sTitle:'Delete card',sTxtYes:'Accept',sTxtNo:'Cancel'})};EditUserCard(t){this.RenderPopUpEdit()};RenderPopUpEdit(){this.RenderPopup2('payment_card_edit',{iWidth:530,iHeight:380,bAllowCloseIt:!0,bCenter:!0});this.GetEl('tExpirationDate').val(this.GetFormattedExpirationDate())};Save(t){if(!this.FillFromForm()){return};var e=this.oEditedFields;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{iIdCard:t,sDescription:e.sDescription},sMethodHash:'',bShowProgress:!1,fPostActions:function(t){if(t.bOk){document.location.href='/my_account?bSC=true'} 425else{$$.ShowDialogNotification(t.sMsg,{sTitle:'Warning'})}}})};GetFormattedExpirationDate(){var t=new Date(this.tExpirationDate*1000);return(t.getMonth()+1)+'/'+t.getFullYear()}};;
425class EcPackage extends AlbBaseObj{LoadInfo(e){super.LoadInfo.call(this,e);this.fPrice=parseFloat(this.fPrice);this.tmpl_sTmplBasePath='/common/javascript/obj/tmpl/'};Render(e){var t=this;super.Render2(e,'ec_package_row',{bAppend:!0});$('.'+this.GetElId('prLk')).on('click',function(){t.GetParent().GetParent().SelectPackage($(this).attr('prLk'));return!1});this.GetEl('info').attr('attAlbTooltip',this.getLongDescr(!1));this.GetEl('fPrice').html(this.fPrice.toLocaleString(undefined,{minimumFractionDigits:2,maximumFractionDigits:2,style:'currency',currency:this.sCurrency}));this.GetEl('row').on('click',function(){t.GetParent().SelectPackage(t.iId)})};IsSelected(){return this.GetEl('row').hasClass("selected")};Select(e){this.GetEl('packageOpt').prop('checked',e);if(e){if(!this.GetEl('row').hasClass("selected")){this.GetEl('row').addClass("selected")};this.GetParent().GetParent().GetParent().PackageSelected();this.GetEl('selInfo').show()} 426else{this.GetEl('row').removeClass("selected");this.GetEl('selInfo').hide()}};getLongDescr(e){if(typeof e=='undefined')e=!0;var t=this;const result=this.sLongDescr.replace(/\[\[(\w+):(\d+)\]\](.*?)\[\[\/\1\]\]/g,function(s,n,a,r){if(n==='LK'){var i=t.GetParent().GetParent().GetPackage(a);if(i){if(e){return'<a class="'+t.GetElId('prLk')+'" prLk="'+a+'" href="#">'+r+'</a>'} 427else{return r}}};return r});return result}; 428};;class EcPackageCategory extends AlbBaseObj{LoadInfo(e){super.LoadInfo.call(this,e);this.SetChildObjects('aPrices',EcPackage);this.tmpl_sTmplBasePath='/common/javascript/obj/tmpl/';this.tmpl_bShowCat=!0};Render(e){var t=this;this.Render2(e,'ec_package_category',{bAppend:!0});for(var s=0;s<this.aPrices.length;s++){this.aPrices[s].Render(this.GetElId('tbl'))};this.GetEl('btn').on('click',function(){$("input[name="+t.GetElId('radio')+"][value='"+t.iId+"']").prop("checked",!0);t.GetParent().SelectCategory(t.iId)})};GetPackage(e){for(var t=0;t<this.aPrices.length;t++){if(this.aPrices[t].iId==e)return this.aPrices[t]};return!1};HasPackage(e){for(var t=0;t<this.aPrices.length;t++){if(this.aPrices[t].iId==e)return!0};return!1};SelectPackage(e){for(var t=0;t<this.aPrices.length;t++){if(this.aPrices[t].iId==e){this.aPrices[t].Select(!0)} 429else{this.aPrices[t].Select(!1)}}};IsSelected(){if(this.GetEl('btn').length==0)return!0;return this.GetEl('btn').hasClass('selected')};HasSelectedPackage(){for(var e=0;e<this.aPrices.length;e++){if(this.aPrices[e].IsSelected())return!0};return!1};Select(e){if(e){this.GetEl('btn').addClass('selected').html(this.sName);if(!this.HasSelectedPackage()){this.SelectPackage(this.aPrices[0].iId)}} 430else{this.GetEl('btn').removeClass('selected').html(this.sLink);for(var t=0;t<this.aPrices.length;t++){this.aPrices[t].Select(!1)}};if(this.GetEl('tbl').parent().is(':visible')!=e){this.GetEl('tbl').parent().slideToggle(300)}};SelectFirstPackage(){this.aPrices[0].Select(!0)};GetSelectedPackageId(){var e=$('input[name='+this.GetElId('packageOpt')+']:checked');if(e.length==1)return e.val();return 0};GetSelectedPackage(){var e=this.GetSelectedPackageId();if(e){return this.GetPackage(e)} 431else{return!1}}; 432};;class EcCategoriesList extends AlbBaseObj{LoadInfo(e){super.LoadInfo.call(this,e);this.SetChildObjects('aCategories',EcPackageCategory);this.tmpl_sTmplBasePath='/common/javascript/obj/tmpl/'};Render(e){var a=this;this.Render2(e,'ec_package_categories_list',{bAppend:!0});if(this.aCategories.length==1&&this.aCategories[0].sName.length==0)this.aCategories[0].tmpl_bShowCat=!1;for(var t=0;t<this.aCategories.length;t++){this.aCategories[t].Render(this.GetElId('tbl'))}};SelectCategory(e){for(var t=0;t<this.aCategories.length;t++){this.aCategories[t].Select(this.aCategories[t].iId==e)};this.GetParent().UnselectAll()};UnselectPackages(){for(var e=0;e<this.aCategories.length;e++){this.aCategories[e].Select(!1)}};SelectPackage(e){for(var t=0;t<this.aCategories.length;t++){if(this.aCategories[t].HasPackage(e)){this.SelectCategory(this.aCategories[t].iId);this.aCategories[t].SelectPackage(e)}};this.GetParent().UnselectAll()};SelectFirstCategory(){this.aCategories[0].Select(!0)};GetPackage(e){for(var t=0;t<this.aCategories.length;t++){var a=this.aCategories[t].GetPackage(e);if(a)return a};return!1};GetSelectedPackageId(){for(var e=0;e<this.aCategories.length;e++){if(this.aCategories[e].IsSelected()){return this.aCategories[e].GetSelectedPackageId()}};return 0};GetSelectedPackage(){for(var e=0;e<this.aCategories.length;e++){if(this.aCategories[e].IsSelected()){return this.aCategories[e].GetSelectedPackage()}};return!1}};;
432class EcPriceCalculator extends AlbBaseObj{LoadInfo(t){this.bIsDevelConfig=!1;super.LoadInfo.call(this,t); 433;this.tmpl_sTmplBasePath='/common/javascript/obj/tmpl/'; 434 435;this.bShowAddButton=!0;this.oCategoriesList=new EcCategoriesList(this.GetMyName()+'.oCategoriesList',t.oCategoriesList,this);this.sRenderTmpl='ec_price_calculator';this.fPostAddPhotoAction=!1;this.fActionsGotPrice=!1; 436};setPacks(t){this.oCategoriesList=new EcCategoriesList(this.GetMyName()+'.oCategoriesList',t,this)};UnselectAll(){ 437}; 438;PackageSelected(){this.GetEl('btnAddToCart').removeClass('disabledDivBtn');if(this.oCartSettings){if(!this.oCartSettings.iIdFixedPrice||this.SettingsChangedFromPrevSelection({iIdPackage:this.oCategoriesList.GetSelectedPackageId()})){this.GetEl('btnAddToCart_span').html('Update cart');this.GetEl('btnAddToCart').show();this.GetEl('btnViewCart').hide()} 439else{this.GetEl('btnAddToCart').hide();this.GetEl('btnViewCart').show()}};if(this.fActionsGotPrice){this.fActionsGotPrice(this.GetSelectedPackagePrice(this.oCategoriesList.GetSelectedPackageId()))};this.GetEl('priceCalculation').hide("fast")};GetSelectedPackagePrice(t){var e=this.oCategoriesList.GetPackage(t);if(e){return e.fPrice};return 0};GetSelectedPriceOptions(){var t={};var e=this.oCategoriesList.GetSelectedPackageId();if(e){t.iIdPackage=e} 440else{ 441;return!1; 442};t.iIdPhoto=this.iIdPhoto;return t};
442PostRender(){if(this.fRequestBudget){var t=this,i;if(this.bHas4K)i='For other uses or 4K format, $1request a custom quote$2';else i='For other uses, $1request a custom quote$2';this.GetEl('elRequestBudget').html('<div style="padding-top:10px;font-size: 18px;">'+i.replace('$1','<a id="'+this.GetElId('btnRequestBudget')+'" class="link" style="font-size:18px;">').replace('$2','</a>')+'</div>');this.GetEl('btnRequestBudget').css('cursor','pointer').click(function(){t.fRequestBudget()})};this.oCategoriesList.Render(this.GetEl('packages'));var t=this; 443;if(this.oCartSettings){this.GetEl('btnAddToCart_span').html("Update cart")}; 444;this.GetEl('btnViewCart').click(function(){if(window.opener&&!window.opener.closed){window.opener.focus();window.opener.location.href='/cart';window.close()} 445else{document.location='https://'+window.location.hostname+'/cart'}});this.GetEl('btnAddToCart').click(function(){t.GetEl('btnAddToCart').addClass('disabledDivBtn');var e=t.GetSelectedPriceOptions();if(!e)return;var i={oPriceOptions:e};if(t.GetParent()&&t.GetParent().oCountry)i.iIdCountry=t.GetParent().oCountry.iId;if(t.sFCurr)i.sFCurr=t.sFCurr;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:i,sMethodHash:'',bShowProgress:!1,fPostActions:function(i){if(i.bOk){if(t.oNav){t.oNav.RefreshCartStatus(!0)};if(t.fPostAddPhotoAction){t.fPostAddPhotoAction(i.mResults)} 446else{t.GetEl('btnAddToCart').hide();t.GetEl('btnViewCart').show();t.GetEl('btnAddToCart').removeClass('disabledDivBtn')};if(e.iIdPackage){t.oCartSettings={iIdFixedPrice:e.iIdPackage}} 447else{t.oCartSettings=e};if(t.oCartSettings.dFrom){t.oCartSettings.dFrom=t.ParseDate(t.oCartSettings.dFrom)}} 448else{$$.ShowDialogNotification(i.sMsg,{sTitle:'Warning'});t.GetEl('btnAddToCart').removeClass('disabledDivBtn')}}})});var e=new Date();if(this.oCartSettings){if(this.oCartSettings.dFrom){e=new Date(this.oCartSettings.dFrom*1000)};if(this.oCartSettings.iIdVideoPrice){this.oCategoriesList.SelectPackage(this.oCartSettings.iIdVideoPrice)} 449else if(this.oCartSettings.iIdFixedPrice){this.oCategoriesList.SelectPackage(this.oCartSettings.iIdFixedPrice)} 450else{ 451}};if(this.oCategoriesList.GetSelectedPackageId()==0){this.oCategoriesList.SelectFirstCategory();this.GetEl('btnAddToCart').removeClass('disabledDivBtn')}; 452;if(!this.oCartSettings){this.GetEl('btnAddToCart').toggle(!this.bPhotoInCart);this.GetEl('btnViewCart').toggle(this.bPhotoInCart)}};SettingsChangedFromPrevSelection(t){if(this.oCartSettings){if(this.oCartSettings.iIdFixedPrice){return(this.oCartSettings.iIdFixedPrice!=t.iIdPackage)} 453else{if(this.oCartSettings.iIdVideoPrice){return(this.oCartSettings.iIdVideoPrice!=t.iIdPackage)} 454else{ 455;return!1; 456}}} 457else{return!1}};RenderPopup(t,i){if(typeof i=='undefined')i=!1;if(this.iIdPhoto&&!this.bIsVideo){var e=this,s={iIdPhoto:this.iIdPhoto,sCurrency:this.sCurrency?this.sCurrency:''};if(this.GetParent()&&this.GetParent().oCountry){s.iIdUserCountry=this.GetParent().oCountry.iId};this.ShowProgressTip('Checking available uses',!0,{iWidth:500});AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:s,sMethodHash:'',bShowProgress:!1,fPostActions:function(t){e.HideProgressTip();if(t.bOk){if(t.mResults){e.oCategoriesList=new EcCategoriesList(e.GetMyName()+'.oCategoriesList',{aCategories:t.mResults.aP},e);e.aEcUsages=t.mResults.aU;e.RenderPopup2('ec_price_calculator',{iWidth:600,iHeight:800,bClosePrevious:!0},{sTitle:"Choose the license",bHideSeeCartBtn:!0});e.PostRender()}} 458else{$$.ShowDialogNotification(t.sMsg,{sTitle:'Warning'})}}})} 459else{this.RenderPopup2('ec_price_calculator',{iWidth:600,iHeight:800,bClosePrevious:!0},{sTitle:"Choose the license",bHideSeeCartBtn:!0});this.PostRender()}};Render(t){this.Render2(t,this.sRenderTmpl);this.PostRender()};GotPrice(t){if(typeof t=='undefined'){this.GetEl('btnAddToCart').addClass('disabledDivBtn')} 460else{this.GetEl('btnAddToCart').removeClass('disabledDivBtn')};if(this.fActionsGotPrice){this.fActionsGotPrice(t)}}; 461 462;GetSelectionDescriptions(){var t=[],e=this.oCategoriesList.GetSelectedPackage();if(e){t.push({sTitle:e.sTitle,sValue:e.sLongDescr})} 463else{ 464};return t}; 465};;jQuery.cachedScript=function(t,e){e=$.extend(e||{},{dataType:"script",cache:!0,url:t});return jQuery.ajax(e)};
465class ShoppingCart extends AlbBaseObj{LoadInfo(t){var s=0;if(this.hasOwnProperty('aLines')){for(var i=0;i<this.aLines.length;i++){for(var e=0;e<t.aLines.length;e++){if(t.aLines[e].iIdPhoto==this.aLines[i].iIdPhoto){t.aLines[e].iStatusFile=this.aLines[i].iStatusFile;continue}}};s=this.GetTotalPrice(!0)};this.aLines=[];this.aCards=[];super.LoadInfo(t);this.SetChildObjects('aLines',ShoppingCartLine,!0);this.SetChildObjects('aCards',PaymentCard,!0);this.ParseNumericFields(!0);this.SetSaveSubobject('oEditedFields');this.oEditedFields.sVatNo='';this.oEditedFields.sInVies=this.sInVies;this.tmpl_sTmplBasePath='/web/views/javascript/obj/';switch(this.iContentType){case 4661:this.tmpl_sMsgChooseLicense='Please select a license for each image to checkout';break;case 4672:this.tmpl_sMsgChooseLicense='Please select a license for each video to process the order';break;default:this.tmpl_sMsgChooseLicense='Please select a license for each item to process the order'}; 468 469;$.templates( 470{"shopping_cart":"<div class=\"cart std\">\n\t<div class=\"title\">\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\tCart <span class=\"num_elements\">({{:getNumItems()}} {{if getNumItems()!=1}}images{{else}}image{{/else}})</span>\n\t\t\t\t</td>\n\t\t\t\t{{if aLines.length> 20}}\n\t\t\t\t\t<td class=\"clearShoppingCart\">\n\t\t\t\t\t\t<div id=\"{{:GetElId('clearShoppingCartDiv')}}\">\n\t\t\t\t\t\t\t<a type=\"button\" class=\"action\" id=\"{{:GetElId('btnClear')}}\" href='#'>Empty cart</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\n\t\t\t\t\t</td>\n\t\t\t\t{{/if}}\n\t\t\t</tr>\n\t\t</table>\n\t</div>\n\t{{if aLines.length>0}}\n\t\t<table class=\"lines\">\n\t\t\t{{for aLines tmpl=\"shopping_cart_line\" /}}\n\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td colspan=\"4\">\n\t\t\t\t\t<table style=\"width:100%\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<span class=\"errMsg\" style=\"font-size:20px;\" id=\"{{:GetElId('errorMsg')}}\"></span>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td style=\"text-align:right\">\n\t\t\t\t\t\t\t\t<span style=\"font-size:20px;\"><b>Subtotal: {{:GetFormattedTotalPriceWithoutVAT()}}</b></span>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"4\" style=\"text-align: right\">\n\t\t\t\t\t\t{{if AllPhotoHasUsage()}}\n\t\t\t\t\t\t\t<input type=\"button\" class=\"green big\" id=\"{{:GetElId('btnCheckout')}}\" value=\"Checkout\">\n\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t<span class=\"errMsg\" style=\"font-size:20px;\" id=\"{{:GetElId('errorMsg')}}\">{{:tmpl_sMsgChooseLicense}}</span>\n\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t<div style=\"padding-top:10px;font-size: 18px;\">\n\t\t\t\t\t\t\t{{if HasVideoWith4K()}}\n\t\t\t\t\t\t\t\tFor other uses or 4K format, <a class=\"link\" style=\"font-size:18px;\" id=\"{{:GetElId('btnReqBudget')}}\">request a custom quote</a></div>\n\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\tFor other uses, <a class=\"link\" style=\"font-size:18px;\" id=\"{{:GetElId('btnReqBudget')}}\">request a custom quote</a></div>\n\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\n\t\t</table>\n\t{{else}}\t\n\t\t<div class=\"empty\">Your shopping cart is empty</div>\n\t{{/if}}\n</div>","shopping_cart_line":"<tr id=\"{{:GetElId('line')}}\" class=\"line item {{if iStatusFile==2}}not_available{{/if}}\">\n\t<td>\n\t\t<table style=\"width: 100%;\">\n\t\t\t<tr>\n\t\t\t\t<td class=\"thumb\">\n\t\t\t\t\t{{if oPhotoForWeb.iIdAssetType==2}}\n\t\t\t\t\t\t<div class=\"video small\">\n\t\t\t\t\t\t<img src=\"{{:oPhotoForWeb.sUrlVideoPosterThumb}}\" style=\"width: 100px\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{{else}}\n\t\t\t\t\t\t<img src=\"{{:oPhotoForWeb.sUrlThumb}}\" style=\"width: 100px\">\n\t\t\t\t\t{{/if}}\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<div><b><span style=\"color: black; font-size:16px;\">{{:oPhotoForWeb.sWebCode}}</span></b></div>\n\t\t\t\t\t<div class=\"credit\"><span style=\"font-size:12px; margin-top:3px;\">{{:oPhotoForWeb.sCredit}}</span></div>\n\t\t\t\t\t<span class=\"info1\">\n\t\t\t\t\t\t<div style=\"margin-top:7px;\" class=\"descr\">\n\t\t\t\t\t\t\t{{for aDescr}}\n\t\t\t\t\t\t\t \t<div style=\"font-size:13px; margin-bottom:5px;\">{{if sTitle}}<b>{{:sTitle}}: </b> {{/if}}{{:sValue}}</div>\n\t\t\t\t\t\t\t{{/for}}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"minPriceDescr\" style=\"margin-top:5px;
470display:none; color:red\">\n\t\t\t\t\t\t\t<div style=\"font-size:13px; margin-bottom:5px;\">{{if iIdAssetType==2}}Video with special price.{{else}}Image with a special price.{{/if}} To proceed with the purchase, please remove this image from the cart or <a href=\"javascript: {{:GetParent().GetMyName()}}.RequestBudget(false,'{{:oPhotoForWeb.sWebCode}}');\" class=\"link\">request a budget</a></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\n\t\t\t\t\t\t{{if oPhotoForWeb.iIdAssetType==2}}\n\t\t\t\t\t\t\t<div style=\"margin-bottom:5px; margin-top:15px;\">\n\t\t\t\t\t\t\t\t<span style=\"font-size:13px; margin-bottom:5px;\"><b>Video duration: </b> {{:oPhotoForWeb.sDuration}}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div style=\"margin-bottom:5px;\">\n\t\t\t\t\t\t\t\t<span style=\"font-size:13px; margin-bottom:5px;\"><b>Resolution: </b> {{:oPhotoForWeb.sVideoFormat}}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t<div style=\"margin-bottom:5px; margin-top:15px;\">\n\t\t\t\t\t\t\t\t<span style=\"font-size:13px; margin-bottom:5px;\"><b>Image size: </b> {{:oPhotoForWeb.iWidthPixels}} × {{:oPhotoForWeb.iHeightPixels}} px | {{:oPhotoForWeb.sSizeUncompressed}}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div style=\"margin-bottom:5px;\">\n\t\t\t\t\t\t\t\t<span style=\"font-size:13px;\"><b>Print size: </b> {{:oPhotoForWeb.iWidth}} × {{:oPhotoForWeb.iHeight}} cm | {{:oPhotoForWeb.iWidthIn}} × {{:oPhotoForWeb.iHeightIn}} in[inches] (300 dpi)</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td style=\"width:150px; text-align:right;\" class=\"price\">\n\t\t\t\t\t<div id=\"{{:GetElId('withoutMinPriceOptions')}}\">\n\t\t\t\t\t\t{{if HasUsage()}}\n\t\t\t\t\t\t\t<div class=\"price\" style=\"margin-bottom:5px;\"><span style=\"font-size:16px; font-weight: bold\" id=\"{{:GetElId('fPrice')}}\">{{:GetFormattedPrice()}}</span></div>\n\t\t\t\t\t\t\t<div style=\"margin-bottom:5px;\"><a type=\"button\" class=\"action\" href='javascript: {{:GetMyName()}}.Remove()'>Delete</a></div>\n\t\t\t\t\t\t\t<div><a type=\"button\" class=\"action\" href='javascript: {{:GetMyName()}}.ChangeUsage()'>Change license</a></div>\n\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t<div style=\"margin-bottom:5px\"><a type=\"button\" class=\"action\" href='javascript: {{:GetMyName()}}.Remove()'>Delete</a></div>\n\t\t\t\t\t\t\t<div><a type=\"button\" class=\"action\" id=\"{{:GetElId('usageBtn')}}\" href='javascript: {{:GetMyName()}}.ChangeUsage()'><b>Choose license</b></a></div>\n\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div id=\"{{:GetElId('withMinPriceOptions')}}\" style=\"display:none\">\n\t\t\t\t\t\t<div style=\"margin-bottom:5px\"><a type=\"button\" class=\"action\" href='javascript: {{:GetMyName()}}.Remove()'>Delete</a></div>\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"info2\">\n\t\t\t\t<td colspan=\"3\" style=\"padding-top: 0px;padding-bottom: 0px;\">\n\t\t\t\t\t<div style=\"margin-top:7px;\" class=\"descr\">\n\t\t\t\t\t\t{{for aDescr}}\n\t\t\t\t\t\t \t<div style=\"font-size:13px; margin-bottom:5px;\">{{if sTitle}}<b>{{:sTitle}}:</b> {{/if}}{{:sValue}}</div>\n\t\t\t\t\t\t{{/for}}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"minPriceDescr\" style=\"margin-top:5px;display:none; color:red\">\n\t\t\t\t\t\t<div style=\"font-size:13px; margin-bottom:5px;\">{{if iIdAssetType==2}}Video with special price.{{else}}Image with a special price.{{/if}} To proceed with the purchase, please remove this image from the cart or <a href=\"javascript: {{:GetParent().GetMyName()}}.RequestBudget(false,'{{:oPhotoForWeb.sWebCode}}');\" class=\"link\">request a budget</a></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"margin-bottom:5px; margin-top:15px;\">\n\t\t\t\t\t\t<span style=\"font-size:13px; margin-bottom:5px;\"><b>Image size: </b> {{:oPhotoForWeb.iWidthPixels}} × {{:oPhotoForWeb.iHeightPixels}} px | {{:oPhotoForWeb.sSizeUncompressed}}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"margin-bottom:5px;\">\t\n\t\t\t\t\t\t<span style=\"font-size:13px;\"><b>Print size: </b> {{:oPhotoForWeb.iWidth}} × {{:oPhotoForWeb.iHeight}} cm | {{:oPhotoForWeb.iWidthIn}} × {{:oPhotoForWeb.iHeightIn}} in[inches] (300 dpi)</span>\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</td>\n</tr>\n","shopping_cart_paid":"<div class=\"cart std\">\n\t<div style=\"background-color: #efefef; padding:15px;\">\n\t\t<ul style=\"list-style:none;\">\n\t\t\t<li style=\"margin-bottom:10px;\">\n\t\t\t\t<b><span id=\"{{:GetElId('paidTitle')}}\" style=\"font-size:22px;\">Purchase successfully completed</span></b>\n\t\t\t</li>\n\t\t\t<li style=\"margin-bottom:10px;\">\n\t\t\t\t<table>\n\t\t\t\t\t{{if sOrderNumber}}\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td style=\"width:165px;\">\n\t\t\t\t\t\t\t\t<span><b>Your purchase reference:</b></span>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<div>{{:sOrderNumber}}</div>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t{{/if}}
470\n\t\t\t\t\t{{if iInvoiceNumber && iIdStatus==40}}\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td style=\"width:165px;\">\n\t\t\t\t\t\t\t\t<div {{if sOrderNumber}}margin-top:10px;{{/if}}\"><b>Invoice number:</b></div>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<div {{if sOrderNumber}}style=\"margin-top:10px;\"{{/if}}>{{:iInvoiceNumber}} \n\t\t\t\t\t\t\t\t\t<span style=\"padding-left: 10px\"><a class=\"link\" target=\"_blank\" href=\"/cart/invoice/{{:sUrlCode}}\" >View invoice</a></span>\n\t\t\t\t\t\t\t\t\t{{for aCreditNotes ~oSc=#data}}\n\t\t\t\t\t\t\t\t\t\t<span style=\"padding-left: 10px\"><a class=\"link\" target=\"_blank\" href=\"/cart/credit_note/{{:~oSc.sUrlCode}}/{{:iInvoiceNumber}}\" >View credit note ({{:~oSc.GetFormattedAmount(fAmount)}})</a></span>\n\t\t\t\t\t\t\t\t\t{{/for}}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t{{/if}}\n\t\t\t\t</table>\n\t\t\t\t\n\t\t\t</li>\n\t\t</ul>\n\t</div>\n\t\n\t<div class=\"title\" style=\"margin-top:10px;\">\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<td style=\"font-size:22px;\">\n\t\t\t\t\t{{if iContentType==1}}\n\t\t\t\t\t\tDownload your images\t\t\t\t\t{{else}}\n\t\t\t\t\t\t{{if iContentType==2}}\n\t\t\t\t\t\t\tDownload your videos\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\tDownload your files\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t{{/if}}\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\t\n\t\t\t{{if HasLinkExpired()}}\n\t\t\t\t{{if IsAnyPhotoStillDownloadabled()}}\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td style=\"font-size:16px; color: red; padding-top:5px; font-weight:normal\"> \n\t\t\t\t\t\t\t<p>For security, the download link has expired.</p>\n\t\t\t\t\t\t\t<p>Please <a class=\"big link\" id=\"{{:GetElId('btnExtendLinkDuration')}}\">contact us</a> to reactivate it.</p>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t{{else}}\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td style=\"padding-top:5px;\" class=\"warning\"> The download for this purchase has expired.</td>\n\t\t\t\t\t</tr>\n\t\t\t\t{{/if}}\n\t\t\t{{/if}}\n\t\t</table>\n\t</div>\n\t{{if aLines.length>0}}\n\t\t<table class=\"lines\">\n\t\t\t{{for aLines tmpl=\"shopping_cart_line_paid\" /}}\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t\n\t\t\t\t</td>\n\t\t\t</tr>\n\n\t\t</table>\n\t{{else}}\t\n\t\t<div class=\"empty\">Your shopping cart is empty</div>\n\t{{/if}}\n</div>","shopping_cart_line_paid":"<tr id=\"{{:GetElId('line')}}\" class=\"paidLine\">\n\t<td class=\"line\">\n\t\t<div class=\"main_info\">\n\t\t\t<div class=\"thumb {{if oPhotoForWeb.iIdAssetType==2}}video{{/if}}\">\n\t\t\t\t{{if oPhotoForWeb.bRemoved}}\n\t\t\t\t\t<img src=\"data:image/png;base64, {{:oPhotoForWeb.sThumbBase64}}\" style=\"width: 100px\">\n\t\t\t\t{{else}}\n\t\t\t\t\t{{if oPhotoForWeb.iIdAssetType==2}}\n\t\t\t\t\t\t<img src=\"{{:oPhotoForWeb.sUrlVideoPosterThumb}}\" style=\"width: 100px\"> \n\t\t\t\t\t{{else}}\n\t\t\t\t\t\t<img src=\"{{:oPhotoForWeb.sUrlThumb}}\" style=\"width: 100px\">\n\t\t\t\t\t{{/if}}\n\t\t\t\t{{/if}}\n\t\t\t</div>\n\t\t\t<div class=\"onlymaininfo\">\n\t\t\t\t<div style=\"margin-bottom:5px;\"><b><span>{{:oPhotoForWeb.sWebCode}}</span></b></div>\n\t\t\t\t<div style=\"margin-bottom:5px;\"><span style=\"font-size:12px;\">{{:oPhotoForWeb.sCredit}}</span></div>\n\t\t\t</div>\n\t\t\t<div class=\"info\">\n\t\t\t\t<div class=\"maininfo\">\n\t\t\t\t\t<div style=\"margin-bottom:5px;\"><b><span>{{:oPhotoForWeb.sWebCode}}</span></b></div>\n\t\t\t\t\t<div style=\"margin-bottom:5px;\"><span style=\"font-size:12px;\">{{:oPhotoForWeb.sCredit}}</span></div>\n\t\t\t\t</div>\n\t\t\t\t{{if aDownloadsInfo.length > 0}}\n\t\t\t\t\t<table class=\"imageDownloadsInfoTbl\" id=\"{{:GetElId('Details')}}\">\n\t\t\t\t\t\t<tr style=\"background-color: #efefef; height:20px;\">\n\t\t\t\t\t\t\t<td style=\"width:170px;\">\n\t\t\t\t\t\t\t\t<b><span>Download date</span></b>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td style=\"min-width:100px;\">\n\t\t\t\t\t\t\t\t<b><span>From IP</span></b>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t{{for aDownloadsInfo ~oSc=#data}}\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<span>{{:~oSc.GetFormattedDateFromStr(tTsCreation,true)}}</span>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td style=\"width:auto;\">\n\t\t\t\t\t\t\t\t\t<span style=\"margin-left:5px; margin-right:5px;\">{{:sIp}}</span>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t{{/for}}\n\t\t\t\t\t</table>\n\t\t\t\t{{/if}}\n\t\t\t</div>\n\t\t\t<div class=\"btns\">\n\t\t\t\t{{if iDownloadPermission == 4}}
470\n\t\t\t\t\t<input type=\"button\" class=\"green btnBuyAgain\" value=\"Purchase again\">\n\t\t\t\t{{/if}}\n\t\t\t\t\n\t\t\t\t{{if iDownloadPermission == 1}}\n\t\t\t\t\t{{if !HasLinkExpired()}} \n\t\t\t\t\t\t{{if bPhotoRemoved}}\n\t\t\t\t\t\t\tThis image is no longer included in our catalog\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t{{if oPhotoForWeb.iIdAssetType==2}}\n\t\t\t\t\t\t\t\t<div class=\"jpg\" style=\"width:100%; padding-left:10px;\">\n\t\t\t\t\t\t\t\t\t<div class=\"container\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"downloading\">\n\t\t\t\t\t\t\t\t\t\t\tDownloading file <span style=\"white-space:nowrap\">({{:oPhotoForWeb.sVideoFormat}})...</span>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"btn btnDwnJpg\">\n\t\t\t\t\t\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img style=\"width: 26px; margin-top:10px;\" alt=\"download\" src=\"/common/images/download_white.svg\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div style=\"color: white\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<b><span class=\"paidDownloadSpan\">Download video</span></b>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span>{{:oPhotoForWeb.sVideoFormat}}</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span>{{:GetFormattedFileSize(oPhotoForWeb.iFileSize)}}</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t<div id=\"{{:GetElId('paidDownloadBtnsContainer')}}\" style=\"position: relative; \">\n\t\t\t\t\t\t\t\t\t<div class=\"paidDownloadTip\" id=\"{{:GetElId('dowloadTip')}}\">\n\t\t\t\t\t\t\t\t\t\t<p>Images are downloadable in JPG format for faster transmission.</p>\n\t\t\t\t\t\t\t\t\t\t<p>JPG is a standard file format to compress an image.</p>\n\t\t\t\t\t\t\t\t\t\t<p>When opening a JPG file, the image is uncompressed and displayed in its real dimension.</p>\n\t\t\t\t\t\t\t\t\t\t{{if oPhotoForWeb.sSizeJpg}}\n\t\t\t\t\t\t\t\t\t\t\t<p>That is, the downloadable JPG file for this image, is <b>{{:oPhotoForWeb.sSizeJpg}}</b>, but the real dimension of the contained image is <b>{{:oPhotoForWeb.sSizeUncompressed}}</b>.</p> \n\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t\t<p>If you prefer to get the uncompressed TIF file, click the button \"<b>Download uncompressed TIF File ({{:oPhotoForWeb.sSizeUncompressed}})</b>\".</p>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"jpg\" style=\"width:100%; padding-left:10px;\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"container\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"downloading\">\n\t\t\t\t\t\t\t\t\t\t\t\tDownloading file <span style=\"white-space:nowrap\">JPG {{if oPhotoForWeb.sSizeJpg}}({{:oPhotoForWeb.sSizeJpg}}){{/if}}...</span>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"btn btnDwnJpg\">\n\t\t\t\t\t\t\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img style=\"width: 26px; margin-top:10px;\" alt=\"download\" src=\"/common/images/download_white.svg\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div style=\"color: white\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<b><span class=\"paidDownloadSpan\">Download high resolution</span></b>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span>{{:oPhotoForWeb.iWidthPixels}} x {{:oPhotoForWeb.iHeightPixels}} px, {{:oPhotoForWeb.sSizeUncompressed}} {{if !oPhotoForWeb.sSizeJpg}} uncompressed{{/if}}</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{{if oPhotoForWeb.sSizeJpg}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span>({{:oPhotoForWeb.sSizeJpg}} compressed)</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"tiff\" style=\"width:100%; padding-left:10px; margin-top: 5px; margin-bottom: 10px;\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"container\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"downloading\">\n\t\t\t\t\t\t\t\t\t\t\t\tDownloading file <span style=\"white-space:nowrap\">TIF ({{:oPhotoForWeb.sSizeUncompressed}})...</span>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"btn btnDwnTif\">\n\t\t\t\t\t\t\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img style=\"width: 18px; margin-top:5px;\" alt=\"download\" src=\"/common/images/download_white.svg\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td style=\"padding-left: 4px; font-size: 12px\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div style=\"color: white;\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<b><span class=\"paidDownloadSpan\">Download uncompressed TIF file ({{:oPhotoForWeb.sSizeUncompressed}})</span></b>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t{{/if}} \n\t\t\t\t{{/if}}\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"xtrainfo\">\n\t\t\t{{if iDownloadPermission == 5}}\n\t\t\t\t<div style=\"margin-bottom: 10px\">Image refunded on {{:GetFormattedDate('dTsRefunded')}}</div>\n\t\t\t\t{{if bPhotoRemoved}}\n\t\t\t\t\tThis image is no longer included in our catalog\t\n\t\t\t\t{{else}}
470\n\t\t\t\t\t<input type=\"button\" class=\"green btnBuyAgain\" value=\"Purchase again\">\n\t\t\t\t{{/if}}\n\t\t\t{{/if}}\n\t\t\t{{if iDownloadPermission == 1}}\n\t\t\t\t{{if !HasLinkExpired() && bPhotoRemoved}} \n\t\t\t\t\tThis image is no longer included in our catalog\t\t\t\t{{/if}}\n\t\t\t{{/if}}\n\t\t\t{{if iDownloadPermission == 2}}\n\t\t\t\t<div>\n\t\t\t\t\t<span>{{:GetMsgValidateEmail()}}</span>\n\t\t\t\t\t<br>\n\t\t\t\t\t<br>\n\t\t\t\t\t<span>Haven't you received it? <a class=\"link\" style=\"font-size: 14px\" href=\"javascript: {{:GetMyName()}}.ReSendExtendEmail();\">Send email again</a></span>\n\t\t\t\t</div>\n\t\t\t{{/if}}\n\t\t\t\n\t\t\t{{if iDownloadPermission == 3}}\n\t\t\t\t<div>\n\t\t\t\t\tFor security, to continue downloading this image, please <a class=\"link ancContactExtend\" style=\"font-size:14px;\" href=\"#\">contact us</a>\t\t\t\t</div>\n\t\t\t{{/if}}\n\t\t\t\n\t\t\t{{if iDownloadPermission == 4}}\n\t\t\t\t<div style=\"color:red;\">\n\t\t\t\t\tThe license associated with this image has expired \n\t\t\t\t</div>\n\t\t\t{{/if}}\n\t\t</div>\n\t</td>\n</tr>","shopping_cart_checkout_cards":"{{if aCards.length>0}}\n\t{{for aCards}}\n\t\t<div style=\"margin-bottom:7px;\">\n\t\t\t<label>\n\t\t\t\t<input {{if bIsMainCard > 0}}checked{{/if}} type=\"radio\" name=\"{{:GetParent().GetElId('cards')}}\" value=\"{{:iId}}\">\n\t\t\t\t<span style=\"font-size:13px;\">{{:sDescription}} ({{:sPan}})</span>\n\t\t\t</label>\n\t\t</div>\n\t{{/for}}\n{{/if}}\t\n<div>\n\t<label style=\"display:none\" >\n\t\t<input type=\"radio\" {{if aCards.length==0}}checked{{/if}} id=\"{{:GetElId('otherCardRadioBtn')}}\" name=\"{{:GetElId('cards')}}\" value=\"other\">\n\t\t<span style=\"font-size:13px;\">New card </span>\n\t</label>\n</div>\n"})};RefreshCart(t,e){if(typeof e=='undefined')e=!1;if(this.sUrlCode.length>0){var i=this;AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{sUrlCode:this.sUrlCode,bFromBudget:e},sMethodHash:'',bShowProgress:!1,fPostActions:function(t){if(t.bOk&&t.mResults){i.LoadInfo(t.mResults);i.RenderPaid()} 471else{document.location.reload()}}})} 472else{this.GetNavigation().RefreshCartStatus(t);this.LoadInfo(t);if(this.tmpl_bCheckoutForm)this.RefreshCheckOutCart();else this.Render()}};Render(t){this.LoadTemplates(['shopping_cart_line']);this.Render2(t,'shopping_cart');for(var e=0;e<this.aLines.length;e++){this.aLines[e].SetPositionInParent(e)};this.CheckPhotoMinPrice();this.CheckPhotoSalableInRetail();var i=this;this.GetEl('btnCheckout').on('click',function(){i.Checkout()});this.GetEl('btnReqBudget').on('click',function(){i.RequestBudget()});this.GetEl('btnClear').on('click',function(){i.ClearShoppingCart();return!1})};RenderPaid(t){this.Render2(t,'shopping_cart_paid');for(var e=0;e<this.aLines.length;e++){this.aLines[e].SetPositionInParent(e);this.aLines[e].SetEvents();$('.paidDownloadContainer',this.aLines[e].GetEl('paidDownloadSpan')).parent().textfill({maxFontPixels:14,explicitWidth:196,explicitHeight:17})};if(typeof this.bJustBought=='undefined'||!this.bJustBought){this.GetEl('paidTitle').html('Purchase information');this.GetEl('paidTip').hide()};var i=this;this.GetEl('btnExtendLinkDuration').on('click',function(){i.openContactUsExtendLinkDuration();return!1})};HasLinkExpired(){if(this.tLinkExpirationTime<Date.now()/1000)return!0;return!1};IsAnyPhotoStillDownloadabled(){for(var t=0;t<this.aLines.length;t++){if(this.aLines[t].IsStillDownloadable()){return!0}};return!1};openContactUsExtendLinkDuration(){var e='The download link for the invoice $1 has expired. I request its reactivation.';e=e.replace('$1',this.iInvoiceNumber);var t='Download link reactivation request, invoice $1';t=t.replace('$1',this.iInvoiceNumber);top.oNavigation.OpenContactUsRightPanel('Extension request',e,t)};SetRowEvents(){var t=this;this.GetEl('orderRow').on('click',function(){t.View()})}; 473;RefreshCheckOutCart(){if(this.aLines.length==1){this.GetEl('numPhotosSpan').html(1+' image')} 474else if(this.aLines.length>1){this.GetEl('numPhotosSpan').html(this.aLines.length+' images')};this.RenderCheckoutLines();this.RenderCheckoutPriceSummary(); 475;if(this.ShowPaycometBtn)this.ShowPaymentMethod( 4762);else this.ShowPaymentMethod( 4771); 478}; 479;RenderCheckoutLines(){this.GetEl('tblLines').empty();for(var t=0;t<this.aLines.length;t++){this.aLines[t].SetPositionInParent(t)};for(var t=0;t<this.aLines.length;t++){this.aLines[t].RenderCheckoutLine(this.GetEl('tblLines'))};this.RenderPhotoAvailability()};RenderCheckoutPriceSummary(){this.Render2(this.GetEl('tblPriceSummary'),'shopping_cart_checkout_price_summary');if(this.oCountry.iId== 48065||this.oCountry.iId== 481223||!this.oCountry.bIsEUCountry){this.showEsUkInfo()} 482else{this.showEuInfo()};this.GetEl('vatNo').keypress(function(e){if(e.keyCode=='13'){t.GetEl('btnAddVatNo').click();e.stopPropagation();e.preventDefault()}});this.GetEl('vatNo').keyup(function(e){if(e.keyCode=='27'){t.GetEl('vatNo').val('');t.GetEl('msgVatNo').html('')}});this.GetEl('vatNo').focusout(function(e){if(t.GetEl('vatNo').val()==''){t.GetEl('msgVatNo').html('')} 483else{setTimeout(function(){if(!t.bValidateVatNoClicked){t.GetEl('msgVatNo').html('Click "Add" to validate the code')}},100)}});var t=this;this.GetEl('btnAddVatNo').on('click',function(){var i=t.GetEl('vatNo').val().trim();if(i.length){t.bValidateVatNoClicked=!0;t.bValidatingVatno=!0;t.GetEl('btnAddVatNo').hide();t.GetEl('loadingVatNo').show();var e=0;if(t.bBudgetView){e=t.iIdBudget};AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{sVatNo:i,iI
483dCountry:t.GetEl('iIdCountry').val(),iIdBudget:e},sMethodHash:'',bShowProgress:!1,fPostActions:function(e){if(e.bOk){t.bVatNoIsValid=e.mResults.bIsValid;if(e.mResults.bIsValid){t.GetEl('msgVatNo').html('');t.oEditedFields.sInVies=e.mResults.sInVies;t.oEditedFields.sVatNo=e.mResults.sFormattedVatNo;t.bVatNoInVies=e.mResults.bInVies;t.GetEl('vatNo').val(e.mResults.sFormattedVatNo);t.GetEl('viewVatNo').html(e.mResults.sFormattedVatNo);t.GetEl('editVatControls').hide();t.GetEl('viewVatControls').show();t.SetVatNoRequiredFields(!0,!0);if(t.GetEl("sAddressLine1").val()==!1&&e.mResults.sAddress1!=!1){t.GetEl("sAddressLine1").val(e.mResults.sAddress1)};if(t.GetEl("sAddressLine2").val()==!1&&e.mResults.sAddress2!=!1){t.GetEl("sAddressLine2").val(e.mResults.sAddress2)};if(t.GetEl("sCompanyName").val()==!1&&e.mResults.sCompanyName!=!1){t.GetEl("sCompanyName").val(e.mResults.sCompanyName)};if(e.mResults.oCountry){t.oCountry=e.mResults.oCountry;$('option[value='+t.oCountry.iId+']',t.GetEl("iIdCountry")).prop('selected',!0);t.sCurrency=e.mResults.oCountry.sCurrency;t.sCurrencySymbol=e.mResults.oCountry.sCurrencySymbol};t.ReCalculatePrice();t.bValidatingVatno=!1;if(t.bPaycometPayStopped){t.GetEl('btnPaycomet').removeClass('disabledDivBtn');t.GetEl('btnPaycometSubmit').prop('disabled',!1);t.GetEl('btnPaycomet2').removeClass('disabledDivBtn');t.bPaycometPayStopped=!1};if(t.ShowPaycometBtn){t.ShowPaycometPayOption()};t.GetEl('paybtnErrorMsg').hide()} 484else{t.bValidateVatNoClicked=!1;t.GetEl('msgVatNo').html(e.mResults.sMsg);t.GetEl('btnAddVatNo').show();t.GetEl('loadingVatNo').hide()};if(t.GetEl('ShowInvoiceDetailsText').is(":visible")){t.ShowInvoiceDetails()}} 485else{$$.ShowDialogNotification(e.sMsg,{sTitle:'Warning'})};t.GetEl('btnAddVatNo').val('Add').prop('disabled',!1)}})}});this.GetEl('btnRemoveVatNo').on('click',function(){t.bVatNoInVies=!1;t.bValidateVatNoClicked=!1;t.oEditedFields.sVatNo='';t.GetEl("vatNo").val('');t.ReCalculatePrice();t.GetEl('editVatControls').show();t.GetEl('viewVatControls').hide();t.GetEl('btnAddVatNo').show();t.GetEl('loadingVatNo').hide();t.SetVatNoRequiredFields(!1);if(t.ShowPaycometBtn){t.ShowPaycometPayOption()}}); 486};IsBudgetExpired(){var t=new Date().getTime()/1000;return this.tBudgetExpirationTime<t};HideDeleteBtns=function(){for(var t=0;t<this.aLines.length;t++){this.aLines[t].HideDeleteBtns()}};RenderBudget(t){this.bBudgetView=!0;this.RenderCheckOut(t);this.GetEl('numPhotosSpan').hide();if(this.oRetailBudget.iIdStatus== 487100){this.HideDeleteBtns();this.GetEl('payment').hide();if(this.oRetailBudget.iIdNewBudget&&this.oRetailBudget.iIdNewBudget>0){this.GetEl('budgetRequestedDiv').show()} 488else{this.GetEl('linkCancelledDiv').show()}} 489else if(this.oRetailBudget.iIdStatus== 4902){if(this.IsBudgetExpired()){this.HideDeleteBtns();var e=this;this.GetEl('payment').hide();this.GetEl('linkExpiredDiv').show()} 491else{this.GetEl('linkValidDiv').show();this.GetEl('linkExpirationTime').html(this.GetFormattedDateFromStr(this.tBudgetExpirationTime,!1,!0))}} 492else if(this.oRetailBudget.iIdStatus== 4934){this.HideDeleteBtns();this.GetEl('payment').hide();this.GetEl('budgetRequestedDiv').show()}};CleanBillingInfo=function(){this.GetEl('sAddressLine1').val('');this.GetEl('sAddressLine2').val('');this.GetEl('sCity').val('');this.GetEl('sCompanyName').val('');this.GetEl('sPostalCode').val('');this.GetEl('sOrderNumber').val('');this.GetEl('sVatNoEsUk').val('')};ActiveExpiredBudget=function(){top.oNavigation.ActiveExpiredBudget(this.iIdBudget)};SetCheckoutTitle=function(t){this.GetEl('checkoutTitle').html(t)};CheckPhotoSalableInRetail=function(){for(var t=0;t<this.aLines.length;t++){this.aLines[t].IsPhotoSalableInRetail()}};CheckPhotoMinPrice=function(){for(var t=0;t<this.aLines.length;t++){this.aLines[t].HasMinSalePrice()}};RenderCheckOut(t){this.tmpl_bCheckoutForm=!0;var e=this;this.bValidatingVatno=!1;this.bPaycometPayStopped=!1;this.bVatNoIsValid=!1;var i=this.getNumberImageToProcess(),s=0;this.tmpl_bFormWaningsInLabels=!0;if(typeof t!='undefined')this.tmpl_oCheckoutContainer=t;else t=this.tmpl_oCheckoutContainer;this.Render2(t,'shopping_cart_checkout');this.GetEl('ShowInvoiceDetailsText').parent().textfill({maxFontPixels:15,innerTag:'a',explicitWidth:288,explicitHeight:25});this.GetEl('HideInvoiceDetailsText').css('font-size',this.GetEl('ShowInvoiceDetailsText').css('font-size'));this.RenderCheckoutLines();this.RenderCheckoutPriceSummary();this.GetEl('optCard').on('click',function(){e.ShowPaymentMethod( 4942)});this.GetEl('optPaypal').on('click',function(){e.ShowPaymentMethod( 4951)});$('option[value='+this.oCountry.iId+']',this.GetEl("iIdCountry")).prop('selected',!0); 496;this.GetEl('logInInfo').show();this.GetEl('saveCardCheckBoxDiv').hide();this.GetEl('saveBillingInfoDiv').hide(); 497;this.CheckBillingInfo();this.RenderPhotoAvailability();this.GetEl('btnRequestBudget').on('click',function(){e.RequestBudget(e.iIdBudget)});this.GetEl('btnActiveExpiredBudget').on('click',function(){e.ActiveExpiredBudget()});
497this.GetEl('ancLogIn').on('click',function(){top.oNavigation.LogInRightPanel(!0,!0);return!1});this.GetEl('saveCardCheckBox').on('click',function(){e.SaveCardCheckBoxClicked(!0,!0)});this.GetEl('btnPaycomet').on('click',function(){e.GetEl('btnPaycometSubmit').click()});this.GetEl('btnPaycomet2').on('click',function(){e.PaycometPay(!1)});this.GetEl('sVatNoEsUk').on('change',function(){e.CheckVatNoEsUkRequiredFields()});this.GetEl('iIdCountry').on('change',function(){var t=0;if(e.iIdBudget){t=e.iIdBudget};AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{iIdCountry:e.GetEl('iIdCountry').val(),iIdBudget:t},sMethodHash:'',bShowProgress:!1,fPostActions:function(t){if(t.bOk){e.oCountry=t.mResults.oCountry;if(t.mResults.oPacks)e.oPriceCalculator.setPacks(t.mResults.oPacks);e.oPriceCalculator.sFCurr=!1;e.oEditedFields.sVatNo='';e.GetEl('viewVatControls').hide();e.GetEl('msgVatNo').html('');e.bVatNoInVies=!1;e.GetEl('sVatNoEsUkLabel').html(t.mResults.sVatNoLabel);if(e.oCountry.iId== 49865){e.showEsUkInfo();e.CheckVatNoEsUkRequiredFields()} 499else if(e.oCountry.iId== 500223||!t.mResults.bIsEUCountry){e.showEsUkInfo();e.CheckVatNoEsUkRequiredFields()} 501else{e.showEuInfo();e.SetVatNoRequiredFields(!1)}; 502;$('input[data-paycomet="jetID"]').val(t.mResults.sJetID); 503;if(!t.mResults.bIsEUCountry&&!t.mResults.bIsUk){e.GetEl('editVatControls').hide()} 504else{e.GetEl("vatNo").val('');e.GetEl("viewVatNo").val('');e.GetEl('editVatControls').show();e.GetEl('loadingVatNo').hide();e.GetEl('btnAddVatNo').show()};if(e.aLines.length!=t.mResults.oShoppingCart.aLines.length){e.HideProgressTip();$$.ShowDialogNotification('The cart is out of date.<br>The page will reload to update it.',{sTitle:'Warning'},function(){document.location.reload()});return};var s=(e.sCurrency!=t.mResults.oShoppingCart.sCurrency);e.sCurrency=t.mResults.oShoppingCart.sCurrency;e.sCurrencySymbol=t.mResults.oShoppingCart.sCurrencySymbol;for(var i=0;i<e.aLines.length;i++){if(e.aLines[i].iId!=t.mResults.oShoppingCart.aLines[i].iId){e.HideProgressTip();$$.ShowDialogNotification('The cart is out of date.<br>The page will reload to update it.',{sTitle:'Warning'},function(){document.location.reload()});return};e.aLines[i].bVisible=t.mResults.oShoppingCart.aLines[i].bVisible;e.aLines[i].fPrice=t.mResults.oShoppingCart.aLines[i].fPrice};e.RefreshAllPrices(); 505;e.aCards=t.mResults.aCards;e.SetChildObjects('aCards',PaymentCard,!0);e.RenderCards();if(s){e.RenderPaypalBtn()};if(e.ShowPaycometBtn){e.ShowPaymentMethod( 5062)} 507else{e.ShowPaymentMethod( 5081)}; 509;e.RenderPhotoAvailability()} 510else{$$.ShowDialogNotification(t.sMsg,{sTitle:'Warning'})};e.GetEl('btnAddVatNo').val('Add').prop('disabled',!1)}})});var e=this; 511;this.RenderPaypalBtn();this.RenderCards();this.ShowPaymentMethod( 5122); 513;if(this.CheckImageStatus( 5142)&&!this.CheckImageStatus( 5151)){this.RenderPopUpNotAvailaBleInfo()};if(this.CheckImageStatus( 5161)){this.RenderPopUpCheckingImages();this.ProcessPendingImage(s,i)};if(!this.CheckImageStatus( 5170)){this.GetEl('payment').hide()}; 518;var e=this;$('#paycometPaymentForm').submit(function(){setTimeout(function(){if($('#paymentErrorMsg').html().length>0){if(e.GetEl('otherCardRadioBtn').is(':visible'))e.GetEl('otherCardRadioBtn').focus();else $('input[data-paycomet="cardHolderName"]').focus()}},50)});$('<'+'script>').attr('src','https://api.paycomet.com/gateway/paycomet.jetiframe.js?lang=en').appendTo(this.GetRenderContainer()); 519};RenderPhotoAvailability=function(){this.iNotVisiblePhoto=0;if(typeof this.oRetailBudget=='undefined'||typeof this.oRetailBudget.bIgnoreCountryRestrictions=='undefined')this.bIgnoreCountryRestrictions=!1;if(!(this.iIdBudget&&this.oRetailBudget.bIgnoreCountryRestrictions&&this.oRetailBudget.oCountry.iId==this.GetEl('iIdCountry').val())){for(var t=0;t<this.aLines.length;t++){if(!this.aLines[t].bRemoved){if(!this.aLines[t].bVisible)this.iNotVisiblePhoto++}};if(this.iNotVisiblePhoto>0){for(var t=0;t<this.aLines.length;t++){if(!this.aLines[t].bRemoved){if(!this.aLines[t].bVisible){this.aLines[t].PrintErrorMsg()} 520else{this.aLines[t].PrintPhotoInfo()}}};this.GetEl('btnPaycomet').addClass('disabledDivBtn');this.GetEl('btnPaycometSubmit').prop('disabled',!0);this.GetEl('btnPaycomet2').addClass('disabledDivBtn')} 521else{this.GetEl('btnPaycomet').removeClass('disabledDivBtn');this.GetEl('btnPaycometSubmit').prop('disabled',!1);this.GetEl('btnPaycomet2').removeClass('disabledDivBtn');for(var t=0;t<this.aLines.length;t++){if(!this.aLines[t].bRemoved){this.aLines[t].PrintPhotoInfo()}}}} 522else{this.GetEl('btnPaycomet').removeClass('disabledDivBtn');this.GetEl('btnPaycometSubmit').prop('disabled',!1);this.GetEl('btnPaycomet2').removeClass('disabledDivBtn');for(var t=0;t<this.aLines.length;t++){if(!this.aLines[t].bRemoved){this.aLines[t].PrintPhotoInfo()}}}};GetNotVisiblePhotosWebCode=function(){var e='';for(var t=0;t<this.aLines.length;t++){if(!this.aLines[t].bVisible)e+=this.aLines[t].oPhotoForWeb.sWebCode;if(t<this.aLines.length-1)e+=','};return e};OpenPhotoNotVisibleForm=function(){var t='Territory restriction: '+this.GetNotVisiblePhotosWebCode();top.oNavigation.OpenContactUsRightPanel('Territory restriction',undefined,t);this.ClosePopup()};SetVatNoRequiredFields=function(t,e){if(typeof e=='undefined')e=!1;if(t){this.GetEl('sCompanyName').attr('alb-req',"").attr('alb-reqforce',"");if(e){this.GetEl('sCity').removeAttr('alb-req').removeAttr('alb-reqforce');this.GetEl('sPostalCode').removeAttr('alb-req').removeAttr('alb-reqforce');this.GetEl('sAddressLine1').removeAttr('alb-req').removeAttr('alb-reqforce');$('#'+this.GetElValMsgId('sCity')).remove();$('#'+this.GetElValMsgId('sPostalCode')).remove();$('#'+this.GetElValMsgId('sAddressLine1')).remove();return};this.GetEl('sCity').attr('alb-req',"").attr('alb-reqforce',"");this.GetEl('sPostalCode').attr('alb-req',"").attr('alb-reqforce',"");this.GetEl('sAddressLine1').attr('alb-req',"").attr('alb-reqforce',"")} 523else{this.GetEl('sCompanyName').removeAttr('alb-req').removeAttr('alb-reqforce');$('#'+this.GetElValMsgId('sCompanyName')).remove();this.GetEl('sCity').removeAttr('alb-req').removeAttr('alb-reqforce');this.GetEl('sPostalCode').removeAttr('alb-req').removeAttr('alb-reqforce');this.GetEl('sAddressLine1').removeAttr('alb-req').removeAttr('alb-reqforce');$('#'+this.GetElValMsgId('sCity')).remove();$('#'+this.GetElValMsgId('sPostalCode')).remove();$('#'+this.GetElValMsgId('sAddressLine1')).remove()}};CheckBillingInfo=function(){if(this.GetEl('sAddressLine1').val()||this.GetEl('sAddressLine2').val()||this.GetEl('sCity').val()||this.GetEl('sCompanyName').val()||this.GetEl('sPostalCode').val()){this.GetEl('ShowInvoiceDetailsText').html("+ Check your billing information");this.GetEl('HideInvoiceDetailsText').html("- Check your billing information")}};showEsUkInfo(){this.GetEl('vatNoEURow').hide();this.GetEl('vatNo').html('');this.GetEl('vatNoEsUkRow').show()};showEuInfo(){ 524;this.GetEl('vatNoEURow').show();this.GetEl('vatNoEsUk').html('');this.GetEl('vatNoEsUkRow').hide(); 525};ShowInvoiceDetails(){this.GetEl('InvoiceDetailsTbl').show();this.GetEl('HideInvoiceDetailsText').show();this.GetEl('ShowInvoiceDetailsText').hide()};HideInvoiceDetails(){this.GetEl('InvoiceDetailsTbl').hide();this.GetEl('HideInvoiceDetailsText').hide();this.GetEl('ShowInvoiceDetailsText').show()};RefreshAllPrices(){for(var t=0;t<this.aLines.length;t++){this.aLines[t].RefreshPrice()};this.ReCalculatePrice()};ReCalculatePrice(){this.GetEl('vatPct').html(this.GetVatPct()+'%');
525this.GetEl('vatAmount').html(this.GetFormattedVatAmount());this.GetEl('totalAmount').html(this.GetFormattedTotalPrice());this.GetEl('fTotalPrice').html(this.GetFormattedTotalPrice());this.GetEl('fTotalPriceNoVat').html(this.GetFormattedTotalPriceWithoutVAT())};GetVatNoFromUser(){if(this.sVatNo.length>0){if(this.oCountry.iId== 52665||this.oCountry.iId== 527223||!this.bIsEUCountry){this.GetEl('sVatNoEsUk').val(this.sVatNo);this.CheckVatNoEsUkRequiredFields()} 528else{this.GetEl('viewVatNo').html(this.sVatNo);this.GetEl('editVatControls').hide();this.GetEl('viewVatControls').show();this.SetVatNoRequiredFields(!0,!0)};this.oEditedFields.sInVies=this.sInVies;this.oEditedFields.sVatNo=this.sVatNo;this.RefreshAllPrices()}};CheckVatNoEsUkRequiredFields=function(){if(this.GetEl('sVatNoEsUk').val()){if(this.oCountry.iId== 52965){this.SetVatNoRequiredFields(!0)} 530else{this.SetVatNoRequiredFields(!0,!0)}} 531else{this.SetVatNoRequiredFields(!1);$('#'+this.GetElValMsgId('sVatNoEsUk')).val('')}};SaveCardCheckBoxClicked(){if(this.GetEl('saveCardCheckBox').prop("checked")==!0){this.GetEl('sDescription').prop('alb-req',!0);this.GetEl('descripDIV').show();if(this.aCards.length==0){this.GetEl('mainCardCheckBox').attr('checked','true');this.GetEl('mainCardCheckBox').attr('disabled','disabled')}} 532else{this.GetEl('descripDIV').hide();this.GetEl('sDescription').prop('alb-req',!1);if(this.aCards.length==0){this.GetEl('mainCardCheckBox').removeAttr('checked');this.GetEl('mainCardCheckBox').removeAttr('disabled')}}};ShowPaymentMethod(t){switch(t){case 5331:this.ShowPaycometBtn=!1;this.GetEl('btnPaypal').show();this.GetEl('paycometOptions').hide();this.GetEl('btnPaycomet2').hide();this.GetEl('btnPaycomet').hide();this.GetEl('btnPaycomet2Div').hide();this.GetEl('btnPaycometDiv').hide();this.GetEl('optPaypal').addClass('active');this.GetEl('optCard').removeClass('active');this.GetEl('limitPriceMsg').hide();this.GetEl('BillingInfoDiv').show();break;case 5342:this.ShowPaycometPayOption();break}};ShowPaycometPayOption(){var t=this.GetMaxAmount();if(this.GetTotalPrice(!0)<t){this.ShowPaycometBtn=!0;this.GetEl('paycometOptions').show();this.GetEl('optCard').addClass('active');this.GetEl('optPaypal').removeClass('active');this.RadioBoxClicked();this.GetEl('limitPriceMsg').hide();this.GetEl('BillingInfoDiv').show()} 535else{this.GetEl('BillingInfoDiv').hide();this.GetEl('limitPriceMsg').html(this.getMsgAmountLimit()).show();this.GetEl('paycometOptions').hide();this.GetEl('btnPaycomet2').hide();this.GetEl('btnPaycomet').hide()};this.GetEl('btnPaypal').hide()};getMsgAmountLimit(){var t="For security reasons, payments of more than $1 by card are not accepted.<br>Please use PayPal or <a class='link' href='javascript: top.oNavigation.OpenContactUsRightPanel()'>contact us</a>.";return t.replace('$1',this.GetMaxAmount()+" "+this.sCurrency)};GetMaxAmount=function(){var t= 5363300;return t};RadioBoxClicked(){if($('input[name="'+this.GetElId('cards')+'"]:checked').val()=="other"){this.GetEl('NewCardForm').show();this.GetEl('btnPaycomet2').hide();this.GetEl('btnPaycomet').show();this.GetEl('btnPaycomet2Div').hide();this.GetEl('btnPaycometDiv').show()} 537else{this.GetEl('NewCardForm').hide();this.GetEl('btnPaycomet2').show();this.GetEl('btnPaycomet').hide();this.GetEl('btnPaycomet2Div').show();this.GetEl('btnPaycometDiv').hide()}};PaycometPay(t){if(this.bValidatingVatno){this.bNewCard=t;this.bPaycometPayStopped=!0;this.GetEl('btnPaycomet').addClass('disabledDivBtn');this.GetEl('btnPaycometSubmit').prop('disabled',!0);this.GetEl('btnPaycomet2').addClass('disabledDivBtn');this.GetEl('paybtnErrorMsg').html('We are calculating the VAT amount. Please try again in a few seconds.').show();return};if(this.GetNumNoAvailImages()){$$.ShowDialogNotification('Please remove unavailable images before processing the order.',{sTitle:'Warning'});return};this.GetEl('paybtnErrorMsg').html('We are calculating the VAT amount. Please try again in a few seconds.').hide();if(this.FillFromForm()){if(!this.GetEl('sVatNoEsUk').is(':visible'))this.oEditedFields.sVatNoEsUk='';var o=!1,a=!1;this.ShowProgressTip("Payment in progress",!0,{iWidth:300,iFontSize:20});if(t)o=$('#paycometPaymentForm input[name=paytpvToken]').val();else a=$('input[name="'+this.GetElId('cards')+'"]:checked').val();if(o||a){var i=this.oEditedFields;i.aLines=[];for(var s=0;s<this.aLines.length;s++){i.aLines.push(this.aLines[s].GetProperties())};i.fBasePrice=this.GetTotalPrice(!1);i.fVatPct=this.GetVatPct();i.sCurrency=this.sCurrency;i.iIdBudget=this.iIdBudget;if(this.iIdBudget){i.bIgnoreCountryRestrictions=this.oRetailBudget.bIgnoreCountryRestrictions};i.sBudgetUrlCode=this.sBudgetUrlCode;var n=this.GetEl('mainCardCheckBox').prop("checked"),e=this;$('input[type=button]').prop('disabled',!0);AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{oRequestSoldShoppingCart:i,sToken:o,iIdCard:a,bIsMainCard:n}
537,sMethodHash:'',bShowProgress:!1,fPostActions:function(i){if(i.bOk){var s=!1;if(!s){if(i.mResults.bRequestPwd){top.oNavigation.ShowRequestPwdPopup(function(){e.PaycometPay(t)});s=!0}};if(!s){if(!i.mResults.bAllPhotoVisible){$$.ShowDialogNotification(i.mResults.sErrorMsg,{sTitle:'Warning'});s=!0}};if(!s){if(!i.mResults.bCorrectUsage){$$.ShowDialogNotification(i.mResults.sErrorMsg,{sTitle:'Warning'});s=!0}};if(!s){if(!i.mResults.bOkCurrentCart){$$.ShowDialogNotification('The cart is out of date.<br>The page will reload to update it.',{sTitle:'Warning'},function(){document.location.reload()});s=!0}};if(!s){if(!i.mResults.bValidBudget){$$.ShowDialogNotification(i.mResults.sBudgetError,{sTitle:'Warning'});s=!0}};if(!s){if(!i.mResults.bVatNoOk){$('#'+e.GetElValMsgId('sVatNoEsUk')).html(i.mResults.sVatNoErrorMsg);e.GetEl('sVatNoEsUk').focus();if(e.GetEl('ShowInvoiceDetailsText').is(":visible")){e.ShowInvoiceDetails()};s=!0}};if(!s){if(i.mResults.bMustBeEuro){if(i.mResults.oPacks)e.oPriceCalculator.setPacks(i.mResults.oPacks);e.oPriceCalculator.sFCurr='EUR';$$.ShowDialogNotification(i.mResults.sMustBeEuroMsg,{sTitle:'Currency'},function(){e.LoadInfo(i.mResults.oCart);e.RefreshCheckOutCart();$('#paycometPaymentForm input[data-paycomet="jetID"]').val(e.sJetID);e.RenderCards();e.bNewCard=!0;$('input[name='+e.GetElId('cards')+'][value="other"]').prop('checked',!0).trigger('click');e.ClosePopup()});s=!0}};if(!s){if(i.mResults.sChallengeUrl){document.location=i.mResults.sChallengeUrl;s=!0}};if(!s){if(i.mResults.sCartUrlCode!=''){e.ShowPurchased(i.mResults.sCartUrlCode,!0)} 538else{$$.ShowDialogNotification('The cart is out of date.<br>The page will reload to update it.',{sTitle:'Warning'},function(){document.location.reload()})}}} 539else{$$.ShowDialogNotification(i.sMsg,{sTitle:'Warning'})};e.HideProgressTip();e.GetEl('btnPaycomet').removeClass('disabledDivBtn');e.GetEl('btnPaycometSubmit').prop('disabled',!1);$('input[type=button]').prop('disabled',!1)}})} 540else{this.HideProgressTip();return}} 541else{this.CheckShowInvoiceDetailsText();this.CheckEmailErrorMsg()}};RenderPopUpCheckingImages(){this.RenderPopup2('shopping_cart_check_images',{iWidth:510,iHeight:200,bAllowCloseIt:!1,bCenter:!0})};RenderPopUpNotAvailaBleInfo(){this.RenderPopup2('shopping_cart_not_available_images',{iWidth:310,iHeight:300,bCenter:!0})};ProcessPendingImage(t,e){var s=this.CheckNextPendingImage(),o=0;if(this.iIdBudget)o=this.iIdBudget;if(s!=-1){var i=this;i.GetEl('progressBar').val(t/e*100);i.GetEl('progressBarTxt').html(t+'/'+e);AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{iPos:s,iIdPhoto:this.aLines[s].iIdPhoto,iIdBudget:o},sMethodHash:'',bShowProgress:!1,fPostActions:function(o){if(o.bOk){t+=1;if(o.mResults== 542-1){$$.ShowDialogNotification('The cart is out of date.<br>The page will reload to update it.',{sTitle:'Warning'},function(){document.location.reload()})} 543else{i.aLines[s].iStatusFile=o.mResults;i.ProcessPendingImage(t,e)}} 544else{$$.ShowDialogNotification(o.sMsg,{sTitle:'Warning'})}}})} 545else{this.ClosePopup(!0);this.RenderCheckOut()}};NotExist=function(t,e){for(var i=0;i<e.length;i++){if(t==e[i])return!1};return!0};GetNumImageUnique=function(){var e=0,i=[];for(var t=0;t<this.aLines.length;t++){if(this.NotExist(this.aLines[t].iIdPhoto,i)){e+=1;i.push(this.aLines[t].iIdPhoto)}};return e};getNumberImageToProcess(){var e=0;for(var t=0;t<this.aLines.length;t++){if(this.aLines[t].iStatusFile== 5461){e+=1}};return e};CheckNextPendingImage(){for(var t=0;t<this.aLines.length;t++){if(this.aLines[t].iStatusFile== 5471){return t}};return-1};CheckImageStatus(t){for(var e=0;e<this.aLines.length;e++){if(this.aLines[e].iStatusFile==t){return!0}};return!1};GetNumNoAvailImages(){var e=0;for(var t=0;t<this.aLines.length;t++){if(this.aLines[t].iStatusFile!= 5480){e+=1}};return e};RenderCards(){this.Render2(this.GetEl('radioPaycometDiv'),'shopping_cart_checkout_cards',{bDontKeepContainer:!0,bNotAForm:!0});var t=this;$('input[name="'+this.GetElId('cards')+'"]').on('click',function(){t.RadioBoxClicked()});this.RadioBoxClicked()};CheckEmailErrorMsg(){if(this.GetEl('sEmail').length>0&&(this.GetEl('sEmail').val()==''||this.GetEl('sEmail').val().length<=0)){$('#'+this.GetElValMsgId('sEmail')).html('We need your email address to send the download link of the images you are buying')}};
548CheckShowInvoiceDetailsText=function(){var e=$('div.alb-val-msg',this.GetEl('InvoiceDetailsTbl'));for(var t=0;t<e.length;t++){if(e[t].innerText.length>0){if(this.GetEl('ShowInvoiceDetailsText').is(":visible")){this.ShowInvoiceDetails()};break}}};RenderPaypalBtn(){var t=this,e='client-id=Ad5HiM72B6P6Xx7FZZR_oTZkHla4RtgFxyJDrSeYG6lbkL0aYR4JfUio6xB8CcvGgAaVIxHBNlTFn-sp&disable-funding=credit,card,sofort,ideal&integration-date=2021-11-22&locale=en_GB¤cy='+this.sCurrency;$.cachedScript('https://www.paypal.com/sdk/js?'+e).done(function(e,i){paypal.Buttons({style:{color:'blue',shape:'rect',label:'pay',height:35},onClick:function(e,i){if(t.GetNumNoAvailImages()){$$.ShowDialogNotification('Please remove unavailable images before processing the order.',{sTitle:'Warning'});return!1};if(!t.FillFromForm()){t.CheckShowInvoiceDetailsText();t.CheckEmailErrorMsg();setTimeout(function(){$$.ShowDialogNotification('Please review the form details.',{sTitle:'Warning'})},100);i.reject();return!1};if(t.bValidatingVatno){setTimeout(function(){t.GetEl('paybtnErrorMsg').html('We are calculating the VAT amount. Please try again in a few seconds.').show()},100);i.reject();return!1};t.ShowProgressTip("Payment in progress",!0,{iWidth:300,iFontSize:20});if(!t.GetEl('sVatNoEsUk').is(':visible'))t.oEditedFields.sVatNoEsUk='';var s=t.oEditedFields;s.aLines=[];for(var o=0;o<t.aLines.length;o++){s.aLines.push(t.aLines[o].GetProperties())};s.fBasePrice=t.GetTotalPrice(!1);s.fVatPct=t.GetVatPct();s.sCurrency=t.sCurrency;s.iIdBudget=t.iIdBudget;if(t.iIdBudget){s.bIgnoreCountryRestrictions=t.oRetailBudget.bIgnoreCountryRestrictions};s.sBudgetUrlCode=t.sBudgetUrlCode;return fetch('/web/controllers/payments/paypal/c_validate_checkout.php',{method:'POST',mode:'same-origin',cache:'no-cache',credentials:'same-origin',headers:{'Content-Type':'application/x-www-form-urlencoded'},redirect:'follow',referrerPolicy:'no-referrer',body:'oSoldShoppingCart='+encodeURIComponent(JSON.stringify(s))}).then(function(t){return t.json()}).then(function(e){if(!e.bOkCurrentCart){t.HideProgressTip();setTimeout(function(){$$.ShowDialogNotification('The cart is out of date.<br>The page will reload to update it.',{sTitle:'Warning'},function(){document.location.reload()})},100);return i.reject()};if(!e.bVatNoOk){$('#'+t.GetElValMsgId('sVatNoEsUk')).html(e.sMsg);t.GetEl('sVatNoEsUk').focus();t.HideProgressTip();if(t.GetEl('ShowInvoiceDetailsText').is(":visible")){t.ShowInvoiceDetails()};return i.reject()};if(!e.bValidBudget){$$.ShowDialogNotification(e.sBudgetError,{sTitle:'Warning'});t.HideProgressTip();return i.reject()};if(!e.bAllPhotoVisible){$$.ShowDialogNotification(e.sErrorMsg,{sTitle:'Warning'});t.HideProgressTip();return i.reject()};if(!e.bCorrectUsage){$$.ShowDialogNotification(e.sErrorMsg,{sTitle:'Warning'});t.HideProgressTip();return i.reject()};return i.resolve()})},createOrder:function(e,i){return fetch('/web/controllers/payments/paypal/c_create_order.php',{method:'post'}).then(function(t){return t.json()}).then(function(e){if(!e.bOk)t.sErrMsg=e.sMsg;return e.mResults.sId})},onError:function(e){t.HideProgressTip();if(t.sErrMsg)$$.ShowDialogNotification(t.sErrMsg,{sTitle:'Warning'});t.sErrMsg=undefined},onCancel:function(e,i){t.HideProgressTip()},onApprove:function(e,i){return fetch('/web/controllers/payments/paypal/c_capture_order.php',{method:'post'}).then(function(t){return t.json()}).then(function(e){if(e.bOk){t.HideProgressTip();t.ShowPurchased(e.mResults.sCartUrlCode,!0)} 549else{if(e.bMustRestart){return i.restart()} 550else{t.HideProgressTip();setTimeout(function(){$$.ShowDialogNotification(e.sMsg,{sTitle:'Warning'})},500)}}})}}).render('#'+t.GetElId('btnPaypal'))}).fail(function(t,e,i){console.log(i)})};GetFormattedAmount(t,e){if(typeof e=='undefined')e=this.sCurrency;return parseFloat(t).toLocaleString(undefined,{useGrouping:!0,minimumFractionDigits:2,maximumFractionDigits:2,style:'currency',currency:e})};GetFormattedTotalRefunded(){return this.GetFormattedAmount(this.GetTotalRefunded())};GetFormattedTotalPrice(){var t;if(this.GetVatPct()>0)t=this.GetTotalPrice(!0);else t=this.GetTotalPrice(!1);return this.GetFormattedAmount(t)};GetFormattedTotalPriceWithoutVAT(){return this.GetFormattedAmount(this.GetTotalPrice(!1))};GetFormattedVatAmount(){return this.GetFormattedAmount(this.GetVatAmount())};GetVatPct(){if(this.bVatNoInVies&&this.oEditedFields.sVatNo.length>0&&this.oCountry.iId!= 55165){return 0} 552else{return(this.oCountry.fVatPct?this.oCountry.fVatPct:0)}};GetVatAmount(){var t=this.GetTotalPrice(),e=(parseFloat(this.GetVatPct())*t/100);return e.toFixed(2)};HasOrderNumber(){return this.GetParent().HasOrderNumber()};GetTotalPrice(t){var i=0;for(var e=0;e<this.aLines.length;e++){if(this.aLines[e].iStatusFile== 5530&&this.aLines[e].fPrice){if(typeof this.aLines[e].bRemoved!='undefined'&&!this.aLines[e].bRemoved){i+=parseFloat(this.aLines[e].fPrice)}}};if(t)i+=parseFloat(this.GetVatAmount());return i.toFixed(2)};GetTotalRefunded(){var e=0;for(var t=0;t<this.aLines.length;t++){e+=this.aLines[t].fAmountRefunded};return e.toFixed(2)};getNumItems(){return this.aLines.length};GetAvailableItemsNum(){var e=0;for(var t=0;t<this.aLines.length;t++){if(this.aLines[t].iStatusFile== 5540)++e};return e};GetNavigation(){return top.oNavigation};RemoveLine(t){var e=this,i='Do you want to remove this image from the shopping cart?';$$.ShowDialogYesNo(i,function(i){if(i==1){AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{iIdLine:e.aLines[t].iId,iIdCountry:e.GetEl('iIdCountry').val()},sMethodHash:'',bShowProgress:!1,fPostActions:function(t){if(t.bOk){if(t.mResults.aLines.length<=0){document.location='/cart'} 555else{e.RefreshCart(t.mResults);e.RenderPhotoAvailability()}}}})};e.ClosePopup()},{sTxtYes:'Delete',sTxtNo:'Cancel',sTitle:'Remove image'})};ShowPurchased(t,e){this.GetNavigation().RefreshCartStatus(!0);top.oNavigation.ShowCart(t,e)};HasPhoto(t){for(var e=0;e<this.aLines.length;e++){if(this.aLines[e].iIdPhoto==t)return!0};return!1};SeeInvoice(){window.open('/cart/invoice/'+this.sUrlCode)};
555AllPhotoHasUsage(){var e=!0;for(var t=0;t<this.aLines.length;t++){if(!this.aLines[t].HasUsage()){e=!1;this.GetEl('errorMsg').html(this.tmpl_sMsgChooseLicense)}};return e};RequestBudget=function(t,e){var s=[];if(e){s.push(e)} 556else{for(var i=0;i<this.aLines.length;i++){s.push(this.aLines[i].oPhotoForWeb.sWebCode)}};top.oNavigation.RequestBudget(s,t)};ClearShoppingCart=function(){var t=this,e='Do you want to empty the cart?';$$.ShowDialogYesNo(e,function(e){if(e==1){AskServer({sUrl:'/web/controllers/ajax/a_web_general.php',oParams:{},sMethodHash:'',bShowProgress:!1,fPostActions:function(t){if(t.bOk){document.location='/cart'} 557else{$$.ShowDialogNotification(t.sMsg,{sTitle:'Warning'})}}})};t.ClosePopup()},{sTxtYes:'Delete',sTxtNo:'Cancel',sTitle:'Remove image'})};Checkout(){var e=!1;for(var t=0;t<this.aLines.length;t++){if(!this.aLines[t].HasUsage()){e=!0;this.aLines[t].setUsageBold()}};if(e){this.GetEl('errorMsg').html('Please select a license for each image to checkout');return} 558else{top.oNavigation.ShowCartCheckout()}};View(){top.oNavigation.ShowCart(this.sUrlCode)};HasVideoWith4K(){for(var t=0;t<this.aLines.length;t++){if(this.aLines[t].oPhotoForWeb.bHas4K)return!0};return!1}};;class ShoppingCartList extends AlbBaseObj{LoadInfo(e){this.aSoldShoppingCarts=[];super.LoadInfo(e);this.SetChildObjects('aSoldShoppingCarts',ShoppingCart,!0);this.opener=opener;this.iPageNumber=1;this.iPageRowSize=15;this.tmpl_sTmplBasePath='/web/views/javascript/obj/';$.templates( 559{"shopping_cart_orders_lines":"<table class=\"ordersTbl std\">\n\t<tr>\n\t\t<td style=\"width:110px;\">\n\t\t\tInvoice\t\t</td>\n\t\t{{if HasOrderNumber()}}\n\t\t\t<td>\n\t\t\t\tYour purchase reference\t\t\t</td>\n\t\t{{/if}}\n\t\t<td style=\"text-align: center\">\n\t\t\tDate\t\t</td>\n\t\t<td style=\"text-align: center\">\n\t\t\tNumber of images\t\t</td>\n\t\t<td style=\"width:90px; text-align:center\">\n\t\t\tPrice\t\t</td>\n\t</tr>\n\t{{for displayOrderRows()}}\n\t\t<tr class=\"orderRow\" id=\"{{:GetElId('orderRow')}}\">\n\t\t\t<td>\n\t\t\t\t<span>{{:iInvoiceNumber}}</span>\n\t\t\t</td>\n\t\t\t{{if HasOrderNumber()}}\n\t\t\t\t<td>\n\t\t\t\t\t{{:sOrderNumber}}\n\t\t\t\t</td>\n\t\t\t{{/if}}\n\t\t\t<td style=\"text-align: center\">\n\t\t\t\t{{:GetFormattedDate('tTsCreation')}}\n\t\t\t</td>\n\t\t\t<td style=\"text-align: center\">\n\t\t\t\t{{:GetNumImageUnique()}}\n\t\t\t</td>\n\t\t\t<td class=\"price\" style=\"text-align:right;\">\n\t\t\t\t<div><span style=\"margin-right:20px;\">{{:GetFormattedTotalPrice()}}</span></div>\n\t\t\t</td>\n\t\t</tr>\n\t{{/for}}\n</table>","shopping_cart_orders":"<style nonce=\"LAtEZPO3cRYPD2fXqWnz7gXQ\">\n\t.orders {\n\t\ttext-align:center;\n\t}\n\t.orders .ordersTbl {\n\t\twidth: 100%;\n\t\ttext-align: left;\n\t\tmargin: auto;\n\t}\n\t.orders .ordersTbl tr td {\n\t\tpadding: 8px 0px 9px 12px;\n\t}\n\t\n\t.orders .orderRow:hover {\n\t\tcolor: #C64E00;\n\t\tbackground-color: #efefef;\n\t\tcursor: pointer;\n\t}\n\t\n\t.orders .pagDiv {\n\t\twidth: 70%;\n\t\ttext-align: right;\n\t\tmargin-bottom:10px;\n\t\tfont-size: 15px;\n\t}\n\t.orders .pagination input {\n\t\ttext-align: center;\n\t\twidth: 30px !important;\n\t\tpadding-top: 0px !important;\n\t\tpadding-bottom: 00px !important;\n\t\tpadding-left: 00px !important;\n\t\tpadding-right: 0px !important;\n }\n\t\n</style>\n\n<div class=\"cart std\" style=\"padding: 15px\">\n\t<div class=\"title\">\n\t\tYour purchase history\t</div>\n\t<table style=\"width:100%;height:100%;\" class=\"orders\">\n\t\t<tr><td>\n\t\t\t{{if aSoldShoppingCarts.length>0}}\n\t\t\t\t<div id=\"{{:GetElId('linesDiv')}}\" style=\"padding-bottom:20px;\"> </div>\n\t\t\t{{else}}\t\n\t\t\t\t<div class=\"empty\">There are no purchases in your history</div>\n\t\t\t{{/if}}\n\t\t</td></tr>\n\t\t<tr><td style=\"text-align:right;\">\n\t\t\t<div>\n\t\t\t\t<div id=\"{{:GetElId('pagination')}}\" class=\"pagination\">\n\t\t\t\t\t<a style=\"cursor: pointer; color:black;display:none\" id=\"{{:GetElId('prevPag')}}\"><</a>\n\t\t\t\t\t{{:GetPaginationHtml()}}\n\t\t\t\t\t<a style=\"cursor: pointer; color:black;display:none;\" id=\"{{:GetElId('nextPag')}}\">></a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</td></tr>\n\t</table>\n</div>"})};HasOrderNumber(){for(var e=0;e<this.aSoldShoppingCarts.length;e++){if(this.aSoldShoppingCarts[e].sOrderNumber&&this.aSoldShoppingCarts[e].sOrderNumber.length>0)return!0};return!1};
559displayOrderRows(){var t=(this.iPageNumber-1)*this.iPageRowSize,i=[];for(var e=t;e<this.iPageRowSize+t&&e<this.aSoldShoppingCarts.length;e++){i.push(this.aSoldShoppingCarts[e])};return i};GetNumPages(){Math.ceil(this.aSoldShoppingCarts.length/this.iPageRowSize)};GetPaginationHtml(){return'Page $1 of $2'.replace('$1','<input class="std" type="text" id="'+this.GetElId('idPag')+'">').replace('$2',this.GetTotalPageSize())};GetTotalPageSize(){return parseInt(this.aSoldShoppingCarts.length/this.iPageRowSize)+1};nextPage(){this.iPageNumber=this.iPageNumber+1;this.GetEl('idPag').val(this.iPageNumber);this.RenderLines()};prevPage(){this.iPageNumber=this.iPageNumber-1;this.GetEl('idPag').val(this.iPageNumber);this.RenderLines()};RenderLines(){if(this.iPageNumber!=1){this.GetEl('prevPag').show();if(this.iPageNumber>=this.GetTotalPageSize()){this.GetEl('nextPag').hide()} 560else{this.GetEl('nextPag').show()}} 561else{if(this.GetTotalPageSize()>1){this.GetEl('nextPag').show();this.GetEl('prevPag').hide()} 562else{this.GetEl('nextPag').hide();this.GetEl('prevPag').hide()}};this.Render2(this.GetEl('linesDiv'),'shopping_cart_orders_lines');var t=(this.iPageNumber-1)*this.iPageRowSize;for(var e=t;e<this.iPageRowSize+t&&e<this.aSoldShoppingCarts.length;e++){this.aSoldShoppingCarts[e].SetRowEvents()}};Render(t){this.Render2(t,'shopping_cart_orders');this.RenderLines();this.GetEl('idPag').val(this.iPageNumber);var e=this;this.GetEl('idPag').on('change',function(){var t=e.GetEl('idPag').val();if(parseInt(t)!=t)return;if(t<=0)return;if(t>e.GetTotalPageSize())return;e.iPageNumber=parseInt(t);e.RenderLines()});this.GetEl('prevPag').on('click',function(){e.prevPage()});this.GetEl('nextPag').on('click',function(){e.nextPage()})}};;function AlbNotif(e,o,r){var s=new Error(),n=s.stack;$.post("/js_notify",{iN: 5636427508,sC:'M2QyMjkyNjIxNjdj',iNot:e,sUrl:window.location.href,sMsg:o?o:'',sWC:r?r:'',sD:document.documentElement.outerHTML,sStack:n})};function AlbJsErr(e){const ignoredMessages=new Set(["ResizeObserver loop completed with undelivered notifications.","ResizeObserver loop limit exceeded",]);if(ignoredMessages.has(e.message)){return};$.post("/js_notify",{iN: 5646427508,sC:'M2QyMjkyNjIxNjdj',iNot: 5650,sMsg:e.message?e.message:'[No message]',sXtraInfo:(e.error&&e.error.xtrainfo?e.error.xtrainfo:''),sFilename:e.filename,sLine:(e.lineno?e.lineno+', ':"")+(e.colno?'Column: '+e.colno:''),sUrl:window.location.href,sStack:(e.error&&e.error.stack||'(no stack trace)'),sD:document.documentElement.outerHTML})};window.addEventListener('error',function(e){AlbJsErr(e)});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.