if (document.location.href.match(/c=Session/)) document.onkeypress = KeyHandler;

function AddWH() {
    var el = document.getElementById('body-content-div');
	document.location.href = document.location.href+"&w="+el.clientWidth+"&h="+el.clientHeight;
}

function ConfirmSubmit(c, m, etc) {
	if (confirm(ConfirmMessage)) Submit(c, m, etc);
}

function Goto(c, m, etc) {
	document.location.href = '/sr?c='+c+'&m='+m+(etc==null?'':'&'+etc);
	return false;
}

function Home() {
	Goto('Subjects','');
}

function KeyHandler(e) {
 	if (!e) { e = window.event; }  //IE variant
	var key = String.fromCharCode(e.keyCode);
	if (key >= 'A' && key <= 'Z') key = String.fromCharCode(e.keyCode+32);
	if (key >= 'a' && key <= 'z') SmartReviseAction(key);
}

function Submit(c, m, etc) {
	document.SRForm.action = '/sr?c='+c+'&m='+m+(etc==null?'':'&'+etc);
	document.SRForm.method = 'POST';
	document.SRForm.submit();
	return false;
}

function SubmitFile(c, m, etc) {
	document.SRForm.encoding = 'multipart/form-data';
	Submit(c, m, etc);
	return false;
}

