function anyClipHelpers(){}
anyClipHelpers.nvl=function(origVal,defaultVal){var retVal=origVal;try{if(!retVal||retVal=='undefined'||retVal+''=='undefined')
retVal=defaultVal;return retVal;}
catch(e){return defaultVal;}};anyClipHelpers.leftPadStringWithChar=function(origString,charToPadWith,desiredLengthOfFinalString){origString=new String(origString).toString();charToPadWith=new String(charToPadWith).toString();desiredLengthOfFinalString=parseInt(desiredLengthOfFinalString);while(origString.length<desiredLengthOfFinalString){origString=charToPadWith+origString;}
return origString;};anyClipHelpers.parseMomentDurationForDisplayFromMS=function(msToParseFrom){var tempDataObj=new Date(msToParseFrom);var timeIndicationString=anyClipHelpers.leftPadStringWithChar(tempDataObj.getMinutes(),'0',2)+':'+
anyClipHelpers.leftPadStringWithChar(tempDataObj.getSeconds(),'0',2);return timeIndicationString;};anyClipHelpers.update_holding_page=function(response){if(typeof onActioPerformed=='function'){onActioPerformed(response);}};anyClipHelpers.htmlEncode=function(value){return $('<div/>').text(anyClipHelpers.nvl(value,'')).html();};anyClipHelpers.htmlDecode=function(value){return $('<div/>').html(anyClipHelpers.nvl(value,'')).text();};anyClipHelpers.strOptionsToObjOptions=function(strOptions){var retVal=[];var optionsArray=strOptions.split("&");for(var i=0;i<optionsArray.length;++i){if(optionsArray[i]!=''){var currParam=optionsArray[i].split("=");retVal[retVal.length]="'"+currParam[0]+"': "+"'"+currParam[1]+"'";}}
eval('retVal = {'+retVal.join(',')+'}');return retVal;};anyClipHelpers.getClipUrl=function(clip){if(clip.name){return"/"+clip.title_unique_name+"/"+clip.name;}
else{return"/"+clip.title_unique_name+"/"+clip.code;}};anyClipHelpers.getClipFullUrl=function(clip){return'http://anyclip.com'+anyClipHelpers.getClipUrl(clip);};anyClipHelpers.renderPlayerByType=function(playerType,bShouldInitPlayer,playerHTMLplaceholderID,playerURL,code,token,bShouldAutoplay,strFlashOptions,renderedPlayerID,renderedPLayerClass){var sizesHash={};var elementCodeClass='';switch(playerType){case('trailer'):{sizesHash={width:'588',height:'294'};elementCodeClass='titleCode=';break;}
default:{sizesHash={width:'100%',height:'100%'};elementCodeClass='code=';break;}}
if(bShouldInitPlayer)
init();var player_place_holder=$(playerHTMLplaceholderID);var player_container=player_place_holder.parent();swfobject.embedSWF(playerURL,playerHTMLplaceholderID,sizesHash.width,sizesHash.height,'9','','',{'quality':'high','allowfullscreen':'true','bgcolor':'#000000','allowScriptAccess':'always','flashVars':elementCodeClass+
code+'&token='+
token+'&autoPlay='+
bShouldAutoplay+'&'+
strFlashOptions,'wmode':'transparent'},{id:renderedPlayerID,styleclass:renderedPLayerClass});};anyClipHelpers.renderTrailerPlayer=function(bShouldInitPlayer,playerHTMLplaceholderID,playerURL,titleCode,token,bShouldAutoplay,strFlashOptions,renderedPlayerID,renderedPLayerClass){anyClipHelpers.renderPlayerByType('trailer',bShouldInitPlayer,playerHTMLplaceholderID,playerURL,titleCode,token,bShouldAutoplay,strFlashOptions,renderedPlayerID,renderedPLayerClass);};anyClipHelpers.renderPlayer=function(bShouldInitPlayer,playerHTMLplaceholderID,playerURL,clipCode,token,bShouldAutoplay,strFlashOptions,renderedPlayerID,renderedPLayerClass){anyClipHelpers.renderPlayerByType('regular',bShouldInitPlayer,playerHTMLplaceholderID,playerURL,clipCode,token,bShouldAutoplay,strFlashOptions,renderedPlayerID,renderedPLayerClass);};anyClipHelpers.getClipEmbedCode=function(clip){var retVal="Currently unavailable";if(clip.code){var linkBack="";retVal='<object width="425px" height="275px" type="application/x-shockwave-flash" class="AnyClipEmbeddedPlayer" id="AnyClipEmbeddedPlayer-'+clip.code+'" data="http://player.anyclip.com/PlayerEm.swf?v='+((new Date()).getTime())+'&amp;>'+'<param name="quality" value="high">'+'<param name="allowfullscreen" value="true">'+'<param name="bgcolor" value="#000000">'+'<param name="allowScriptAccess" value="always">'+'<param name="flashVars" value="code='+
clip.code+'&amp;autoPlay=false">'+'<param name="wmode" value="transparent">'+'</object>';if(clip.name){linkBack+='<a href="'+anyClipHelpers.getClipFullUrl(clip)+'" class="AnyClipEmbeddedPlayer-TrackBack-Clip" rel="http://anyclip.com">'+clip.display_name+'</a> ';}
else{linkBack+='Clip ';}
linkBack+='from ';linkBack+='<a href="http://anyclip.com/'+clip.title_unique_name+'" class="AnyClipEmbeddedPlayer-TrackBack-Title" rel="http://anyclip.com">'+clip.title_name+'</a>';if(clip.characters&&clip.characters.length>=1){linkBack+=" starring "
for(var i=0;i<2&&i<clip.characters.length;++i){linkBack+='<a href="http://anyclip.com/actors/'+clip.characters[i].actor.api_entity.unique_name+'" class="AnyClipEmbeddedPlayer-TrackBack-Actor" rel="http://anyclip.com">'+clip.characters[i].actor.api_entity.name+'</a> ';}}
retVal+='<strong class="AnyClipEmbeddedPlayer-TrackBack-Wrapper" style="font-family: arial; font-size: 14px; width: 425px; display: block; ">'+linkBack+'</strong>';}
return retVal;};$.fn.ac_track=function(options)
{var element=$(this);if(options.category!=undefined)
{options=$.extend({event_name:'click'},options)
element.track(options);var event_name=options.event_name;element.bind(event_name,function(eventname,data){traceWatch.send_event(options,$(this),data);});}
else
{}};anyClipHelpers.track_event=function(settings){$.trackEvent(settings.category,settings.action,'',"");traceWatch.send_event(settings,null);}
anyClipHelpers.add_flash_msg=function(m_type,m_msg){$('#msgs').html("<p class='"+m_type+"'>"+m_msg+"</p>");}
$.fn.ac_track.defaults={};$(document).ready(function(){var dropdown=$('li.dropdown');dropdown.hover(function(){$('ul',this).css('display','block');},function(){$('ul',this).css('display','none');});});;function selectReplacement(obj){obj.className+=' replaced';var ul=document.createElement('ul');ul.className='selectReplacement';var opts=obj.options;var selectedOpt=(!obj.selectedIndex)?0:obj.selectedIndex;for(var i=0;i<opts.length;i++){var li=document.createElement('li');var txt=document.createTextNode(opts[i].text);li.appendChild(txt);li.selIndex=i;li.selectID=obj.id;li.onclick=function(){selectMe(this);};if(i==selectedOpt){li.className='selected';li.onclick=function(){this.parentNode.className+=' selectOpen';this.onclick=function(){selectMe(this);};};}
if(window.attachEvent){li.onmouseover=function(){this.className+=' hover';};li.onmouseout=function(){this.className=this.className.replace(new RegExp(" hover\\b"),'');};}
ul.appendChild(li);}
obj.onfocus=function(){ul.className+=' selectFocused';};obj.onblur=function(){ul.className='selectReplacement';};obj.onchange=function(){var idx=this.selectedIndex;selectMe(ul.childNodes[idx]);};obj.onkeypress=obj.onchange;obj.parentNode.insertBefore(ul,obj);}
function selectMe(obj){var lis=obj.parentNode.getElementsByTagName('li');for(var i=0;i<lis.length;i++){if(lis[i]!=obj){lis[i].className='';lis[i].onclick=function(){selectMe(this);};}
else{setVal(obj.selectID,obj.selIndex);obj.className='selected';obj.parentNode.className=obj.parentNode.className.replace(new RegExp(" selectOpen\\b"),'');obj.onclick=function(){obj.parentNode.className+=' selectOpen';this.onclick=function(){selectMe(this);};};}}}
function setVal(objID,val){var obj=document.getElementById(objID);obj.selectedIndex=val;}
function setForm(){var s=document.getElementById('type');if(s!=null){selectReplacement(s);}}
window.onload=function(){(document.all&&!window.print)?null:setForm();};;(function($){$.lightbox=function(options,extra_key,extra_value){if(!$.isFunction(top.lightbox)){top.lightbox=function(options,extra_key,extra_value){if(typeof options=='string'){if(typeof extra_key=='string'){if(typeof extra_value!="undefined"){var ex=$('#modal-'+options).data('lightbox_extra');ex[extra_key]=extra_value;$('#modal-'+options).data('lightbox_extra',ex);}
else{return $('#modal-'+options).data('lightbox_extra')[extra_key];}}
else{return $('#modal-'+options);}}
else{var settings=$.extend({element:null,uri:null,width:300,height:340,title:null,name:null,open:null,close:null,extra:null,dialog_options:null},options);if(settings.element){var $element=$(settings.element);}
else
if(settings.uri){var $element=$('<iframe/>').attr('class','modal-iframe').attr('frameBorder','0').attr('src',settings.uri).width(settings.width).height(settings.height);if(settings.name){$element.attr('id','modal-'+settings.name)}}
if(settings.extra){$element.data('lightbox_extra',settings.extra);}
if($element.length){return $element.dialog($.extend({title:settings.title,width:settings.width,height:settings.height,modal:true,resizable:false,draggable:false,open:function(ev,ui){if($.isFunction(settings.open)){settings.open.call(this,ev,ui);}},close:function(ev,ui){if($.isFunction(settings.close)){settings.close.call(this,ev,ui);}
$(this).filter('iframe').remove();}},settings.dialog_options)).width(settings.width).height(settings.height);}}}}
return top.lightbox.call(this,options,extra_key,extra_value);}
$.login_lightbox=function(options){var settings=$.extend({uri:null,refresh_page:false,success:null,save_moment:null},options);if(!settings.uri){settings.uri=$('a#nav-login').attr('href');}
return $.lightbox({uri:settings.uri+'?modal=1',width:300,height:400,title:'Log In',name:'login',extra:{refresh_page:settings.refresh_page,success:settings.success,save_moment:settings.save_moment}});};$('a[rel="login"]').live('click',function(e){$.login_lightbox({refresh_page:true});e.preventDefault();return false;});$('a[rel^="modal"]').live('click',function(e){var _args=$(this).attr('rel').split(',');var _width=(1 in _args&&_args[1])?parseInt(_args[1]):300;var _height=(2 in _args&&_args[2])?parseInt(_args[2]):340;var uri=$(this).attr('href');var modal_param=(uri.match(/\?/)?'&':'?')+'modal=1';$.lightbox({uri:uri+modal_param,width:_width,height:_height,title:$(this).attr('title')?$(this).attr('title'):$(this).text(),name:$(this).attr('id')});e.preventDefault();return false;});$('a[rel="logout"]','body.modal').bind('click',function(e){var href=$(this).attr('href');try{href+='?back='+encodeURIComponent(top.document.location);top.document.location=href;e.preventDefault();return false;}
catch(e){}})
$('a[href]:not([onclick]):not([rel=logout]):not([rel^=modal])','body.modal').live('click',function(e){try{top.document.location=$(this).attr('href');e.preventDefault();return false;}
catch(e){}});})(jQuery);;(function($){$.InFieldLabels=function(b,c,d){var f=this;f.$label=$(b);f.label=b;f.$field=$(c);f.field=c;f.$label.data("InFieldLabels",f);f.showing=true;f.init=function(){f.options=$.extend({},$.InFieldLabels.defaultOptions,d);if(f.$field.val()!=""){f.$label.hide();f.showing=false};f.$field.focus(function(){f.fadeOnFocus()}).blur(function(){f.checkForEmpty(true)}).bind('keydown.infieldlabel',function(e){f.hideOnChange(e)}).change(function(e){f.checkForEmpty()}).bind('onPropertyChange',function(){f.checkForEmpty()})};f.fadeOnFocus=function(){if(f.showing){f.setOpacity(f.options.fadeOpacity)}};f.setOpacity=function(a){f.$label.stop().animate({opacity:a},f.options.fadeDuration);f.showing=(a>0.0)};f.checkForEmpty=function(a){if(f.$field.val()==""){f.prepForShow();f.setOpacity(a?1.0:f.options.fadeOpacity)}else{f.setOpacity(0.0)}};f.prepForShow=function(e){if(!f.showing){f.$label.css({opacity:0.0}).show();f.$field.bind('keydown.infieldlabel',function(e){f.hideOnChange(e)})}};f.hideOnChange=function(e){if((e.keyCode==16)||(e.keyCode==9))return;if(f.showing){f.$label.hide();f.showing=false};f.$field.unbind('keydown.infieldlabel')};f.init()};$.InFieldLabels.defaultOptions={fadeOpacity:0.5,fadeDuration:300};$.fn.inFieldLabels=function(c){return this.each(function(){var a=$(this).attr('for');if(!a)return;var b=$("input#"+a+"[type='text'],"+"input#"+a+"[type='password'],"+"textarea#"+a);if(b.length==0)return;(new $.InFieldLabels(this,b[0],c))})}})(jQuery);;(function($){$(document).ready(function(){$("label.overlayed").inFieldLabels({fadeDuration:150,fadeOpacity:0.8}).bind('click focus',function(){$('#'+$(this).attr('for')).focus();});});})(jQuery);;(function($){$.fn.menu_show=function(){return $(this).each(function(){if(!$(this).parent().hasClass('current'))
{$(this).show();$(this).parent().siblings('.current').children().hide();$('.menu-reveal').removeClass('hover').filter('[rel="'+$(this).attr('id')+'"]').addClass('hover');}});};$.fn.menu_hide=function(immediately){return $(this).each(function(){var $self=$(this);if(!$(this).parent().hasClass('current'))
{window.setTimeout(function(){if(!$self.data('hover')){$self.hide();$self.parent().siblings('.current').children().show();$('.menu-reveal[rel="'+$self.attr('id')+'"]').removeClass('hover');}},immediately?0:250);}});}
$.fn.menu_reveal=function(){return $(this).each(function(){var menuId=$(this).attr('rel');var $menu=$('#'+menuId).menu_hide(true);if($menu.length)
{$(this).bind('focus mouseenter',function(){$menu.menu_show();$menu.data('hover',true);}).bind('blur mouseleave',function(e){var $target=$(e.relatedTarget);if(!$target.is('#'+menuId)&&!$target.parents('#'+menuId).length){$menu.menu_hide($target.is('.menu-reveal'));$menu.data('hover',false);}});$menu.bind('focus mouseenter',function(){$(this).data('hover',true);}).bind('blur mouseleave',function(){$(this).menu_hide();$(this).data('hover',false);});}});}
$(document).ready(function()
{$('.menu-reveal').menu_reveal();});})(jQuery);