/*This script provides the following:
1. Instructors by course.
2. The clearText function.
3. The 'no right click function.
4. The 'checkEmail function for SurveyGold pages.
5. The showtip and hidetip functions. 
6. The first routine checks the user's browser. */

if(document.getElementById){;}
else{
alert("Your browser version will not run important routines.\nPlease upgrade before continuing.");
}

//Disables right click
function click(e){if (document.all) if (event.button == 2) return false;if
(document.layers) if (e.which == 3) return false;}

function click2(){event.returnValue=false;return false;}if (document.layers)
document.captureEvents(Event.MOUSEDOWN);document.onmousedown=click;document.oncontextmenu=click2;
//end both right click functions

var Teachers = new Array() 
/*Arrays to set course and the instructor's name, Email and biography link.  It also sets
the course pages for the instructor. ALWAYS use this exact format.*/
Teachers["XXX"]= new Array("Title set as XXX", " ", " ", " ");
Teachers["AJ41"]= new Array("Dave Balch", "dbalch@riohondo.edu","balch.htm","aj41Units.htm");
Teachers["AJ41A"]= new Array("John S. Bryan", "jsb321@juno.com", "jsbbio.htm", "aj41Units.htm");
Teachers["AJ42"]= new Array("TBA", "TBA", "UnderCons.htm", "aj42Units.htm");
Teachers["AJ101"]= new Array("Jim Newman", "jnewman@riohondo.edu", "UnderCons.htm", "aj101units.htm");
Teachers["AJ101A"]= new Array("Don Mason", "dmason@riohondo.edu", "don_mason.htm", "aj101Units.htm");
Teachers["AJ102"]= new Array("G. Kimber", "kimbergeorge@hotmail.com", "UnderCons.htm", "aj102Units.htm");
Teachers["AJ104"]= new Array("Don Mason", "masondon681@hotmail.com", "don_mason.htm", "aj104Units.htm");
Teachers["AJ105"]= new Array("Barry Dineen", "bdineen@riohondo.edu", "UndersCons.htm", "../../ajNoQuiz/aj105Units.htm");
Teachers["AJ106"]= new Array("George Kimber", "kimbergeorge@hotmail.com", "Geo_k.htm", "aj106Units.htm");
Teachers["AJ107"]= new Array("Carley Mitchell", "MitchellCarley@hotmail.com","Mitchell.htm", "aj107Units.htm");
Teachers["AJ108"]= new Array("TBA", "TBA", "UnderCons.htm", "aj108Units.htm");
Teachers["AJ134"]= new Array(" TBA", "TBA", "UnderCons.htm", "aj134Units.htm");
Teachers["AJ205"]= new Array("TBA", "TBA", "UnderCons.htm", "aj205Units.htm");
Teachers["AJ207"]= new Array("Bob Feliciano", "bfeliciano@riohondo.edu", "TBA", "../../ajNoQuiz/aj207Units.htm");
Teachers["AJ208"]= new Array("Dave Balch", "debalch@hotmail.com", "balch.htm", "aj208Units.htm");
Teachers["AJ215"]= new Array("Jim Newman", "jnewman@riohondo.edu", "UnderCons.htm", "aj215Units.htm");
Teachers["AJ228"]= new Array("Jim Newman","jnewman@riohondo.edu", "UnderCons.htm", "aj228Units.htm");
Teachers["AJ250"]= new Array("Jim Newman", "jnewman@riohondo.edu", "UnderCons.htm", "aj250Units.htm");
Teachers["AJ275"]= new Array("Jim Newman", "jnewman@riohondo.edu", "UnderCons.htm", "aj275Units.htm");
Teachers["CORR101"]= new Array("B. Dineen", "bdineen@riohondo.edu", "UnderCons.htm", "../../coNoQuiz/corr101Units.htm");
Teachers["CORR104"]= new Array("D. Balch", "debalch@hotmail.com", "balch.htm", "../../coNoQuiz/corr104Units.htm");
Teachers["CORR104A"]= new Array("D. Balch", "debalch@hotmail.com", "balch.htm", "corr104Units.htm");
Teachers["CORR106"]= new Array("D. Balch", "debalch@hotmail.com", "balch.htm", "corr106Units.htm");
Teachers["CORR134"]= new Array("D. Balch",  "debalch@hotmail.com", "balch.htm", "corr134Units.htm");
Teachers["CORR208"]= new Array("D. Balch", "debalch@hotmail.com", "balch.htm", "../../coNoQuiz/corr208Units.htm");
Teachers["CORR209"]= new Array("D. Balch", "debalch@hotmail.comt", "balch.htm", "../../coNoQuiz/corr209Units.htm");
Teachers["CORR210"]= new Array("D. Balch", "debalch@hotmail.com", "balch.htm", "corr210Units.htm");
Teachers["CORR235"]= new Array("D. Mason", "masondon681@hotmail.com", "don_mason.htm","corr235Units.htm");
Teachers["CORR264"]= new Array("D. Balch", "debalch@hotmail.com", "balch.htm", "corr264Units.htm");
Teachers["CORR265"]= new Array("D. Balch", "debalch@hotmail.com", "UnderCons.htm", "corr265Units.htm");
Teachers["CORR290"]= new Array("D. Balch", "debalch@hotmail.com", "TBA", "corr290Units.htm");


