// SCRIPT FOR THE "TODAY" BUTTON
var gURL = "http://EPWeb.dmgov.org/?"
var sUserName = 'webuser'
var sPassword = 'epweb1'
function today(iDays)
{
var now,rv;
now = new Date();
now.setDate(now.getDate()+iDays)
var rv = 
   now.getMonth()+1 + "/" + 
   now.getDate()  + "/" + 
   now.getYear();
return rv;
}

function poptastic(url)
{
var cDate = new Date();
cDate.setTime(cDate.getTime() + 60000);
var cString = "url="+url+"; expires=" + cDate.toString();
document.cookie = cString
//alert(url);


var newwindow;
	newwindow=window.open(url,'EPWEB','height=700px,width=925px, scrollbars=yes, resizable=yes');
	if (window.focus) {newwindow.focus()} 
	
}

function EPWebAvailable(sGroup, sFrom, sTo)
{
var sUrl;

	sUrl = gURL + "AvailableResults&" + sUserName + "&" + sPassword
	sUrl = sUrl + "&" + today(4) + "&" + today(4);
	sUrl = sUrl + "&" + sFrom + "&" + sTo + "&99999&" + sGroup;
	poptastic(sUrl);
}

function EPWebShelterBooking(sGroup, timeType)
{
	var sUrl;

	sUrl = gURL + "Bookings" + timeType + "&" + sUserName + "&" + sPassword + "&" + sGroup;
	poptastic(sUrl);

}

function EPWebAvailableResults(sGroup)
{
var sUrl;

	sUrl = gURL + "availableresults&" + sUserName + "&" + sPassword
	sUrl = sUrl + "&" + today(4) + "&" + today(4);
	sUrl = sUrl + "&10:00am&9:00pm" + "&99999&" + sGroup;
	poptastic(sUrl);
}

function EPWebBooking(sGroup)
{
var sUrl;

	sUrl = gURL + "Bookings&" + sUserName + "&" + sPassword + "&" + sGroup;
	poptastic(sUrl);
}