$(document).ready(function(){

  // Provide a function to disable text selection and auto-apply it to all elements with the 'noselect' class
  $(function(){
    $.extend($.fn.disableTextSelect = function() {
      return this.each(function(){
			  if($.browser.mozilla){//Firefox
          $(this).css("MozUserSelect","none");
        }else if($.browser.msie){//IE
          $(this).bind("selectstart",function(){return false;});
        }else{//Opera, etc.
          $(this).mousedown(function(){return false;});
        }
      });
    });
    $(".noselect").disableTextSelect();
  });

  // Attach a click event-handler to links to handle XXX_WINDOW targets
  $("a[target$=_WINDOW]").click(function(event){
    var href = $(this).attr("href");
    var target = $(this).attr("target");
    switch (target){
      case 'TEAM_WINDOW':
      case 'NEWS_WINDOW':
        window.open(href, target, 'menubar,scrollbars,resizable,width=1024,height=720');
        return false;
        break;
      case 'PICK_WINDOW':
        window.open(href, target, 'menubar,scrollbars,resizable,width=970,height=735');
        return false;
        break;
      default:
        return true;
    }
  });

});
