var MouseOverVisible=0;var MacToolTipVisible=0;function $(){var d=new Array();for(var c=0;c<arguments.length;c++){var b=arguments[c];if(typeof b=="string"){b=document.getElementById(b)}if(arguments.length==1){return b}d.push(b)}return d}function addEvent(f,e,c,b){if(f.addEventListener){f.addEventListener(e,c,b);return true}else{if(f.attachEvent){var d=f.attachEvent("on"+e,c);return d}else{f["on"+e]=c}}}function addslashes(b){b=b.replace(/\'/g,"\\'");b=b.replace(/\"/g,'\\"');b=b.replace(/\\/g,"\\\\");b=b.replace(/\0/g,"\\0");return b}function answerServer(RequestObject,respHandler,handleData){var status="";try{status=RequestObject.status}catch(e){status="Firefox error trap"}if(RequestObject.readyState==4){if(status==200){eval(respHandler+"(RequestObject.responseText,handleData)")}RequestObject=null}}function array_search(e,d,b){var b=!!b;for(var c in d){if((b&&d[c]===e)||(!b&&d[c]==e)){return c}}return false}function BubbleSort(d,c){return(d-c)}function CallEmail(b,c){if(typeof(RequestObject)=="undefined"){RequestObject=createRequestObject()}if(c==""){c=prompt("Please supply a return e-mail address.","")}if(c==null){return}if(document.getElementById("PrintContent")){tmpBody=document.getElementById("PrintContent").innerHTML;tmpBody=StripWhitespace(tmpBody);tmpBody=StripNoPrint(tmpBody)}else{if(document.getElementById("content")){tmpBody=document.getElementById("content").innerHTML;tmpBody=StripWhitespace(tmpBody);tmpBody=StripNoPrint(tmpBody)}}tmpBody=escape(tmpBody);SendString="subject="+b+"&body="+tmpBody+"&to="+document.getElementById("EmailAddress").value+"&from="+c;document.getElementById("EmailAddress").enabled=false;RequestObject.open("post","../SendEmail.php");RequestObject.onreadystatechange=handleEmailResponse;RequestObject.setRequestHeader("Content-Type","application/x-www-form-urlencoded");RequestObject.send(SendString)}function callServer(b,d,c,f){var g=createRequestObject();var e=new Object;e.serverAction=b;e.serverData=d;if(d.pageName){pageName=d.pageName}else{pageName="AjaxCommands.php"}var c=c;if(d.Asyncronous=="false"){g.open("post",pageName,false)}else{g.open("post",pageName,true)}g.onreadystatechange=function(){answerServer(g,c,f)};g.setRequestHeader("Content-Type","application/x-www-form-urlencoded");g.send(e.toJSONString())}function GetStandardList(f,d,c,g){var e=new Object;e.OrganizationID=f;e.StandardSetID=d;e.CurrentStandardID=c;e.Direction=g;var b="GetStandardList";e.pageName="GetStandards.php";respHandler="handleStandardResponse";handleData=null;callServer2(b,e,respHandler,handleData)}function callServer2(b,d,c,f){var g=createRequestObject();var e=new Object;e.serverAction=b;e.serverData=d;if(d.pageName){pageName=d.pageName}else{pageName="AjaxCommands.php"}var c=c;if(d.Asyncronous=="false"){g.open("post",pageName,false)}else{g.open("post",pageName,true)}g.onreadystatechange=function(){answerServer(g,c,f)};g.setRequestHeader("Content-Type","application/x-www-form-urlencoded");g.send(JSON.stringify(e))}function ChangeClassName(d,c,b){FullClassString=GetClassName(d);FullClassString=FullClassString.replace(c,b);document.getElementById(d).className=FullClassString}function ChangeGraphic(c,b){document.getElementById(c).src=b}function checkAdminStatus(b){b=b.parseJSON();ERR_PARTICIPANTS_REMOVED=1;ERR_PARTICIPANTS_MISSING=2;ERR_PARTICIPANTS_NOT_ADDED=3;ERR_PARTICIPANTS_PARTIAL_ADD=4;if(b.printMsg&&b.printMsg==1){$("numStuds").innerHTML=b.msg}}function CheckBrowserType(){UserAgentString=navigator.userAgent;if(UserAgentString.indexOf("Opera")!=-1){BrowserName="Opera";var b=UserAgentString.indexOf("Opera")+6;var c=UserAgentString.indexOf(" ",b);if(c==-1){c=UserAgentString.length}BrowserVersion=UserAgentString.substr(b,(c-b))}else{if(UserAgentString.indexOf("Firefox")!=-1){BrowserName="Firefox";var b=UserAgentString.indexOf("Firefox")+8;var c=UserAgentString.indexOf(" ",b);if(c==-1){c=UserAgentString.length}BrowserVersion=UserAgentString.substr(b,(c-b))}else{if(UserAgentString.indexOf("MSIE")!=-1){BrowserName="IE";var b=UserAgentString.indexOf("MSIE")+5;var c=UserAgentString.indexOf(";",b);if(c==-1){c=UserAgentString.length}BrowserVersion=UserAgentString.substr(b,(c-b))}else{BrowserName="Unknown";BrowserVersion="Unknown"}}}}function CheckExistence(b){return b!=null?1:0}function checkRequired(){var c=document.getElementsByTagName("input");var b="";for(i=0;i<c.length;i++){if(c[i].getAttribute("required")&&imps[i].value.length==0){c.style.backgroundColor="red";b="Required Fields have been omitted"}else{c.style.backgroundColor="white"}}if(b){alert(b);return false}else{return true}}function ClearContents(b){while(document.getElementById(b).childNodes[0]){document.getElementById(b).removeChild(document.getElementById(b).childNodes[0])}document.getElementById(b).innerHTML=""}function createCookie(c,d){var b="";c="Esess"+c;document.cookie=c+"="+d+b+"; path=/"}function createRequestObject(){return window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")}function DelayScript(d){var c=new Date();var b=null;do{b=new Date()}while(b-c<d)}function eraseCookie(b){b="Esess"+b;createCookie(b,"",-1)}function EscapeQuotes(c,b){if(b=="double"||b=="both"){tmpVal=c.replace(/["]/g,'\\"')}if(b=="single"||b=="both"){tmpVal=tmpVal.replace(/[']/g,"\\'")}return tmpVal}function GetClassName(b){ClassName=document.getElementById(b).className;return ClassName}function handleEmailResponse(){if(RequestObject.readyState==4){if(RequestObject.status==200){alert(RequestObject.responseText)}else{alert("error!! Problem occurred: "+RequestObject.statusText)}document.getElementById("EmailAddress").value="";document.getElementById("EmailAddress").enabled=true}}function handleStandardResponse_OLD(){if(RequestObject.readyState==4){if(RequestObject.status==200){document.getElementById("divStandards").innerHTML=RequestObject.responseText;if(document.getElementById("lstStandardSets")){document.getElementById("btnStandardsUp").disabled=true}else{document.getElementById("btnStandardsUp").disabled=false}OnStandardChange()}else{document.getElementById("divStandards").innerHTML="error!! Problem occurred: "+RequestObject.statusText}}}function handleStandardResponse(b){response=JSON.parse(b);document.getElementById("divStandards").innerHTML=response.Report;if(document.getElementById("lstStandardSets")){document.getElementById("btnStandardsUp").disabled=true}else{document.getElementById("btnStandardsUp").disabled=false}OnStandardChange();if(response.Feedback>""){alert(response.Feedback)}}function HideMouseHelp(){document.getElementById("MouseHelp").style.visibility="hidden"}function IllegalCharacters(b,d){for(var c in b){if(!in_array(b[c],d)){return true}}return false}function in_array(f,e,b){var d=false,c,b=!!b;for(c in e){if((b&&e[c]===f)||(!b&&e[c]==f)){d=true;break}}return d}function isAlphanumeric(b){TestString=" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";ReturnVal=true;if(b.length==0){ReturnVal=false}else{for(x=0;x<=(b.length-1);x++){if(TestString.indexOf(b.substr(x,1))==-1){ReturnVal=false}}}return ReturnVal}function isInteger(b){TestString="0123456789";ReturnVal=true;if(b.length==0){ReturnVal=false}else{for(x=0;x<=(b.length-1);x++){if(TestString.indexOf(b.substr(x,1))==-1){ReturnVal=false}}}return ReturnVal}function isMonetaryNumber(b){TestString="0123456789.";ReturnVal=true;if(b.length==0){ReturnVal=false}else{for(x=0;x<=(b.length-1);x++){if(TestString.indexOf(b.substr(x,1))==-1){ReturnVal=false}}}if(b.indexOf(".")!=b.lastIndexOf(".")||(b.length-b.indexOf("."))!=3){ReturnVal=false}return ReturnVal}function isName(b){TestString="'- abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";ReturnVal=true;if(b.length==0){ReturnVal=false}else{for(x=0;x<=(b.length-1);x++){if(TestString.indexOf(b.substr(x,1))==-1){ReturnVal=false}}}return ReturnVal}function isNumber(b){TestString="0123456789.";ReturnVal=true;if(b.length==0){ReturnVal=false}else{for(x=0;x<=(b.length-1);x++){if(TestString.indexOf(b.substr(x,1))==-1){ReturnVal=false}}}return ReturnVal}function isString(b){TestString="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";ReturnVal=true;if(b.length==0){ReturnVal=false}else{for(x=0;x<=(b.length-1);x++){if(TestString.indexOf(b.substr(x,1))==-1){ReturnVal=false}}}return ReturnVal}function isValidDate(b){myDate=new Date(Date.parse(b));newYear=myDate.getFullYear();newMonth=myDate.getMonth()+1;newDay=myDate.getDate();if(varYear==newYear&&varMonth==newMonth&&varDay==newDay){return 1}else{return 0}}function limitChanged(b){document.location=b+"?min=0&limit="+$("limit").value}function MoveDownStandard(){if(document.getElementById("lstStandardSets")){StandardSetID=document.getElementById("lstStandardSets").value;GetStandardList(OrganizationID,StandardSetID,"","Down")}else{StandardSetID=document.getElementById("hdnStandardSetID").value;ParentStandardID=document.getElementById("lstStandards").value;GetStandardList(OrganizationID,StandardSetID,ParentStandardID,"Down")}}function moveRes(b){document.location=b+"?min="+$("recordJump").value+"&limit="+$("limit").value}function MoveUpStandard(){StandardSetID=document.getElementById("hdnStandardSetID").value;ChildStandardID=document.getElementById("lstStandards").value;GetStandardList(OrganizationID,StandardSetID,ChildStandardID,"Up")}function ObjectName(d){var c=d.constructor.toString();var b=c.match(/\s*function (.*)\(/);if(b!=null){return b[1]}}function OnStandardChange(){if(document.getElementById("lstStandards")){if(document.getElementById("lstStandards").selectedIndex==undefined){tmpInd=0}else{tmpInd=document.getElementById("lstStandards").selectedIndex}tmpRef=document.getElementById("lstStandards");if(tmpRef[tmpInd].getAttribute("HasChildren")==1){document.getElementById("btnStandardsDown").disabled=false}else{document.getElementById("btnStandardsDown").disabled=true}}else{if(document.getElementById("lstStandardSets")){if(document.getElementById("lstStandardSets").selectedIndex==undefined){tmpInd=0}else{tmpInd=document.getElementById("lstStandardSets").selectedIndex}tmpRef=document.getElementById("lstStandardSets");if(tmpRef[tmpInd].getAttribute("HasChildren")==1){document.getElementById("btnStandardsDown").disabled=false}else{document.getElementById("btnStandardsDown").disabled=true}}else{document.getElementById("btnStandardsUp").disabled=true}}}function OpenLink(b,c){Config="toolbar=yes,location=no,directories=no,status=yes,menubar=no,screenX=0,screenY=0,scrollbars=yes,resizable=yes";pop=window.open(b,c,Config)}function OpenPrintWindow(){wndPrint=window.open("PrintTemplate.html","mywindow")}function OpenStripped(b,c){Config="toolbar=no,location=no,directories=no,status=yes,menubar=no,screenX=0,screenY=0,width=800px,height=600px,scrollbars=yes,resizable=yes";pop=window.open(b,c,Config)}function OpenWindow(b,c){Config="toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,screenX=0,screenY=0,width=800px,height=600px,scrollbars=yes,resizable=yes";pop=window.open(b,c,Config)}function readCookie(d){d="Esess"+d;var f=d+"=";var b=document.cookie.split(";");for(var e=0;e<b.length;e++){var g=b[e];while(g.charAt(0)==" "){g=g.substring(1,g.length)}if(g.indexOf(f)==0){return g.substring(f.length,g.length)}}return null}function SetClassName(c,b){document.getElementById(c).className=b}function SetVisibility(c,b){document.getElementById(c).style.visibility=b}function ShowMousePos(b){if(!b){var b=window.event}if(b.pageX||b.pageY){posx=b.pageX;posy=b.pageY}else{if(b.clientX||b.clientY){posx=b.clientX+document.body.scrollLeft;posy=b.clientY+document.body.scrollTop}}window.status="Y:"+(posy-2)+", X:"+(posx-2)}function ShowMouseHelp(b){if(!c){var c=window.event}if(c.pageX||c.pageY){posx=c.pageX;posy=c.pageY}else{if(c.clientX||c.clientY){posx=c.clientX+document.body.scrollLeft;posy=c.clientY+document.body.scrollTop}}MouseOverVisible=1;document.getElementById("MouseHelp").innerHTML=b;document.getElementById("MouseHelp").style.left=(posx-160);document.getElementById("MouseHelp").style.top=(posy+5);document.getElementById("MouseHelp").style.visibility="visible"}String.prototype.trim=function(){a=this.replace(/^\s+/,"");return a.replace(/\s+$/,"")};function StripNoPrint(c){var d=0;var b=0;while(c.indexOf("NoPrint")>-1){NoPrintPosition=c.indexOf("NoPrint");TagPosition=c.lastIndexOf("<",NoPrintPosition)+1;CutFrom=TagPosition-1;EndTagPosition=c.indexOf(" ",TagPosition);TagType=c.substring((TagPosition),EndTagPosition);d++;if(TagType=="table"){d=0}while(d>0){TagPosition=c.indexOf("<",TagPosition)+1;ClosePosition=c.indexOf(">",TagPosition)-1;if(c.substr(ClosePosition,2)=="/>"){TagClosedItself=1}else{TagClosedItself=0}if(TagPosition==0){alert("ERROR! There are no more tags and there are "+d+" tags still open.\n"+c);d=0;return c}if(c.substr(TagPosition,1)=="/"){d--}else{if(c.substr(TagPosition,1)!="!"&&c.substr(TagPosition,2)!="br"&&c.substr(TagPosition,3)!="img"&&c.substr(TagPosition,5)!="input"&&TagClosedItself==0){d++}}if(b>10000){alert("hit 10000 iterations, so diving out to prevent crash");d=0}b++}CutTo=c.indexOf(">",TagPosition+1)+1;c=c.substring(0,CutFrom)+c.substring(CutTo)}return c}function stripslashes(b){b=b.replace(/\\'/g,"'");b=b.replace(/\\"/g,'"');b=b.replace(/\\\\/g,"\\");b=b.replace(/\\0/g,"\0");return b}function StripWhitespace(b){b=b.replace(/\s*/i,"");return b}function ToggleMenu(d,b,c){CurrentClass=GetClassName(b);ImageName="img"+d;if(CurrentClass.indexOf("collapsed")>-1){ChangeClassName(b,"collapsed","expanded");document.getElementById(d).title="Click to collapse";ChangeClassName(d,"MenuHeader_Plus","MenuHeader_Minus")}else{ChangeClassName(b,"expanded","collapsed");document.getElementById(d).title="Click to expand";ChangeClassName(d,"MenuHeader_Minus","MenuHeader_Plus")}if(!c){var c=window.event}c.cancelBubble=true;if(c.stopPropagation){c.stopPropagation()}}function updateAvailIDs(f,c){var b="UpdateAdminPersonalIDs";var d=Object();d.pageName="../ServerSideAjax/commonAjaxFunctions.php";d.addThisMany=f;d.adminOverride=c;var g="checkAdminStatus";var e=null;callServer(b,d,g,e)};