var rollFlag = 0
var browserName= navigator.appName
var browserVersion = navigator.appVersion
current_overID = "";
last_overID = "";

window.onerror = stopError;

function version() {
        if (browserName.charAt(0)=="N") {
                if (browserVersion.charAt(0) > "2") {
                        // Netscape 3.0 or above.
                        rollFlag=1              
                } else {
                        // Netscape 2.0 or below.
                        rollFlag=0
                }
        } else if (browserName.charAt(0)=="M") {
                if (browserVersion.charAt(0) > "3") {
                        // IE 4.0 or above
                        rollFlag=1
                } else {
                        // IE 3.0 or below
                        rollFlag=0
                }     
        } else {
                // Some other browser
                rollFlag=0        
        }
        return rollFlag
}

function remove_Frame () {
        if (version()==0) return;
	parent.location=parent.frames[1].location.href;
}

function goUp(drop_down){
	var newurl = drop_down.options[drop_down.selectedIndex].value;
	if(drop_down.selectedIndex > 0){
		drop_down.selectedIndex = 0;
		parent.location.href = newurl;
	}
}

function go(drop_down){
	var newurl = drop_down.options[drop_down.selectedIndex].value;
	if(drop_down.selectedIndex > 0){
		drop_down.selectedIndex = 0;
//		location.href = newurl;
		parent.location.href = newurl;
	}
}

function foc(loc){
	loc.select()
	loc.focus()
}
 
function stopError() {
	return true;
}

function StripSpacesFromEnds(s) {
 while((s.indexOf(' ',0) == 0) && (s.length > 1)) { s = s.substring(1,s.length); }
 while((s.lastIndexOf(' ') == (s.length - 1) && (s.length > 1))) { s = s.substring(0,(s.length - 1)); }
 if((s.indexOf(' ',0) == 0) && (s.length == 1)) s = '';
 return s;
}

function Capitalize(f_entry) {
 f_entry = StripSpacesFromEnds(f_entry);
 if(! f_entry) return ''; 
 var i = f_entry.indexOf('  ',0);
 while(i > -1) {       
  f_entry = f_entry.substring(0,(i + 1)) +
   f_entry.substring((i + 2),f_entry.length);
  i = f_entry.indexOf('  ',0);
 }
 //f_entry_L = f_entry.toLowerCase();
 //f_entry_U = f_entry.toUpperCase();
 //if(f_entry != f_entry_L && f_entry != f_entry_U){
  //return f_entry;      
 //}
 f_entry = f_entry.toLowerCase();
 var s = new String(f_entry.substring(0,1));    
 s = s.toUpperCase();
 f_entry = s + f_entry.substring(1,f_entry.length);
 i = f_entry.indexOf(' ',0);
 if(i == (f_entry.length - 1)) i = -1;
 var ts = new String("");
 var j = 0;
 while(i > -1) {
  i++;
  j = i + 1;
  s = f_entry.substring(i,j);
  s = s.toUpperCase();
  ts = '';
  if(i > 0) ts = f_entry.substring(0,i);
  f_entry = ts + s + f_entry.substring(j,f_entry.length);
  i = f_entry.indexOf(' ',j);
  if(i == (f_entry.length - 1)) i = -1;
 }
 return f_entry;
}

function CApitalize(f_entry) {
 f_entry = StripSpacesFromEnds(f_entry);
 if(! f_entry) return ''; 
 var i = f_entry.indexOf('  ',0);
 while(i > -1) {       
  f_entry = f_entry.substring(0,(i + 1)) +
   f_entry.substring((i + 2),f_entry.length);
  i = f_entry.indexOf('  ',0);
 }
 f_entry_L = f_entry.toLowerCase();
 f_entry_U = f_entry.toUpperCase();
 if(f_entry != f_entry_L && f_entry != f_entry_U){
  return f_entry;      
 }
 f_entry = f_entry.toLowerCase();
 var s = new String(f_entry.substring(0,1));    
 s = s.toUpperCase();
 f_entry = s + f_entry.substring(1,f_entry.length);
 i = f_entry.indexOf(' ',0);
 if(i == (f_entry.length - 1)) i = -1;
 var ts = new String("");
 var j = 0;
 while(i > -1) {
  i++;
  j = i + 1;
  s = f_entry.substring(i,j);
  s = s.toUpperCase();
  ts = '';
  if(i > 0) ts = f_entry.substring(0,i);
  f_entry = ts + s + f_entry.substring(j,f_entry.length);
  i = f_entry.indexOf(' ',j);
  if(i == (f_entry.length - 1)) i = -1;
 }
 return f_entry;
}

function SEmester(faspsu){
 document.courseform.Semester.value=faspsu;
 document.courseform20.Semester.value=faspsu;
 document.dptform20.Semester.value=faspsu;
 document.allform20.Semester.value=faspsu;
 document.customform.Semester.value=faspsu;
 document.instruform.Semester.value=faspsu;
 document.bldrooform.Semester.value=faspsu;
}
function DaEvWe(daevwe){
 document.courseform.DEW.value=daevwe;
 document.courseform20.DEW.value=daevwe;
 document.dptform20.DEW.value=daevwe;
 document.allform20.DEW.value=daevwe;
 document.allformCap.DEW.value=daevwe;
 document.customform.DEW.value=daevwe;
 document.instruform.DEW.value=daevwe;
 document.bldrooform.DEW.value=daevwe;
}
function Check(){
 if(document.courseform.Semester.value=="7"){
  document.courseform.FALL.value="CHECKED";
  document.courseform.SPRING.value="";
  document.courseform.SUMMER.value="";
 } else if(document.courseform.Semester.value=="3"){
  document.courseform.FALL.value="";
  document.courseform.SPRING.value="CHECKED";
  document.courseform.SUMMER.value="";
 } else if(document.courseform.Semester.value=="5"){
  document.courseform.FALL.value="";       
  document.courseform.SPRING.value="CHECKED";
  document.courseform.SUMMER.value="";
 } else{
  document.courseform.FALL.value="";
  document.courseform.SPRING.value="";
  document.courseform.SUMMER.value="";
 }
}
//function Season(){
 today = new Date();
 thisYear = today.getYear()
 thisMonth = today.getMonth()
// document.courseform.semester.FALL.click()
// if(thisMonth < 5){
//   season = "Spring"
// } else if(thisMonth < 7)
//   season = "Summer"
// } else{
//   season = "Fall"
// }
//}
