<!--


function open_window(url) {
popup = window.open(url,"popup","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=yes,resizable=yes,width=480,height=410");
    if (!popup.opener)
        popup.opener=self;
    popup.focus();
} 

function monitor() {
var counter=0;
counter++;
if(counter>1) {return false;}
return true;
} 
function open_window2(url) {
popup = window.open(url,"popup","toolbar=1,location=0,directories=0,status=1,menubar=1,scrollbars=yes,resizable=yes,width=510,height=410");
popup.focus();
}

function openramosus(url, name, width, height)
{  popupWin = window.open(url,name,'width=' + width + ',height=' + height + ',scrollbars=yes,toolbar=no,resizable=yes,menubar=no,location=no,status=yes,screenX=50,screenY=50,top=50,left=50')
    if (!popupWin.opener)
        popupWin.opener=self;
    popupWin.focus();
}
function openpopup(url, name, width, height)
{  popupWin = window.open(url,name,'width=' + width + ',height=' + height + ',scrollBars=yes,toolbar=no,resizable=yes,location=0,status=0,screenX=50,screenY=50,top=50,left=50')
    if (!popupWin.opener)
        popupWin.opener=self;
    popupWin.focus();
}

function openpopup2(url, name, width, height, toolbar)
{  popupWin = window.open(url,name,'width=' + width + ',height=' + height + ',scrollBars=auto,toolbar='+toolbar+',resizable=yes,location=0,status=0,screenX=150,screenY=50,top=50,left=150')
    if (!popupWin.opener)
        popupWin.opener=self;
    popupWin.focus();
}

function openpopup3(mylink, name, percent, toolbar){
    var w = 650, h = 450; // default sizes
    var winleft = 50
    var winUp = 50
    if (window.screen) {
        w = window.screen.availWidth * percent / 100;
        h = window.screen.availHeight * percent * 1.5/ 100;
        winleft = (window.screen.availWidth - w) / 2;
        winUp = (window.screen.availHeight - h) / 2;
    }
    var href;
    if (typeof(mylink) == 'string')
       href=mylink;
    else
       href=mylink.href;
       
    popupWin3 = window.open(href,name,'width=' + w + ',height=' + h + ',scrollBars=yes,toolbar='+toolbar+',resizable=yes,location=0,status=0,screenX='+winleft+',screenY='+winUp+',top='+winUp+',left='+winleft+'')
    if (!popupWin3.opener)
        popupWin3.opener=self;
    popupWin3.focus();
}

/*ex. submitjs.inc*/
function setFocus() {
    if (document.activity)
    if (document.activity.elements[0].type == "text" || document.activity.elements[0].type == "textarea")
    document.activity.elements[0].focus();
}
var thechoice = null;
function checkresponse(form){
    var msg;
    var noErrors=true;
    if(thechoice==""||thechoice==null||thechoice=="0"){
    msg="Please choose an option\nfrom the dropdown box\nbefore clicking.";
        noErrors=false;}
    if(noErrors){
        return true;}
    else{
        alert(msg);
        return false;}
}
function checkselectstudent(form){
    var msg;
    var noErrors=true;
    if(thechoice==""||thechoice==null||thechoice=="0"){
    msg="You must select at least\none student's name\nbefore clicking.";
        noErrors=false;}
    if(noErrors){
        return true;}
    else{
        alert(msg);
        return false;}
}


function expandEditbox(poButton, pcEditboxID, pnMaxRows)
{
	var loEditbox = document.getElementById(pcEditboxID);
	if(!loEditbox.disabled)
	{
		loEditbox.rows = Math.min(loEditbox.rows + 5, pnMaxRows);
	
		if(loEditbox.rows == pnMaxRows)
		{
			poButton.style.display = "none";
		}
	}
	return true;
}

function setLanguage(s) {
    target = 'switchLang'
    url = 'scripts/language.asp?id=' + s 
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.open("GET", url, false);
        req.send(null);
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.open("GET", url, true);
            req.send();
        }
    }
}    

$(document).ready(function() {
    // $('#jqlist').find('dd').hide();
   //  $('#jqlist').find('dt').click(function() {
    //     var answer = $(this).find('+dd');
     //    if (answer.is(':visible')) {
    //         answer.slideUp('slow');
    //     } else {
    //         answer.slideDown('slow');
    //     }
    // });
    //$('#jq').find('div').hide();    
    //$('#jq').find('a').click(function(){
    //     var z = $(this).find('div');
    //     if (z.is(':visible')) {
    //         z.slideUp('slow');
             //alert("up")
    //     } else {
   //          $('#jq').find('div').slideDown('slow');
             //alert("down")
   //      }
   //      return false;   
   // });     
    //$('a').ToolTip('inputsTooltip',{position: 'top'});
    
});

function showStuff() {
         var z = $('#jq').find('div:hidden');
         if (z.is(':visible')) {
             z.slideUp('slow');
         } else {
             z.slideDown('slow');
         }
}
function jqGetContent(script,z,el){
$.post("scripts/ajax_"+script+".asp",{s:z},function(q){$(el).html(q);});
}
var cel = null;
function toggleContent(el){
		if (cel) {
			$('#' + cel).slideUp('slow');
		}
	if (el != cel) {
		cel = el;
		$('#' + cel).slideDown('slow');
	} else {
		cel = null;
	}
	return false;
}
jQuery.fn.focusFirstInput = function(){

  // If there's a form on the page, then set focus to the first visible input element

  var e = $('form input:visible');

  if(e && e.get(0)){e.get(0).focus();}  

}



jQuery.fn.fadeIn = function(speed, callback) { 
    return this.animate({opacity: 'show'}, speed, function() { 
        if (jQuery.browser.msie)  
            this.style.removeAttribute('filter');  
        if (typeof callback == 'function')  
            callback();  
    }); 
}; 

 

jQuery.fn.fadeOut = function(speed, callback) { 
    return this.animate({opacity: 'hide'}, speed, function() { 
        if (jQuery.browser.msie)  
            this.style.removeAttribute('filter');  
        if (typeof callback == 'function')  
            callback();  
    }); 
}; 

 

jQuery.fn.fadeTo = function(speed,to,callback) { 
    return this.animate({opacity: to}, speed, function() { 
        if (to == 1 && jQuery.browser.msie)  
            this.style.removeAttribute('filter');  
        if (typeof callback == 'function')  
            callback();  
    }); 
}; 

// end hiding scripting -->