getTwitters("tweet",{id:"62models",count:1,enableLinks:!0,ignoreReplies:!0,clearContents:!0,template:'"%text%" <\!--a href="http://twitter.com/%user_screen_name%/statuses/%id%/">%time%</a--\>'});
$(document).ready(function(){function v(){$(".thumb").addClass("dim").children("a").fadeTo("fast",0.22);if(filterArray.length==0&&sexArray.length==0)$(".thumb").removeClass("dim").children("a").fadeTo("fast",1);else{for(i=0;i<=filterArray.length;i++)if(filterArray[i]=="boy"||filterArray[i]=="girl")sexArray.push(filterArray[i]),filterArray.splice(i,1);filterArray.length!=0&&$(".thumb").filter(function(){return $(this).hasClass(filterArray[0])||$(this).hasClass(filterArray[1])||$(this).hasClass(filterArray[2])||
$(this).hasClass(filterArray[3])||$(this).hasClass(filterArray[4])}).removeClass("dim").children("a").fadeTo("fast",1);sexArray.length!=0&&(filterArray.length==0&&$(".thumb").removeClass("dim").children("a").fadeTo("fast",1),$(".thumb:not(.dim)").filter(function(){return!$(this).hasClass(sexArray[0])}).addClass("dim").children("a").stop().fadeTo(10,0.23))}}function z(a){$.fancybox.showActivity();$.getJSON(e+"remove-from-collection?model="+a.attr("rel"),function(d){$.fancybox.hideActivity();d.success&&
(a.parent().remove(),j--,$(".bar span").html($("#lightbox li.thumb").size()),$("#lightbox li.thumb").size()==0&&(o(),$(".default").fadeIn("fast"),$(".options").hide()),g())},function(){alert("failed?")})}function g(){k==5?$(".lightboxleft").hide():$(".lightboxleft").show();k==j||j<=5?$(".lightboxright").hide():$(".lightboxright").show()}function o(){$("#lightbox").animate({bottom:"-205px"},"medium");p=!1}function w(){$("#lightbox").animate({bottom:"0px",opacity:1},"fast");p=!0}function A(){q=setTimeout(function(){o()},
2E3)}function r(){c=1;$("#card .slide img").hide();$(b+" .slide img:first").show();x=$(b+" .slide img").size()}function l(){var a=$(b+" .slide img:nth-child("+c+")").attr("width");$("#fancybox-inner").width(a+54);$("#fancybox-wrap").width(a+54);$.fancybox.resize()}function h(){c==1?$(".cardleft").hide():$(".cardleft").show();c==x?$(".cardright").hide():$(".cardright").show()}function y(a){$.fancybox.showActivity();$.ajax({type:"GET",cache:!1,url:e+"/card?model="+a,data:{},success:function(a){$.fancybox.hideActivity();
b="#portfolio";$.fancybox({content:a,titleShow:!1,transitionIn:"none",showCloseButton:!1,padding:0,overlayOpacity:0.8,overlayColor:"#FFF"});b=="#digis"?$("#portfolio").hide():$("#digis").hide();r();h();$("#fancybox-wrap").stop().css("visibility","hidden");$("#card #portfolio .slide img:first").load(function(){setTimeout(function(){$("#fancybox-wrap").stop().hide().css("visibility","visible").fadeIn("fast");l();$.fancybox.center()},50)})}})}$.ajaxSetup({error:function(){$.fancybox.hideActivity()}});
var e="",B=location.protocol+"//"+location.host+"/collection/";$(".overseas").append('<img src="images/icon-overseas.gif" class="icon-overseas" />');$(".tooltip").tipsy({fade:!0});var f=null,s=!1,t=!1,C=$(".legal",this),m=$(".legaltip",this).css("opacity",0);$([C.get(0),m.get(0)]).mouseover(function(){f&&clearTimeout(f);if(!s&&!t)return s=!0,m.css({top:-125,left:0,display:"block"}).animate({top:"-=10px",opacity:1},250,"swing",function(){s=!1;t=!0}),!1}).mouseout(function(){f&&clearTimeout(f);f=setTimeout(function(){f=
null;m.animate({top:"-=10px",opacity:0},250,"swing",function(){t=!1;m.css("display","none")})},500);return!1});filterArray=[];sexArray=[];$(".filter.enabled").toggle(function(){filterArray.push($(this).attr("rel"));$(this).addClass("selected");v();return!1},function(){for(i=0;i<=filterArray.length;i++)filterArray[i]==$(this).attr("rel")&&filterArray.splice(i,1),sexArray[i]==$(this).attr("rel")&&sexArray.splice(i,1);v();$(this).removeClass("selected");return!1});$(".hover").hide();$(".thumb").hover(function(){$(this).css("cursor",
"pointer").children(".hover").show()},function(){$(this).children(".hover").hide()});if($("#content .frame").length){var D=$(".thumb-holder ul").size(),n=1;$(".arrow-right").click(function(){$(".thumb-holder").animate({"margin-left":"-=674px"},"slow");n++;u();return!1});$(".arrow-left").click(function(){$(".thumb-holder").animate({"margin-left":"+=674px"},"slow");n--;u();return!1});var u=function(){n==1?$(".arrow-left").hide():$(".arrow-left").show();n==D?$(".arrow-right").hide():$(".arrow-right").show()};
u()}var p=!1,j=$("ul.selection").children().length;$("#lightbox .removeme").live("click",function(){z($(this))});$(".add").live("click",function(){w();if(!$("#lightbox li."+$(this).attr("rel")).length){clearTimeout(q);$.fancybox.showActivity();var a=$(this).attr("rel");$.ajax({type:"GET",cache:!1,url:e+"add-to-collection?model="+$(this).attr("rel"),data:{},error:function(){$.fancybox.hideActivity()},success:function(d){$.fancybox.hideActivity();$(".default").is(":visible")&&!$("#lightbox .options").is(":visible")&&
$.getJSON(e+"get-collection-code",function(a){a.success&&($("#lightbox .options a#lightboxMailto").attr("href","mailto:?subject=62 Models and Talent lightbox&body=You can view this lightbox at http://62models.com/collection/"+a.code),$("#lightbox .options input#lightURL").val(B+a.code),$("#lightbox .options a#lightboxPdf").attr("href","card-pdf/"+a.code),$("#lightbox .options").fadeIn())});$(".default").hide();d=$(d);$(".selection").append(d);d=$(".selection li."+a);d.hide().fadeIn("slow");j++;$(".bar span").html($("#lightbox li.thumb").size());
g()}})}return!1});$(".bar").click(function(){p?o():w()});$("#lightURL").focus(function(){$(this).select()});var k=5;$(".lightboxright").click(function(){$(".selection").animate({"margin-left":"-=134px"},"medium");k++;g()});$(".lightboxleft").click(function(){$(".selection").animate({"margin-left":"+=134px"},"medium");k--;g()});g();var q;$("#lightbox").hover(function(){clearTimeout(q)},function(){A()});$("#digis").hide();var b="#portfolio",c;r();var x=$(b+" .slide img").size();$(".tabs a").live("click",
function(){$(this).hasClass("disabled")===!1&&"#"+$(this).html().toLowerCase()!=b&&($("#digis").toggle(),$("#portfolio").toggle(),$(".tabs").toggleClass("tabstoggle"),b=b=="#portfolio"?"#digis":"#portfolio",r(),l(),h());return!1});$(".cardright").live("click",function(){c++;$(this).parent().siblings().children().hide();$(".slide img:nth-child("+c+")").show();l();h();return!1});$(".cardleft").live("click",function(){c--;$(this).parent().siblings().children().hide();$(".slide img:nth-child("+c+")").show();
l();h();return!1});$(".close").live("click",function(){$.fancybox.close();return!1});h();$("#search").click(function(){if(!($("#search input#s").length>0)){var a=$('<input type="text" id="s" name="s" placeholder="Search" autofocus /><div id="search-results"></div>');$(this).html(a);a.focus();a.blur(function(){if($("#search input#s").val()==""){var a="";$("#search").hasClass("blogSearch")&&(a=" Blog");$("#search").html('<a href="#" >Search'+a+"</a>");$(".ac_results").remove()}});$("#search").hasClass("blogSearch")?
a.keypress(function(a){if(a.keyCode=="13")location.href=e+"blog?q="+$(this).val()}):a.autocomplete(e+"search").result(function(a,b){b[1]!="-1"?y("model-"+b[1]):$("#search input#s").val("")})}});$(".box").live("click",function(){y($(this).attr("rel"));return!1});$("#content .thumb").length&&$("#content .thumb").fadeTo(0,0).EffectChain({effect:"fadeTo",fadeToOpacity:1,duration:0.1});$(".thumb-holder-sm .thumb").length&&$(".thumb-holder-sm .thumb").fadeTo(0,1)});
