function ImgWindow(url,name,w,h)
	{
	window.open(url,name,"resizable=0,width="+w+",height="+h);
	}


function StrReplaceAll( str, s, r )
    {
    var i, strSplit;
    strSplit = str.split(s);

    strR = strSplit[0];
    for( i = 1; ++i; i < strSplit.length )
        strR += (r + strSplit[i]);
    
    return strR;
    }


function SearchArea( a )
	{
	var strAreaC = 'Downtown, Southside', 
	    strAreaE = 'Airport, Centerpoint, Eastwood, Irondale, Leeds, Pinson, Trussville', 
	    strAreaN = 'Adamsville, Fultondale, Northwest', 
        strAreaO = 'Homewood, MtnBrook, Inverness',
	    strAreaS = 'Hoover, Pelham, Vestavia', 
	    strAreaW = 'Bessemer, West';

	switch( a )
		{
		case 'A':		// all areas
			document.frmSearchArea.hidAreaList.value = 'ALL AREAS';
			break;
		case 'C':		// central area
			document.frmSearchArea.hidAreaList.value = strAreaC;
			break;
		case 'E':		// eastern area
			document.frmSearchArea.hidAreaList.value = strAreaE;
			break;
		case 'N':		// northern area
			document.frmSearchArea.hidAreaList.value = strAreaN;
			break;
		case 'O':		// Over-the-mountain / Highway 280 area
			document.frmSearchArea.hidAreaList.value = strAreaO;
			break;
		case 'S':		// southern area
			document.frmSearchArea.hidAreaList.value = strAreaS;
			break;
		case 'W':		// western area
			document.frmSearchArea.hidAreaList.value = strAreaW;
			break;
		default:		// should never fire, but...
			document.frmSearchArea.hidAreaList.value = 'ALL AREAS';
			break;
		}

    if( ! (document.frmSearchArea.lstNightlifeType.selectedIndex > 1) )
        {
        // Following lines replaced w/ code to autoselect "All Types" choice, if no choice selected by user.
        // NOTE: This way of stating the condition avoids a bug(?) that causes both of the first two
        //  choices to be selected if the user searches on either one, then hits the 'back' button.

		// alert("Please select at least one type\nof Nightlife to search for.");
        // document.frmSearchArea.lstNightlifeType.focus();
        // return false;

        document.frmSearchArea.lstNightlifeType.selectedIndex = 0;
		document.frmSearchArea.submit();
        }
	else
		document.frmSearchArea.submit();
	}


function SearchAreaAlpha()
    {

	document.frmSearchArea.hidLowCount.value = '1';             // results in order from 'A'...
	document.frmSearchArea.hidHighCount.value = '26';           // ... to 'Z'.

    document.frmSearchArea.hidAreaList.value = 'ALL AREAS';     // not used; provided for consistency

	document.frmSearchArea.submit();
    }
    
