<!--
// remove frames
// if (parent.frames.length > 0) {parent.location.href = location.href;}
var ButtonPressed = false;
var theForm = '';
var action_div_filler_text;
var HideSelectBoxes = 0;
var PLUS = new Image(); PLUS.src = '/graphics_uc/boards/plus.gif';
var MINUS = new Image(); MINUS.src = '/graphics_uc/boards/minus.gif';
var BIG_PLUS = new Image(); BIG_PLUS.src = '/graphics_uc/plus.gif';
var BIG_MINUS = new Image(); BIG_MINUS.src = '/graphics_uc/minus.gif';
function disableButton(button) {
   if (!ButtonPressed){
        button.value ="  Please wait ...  ";
        button.disabled = true;
        ButtonPressed = true;
        return true;
   } else {
        return false;
   }
}
function openpopup(popURL,popScrollbars,popWidth,popHeight,popName) {
if (!popURL) { return false }
if (!popScrollbars) { popScrollbars = 'yes' }
if (!popWidth) { popWidth = '450' }
if (!popHeight) { popHeight = '500' }
if (!popName) { popName = 'popupwindow' }
var popString = 'scrollbars='+popScrollbars+',width='+popWidth+',height='+popHeight;
popupWindow=open(popURL,popName,popString)
if (popupWindow==null || typeof(popupWindow)=="undefined") alert("Oops! It looks like your browser has blocked the pop-up window from being displayed.");
if (popupWindow.opener == null) popupWindow.opener = self;
}
function di(id,name){
  if (document.images) {document.images[id].src=eval(name+".src"); }
}
// function that displays status bar message
function dm(msgStr) {
  document.returnValue = false;
  if (document.images) { 
     window.status = msgStr;
     document.returnValue = true;
  }
}
var showMsg = navigator.userAgent != "Mozilla/4.0 (compatible; MSIE 4.0; Mac_PowerPC)";
function dmim(msgStr) {
  document.returnValue = false;
  if (showMsg) { 
    window.status = msgStr;
    document.returnValue = true;
  }
}
function getRefToDiv(divID) {
    if( document.layers ) { //Netscape layers
        return document.layers[divID]; }
    if( document.getElementById ) { //DOM; IE5, NS6, Mozilla, Opera
        return document.getElementById(divID); }
    if( document.all ) { //Proprietary DOM; IE4
        return document.all[divID]; }
    if( document[divID] ) { //Netscape alternative
        return document[divID]; }
    return false;
}
function ShowDiv(divID_as_string) {
    // browser-compatible-de-referencing
    var current_div = getRefToDiv(divID_as_string);
    if( !current_div ) {
        return false; //don't go any further
    }
    if( current_div.style ) { //DOM & proprietary DOM
        current_div.style.visibility = 'visible';
        current_div.style.position = 'relative';
    } else {
        if( current_div.visibility ) { // Netscape
            current_div.visibility = 'show';
            current_div.position = 'relative';
        } else {
            return false; // stop - no further
        }
    }
    return true;
}
function HideDiv(divID_as_string) {
    // browser-compatible-de-referencing
    var current_div = getRefToDiv(divID_as_string);
    if( !current_div ) {
        return false; //don't go any further
    }
    if( current_div.style ) { //DOM & proprietary DOM
        current_div.style.visibility = 'hidden';
        current_div.style.position = 'absolute';
    } else {
        if( current_div.visibility ) { // Netscape
            current_div.visibility = 'hidden';
            current_div.position = 'absolute';
        } else {
            return false; // stop - no further
        }
    }
    return true;
}
function ShowRowDiv(divID_action,divID_text,image_ID) {
    // browser-compatible-de-referencing 
    action_div = getRefToDiv(divID_action);
    text_div = getRefToDiv(divID_text);
    if( !action_div || !text_div ) {
        return false; // Go No Further!
    }
	if ( OpenClose[divID_action] == 0 ) {
		// Div is Closed --> Open
		action_div.innerHTML = text_div.innerHTML;
		OpenClose[divID_action] = 1;
		di(image_ID,'MINUS');
	} else {
		if ( !action_div_filler_text ) {
			action_div.innerHTML = '&nbsp;';
		} else {
			action_div.innerHTML = action_div_filler_text;
		}
		OpenClose[divID_action] = 0;
		di(image_ID,'PLUS');
	}
	return true;
}
function ShowHideDiv(divID_as_string,image_ID,big_or_small) {
    // browser-compatible-de-referencing
    var current_div = getRefToDiv(divID_as_string);
    if( !current_div ) {
        return false; //don't go any further
    }
    if( current_div.style ) { //DOM & proprietary DOM
		if (current_div.style.visibility == 'visible' ) {
			HideDiv(divID_as_string);
			if (image_ID ) {
				if (big_or_small == '1') {
					di(image_ID,'BIG_PLUS');
				} else {
					di(image_ID,'PLUS');
				}
			}
		} else {		
			ShowDiv(divID_as_string);
			if (image_ID ) {
				if (big_or_small == '1') {
					di(image_ID,'BIG_MINUS');
				} else {
					di(image_ID,'MINUS');
				}
			}
		}
    } else {
        if( current_div.visibility ) { // Netscape
            if ( current_div.visibility == 'show' ) {
				HideDiv(divID_as_string);
				if (big_or_small == '1') {
					di(image_ID,'BIG_PLUS');
				} else {
					di(image_ID,'PLUS');
				}
			} else {		
				ShowDiv(divID_as_string);
				if (big_or_small == '1') {
					di(image_ID,'BIG_MINUS');
				} else {
					di(image_ID,'MINUS');
				}
			}
        } else {
            return false; // stop - no further
        }
    }
    return true;
}
function changeRowStyle(style_name,tr_id) {
	if ( style_name && tr_id ) {
		var row = document.getElementById(tr_id);
		if ( row ) {
			var cells = row.getElementsByTagName("td");  
			if ( cells ) {
				for(iCount = 0; iCount < cells.length; iCount++) {
					cells[iCount].className = style_name;
				}
			}
		}
	}
}
function cs(element_id,new_style) {
	var itemid = getRefToDiv(element_id);
	if ( !itemid ) { return false; }
	if ( !new_style) { return false; }
	itemid.className = new_style;
}
function replace(s, t, u) {
// Replace a token in a string
// s  string to be processed
// t  token to be found and removed
// u  token to be inserted
// returns new String
i = s.indexOf(t);
r = "";
if (i == -1) return s;
r += s.substring(0,i) + u;
if ( i + t.length < s.length)
r += replace(s.substring(i + t.length, s.length), t, u);
return r;
}
function right(s, n) {
if (n <= 0)
return "";
else if (n > String(s).length)
return s;
else {
var iLen = String(s).length;
return String(s).substring(iLen, iLen - n);
}
}
function Left(s, n) {
if (n <= 0)
return "";
else if (n > String(s).length)
return s;
else
return String(s).substring(0,n);
}
function Mix(c1,c2){
var i,step1,step2,x,y,r=new Array(3);
if(c1.length==4)step1=1;
else step1=2;
if(c2.length==4) step2=1;
else step2=2;
for(i=0;i<3;i++){
    x=parseInt(c1.substr(1+step1*i,step1),16);
    if(step1==1) x=16*x+x;
    y=parseInt(c2.substr(1+step2*i,step2),16);
    if(step2==1) y=16*y+y;
    r[i]=Math.floor((x*50+y*50)/100);
    }
return("#"+r[0].toString(16)+r[1].toString(16)+r[2].toString(16));
}
function deleteComm(table_id,tr_id,comm_id) {
var CommControlForm = window.frames['CommFrame'].document.forms['CommControlForm'];
if (CommControlForm) {
CommControlForm.table_id.value = table_id;
CommControlForm.tr_id.value = tr_id;
CommControlForm.comm_id.value = comm_id;
window.frames['CommFrame'].document.forms['CommControlForm'].submit();
}
}
function deleteTableRow(table_id,tr_id) {
if ( table_id && tr_id ) {
var table = parent.document.getElementById(table_id);
if (table ) {
var rows = table.getElementsByTagName("tr");
for(i = 0; i < rows.length; i++) {
if ( rows[i].id == tr_id ) {
var tr_index = i;
}
}
if ( tr_index ) {
table.deleteRow(tr_index);
}
}
}
}
function DoGenFrame(SI,CRN,MN) {
document.write('<DIV ID="hideframe" NAME="hideframe" STYLE="visibility:hidden;position:absolute;top:1px;left:1px;width:1px;height:1px;">');
document.write('<IFRAME border="0" SRC="/secure/' + SI + '/' + CRN + '/shortform/genfun.htm" NAME="GenFrame" ID="GenFrame"></IFRAME>');
document.write('</DIV>');
}
function openActivityWindow(SI,CRN,lessonid) {
var activitywin=dhtmlwindow.open("activitybox", "iframe", "/secure/" + SI + "/" + CRN + "/shortform/lessontodo.htm?LessonID="+lessonid, "Please complete related lesson activities.", "width=525px,height=475px,resize=1,scrolling=1,center=1", "recal");
}
function openAssignmentWindow(SI,CRN,lessonid,assignmentid,atitle) {
var activitywin=dhtmlwindow.open("assignmentbox" + assignmentid, "iframe", "/secure/" + SI + "/" + CRN + "/shortform/assignment.htm?AssignmentID=" + assignmentid + "&LessonID="+lessonid, "Assignment: " + atitle, "width=500px,height=450px,resize=1,scrolling=1,center=1", "recal");
}
function openPollWindow(SI,CRN,lessonid,pollid,ptitle) {
var activitywin=dhtmlwindow.open("pollbox" + pollid, "iframe", "/secure/" + SI + "/" + CRN + "/shortform/poll.htm?PollID=" + pollid + "&LessonID="+lessonid, "Poll: " + ptitle, "width=475px,height=425px,resize=1,scrolling=1,center=1", "recal");
}
function openNetLinkWindow(SI,CRN,lessonid,netlinkid,nurl,ntitle) {
var activitywin=dhtmlwindow.open("netlinkbox" + netlinkid, "iframe", "/secure/" + SI + "/" + CRN + "/shortform/netlink.htm?NetlinkID=" + netlinkid + "&LessonID="+lessonid, "NetLink: " + ntitle, "width=640px,height=480px,resize=1,scrolling=1,center=1", "recal");
}
function openLessonComplete(SI,CRN,lessonid,prelessonid) {
var activitywin=dhtmlwindow.open("lessoncomplete" + prelessonid, "iframe", "/secure/" + SI + "/" + CRN + "/shortform/congrats.htm?flag=lessoncomplete&LessonID=" + prelessonid, "You successfully completed a class lesson!", "width=640px,height=480px,resize=1,scrolling=1,center=1", "recal");
}
function openFileUploadWindow(SI,CRN,lessonid,fileuploadid,filename) {
var activitywin=dhtmlwindow.open("fileupload" + fileuploadid, "iframe", "/secure/" + SI + "/" + CRN + "/shortform/fileupload.htm?FileUploadID=" + fileuploadid + "&LessonID="+lessonid, "Document: " + filename, "width=600px,height=500px,resize=1,scrolling=1,center=1", "recal");
}
function openEAStatusWindow(SI,CRN,lessonid,examid,assignmentid,eatitle,emailid) {
var activitywin=dhtmlwindow.open("eastatus" + examid + assignmentid, "iframe", "/secure/" + SI + "/" + CRN + "/shortform/eastatus.htm?assignmentid=" + assignmentid + "&examid=" + examid + "&LessonID="+lessonid+"&EmailID="+emailid, "View Status: " + eatitle, "width=500px,height=500px,resize=1,scrolling=1,center=1", "recal");
}
function changePicture(SI,CRN,lessonid,eatitle) {
var activitywin=dhtmlwindow.open("picture" + lessonid, "iframe", "/next_uc/fileupload/profilepicture.aspx?SiteID=" + SI + "&CRN=" + CRN, "Change Member Picture: " + eatitle, "width=500px,height=450px,resize=1,scrolling=1,center=1", "recal");
}
function hideElement (elementId) {
var element;
if (document.all)
element = document.all[elementId];
else if (document.getElementById)
element = document.getElementById(elementId);
if (element && element.style)
element.style.display = 'none';
}
function showElement (elementId) {
var element;
if (document.all)
element = document.all[elementId];
else if (document.getElementById)
element = document.getElementById(elementId);
if (element && element.style)
element.style.display = '';
}
//-->
