function MM_openBrWindow(theURL,winName,features) { //v2.0
    return window.open(theURL,winName,features);
}

function WM_netscapeCssFix() {
	/*
	Source: Webmonkey Code Library
	(http://www.hotwired.com/webmonkey/javascript/code_library/)

	Author: Taylor
	Author Email: taylor@wired.com
	Author URL: http://www.taylor.org/
	*/

	// This part was inspired by Matthew_Baird@wayfarer.com
	// It gets around another unfortunate bug whereby Netscape 
	// fires a resize event when the scrollbars pop up. This 
	// checks to make sure that the window's available size 
	// has actually changed.
	
	if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth || document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {
		// Reset default width values - Robert Evans 2/2/02
		document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;
		document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;   
		document.location = document.location;
	}
}

function WM_netscapeCssFixCheckIn() {
	// This function checks to make sure the version of Netscape 
	// in use contains the bug; if so, it records the window's 
	// width and height and sets all resize events to be handled 
	// by the WM_netscapeCssFix() function.
	//alert("resized");
	if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
		if (typeof document.WM == 'undefined') {
			document.WM = new Object;
		}
		// Check whether object has been defined - Robert Evans 2/2/02
		if (typeof document.WM.WM_netscapeCssFix == 'undefined') {
			document.WM.WM_netscapeCssFix = new Object;
			document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;
			document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;
		}
		window.onresize = WM_netscapeCssFix();
	}
}



function setF(formName, inputName)
{
    /*
        Author:     Christopher Parod
        Purpose:    sets focus of text input box on page load 
        Parameters: Name of form input box resides in, name of text input box
        Returns:    true
    */
    document[formName][inputName].focus();
    return 1;
}

function submitSearchOnEnter(formName)
{
    /*
        Author:     Christopher Parod
        Purpose:    sets hidden input to search box value and submits form when an <ENTER> keypress is sent from the search input box 
        Parameters: Name of form the search input box resides in
        Returns:    true
    */
    if (window.event.keyCode == 13)
    {
        //document[formName].searchHidden.value=document[formName].searchText.value;
        document[formName].submit();
    }
    return 1;
}


/*
    Function:   date_popup
    Author:     Robert Evans
    Purpose:    Builds and returns a 3-part pop-up list of possible date values
    Parameters: start month (1-12)
                start day   (1-31)
                start year  (4 digit)
                year span   (+-int)
                parameter name
                currently selected month
                currently selected day
                currently selected year
    Returns:    html pop-up lists with name being param_name_LIST
*/
function date_popup(month, day, year, span, param_name, s_month, s_day, s_year) {
    // Create month pop-up
    var month_p = '<select name="'+param_name+'_month">';
    for (i = 1; i <= 12; i++ ) {
        if (i==s_month) {
            month_p += '<option value="'+i+'" selected>'+month_name(i)+'</option>';
        }
        else {
            month_p += '<option value="'+i+'">'+month_name(i)+'</option>';
        }
    }
    month_p += '</select>';

    // Create day pop-up
    var day_p = '<select name="'+param_name+'_day">';
    for (i = 1; i <= 31; i++ ) {
        if ( i == s_day ) {
            day_p += '<option value="'+i+'" selected>'+i+'</option>';
        }
        else {
            day_p += '<option value="'+i+'">'+i+'</option>';
        }
    }
    day_p += '</select>';

    // Create year pop-up
    var year_p = '<select name="'+param_name+'_year">';
    if ( span < 0 ) {
        for (i = year; i >= year + span; i--) {
            if ( i == s_year ) {
                year_p += '<option value="'+i+'" selected>'+i+'</option>';
            }
            else {
                year_p += '<option value="'+i+'">'+i+'</option>';
            }
        }
    }
    else {
        for (i = year; i <= year + span; i++) {
            if ( i == s_year ) {
                year_p += '<option value="'+i+'" selected>'+i+'</option>';
            }
            else {
                year_p += '<option value="'+i+'">'+i+'</option>';
            }
        }
    }
    year_p += '</select>';

    return month_p+'&nbsp;'+day_p+',&nbsp;'+year_p
}

/*
    Function:   month_name
    Author:     Robert Evans
    Purpose:    Returns the long (full) month name for the given int
                (i.e. 1 = January)
    Parameters: int between 1 and 12
    Returns:    Long month name
*/
function month_name( month_num ) {
    switch(month_num) {
        case 1:  return 'January';
        case 2:  return 'February';
        case 3:  return 'March';
        case 4:  return 'April';
        case 5:  return 'May';
        case 6:  return 'June';
        case 7:  return 'July';
        case 8:  return 'August';
        case 9:  return 'September';
        case 10: return 'October';
        case 11: return 'November';
        case 12: return 'December';
    }
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// Apply netscape 4.x stylesheet fix
WM_netscapeCssFixCheckIn();

// Initialize reload page check
if ( typeof reloadPage == 'undefined' )
{
    /*
        Since reloadPage is undefined this must be a first time load of this
        page.  Initialize reloadPage and set it to 0 indicating that no reload
        is needed.
    */
    var reloadPage = 0;
}

// Check for cookie support
if (navigator.cookieEnabled == 0) {
	alert("This application requires cookies.  Please set your browser's preferences to allow cookies and then reload this page to continue.");
	history.back();
}
