
$(function(){function getUrlVars(){var vars=[],hash;var hashes=window.location.href.slice(window.location.href.indexOf('?')+1).split('&');for(var i=0;i<hashes.length;i++){hash=hashes[i].split('=');vars.push(hash[0]);vars[hash[0]]=hash[1];}
return vars;}
$('#js-newsletter-form').submit(function(ev){ev.preventDefault();Evisua.makeRequest({url:'/ajax/newsletter/',form:'js-newsletter-form',handler:function(success,data){if(success){$('#js-newsletter-click').click();}else{$('#js-newsletter-error-click').click();}}});return false;});var msg=getUrlVars()['msg'];if(msg!=undefined&&msg!=''){$('#js-newsletter-'+msg+'').click();}
setTimeout(function(){$('.js_playable').each(function(ev){var This=$(this);This.click(function(ev){ev.preventDefault();ev.target.blur();var $playerHolder=$('.'+This.attr('id'));var iClipId=$playerHolder.stripId();var $videoPlayer=$('<div class="video_player" />');var $overlay=$('<div id="dark"/>').hide();var $play=$('.img_container *',$playerHolder);$playerHolder.append($videoPlayer);$('body').append($overlay);$overlay.fadeIn(600);$playerHolder.stop().css({opacity:0}).show().animate({opacity:'1',top:'-73'+'px'},{duration:600,complete:function(){$videoPlayer.player({file:DataBridge.spotlights_clips[iClipId].video_path,image:DataBridge.spotlights_clips[iClipId].image_generic_path+'950_575_crop.'+DataBridge.spotlights_clips[iClipId].image_generic_extension,width:950,height:575});}});$('.js_close_button',$playerHolder).add($overlay).one('click',function(){$videoPlayer.remove();$play.unbind('click');$('.img_container',$playerHolder).show();$overlay.fadeOut(600);$playerHolder.stop().animate({opacity:'0',top:0},{duration:600,complete:function(){$playerHolder.hide();$overlay.remove();}});});$play.bind('click',function(ev){ev.preventDefault();ev.target.blur();$('.img_container',$playerHolder).fadeOut(500,function(){player.sendEvent('play');});});});});},400);$('#newsletter_signup form').live('submit',function(ev){ev.preventDefault();var This=$(this);var sUrl=This.attr('action');Evisua.makeRequest({url:sUrl,form:This,handler:function(success,data){if(!success){Evisua.Msg.error('An error occured',data.error);}else{This.find('input[name="email"]').val('');Evisua.Msg.alert('Success','You have successfully subscribed to the newsletter.');}}});return false;});});
