window.log = function(){
  log.history = log.history || [];
  log.history.push(arguments);
  arguments.callee = arguments.callee.caller;  
  if(this.console) console.log( Array.prototype.slice.call(arguments) );
};
(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();)b[a]=b[a]||c})(window.console=window.console||{});


/*
* Placeholder plugin for jQuery
* ---
* Copyright 2010, Daniel Stocks (http://webcloud.se)
* Released under the MIT, BSD, and GPL Licenses.
*/

(function(b){function d(a){this.input=a;a.attr("type")=="password"&&this.handlePassword();b(a[0].form).submit(function(){if(a.hasClass("placeholder")&&a[0].value==a.attr("placeholder"))a[0].value=""})}d.prototype={show:function(a){if(this.input[0].value===""||a&&this.valueIsPlaceholder()){if(this.isPassword)try{this.input[0].setAttribute("type","text")}catch(b){this.input.before(this.fakePassword.show()).hide()}this.input.addClass("placeholder");this.input[0].value=this.input.attr("placeholder")}},
hide:function(){if(this.valueIsPlaceholder()&&this.input.hasClass("placeholder")&&(this.input.removeClass("placeholder"),this.input[0].value="",this.isPassword)){try{this.input[0].setAttribute("type","password")}catch(a){}this.input.show();this.input[0].focus()}},valueIsPlaceholder:function(){return this.input[0].value==this.input.attr("placeholder")},handlePassword:function(){var a=this.input;a.attr("realType","password");this.isPassword=!0;if(b.browser.msie&&a[0].outerHTML){var c=b(a[0].outerHTML.replace(/type=(['"])?password\1/gi,
"type=$1text$1"));this.fakePassword=c.val(a.attr("placeholder")).addClass("placeholder").focus(function(){a.trigger("focus");b(this).hide()});b(a[0].form).submit(function(){c.remove();a.show()})}}};var e=!!("placeholder"in document.createElement("input"));b.fn.placeholder=function(){return e?this:this.each(function(){var a=b(this),c=new d(a);c.show(!0);a.focus(function(){c.hide()});a.blur(function(){c.show(!1)});b.browser.msie&&(b(window).load(function(){a.val()&&a.removeClass("placeholder");c.show(!0)}),
a.focus(function(){if(this.value==""){var a=this.createTextRange();a.collapse(!0);a.moveStart("character",0);a.select()}}))})}})(jQuery);


/**
* @name     Half Court Shot
* @author <codes>      mediaHACK - http://www.mediahack.com [codes at the mediahack dotz com]
* @author <pretties>      KomodoMedia - http://www.komodomedia.com [rogie at the komodomedia dotz com]
* @date         2010.07.28
* @version	1.101129
* 
* This has been a mediaHACK and KomodoMedia  collar. Our powers
* combined are Super-Sonic-Bionic. Trust pound#.
*
* @copyright   2010 - mH
* @licence  MIT Licensed. Nice if you give origination cred.
* 
**/
function HalfCourtShot(settings){this.settings=settings;this.play;this.goal=document.getElementsByTagName("body")[0];var allstarsIMO=["rogue","simple bits","shauninman","jam","squared eye"];var cointoss=Math.floor(Math.random()*5);this.player=allstarsIMO[cointoss];this.jersey=this.player;this.shots=0;this.page;this.per_page;this.following=false;this.className="hcs";this.apiUrl="http://api.dribbble.com/";this.playType="players";this.url="";HalfCourtShot.currentIndex=HalfCourtShot.currentIndex||0;this.index=HalfCourtShot.currentIndex++;this.debug=false;this.callThePlay=function(){var ball=this;if(ball.settings==null){return}for(var x in ball.settings){if(ball[x]!=undefined){ball[x]=ball.settings[x]}}};this.shootDaBall=function(){var ball=this;var sCallback="HalfCourtShot.callback"+ball.index;HalfCourtShot["callback"+ball.index]=function(data){ball.jumboTron(data)};ball.genUrl();var instId="halfCourtShot"+ball.currentIndex;HalfCourtShot[instId]=document.createElement("script");HalfCourtShot[instId].setAttribute("id",instId);HalfCourtShot[instId].setAttribute("type","text/javascript");HalfCourtShot[instId].setAttribute("src",ball.url);document.getElementsByTagName("body")[0].appendChild(HalfCourtShot[instId])};this.jumboTron=function(data){var ball=this;var bounds=document.createElement("div");bounds.setAttribute("class",ball.className);var imgList=document.createElement("ul");var thumbList=document.createElement("ul");var show=(ball.shots)?ball.shots:data.shots.length;if(show>data.shots.length){show=data.shots.length}var mainShot=show;if(ball.warmUp){show+=ball.numberOfLayups}if(data.shots){for(var x=0;x<show;x++){var li=ball.buildImageListItem(data.shots[x]);imgList.appendChild(li)}}else{if(data.image_url||data.avatar_url){var li=ball.buildImageListItem(data);imgList.appendChild(li)}}bounds.appendChild(imgList);if(ball.warmUp){bounds.appendChild(thumbList)}if(typeof ball.goal=="string"){ball.goal=document.getElementById(ball.goal)}ball.goal.appendChild(bounds);ball.goal.innerHTML=ball.goal.innerHTML;if(ball.onComplete){ball.onComplete()}};this.buildImageListItem=function(d){var image_url=(d.image_url)?d.image_url:d.avatar_url;var a=document.createElement("a");a.setAttribute("href",d.url);a.setAttribute("title",d.title);var img=document.createElement("img");img.setAttribute("src",image_url);var lay=document.createElement("span");lay.setAttribute("class","overlay");if(d.width){img.setAttribute("width",d.width)}if(d.height){img.setAttribute("height",d.height)}if(d.title){img.setAttribute("title",d.title)}else{if(d.name){img.setAttribute("title",d.name)}}if(d.title){img.setAttribute("alt",d.title)}else{if(d.name){img.setAttribute("alt",d.name)}}a.appendChild(img);a.appendChild(lay);var li=document.createElement("li");li.appendChild(a);return li};this.genUrl=function(){var randomNo=Math.floor(Math.random()*9999999);if(typeof this.jersey=="string"){if(this.page!=undefined){pageOpts="page="+this.page}if(this.per_page!=undefined){pageOpts=pageOpts+"&per_page="+this.per_page}}if(this.playType=="shots"){var pageOpts="";if(this.jersey=="debuts"||this.jersey=="everyone"||this.jersey=="popular"){this.url=this.apiUrl+this.playType+"/"+this.jersey+"/?"+pageOpts+"&r="+randomNo+"&callback=HalfCourtShot.callback"+this.index}else{this.url=this.apiUrl+this.playType+"/"+this.jersey+"/?r="+randomNo+"&callback=HalfCourtShot.callback"+this.index}if(this.debug){console.log(this.url)}}else{if(this.playType=="players"){var jerseyType=parseInt(this.jersey);if(parseInt(this.jersey)){this.url=this.apiUrl+this.playType+"/"+this.jersey+"/?r="+randomNo+"&callback=HalfCourtShot.callback"+this.index}else{var followingOpts=(eval(this.following))?"following/":"";this.url=this.apiUrl+this.playType+"/"+this.jersey+"/shots/"+followingOpts+"?r="+randomNo+"&callback=HalfCourtShot.callback"+this.index}}}};this.rideThePine=function(v){if(this.debug){console.log(this[v])}};this.hitTheFloor=function(){this.callThePlay();this.shootDaBall()};this.hitTheFloor()};

