function jqTableResize(cls)
{
    var largest = 0;
    $('table.' + cls).each(function() {
        var width = $(this)[0].offsetWidth;
        if(width > largest) {
            largest = width;
        }
    }).width(largest);
};
function jqCheckAll(id, pid)
{
	$( "#" + pid + " :checkbox").attr('checked', $('#' + id).is(':checked'));
};

function jqUnCheck(id)
{
	$( "#" + id + "_all").attr('checked', false);
};


function jListedAction()
{	
    $('.xxP').each(function() {
		var $this = $(this);
		var n = $this.attr("id").slice(3);
		//alert(n);

		// show any actions - this is for back button otherwise stays on listed
		//if($("#xxP"+n).val()=="N")
		if ($this.val()=="N")
		{
			$("#zz"+n).html(" Action");
			$("#zz"+n).attr("title","Click to switch this team from action to listed pitcher required.");
			//alert("#zz"+n + "=" + $("#zz"+n).html());
		}

    });

	$(".listed_action").click(function(){

	var $this = $(this);
	var n = $this.attr("id").slice(2);
	//alert(n);

	if($("#xxP"+n).val()=="Y")
	{
		$this.html(" Action");
		$this.attr("title","Click to switch this team from action to listed pitcher required.");
		$("#xxP"+n).val("N");
		//alert($("#P"+n).attr("name"));
	}
	else 
	{
		$this.html(" Listed");
		$this.attr("title","Click to switch this pitcher from required to action.");
		$("#xxP"+n).val("Y");
	}
	//var x = $this.attr("id");
	//$("#hdn" + x).val(0);
	//alert('fuck=' + $this.attr("name"));
	return false;

	});
};

function jMenuTips()
{
	$('body').click(function() { $(document).trigger('hideCluetip');});

  $('a.mnuCasinoTip').cluetip({
    cluetipClass: 'jtip', 
  	width: '160px', 
    sticky: true,
	activation: 'click',
  	showTitle: false,
	local:true, 
	positionBy:       'fixed',   // Sets the type of positioning. more info below [2]
    topOffset:        25,       // Number of px to offset clueTip from top of invoking element. more info below [3]
    leftOffset:       -50,       // Number of px to offset clueTip from left of invoking element. more info below [4]
    closePosition: 'bottom',
	closeText: '',
	cursor: 'hand'

  });
  $('a.mnuPokerTip').cluetip({
    cluetipClass: 'jtip', 
  	width: '105px', 
    sticky: true,
	activation: 'click',
  	showTitle: false,
	local:true, 
	positionBy:       'fixed',   // Sets the type of positioning. more info below [2]
    topOffset:        25,       // Number of px to offset clueTip from top of invoking element. more info below [3]
    leftOffset:       -45,       // Number of px to offset clueTip from left of invoking element. more info below [4]
    closePosition: 'bottom',
	closeText: '',
	cursor: 'hand'

  });

  $('a.mnuAccountTip').cluetip({
    cluetipClass: 'jtip', 
  	width: '120px', 
    sticky: true,
	activation: 'click',
  	showTitle: false,
	local:true, 
	positionBy:       'fixed',   // Sets the type of positioning. more info below [2]
    topOffset:        25,       // Number of px to offset clueTip from top of invoking element. more info below [3]
    leftOffset:       -55,       // Number of px to offset clueTip from left of invoking element. more info below [4]
    closePosition: 'bottom',
	closeText: '' ,
	cursor: 'hand'

  });

  $('a.BalanceTip').cluetip({
    cluetipClass: 'jtip', 
  	width: '230px',sticky: true, 
	local: true, hideLocal: true,
	closePosition:    'bottom',    // location of close text for sticky cluetips; can be 'top' or 'bottom' or 'title'
//    closeText:        '<img src="jq/cross.png" alt="" />',  
    closeText:        '',  
	positionBy:       'fixed',   // Sets the type of positioning. more info below [2]
    topOffset:        30,       // Number of px to offset clueTip from top of invoking element. more info below [3]
    leftOffset:       -230,       // Number of px to offset clueTip from left of invoking element. more info below [4]
	showTitle: false,
  	hoverIntent: true,
  	activation: 'click',
	titleAttribute: '',
	cursor: 'hand'
  });

  $('a.mnuHelpTip').cluetip({
    cluetipClass: 'jtip', 
  	width: '100px', 
    sticky: true,
	activation: 'click',
  	showTitle: false,
	local:true, 
	positionBy:       'fixed',   // Sets the type of positioning. more info below [2]
    topOffset:        30,       // Number of px to offset clueTip from top of invoking element. more info below [3]
    leftOffset:       -105,       // Number of px to offset clueTip from left of invoking element. more info below [4]
    closePosition: 'bottom',
	closeText: '',
	cursor: 'hand'

  });
  $('a.mnuLineTypeTip').cluetip({
    cluetipClass: 'jtip', 
  	width: '100px', 
    sticky: true,
	activation: 'click',
  	showTitle: false,
	local:true, 
	positionBy:       'fixed',   // Sets the type of positioning. more info below [2]
    topOffset:        30,       // Number of px to offset clueTip from top of invoking element. more info below [3]
    leftOffset:       -100,       // Number of px to offset clueTip from left of invoking element. more info below [4]
	titleAttribute: '',
    closePosition: 'bottom',
	closeText: '',
	cursor: 'hand'

  });
  $('a.mnuAltLinesTip').cluetip({
    cluetipClass: 'jtip', 
  	width: '100px', 
    sticky: true,
	activation: 'click',
  	showTitle: false,
	local:true, 
	positionBy:       'fixed',   // Sets the type of positioning. more info below [2]
    topOffset:        30,       // Number of px to offset clueTip from top of invoking element. more info below [3]
    leftOffset:       -70,       // Number of px to offset clueTip from left of invoking element. more info below [4]
	titleAttribute: '',
    closePosition: 'bottom',
	closeText: '',
	cursor: 'hand'

  });
};

