
function encrypt(){
N=5633
E=11

 code="";
 fieldValue=document.frmLogin.loginID.value;
  for(len=0; len<fieldValue.length;len++){ 
     num=fieldValue.charCodeAt(len);
     if ( E % 2 == 0) {
        G = 1;
        for (  i = 1; i <= E/2; i++) {
               F = (num*num) % N;
               G = (F*G) % N;
        }
     } else {
        G = num;
        for (  i = 1; i <= E/2; i++) {
               F = (num*num) % N;
               G = (F*G) % N;
        }
     }
   code+=String.fromCharCode(Math.floor(G/100)+48);
   code+=String.fromCharCode((G%100-G%10)/10+48);
   code+=String.fromCharCode(Math.floor(G%10)+48);
  }
 document.frmLogin.loginID.value=code;
}

function changeTerm(page,q_String,b_sort) {
	var list = document.forms[0].Semester;
	var url = page + '?' + q_String + 's=' + list.options[list.selectedIndex].value;
	//keep sorting option
	if(b_sort) {
		list = document.forms[1].Sort;
		url += '&sv=' + list.options[list.selectedIndex].value;
	}
	document.location.href = url
}

function changeSorting(page, q_String) {
	var list = document.forms[1].Sort;
	document.location = page + '?' +  q_String + 'sv=' + list.options[list.selectedIndex].value;

}