/* This script is for .html pages that could not be converted to the .asp extension */
/* Edited by Ian Chan on 03.August.04 - */
/* The key function of this file is to select the correct style sheet for non-ASP web pages */
/* Non-ASP web pages using this file include all the web pages on the EZproxy server */

/* Writes CSS links based on  user browser */
var exclude=1;
var agt=navigator.userAgent.toLowerCase();
var win=0;var mac=0;var lin=1;
if(agt.indexOf('win')!=-1){win=1;lin=0;}
if(agt.indexOf('mac')!=-1){mac=1;lin=0;}
var lnx=0;if(lin){lnx=1;}
var ice=0;
var ie=0;var ie4=0;var ie5=0;var ie6=0;var com=0;var dcm;
var op5=0;var op6=0;var op7=0;
var ns4=0;var ns6=0;var ns7=0;var mz7=0;var kde=0;var saf=0;
if(typeof navigator.vendor!="undefined" && navigator.vendor=="KDE"){
	var thisKDE=agt;
	var splitKDE=thisKDE.split("konqueror/");
	var aKDE=splitKDE[1].split("; ");
	var KDEn=parseFloat(aKDE[0]);
	if(KDEn>=2.2){
		kde=1;
		ns6=1;
		exclude=0;
		}
	}
else if(agt.indexOf('webtv')!=-1){exclude=1;}
else if(typeof window.opera!="undefined"){
	exclude=0;
	if(agt.indexOf("opera/5")!=-1||agt.indexOf("opera 5")!=-1){
	    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/global.css" type="text/css">');
    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/opera6.css" type="text/css">');
}
	if(agt.indexOf("opera/6")!=-1||agt.indexOf("opera 6")!=-1){
	    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/global.css" type="text/css">');
    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/opera6.css" type="text/css">');
}
	if(agt.indexOf("opera/7")!=-1||agt.indexOf("opera 7")!=-1){    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/global.css" type="text/css">');
    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/v6_fonts.css" type="text/css">');
}
	}
else if(typeof document.all!="undefined"&&!kde){
	exclude=0;
	ie=1;
	if(typeof document.getElementById!="undefined"){
    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/global.css" type="text/css">');
    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/ie5.css" type="text/css">');
		if(agt.indexOf("msie 6")!=-1){
    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/global.css" type="text/css">');
    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/v6_fonts.css" type="text/css">');
    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/ie6.css" type="text/css">');
		}
		}
	else{ie4=1;}
	}
else if(typeof document.getElementById!="undefined"){
	exclude=0;
	if(agt.indexOf("netscape/6")!=-1||agt.indexOf("netscape6")!=-1){
	    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/global.css" type="text/css">');
    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/v6_fonts.css" type="text/css">');
}
	else if(agt.indexOf("netscape/7")!=-1||agt.indexOf("netscape7")!=-1){
	    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/global.css" type="text/css">');
    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/v6_fonts.css" type="text/css">');
}
	else if(agt.indexOf("gecko")!=-1){
	    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/global.css" type="text/css">');
    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/v6_fonts.css" type="text/css">');
}
	if(agt.indexOf("safari")!=-1 || (typeof document.childNodes!="undefined" && typeof document.all=="undefined" && typeof navigator.taintEnabled=="undefined")){
	    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/global.css" type="text/css">');
    document.write('<link rel="stylesheet" href="http://dept.sccd.ctc.edu/cclib/css/v6_fonts.css" type="text/css">');
}
	}

<!-- Adds border to selected form field -->
<!-- courtesy of  http://www.sitepoint.com/article/simple-tricks-usable-forms/2-->

addEvent(window, 'load', function() { 
 var input, textarea; 
 var inputs = document.getElementsByTagName('input'); 
 for (var i = 0; (input = inputs[i]); i++) { 
   addEvent(input, 'focus', oninputfocus); 
   addEvent(input, 'blur', oninputblur); 
 } 
 var textareas = document.getElementsByTagName('textarea'); 
 for (var i = 0; (textarea = textareas[i]); i++) { 
   addEvent(textarea, 'focus', oninputfocus); 
   addEvent(textarea, 'blur', oninputblur); 
 } 
}); 
function oninputfocus(e) { 
 /* Cookie-cutter code to find the source of the event */ 
 if (typeof e == 'undefined') { 
   var e = window.event; 
 } 
 var source; 
 if (typeof e.target != 'undefined') { 
    source = e.target; 
 } else if (typeof e.srcElement != 'undefined') { 
    source = e.srcElement; 
 } else { 
   return; 
 } 
 /* End cookie-cutter code */ 
} 
function oninputblur(e) { 
 /* Cookie-cutter code to find the source of the event */ 
 if (typeof e == 'undefined') { 
   var e = window.event; 
 } 
 var source; 
 if (typeof e.target != 'undefined') { 
    source = e.target; 
 } else if (typeof e.srcElement != 'undefined') { 
    source = e.srcElement; 
 } else { 
   return; 
 } 
 /* End cookie-cutter code */ 
 source.style.border='1px solid #ccc'; 
} 

function addEvent(obj, evType, fn){ 
 if (obj.addEventListener){ 
   obj.addEventListener(evType, fn, true); 
   return true; 
 } else if (obj.attachEvent){ 
   var r = obj.attachEvent("on"+evType, fn); 
   return r; 
 } else { 
   return false; 
 } 
}