
function ToggleDiv(divId,imgId,showImgSrc,hideImgSrc){var TargetDiv;var TargetImg;var ShowImgSrc="../images/block_opened.gif";var HideImgSrc="../images/block_closed.gif";TargetDiv=document.getElementById(divId);if(imgId)TargetImg=document.getElementById(imgId);if(showImgSrc)ShowImgSrc=showImgSrc;if(hideImgSrc)HideImgSrc=hideImgSrc;if(TargetDiv.style.display==""){TargetDiv.style.display="none";if(TargetImg)
TargetImg.setAttribute("src",HideImgSrc);TargetImg.setAttribute("alt","Hide details");}else{TargetDiv.style.display="";if(TargetImg)
TargetImg.setAttribute("src",ShowImgSrc);TargetImg.setAttribute("alt","Show details");}}
function HideDiv(divId,imgId,hideImgSrc){var TargetDiv;var TargetImg;var HideImgSrc="../images/block_closed.gif";TargetDiv=document.getElementById(divId);if(imgId)TargetImg=document.getElementById(imgId);if(hideImgSrc)HideImgSrc=hideImgSrc;TargetDiv.style.display="none";if(TargetImg)
{TargetImg.setAttribute("src",HideImgSrc);TargetImg.setAttribute("alt","Hide details");}}
function ShowDiv(divId,imgId,showImgSrc){var TargetDiv;var TargetImg;var ShowImgSrc="../images/block_opened.gif";TargetDiv=document.getElementById(divId);if(imgId)TargetImg=document.getElementById(imgId);if(showImgSrc)ShowImgSrc=showImgSrc;TargetDiv.style.display="";if(TargetImg)
{TargetImg.setAttribute("src",ShowImgSrc);TargetImg.setAttribute("alt","Show details");}}
function HideAllDiv(divIds,imgIds,hideImgSrc){for(var i=0;i<divIds.length;i++)
{if(imgIds)
HideDiv(divIds[i],imgIds[i],hideImgSrc);else
HideDiv(divIds[i],null,hideImgSrc);}}
function ShowAllDiv(divIds,imgIds,showImgSrc){for(var i=0;i<divIds.length;i++)
{if(imgIds)
ShowDiv(divIds[i],imgIds[i],showImgSrc);else
ShowDiv(divIds[i],null,showImgSrc);}}
var SchoolNetLogoutTimer=-1;function ResetTimer(session_timeout,logout_url,analyze_logout_url)
{var timeout=session_timeout*60000;if(timeout>120000)
SetTimeout("displayLogout('"+logout_url+"', '"+analyze_logout_url+"')",timeout-120000);else
SetTimeout("logoutNow('"+logout_url+"', '"+analyze_logout_url+"')",timeout);}
function ClearTimeout()
{window.clearTimeout(SchoolNetLogoutTimer);}
function SetTimeout(expression,msec)
{ClearTimeout();SchoolNetLogoutTimer=window.setTimeout(expression,msec);}
function logoutNow(logout_url,analyze_logout_url)
{self.focus();if(window.parent!=null)
{if(analyze_logout_url.length>0)
{window.parent.location.replace(analyze_logout_url);if(window.parent!=null)
{window.parent.location.replace(logout_url);}
else
{window.location.replace(logout_url);}}
else
window.parent.location.replace(logout_url);}
else
{window.location.replace(logout_url);}}
function displayLogout(logout_url,analyze_logout_url)
{self.focus();var then=new Date().getTime();if(confirm("Your session has been inactive and will time out in two minutes.\n\nTo stay logged in, click 'OK' and then save any content you are adding/editing. Click 'Cancel' to log out immediately.\n\nIf you are not editing content, you can click the 'Reload' button on your browser \nor go to a different page to stay active.")){var now=new Date();if(now-then<120000){SetTimeout("logoutNow('"+logout_url+"', '"+analyze_logout_url+"')",120000-(now-then));}else{logoutNow(logout_url,analyze_logout_url);}}else{logoutNow(logout_url,analyze_logout_url);}}
function PageSubmit()
{if((typeof(WebForm_OnSubmit)=="function"))
{return WebForm_OnSubmit();}
return true;}
function openHelpWindow(helpTopic,appId,applicationPath)
{var widthPx=800;var heightPx=600;var leftPx=(screen.width/2)-(widthPx/2);var topPx=(screen.height/2)-(heightPx/2);window.open(applicationPath+'/MainHelp.aspx?topic='+helpTopic+'&app_id='+appId,'SchoolNetHelp','width='+widthPx+',height='+heightPx+',scrollbars=yes,resizable=yes,toolbar=no,personalbar=no,left='+leftPx+', top='+topPx);}
function openDiagnostics(diagnosticsURL,versionString)
{var majorVersion=versionString.split(".")[0];window.open(diagnosticsURL+"?ims="+majorVersion,"SnDiagnostics","width=640,height=480,scrollbars=yes,resizable=yes,toolbar=no,personalbar=no,left=0,top=0")}
var CheckBoxManager=function(){return{_checkBoxes:function(){var checkBoxes=[];var elm=document.forms[0].elements;for(i=0;i<elm.length;i++)
if(elm[i].type=="checkbox"&&elm[i].disabled==false)
checkBoxes.push(elm[i]);return checkBoxes;},_changeAll:function(selectThem){var checkBoxes=this._checkBoxes();for(var i=0;i<checkBoxes.length;i++){if((checkBoxes[i].checked&&selectThem)||(!checkBoxes[i].checked&&!selectThem))
continue;checkBoxes[i].checked=!selectThem;checkBoxes[i].click();}},selectAll:function(){this._changeAll(true);},deselectAll:function(){this._changeAll(false);}}}();var BenchmarkManager=function(){return{_loop:function(ar,fn){for(var i=0;i<ar.length;i++)
fn(ar[i]);},_hide:function(el){el.style.display="none";},_show:function(el){el.style.display="";},_getEl:function(id){return document.getElementById(id);},_makeRowGray:function(el){el.className="TeacherRow";},_makeRowBlue:function(el){el.className="SectionRow";},_startsWith:function(stringToSearch,substring){return stringToSearch.indexOf(substring)==0;},_getAllRows:function(){return document.getElementsByTagName("TR");},_getAllSpans:function(){return document.getElementsByTagName("SPAN");},_getSectionRows:function(){var sectionRows=[];var allRows=this._getAllRows();for(var i=0;i<allRows.length;i++)
if(this._startsWith(allRows[i].id,"SectionRow_"))
sectionRows.push(allRows[i]);return sectionRows;},_getTeacherRows:function(){var teacherRows=[];var allRows=this._getAllRows();for(var i=0;i<allRows.length;i++)
if(this._startsWith(allRows[i].id,"TeacherRow_"))
teacherRows.push(allRows[i]);return teacherRows;},_getTeacherLinks:function(){var links=[];var spans=document.getElementsByTagName("span");for(var i=0;i<spans.length;i++)
if(spans[i].className=="TeacherLink")
links.push(spans[i]);return links;},_expandCollapseTeacherLinks:function(expanding){var teacherLinks=this._getTeacherLinks();for(var k=0;k<teacherLinks.length;k++){var isExpandLink=this._startsWith(teacherLinks[k].id,"expand_");var isCollapseLink=this._startsWith(teacherLinks[k].id,"hide_");if((expanding&&isExpandLink)||(!expanding&&isCollapseLink))
this._hide(teacherLinks[k]);else if((expanding&&isCollapseLink)||(!expanding&&isExpandLink))
this._show(teacherLinks[k]);}},expandAllBenchmarks:function(){this._loop(this._getSectionRows(),this._show);this._loop(this._getTeacherRows(),this._makeRowBlue);this._expandCollapseTeacherLinks(true);},_getRowsStartsWith:function(str){var Rows=[];var allRows=this._getAllRows();for(var i=0;i<allRows.length;i++)
if(this._startsWith(allRows[i].id,str))
Rows.push(allRows[i]);return Rows;},_getSpansStartsWith:function(str){var Rows=[];var allRows=this._getAllSpans();for(var i=0;i<allRows.length;i++)
if(this._startsWith(allRows[i].id,str))
Rows.push(allRows[i]);return Rows;},expandAllCourses:function(){this._loop(this._getTeacherRows(),this._show);this._loop(this._getSectionRows(),this._show);this._loop(this._getTeacherRows(),this._makeRowBlue);this._loop(this._getSpansStartsWith("c_expand_"),this._hide);this._loop(this._getSpansStartsWith("c_hide_"),this._show);this._loop(this._getSpansStartsWith("expand_"),this._hide);this._loop(this._getSpansStartsWith("hide_"),this._show);},expandOne:function(id){this._loop(this._getRowsStartsWith("SectionRow_"+id),this._show);this._hide(this._getEl("expand_"+id));this._show(this._getEl("hide_"+id));this._makeRowBlue(this._getEl("TeacherRow_"+id));},collapseOne:function(id){this._loop(this._getRowsStartsWith("SectionRow_"+id),this._hide);this._show(this._getEl("expand_"+id));this._hide(this._getEl("hide_"+id));this._makeRowGray(this._getEl("TeacherRow_"+id));},expandOneCourse:function(id){this._loop(this._getRowsStartsWith("TeacherRow_"+id),this._show);this._hide(this._getEl("c_expand_"+id));this._show(this._getEl("c_hide_"+id));this._loop(this._getSpansStartsWith("expand_"+id),this._show);this._loop(this._getSpansStartsWith("hide_"+id),this._hide);this._loop(this._getRowsStartsWith("TeacherRow_"+id),this._makeRowBlue);},collapseOneCourse:function(id){this._loop(this._getRowsStartsWith("SectionRow_"+id),this._hide);this._loop(this._getRowsStartsWith("TeacherRow_"+id),this._hide);this._show(this._getEl("c_expand_"+id));this._hide(this._getEl("c_hide_"+id));},collapseAllBenchmarks:function(){this._loop(this._getSectionRows(),this._hide);this._loop(this._getTeacherRows(),this._makeRowGray);this._expandCollapseTeacherLinks(false);this._loop(this._getSpansStartsWith("expand_"),this._show);this._loop(this._getSpansStartsWith("hide_"),this._hide);},collapseAllCourses:function(){this._loop(this._getTeacherRows(),this._hide);this._loop(this._getSectionRows(),this._hide);this._loop(this._getSpansStartsWith("c_expand_"),this._show);this._loop(this._getSpansStartsWith("c_hide_"),this._hide);}}}();function getElem(id){if(document.layers)return document.layers[id];else if(document.all)return document.all[id];else if(document.getElementById)return document.getElementById(id);}
function toggleSectionElements(teacherId)
{var sectionElems=document.getElementsByTagName('tr');for(var k=0;k<sectionElems.length;k++)
{if(sectionElems[k].id.substring(0,teacherId.length+2)==teacherId+'_S')
{if(sectionElems[k].style.display=='')
sectionElems[k].style.display='none';else
sectionElems[k].style.display='';}}}
var expandedTeacherRow=null;function toggleTeacherElement(teacherId,expand){if(expandedTeacherRow!=null)
expandedTeacherRow.className='TeacherRow';if(expand)
{getElem(teacherId).className='SectionRow';expandedTeacherRow=getElem(teacherId);}
else
getElem(teacherId).className='TeacherRow';var elems=document.getElementsByTagName('span');for(var i=0;i<elems.length;i++)
{var tmpTeacherId=elems[i].id.substring(5);if(tmpTeacherId==teacherId)
{if(getElem('hide_'+teacherId).style.display=='')
{getElem('hide_'+teacherId).style.display='none';getElem('expand_'+teacherId).style.display='';}
else
{getElem('hide_'+teacherId).style.display='';getElem('expand_'+teacherId).style.display='none';}
toggleSectionElements(teacherId);}
else
{if(elems[i].id.substring(0,5)=='hide_'&&elems[i].style.display=='')
{elems[i].style.display='none';getElem('expand_'+tmpTeacherId).style.display='';toggleSectionElements(tmpTeacherId);}}}}
function toggleRegionElement(regionId,expand){var elems=document.getElementsByTagName('span');for(var i=0;i<elems.length;i++)
{var tmpRegionId=elems[i].id.substring(5);if(tmpRegionId==regionId)
{if(expand)
{getElem('hide_'+regionId).style.display='';getElem('expand_'+regionId).style.display='none';}
else
{getElem('hide_'+regionId).style.display='none';getElem('expand_'+regionId).style.display='';}}}
var trElems=document.getElementsByTagName('tr');for(var k=0;k<trElems.length;k++)
{if(trElems[k].id.substring(0,regionId.length+2)==regionId+'_S')
{if(expand)
trElems[k].style.display='';else
trElems[k].style.display='none';}}}
function InputRestrictor(config){this.fieldId=config.field;this.regex=config.regex;this._field=null;}
InputRestrictor.prototype={load:function(){this._field=document.getElementById(this.fieldId);var that=this;if(!this._field)
return;this._field.onkeypress=function(e){return that._onKeyPress(e);}},_onKeyPress:function(e){var key;if(window.event)
key=window.event.keyCode;else if(e)
key=e.which;else
return true;if(this._isSpecialKey(key))
return true;var proposedString=this._field.value+String.fromCharCode(key);var re=new RegExp(this.regex);return re.test(proposedString);},_isSpecialKey:function(key){var specialKeys=[null,0,8,9,13,27];for(var i=0;i<specialKeys.length;i++)
if(key==specialKeys[i])
return true;return false;}}
function confirmDelete()
{return confirm(' You are attempting to delete a report from this location. \n \n Click OK to confirm the deletion.');}
function confirmRemovePublication()
{return confirm(' WARNING: This report has been published. Deleting it here will not remove it from the recipient banks.\n\n To remove them it from recipient banks, view Publication Details.\n \n Click OK to confirm the deletion from this bank only.');}
var ScoreManager=function(){return{load:function(){var scoresTable=document.getElementById("scoresTable");var inputs=document.getElementsByTagName("INPUT");var that=this;for(var i=0;i<inputs.length;i++)
if((inputs[i].type=='radio'&&inputs[i].id.indexOf("_rblAnswers_")!=-1)||(inputs[i].type=="text"&&inputs[i].id.indexOf("_txtGridableAnswer_")!=-1))
{inputs[i].onchange=function(){that.haveScoresChanged=true;}}
var selects=document.getElementsByTagName("SELECT");for(var i=0;i<selects.length;i++){if(selects[i].id.indexOf("_ddlPointsAchieved")==-1)
continue;selects[i].onchange=function(){that.haveScoresChanged=true;}}},validate:function(){if(this.haveScoresChanged){if(window.confirm("You have unsaved changes. Do you want to proceed?")){return true;}
else
return false;}}}}();ScoreManager.haveScoresChanged=false;function CheckBoxTracker(config){this.filter=config.filter;this.fnChanged=config.fnChanged;this._checkBoxes=null;}
CheckBoxTracker.prototype={load:function(){this._checkBoxes=[];var inputs=document.getElementsByTagName("INPUT");var that=this;for(var i=0;i<inputs.length;i++)
if(inputs[i].type=='checkbox'&&inputs[i].id.indexOf(this.filter)!=-1)
{this._checkBoxes.push(inputs[i]);inputs[i].onclick=function(){that._checkChanged();}}},anyChecked:function(){for(var i=0;i<this._checkBoxes.length;i++)
if(this._checkBoxes[i].checked)
return true;return false;},_checkChanged:function(){this.fnChanged(this);}}