function GBL_confirmDeleteObject(objectName) {
	if (confirm("Are you SURE you wish to delete this " + objectName + "?") == false) {
		return false;
	}
}

function openWin( windowURL, windowName, windowFeatures ) { 
	return window.open( windowURL, windowName, windowFeatures ) ; 
}


function toggleMap(mapName) {	
	var clickedMap = document.getElementById(mapName);		
	if (mapName == 'NYSLitMapLarge') {
		var otherMap = document.getElementById('NYCLitMapLarge');
	} else {
		var otherMap = document.getElementById('NYSLitMapLarge');
	}
	
	//we now have clickedMap and otherMap as div objects.
	
	if (otherMap.style.visibility == 'visible') {
		//fadeImageOut(otherMap,0);
		otherMap.style.visibility = 'hidden';
	}	
	if (clickedMap.style.visibility == 'visible') {
		//fadeImageOut(clickedMap,0);	
		clickedMap.style.visibility = 'hidden';
	} else {		
		//fadeImageIn(clickedMap,1);
		clickedMap.style.visibility = 'visible';
	}

}


function pleaseWait(mapName) {
	var nycMap = document.getElementById('NYCLitMapLarge');
	var nysMap = document.getElementById('NYSLitMapLarge');
	if (nycMap.style.visibility == 'visible') {
		// fadeImageOut(nycMap,.5);
		nycMap.style.opacity = .5;
		nycMap.style.filter = "alpha(opacity=50)";
	}
	if (nysMap.style.visibility == 'visible') {
		// fadeImageOut(nysMap,.5);
		nysMap.style.opacity = .5;
		nysMap.style.filter = "alpha(opacity=50)";
	}	
	document.getElementById('PleaseWait').style.visibility = 'visible';
}


function resetPopups() {

	document.getElementById('PleaseWait').style.visibility = 'hidden';
		
	var nycMap = document.getElementById('NYCLitMapLarge');
	var nysMap = document.getElementById('NYSLitMapLarge');
	
	nycMap.style.visibility = 'hidden';
	nycMap.style.opacity = 1;
	nycMap.style.filter = "alpha(opacity=100)";

	nysMap.style.visibility = 'hidden';	
	nysMap.style.opacity = 1;
	nysMap.style.filter = "alpha(opacity=100)";
	

}





function fadeImageIn(theImg,endOp) {	
	theImg.style.visibility = 'visible';
	if (theImg.style.opacity) {
		var op = 0;
		theImg.style.opacity = op;
		while (op < endOp) {
			op = op + .05;
			theImg.style.opacity = op;
			pause(5);
		}	
	}
	if(endOp == 1) { 	
		theImg.style.opacity = 1;
	}
}


function fadeImageOut(theImg,endOp) {	
	if (theImg.style.opacity) {
		var op = 1;	
		while (op > endOp) {
			op = op - .05;
			theImg.style.opacity = op;
			pause(5);
		}	
	}
	if (endOp == 0)	{
		theImg.style.opacity = 0;	
		theImg.style.visibility = 'hidden'
	}
}




function pause(millis) {
	var date = new Date();
	var curDate = null;
	do { curDate = new Date(); }
	while(curDate-date < millis);
} 