$(document).ready(function() {

	/*$(".athlete-thumb-index:nth-child(6n)").addClass("last");*/

});
						  

if (document.images) {
/*      storelocator = new Image();
      storelocator.src = "/images/nav/storelocator_off.gif";
      storelocatorover = new Image();
      storelocatorover.src = "/images/nav/storelocator_over.gif";
*/	  
}          

function over(name){
	if (document.images) {
		document[name].src = eval(name + "over.src");
	}
}

function off(name){
	if (document.images) {
		document[name].src = eval(name + ".src");
	}
}



































//---------------------------------------------------------------------------------
//
// Function: 	popup
//
// Description: This function popups a new window with a specified width
//              and height and brings the focus to the popup window
//
// Parameters:  pagename -  the name of the page to be opened in the popup
//							window
//
//				width - the width of the window to be opened
//
//				height - the height of the window to be opened
//
//				scroll - 'yes' if the window should have scrollbars, 'no' if not
//
//				resizeable - 'yes' if the window should be resizeable, 'no' if not
//
// Programmer:  Happy Tsugawa-Banta
//
// Date: 		2/7/01
//
// Updates:     2/7/01 - added these comments (HT)
//
//--------------------------------------------------------------------------------


function popup(pagename,winname,width,height,scroll,resizable) {
	var popup = window.open(pagename,winname,"toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=" + scroll + ",resizable=" + resizable + ",width=" + width + ",height=" + height + ",left=0,top=0");

    popup.focus();

}

function prodPopup(pagename) {
	var prodPopup = window.open(pagename,"productPopup","toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=355,height=393,left=0,top=0");

    prodPopup.focus();

}


//---------------------------------------------------------------------------------
//
// Function: 	popupPrint
//
// Description: This function popups a new window with a specified width
//              and height and brings the focus to the popup window and keeps the menu bar
//
// Parameters:  pagename -  the name of the page to be opened in the popup
//							window
//
//				width - the width of the window to be opened
//
//				height - the height of the window to be opened
//
// Programmer:  Happy Tsugawa-Banta
//
// Date: 		9/6/01
//
//
//--------------------------------------------------------------------------------