function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
} // end function

function checkEmail(email){
var atSymbAt = email.indexOf('@');
var lastDotAt = email.lastIndexOf('.');
var spaceAt = email.indexOf(' ');
var len = email.length;
  if (atSymbAt < 1
   || lastDotAt < 0
   || len-atSymbAt <=2
   || spaceAt > -1
   || len-lastDotAt <=2
   || lastDotAt < atSymbAt){
   alert("Your e-mail is not the correct format.");
 } // end if
} // end checkEmail

// WIZ SHOWTIP
//Set the tool tip message you want for each link here.
var tip=new Array
tip[0]="Enter your complete e-mail address.&nbsp;&nbsp;The proper format is username+@sign+domain+dot+extension.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Example: TheWizard@someplace.net";
tip[1]="Enter the name as registered under at the College.";
tip[2]="Enter the last four digits of your student identification number.";
tip[3]="Enter the proctor's name and title, or 'not required.' (whichever is applicable.)"; 
tip[4]="Please comment on any of your responses--positive or negative.<br> If there is an area that was not asked about feel free to comment on it here.";
tip[5]="Take a moment to review your ratings.<br><br>When this button is clicked the survey is sent to the College and the form is cleared of all responses. The survey is routed through the server at SurveyGold and may take a moment or two--be patient.";
tip[6]="Enter the exact password. Avoid putting in extra spaces or characters.<br>It is ok to use upper or lowercase letters.";
tip[7]="Click the button to review the questions. The review page and the address of the full exam will be shown to you. Note: The Instructor will be advised you have begun the review.";
tip[8]="The instructor's name is on the desktop page.";
tip[9]="";
tip[10]="";

  function showtip(current,e,num){
         if (document.layers) // Netscape 4.0+
            {
             theString="<DIV CLASS='ttip'>"+tip[num]+"</DIV>"
             document.tooltip.document.write(theString)
             document.tooltip.document.close()
             document.tooltip.left=e.pageX+44
             document.tooltip.top=e.pageY+45
             document.tooltip.visibility="show"
            }
         else
           {
            if(document.getElementById) // Netscape 6.0+ and Internet Explorer 5.0+
              {
               elm=document.getElementById("tooltip")
               elml=current
               elm.innerHTML=tip[num]
               elm.style.height=elml.style.height
               elm.style.top=parseInt(elml.offsetTop+elml.offsetHeight)
               elm.style.left=parseInt(elml.offsetLeft+elml.offsetWidth+10)
               elm.style.visibility = "visible"
              }
           }
        }
function hidetip(){
if (document.layers) // Netscape 4.0+
   {document.tooltip.visibility="hidden"}
else{
 if(document.getElementById) // Netscape 6.0+ and Internet Explorer 5.0+
     {
      elm.style.visibility="hidden"
     }
  } 
}
// end showtip
