var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizable=1,copyhistory=0,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');

}

function popDetails(cat,id)
{
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open('details.cfm?cat='+cat+'&id='+id, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizable=1,copyhistory=0,width=500,height=400,left=10,top=10,screenX=10,screenY=10');
}

//use the following var to remember an image's original src value
//the imageRoll function will constantly update this value, allowing the imageOut function to use its current value
var imageSourceValue = '';
function imageRoll(imageObject)
{
	//store the current src value
	imageSourceValue = imageObject.src;
	//grab the directory from the src attribute
	var folderIndex = imageObject.src.lastIndexOf("/");
	var theDirectory = imageObject.src.substring(0,folderIndex+1);//returns the DIR in the form http://domain.com/folder
	//test for image file type, jpg v. gif
	var theFileType = imageObject.src.substring(imageObject.src.length-3);//grab the last 3 characters, they represent the file type

	imageObject.src=theDirectory+imageObject.name+'-on.'+theFileType;
}
function imageOut(imageObject)
{
	//retrieve the original image src attribute
	imageObject.src = imageSourceValue;
}

function checkSearchForm()
{
	var d = document.getElementById("searchForm");
	if(d.category.selectedIndex == 0 || d.radius.selectedIndex == 0 || d.centerPoint.selectedIndex == 0)
	{
		alert("You must select a category, radius and venue to perform a search.");
	}
	else
	{
		//show the searching string (dhtml.js)
		showSearching();
		d.submit();
	}
}