function popupPrint(pagename,width,height) {
	var popupPrint = window.open(pagename,"popup_print","toolbar=yes,directories=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height + ",left=0,top=0");

    popupPrint.focus();

}


//---------------------------------------------------------------------------------
//
// Function:    checkRadio
//
// Description: This validates that at least one Radio button in a group
//              has been selected. If there is a single radio button in the
//              group, and it hasn't been selected, the function selects it.
//
// Parameters:  name - the name of the radio button group
//              message - message to display if no button has been selected
//
// Programmer:  Happy Tsugawa-Banta
//
// Date:        2/9/01
//
// Updates:     6/8/01 - added behavior for single radio button SjG
//
//--------------------------------------------------------------------------------

function checkRadio(name,message){
	var radioChecked = 0;
	for (var j=0; j < name.length; j++){
		if (name[j].checked){
			radioChecked=1;
			return true;
		}
	}
    if (!name.length)
        {
        name.checked=1;
        radioChecked=1;
        }
	if (radioChecked == 1){
		form.submit();
        return true;
	} else {
		alert(message);
		return false;
	}
}

//--------------------------------------------------------------------------
//
// Function:    populateRadio
//
// Description: Iterates through the radio buttons in a group and selects
//              one matching a particular value
//
// Parameters:  buttons - the element representing the buttons
//              value - the value to select
//
// Programmer:  Karl Zilles
//
// Date:        5/16/01
//
// Updates:
//
//--------------------------------------------------------------------------

function populateRadio(buttons, value) {
	for (i=0; i<buttons.length; i++)
		if (buttons[i].value==value)
			buttons[i].checked = true;
}

//--------------------------------------------------------------------------
//
// Function:    countChecked
//
// Description: Iterates through the checkboxes in a group and counts how
//              many have been checked.
//
// Parameters:  element - name of the checkboxes
//
// Programmer:  SjG
//
// Date:        06/07/01
//
// Updates:
//
//--------------------------------------------------------------------------

function countChecked(element)
    {
    count=0;
    for(i=0; i<element.length; i++)
        {
        if (element[i].checked)
            {
            count++;
            }
        }
    return count;
}

//--------------------------------------------------------------------------
//
// Function:    checkAll
//
// Description: Iterates through the check boxes in a group and
//              checks or unchecks them
//
// Parameters:  element - name of the checkboxes
//              val - true for checked, false for unchecked
//
// Programmer:  SjG
//
// Date:        06/07/01
//
// Updates:
//
//--------------------------------------------------------------------------

function checkAll(element, val)
    {
    len = element.length;
    var i=0;
    for( i=0 ; i<len ; i++)
        {
        element[i].checked=val;
        }
    }

//--------------------------------------------------------------------------
//
// Function:    toggleSet
//
// Description: Toggles the state of a single checkbox that controls
//              the state of many checkboxes (i.e., "check here to select
//              all" situations)
//
// Parameters:  primary - name of the controller checkbox
//              children - name of the dependent checkboxes
//
// Programmer:  SjG
//
// Date:        06/07/01
//
// Updates:
//
//--------------------------------------------------------------------------

function toggleSet(primary, children)
    {
    if (primary.checked)
        {
        checkAll(children,true);
        }
    else
        {
        checkAll(children,false);
        }
    }
//--------------------------------------------------------------------------
//
// Function:    populateSelect
//
// Description: Iterates through the select options in a dropdown and selects
//              one matching a particular value
//
// Parameters:  select - the element representing the select
//              value - the value to select
//
// Programmer:  Karl Zilles
//
// Date:        5/16/01
//
// Updates:
//
//--------------------------------------------------------------------------
function populateSelect(select, value) {
	for (i=0; i<select.length; i++)
		if (select.options[i].value==value)
			select.selectedIndex = i;
}



//---------------------------------------------------------------------------------
//
// Function: 	checkDateRange
//
// Description: This function checks to see if any of the start date or end date
//              fields have been selected.  If so, it makes sure all of the fields
//              are selected and makes sure that the start date is earlier than the 
//              end date.
//
// Parameters:  form - the name of the form
//
// Returns:     true if all everything is selected correctly, otherwise false
//
// Programmer:  Happy Tsugawa-Banta
// 
// Date: 		6/06/01
//
//--------------------------------------------------------------------------------

function checkDateRange()
{
	var startmonthvalue = eval(document.form.startmonth.options[document.form.startmonth.selectedIndex].value);
	var startdayvalue = eval(document.form.startday.options[document.form.startday.selectedIndex].value);
	var startyearvalue = eval(document.form.startyear.options[document.form.startyear.selectedIndex].value);
	var endmonthvalue = eval(document.form.endmonth.options[document.form.endmonth.selectedIndex].value);
	var enddayvalue = eval(document.form.endday.options[document.form.endday.selectedIndex].value);
	var endyearvalue = eval(document.form.endyear.options[document.form.endyear.selectedIndex].value);
		

		if ( (startyearvalue > endyearvalue) || ( (startyearvalue == endyearvalue) && (startmonthvalue > endmonthvalue) ) ||  ( (startyearvalue == endyearvalue) && (startmonthvalue == endmonthvalue) && (startdayvalue >= enddayvalue) ) ) {
			alert("Please make sure the starting date is before the ending date.");
			return false;
		} else {
			return validate(document.form,fields);
		}
}


//---------------------------------------------------------------------------------
//
// Function: 	deleteCheckUser
//
// Description: This function checks to make sure this is not the only user.  Then
//              it pops up a confirm box to warn that the user is about to delete a user.
//
// Returns:     true if this is not the only user and they choose to go on
//              with the delete, otherwise false
//
// Programmer:  Happy Tsugawa-Banta
// 
// Date: 		6/13/01
//
// Updates:     
//
//--------------------------------------------------------------------------------

function deleteCheckUser()
{
	if (document.form.userid.length == 1)
    { 
        alert("There is only one current user - therefore you cannot delete this user");
        return false;
    }
	
	if (confirm("Are you sure you want to delete this user?"))
	{
		return validate(this.form,fields);
	} else {
		return false;
	}
}



//---------------------------------------------------------------------------------
//
// Function: 	compare
//
// Description: This function checks which item the user selected in the pulldown and
//              goes to the page by using the option value
//
// Programmer:  Happy Tsugawa-Banta
// 
// Date: 		1/31/01
//
// Updates:     
//
//--------------------------------------------------------------------------------

function compare(what) {
   var n = what.selectedIndex;
   filename = what.form.model.options[n].value;
   window.location=filename;
}





function getCookie (name)
	{
	var arg = name + "=";
	var arg_len = arg.length;
	var cookie_len = document.cookie.length;
	var i = 0;
	while (i < cookie_len)
		{
		var ptr = i + arg_len;
		if (document.cookie.substring(i, ptr) == arg)
			{
			var endstr = document.cookie.indexOf (";", ptr);
			if (endstr == -1)
			endstr = document.cookie.length;
			return unescape(document.cookie.substring(ptr, endstr));
			}
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
		}
	return null;
	}

function setLongCookie (name, value)
	{
	var expires = new Date("December 31, 2035 21:34:05");
	document.cookie = name + "=" + escape (value) + "; expires=" + expires.toGMTString();
	}
























































/*write layer styles by browser*/

ns = (document.layers)? true:false
ie = (document.all)? true:false

if (ie) {	
	document.write('<LINK REL="stylesheet" HREF="/css/style_ie.css" TYPE="text/css">');
}

