var xURL = document.location.href.substr(7);
var xTmp = xURL.split('/');

myDate 			= new Date();
var myMin		= myDate.getMinutes();
var myHour		= myDate.getHours();
var myDay 		= myDate.getDate();
var myMonth 	= myDate.getMonth();
var myDawn		= 0;

if(xTmp[1] == 'event_new.html') {
	document.form1.v_month.selectedIndex = myMonth;
	document.form1.v_month2.selectedIndex = myMonth;
	document.form1.v_day.selectedIndex = myDay - 1;
	document.form1.v_day2.selectedIndex = myDay - 1;
}

if (myHour > 12) {
	myDawn = 1;
	myHour -= 12;
}

if (myMin >= 52 && myMin < 7) myMin = 0;
else if (myMin >= 7 && myMin < 22) myMin = 1;
else if (myMin >= 22 && myMin < 37) myMin = 2;
else myMin = 3

if(xTmp[1] == 'event_new.html') {
	document.form1.v_hour.selectedIndex = myHour - 1;
	document.form1.v_hour2.selectedIndex = myHour - 1;
	document.form1.v_dawn.selectedIndex = myDawn;
	document.form1.v_dawn2.selectedIndex = myDawn;
	document.form1.v_min.selectedIndex = myMin;
	document.form1.v_min2.selectedIndex = myMin;
}

function getEdit() {
     var myID = prompt('Enter your Ref#: ','');
     var myPwd = prompt('Enter your Password: ','');
     document.form2.v_id.value = myID;
     document.form2.v_password.value = myPwd;
     document.form2.submit();
}

document.write('<form name=form2 method=post action="/cgi-bin/uo_events.pl?1">');
document.write('<input type=hidden name=v_id>');
document.write('<input type=hidden name=v_password>');
document.write('</form>');
