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 i = 0,
        counts;
    do 
        {
        if( document.frmSearchArea.radRoomCount[i].checked )
       counts = String(document.frmSearchArea.radRoomCount[i].value).split('-');
   }
    while( !document.frmSearchArea.radRoomCount[i++].checked );         // current item 'checked'?  if not, increment index and inspect the next item.

	document.frmSearchArea.hidLowCount.value = counts[0];
	document.frmSearchArea.hidHighCount.value = counts[1];

	var strAreaC = 'Downtown, Southside', 
	    strAreaE = 'Airport, Centerpoint, Eastwood, Irondale, Leeds, Pinson', 
	    strAreaN = 'Adamsville, Fultondale, Northwest, Trussville', 
        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;
		}

	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();
    }
