<!--
//var CONST_LOCATION = "/public/";
var modifiedStatus = false;
var formFocus = false;
var checkModifiedMessage = 'You may have changed page content without saving. \nClick OK to continue without saving (any changes will be lost), \nor cancel to go back and click save.'

/* this function is used by the student/instructor portal login tabs for the new stanford tabs
 * Do
 */
/*
var userType="logonStudent";

function submitUser() {
  var form = document.forms[1];
  form.method.value=userType;
  form.submit();
  return false;
}

*/
/*
This function is in stanfordGeneral.js and consequently part
of all template forms.  Please do not add this function here.

function changeClass(elementVar, classNameVar) {
    elementVar.className=classNameVar;
    return false;
}
*/

/* 
These functions may be needed for the course browser if it is ever 
decided to implemented
function changeImg(imgNam, onoff){
	if(document.images){	
		if (onoff == 'on')
                    onoff = 'On';
                else if (onoff == 'off')
                    onoff = 'Off';
                else if (onoff == 'over')
                    onoff = 'On';
		document.images[imgNam].src=eval(imgNam+onoff+'.src');
	}
}



function changeImg1(imgNam, imgSrc, onoff){
	if (document.images) {
		document.images[imgNam].src=eval(imgSrc+onoff+'.src');
	}
}
*/

function hyperlinkjump(form) {
  parent.refresh;
  var myindex=form.quickinfo.selectedIndex
  if (myindex==0) return false;
  if (form.quickinfo.options[myindex].value.indexOf("http://")!=-1) {
    form.target="_blank";
  } else {
    form.target="_self";
  }
  if (form.quickinfo.options[myindex].value!="") {
    form.action=form.quickinfo.options[myindex].value;
    form.submit();
    return true;
  }
  return false;
}

// side menu arrow bullets

function act(imgName) {
  if (document.images)
     document.images[imgName.name].src = linkon.src;
}

function inact(imgName) {
  if (document.images)
     document.images[imgName.name].src = linkoff.src;
}    

var popF;
function centeredPopup(page, popWidth, popHeight, close_only, properties) {

  if (properties==null) { properties=",resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,top="}
	if ( popF && !popF.closed && popF.close ) {
		popF.close();
	}
	if ( !close_only ) {
		if (popWidth==null) { popWidth=400 }
		if (popHeight==null) { popHeight=400 }
 	    winX=(screen.width-popWidth)/2
	    winY=(screen.height-popHeight)/2      
      popF = window.open(page, "Window", "width="+ popWidth + ",height=" + popHeight + properties +winY+",left="+winX);
  } 
}

function create() {
        this.width = ''
        this.height = ''
        this.src = ''
        this.href = ''
        this.border = ''
        this.mouseover = ''
        this.sponsor = ''
}



function setModifiedStatus() {
  modifiedStatus = true
}

function checkModifiedStatus() {
  if (formFocus==false) {
    return true;
  }
  if (modifiedStatus==true) {
    if (confirm(checkModifiedMessage)) {
      return true;
    }
    return false;
  }

}  

function initFormFocus(formNumber) {
  if (formFocus==true) {
    if (document.forms[formNumber]!=null) {
      for(i=0;i<document.forms[formNumber].elements.length;i++) {
          document.forms[formNumber].elements[i].onfocus=setModifiedStatus;
      }
    }
  }
}

function gotoLink (linkValue) {
    document.location=linkValue;
    return true;
}
//-->
