function Navigate(page){
	document.navigate.page.value = page;
	document.navigate.submit();
}

function calendar(month){
	document.navigate.page.value = 'UpcomingEvents';
	document.navigate.month.value = month;
	document.navigate.submit();
}
function getEvent(eid){
	var evt = "event_details.html?eid="+eid;
	popUp(evt, 'Event', 300, 300);
}
function getRoom(rm){
	var room = 'room_details.html?rm='+rm;
	popUp(room, 'Room', 800, 450);
}
function popUp(mypage, myname, w, h){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',toolbar=no,scrollbars=yes,resizable,location=no';
	window.open(mypage,myname,settings);

}
function contactUs(){
	var temp = false;	
	var cu = document.cu;
        if(cu.name.value == ''){
                alert('Name cannot be blank.');
                cu.name.focus();
        }else if(cu.email.value == ''){
                alert('E-Mail cannot be blank.');
                cu.email.focus();
	}else if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(cu.email.value))){
		alert("Invalid E-mail Address! Please re-enter.")
                cu.email.focus();
	}else if(cu.message.value == ''){
		alert('Message cannot be blank.');
		cu.message.focus();
	}else
		temp = true;

	return temp;
}
