function ControlEnterKey(buttonToClick)
{
	if (event.keyCode == 13)
	{
		event.cancelBubble = true;
		event.returnValue = false;
		frmMain[buttonToClick].click();
	}
}

function new_window(url) {
ann = window.open(url,"ann","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=500,height=200,left=100,top=100");
}

function openwindow(url,percent1,percent2) {
	var w = 640, h = 480; // default sizes
	if (window.screen) {
		w = window.screen.availWidth * percent1 / 100;
		h = window.screen.availHeight * percent2 / 100;
	}
	ann=window.open(url,"ann",'toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,left=0,top=0,width='+w+',height='+h);

}

function Bus(url) {
link=window.open(url,"link","toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=600,height=400,left=0,top=0");
}

function pdf_window(url) {
pdf = window.open(url,"pdf","toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=600,height=400,left=0,top=0");
}

function student_window(url) {
ann = window.open(url,"student","toolbar=1,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=500,height=500,left=380,top=40");
}

function openwindow(url,percent1,percent2) {
    var w = 640, h = 480; // default sizes
    if (window.screen) {
        w = window.screen.availWidth * percent1 / 100;
        h = window.screen.availHeight * percent2 / 100;
    }
	ann=window.open(url,"ann",'toolbar=1,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,left=0,top=0,width='+w+',height='+h);
}

function checkItems(checked,controlname){	
			Upper = document.forms[0].elements.length;

			for (i=0; i<=Upper-1; i=i+1){
				if (document.forms[0].elements[i].name.substring(document.forms[0].elements[i].name.length - controlname.length,document.forms[0].elements[i].name.length) == controlname) {
					document.forms[0].elements[i].checked = checked;
				}
			}
}
