function branchAct(branch){var opSelected=document.forms['branchCode'].elements[branch].selectedIndex;var opValue=document.forms['branchCode'].elements[branch].options[opSelected].value;if(opValue!=''){window.location.href=opValue;}}function closeothers(){closepop('coursesmenu');closepop('usersmenu');}function closepop(popname){if(btype=='IE4'||btype=='IE5'){document.all(popname).style.visibility='hidden';}else{if(btype=='NS4'){document.layers['popname'].visibility='hidden';}else if(btype=='NS6'){var myElement=document.getElementById(popname);myElement.style.visibility='hidden';}}}function confirmRegistration(){if(confirm('Please verify that this information is accurate to the best of your knowledge.\n Click okay to continue, Click Cancel to review the information and make changes.')){return true;}}function createURL(formname,field){var urlString=document.reportSelect.FORM_reportLink.value;var urlArray=urlString.split('&');var results=urlArray[0];var fieldObj=formname.elements[field].value;var objChecked=formname.elements[field].checked;var newUrl=field+'='+fieldObj;var exists=false;if(urlString.length==0){}for(var i=1;i<urlArray.length;i++){if(urlArray[i]!=newUrl){var exists=false;results=results+'&'+urlArray[i];}else{var exists=true;if(objChecked===true){results=results+'&'+urlArray[i];}}}if(exists===false&&objChecked===true){results=results+'&'+field+'='+fieldObj;}document.reportSelect.FORM_reportLink.value=results;}function getElementsByName_iefix(tag,name){var elem=document.getElementsByTagName(tag);var arr=new Array();for(i=0,iarr=0;i<elem.length;i++){att=elem[i].getAttribute("name");if(att==name){arr[iarr]=elem[i];iarr++;}}return arr;}function getKeyPressed(e,returnString){if(returnString!=false){returnString=true;}var Key;if(e.which){Key=e.which;}else if(window.event&&window.event.keyCode){Key=window.event.keyCode;}else{Key='';}if(returnString){return String.fromCharCode(Key);}else{return Key;}}function globalChanges(globalChange,myButton){document.adminLookupForm.manageOption.value=myButton.value;if(document.adminLookupForm.globalChange.checked){if(myButton.value=='Global Delete'){var myMSG='Please Make Sure that the admin you are deleting is not the primary admin for any course.';var deleteAll='y';}else{var myMSG="Are you sure you want to change all the course(s) that this administrator currently manages?";}if(confirm(myMSG)){document.adminLookupForm.submit();}else{if(deleteAll){return false;}else{document.adminLookupForm.globalChange.value='';document.adminLookupForm.submit();}}}else{if(myButton.value=="Remove Admin"){if(confirm('Are you sure you want to delete this admin?')){document.adminLookupForm.globalChange.value='';document.adminLookupForm.submit();}else{return false;}}else{document.adminLookupForm.globalChange.value='';document.adminLookupForm.submit();}}}function globalUpdate(field){if(document.adminLookupForm.updateAdmin)document.adminLookupForm.updateAdmin.value=(field.checked==true)?"Global Update":"Update Admin";if(document.adminLookupForm.assignAdmin)document.adminLookupForm.assignAdmin.value=(field.checked==true)?"Global Assign":"Assign Admin";if(document.adminLookupForm.deleteAdmin)document.adminLookupForm.deleteAdmin.value=(field.checked==true)?"Global Delete":"Remove Admin";}function hideButtonBox(myID){document.getElementById(myID).style.visibility="hidden";}function in_array(needle,haystack,strict){var found=false,key,strict=!!strict;for(key in haystack){if((strict&&haystack[key]===needle)||(!strict&&haystack[key]==needle)){found=true;break;}}return found;}function isDigit(c){return(c=='\b'||c!='-'||(c>='0'&&c<='9'));}function isLegit(c){return(c=='\b'||(c!='\''&&c!='\r'));}function jumpMenu(formname,pntr,url){var cat=formname.elements[pntr].value;if(cat==""||cat==0){alert('Error! Please insert the keyword.');return false;}else{var URL=url+cat;window.location.href=URL;}}function jumpToMenu(myform,keyword,opt,url){var cat1=document.getElementById('keyword').value;var cat2="";var pntr='';if(cat1==""||cat1=="Find - Enter Keyword Here"){alert('Error! Please insert the keyword.');return false;}var userOpt=document.forms[myform].elements['lookupOpt'];for(i=0;i<userOpt.length;i++){if(userOpt[i].checked){var cat2=userOpt[i].value;}}window.location.href=url+cat1+'&opt='+cat2+'&cpntr='+pntr;}function launchFAQ(){window.open('../faq/index.php','hyperFAQ','width=780,height=520,resizable=no,status=no,menubar=no,scrollbars=no');}function launchHelp(){window.open('./help/','lmsHelp','width=650,height=450,scrollbars=yes,resizable=no');}function letterSelect(v,selectedId){var fv=v.substring(0,1);var allOpt=document.getElementById(selectedId).getElementsByTagName('option');var i=0,o,fo;while(o=allOpt[i++]){fo=o.text.substring(0,1).toLowerCase();if(fo==fv){o.selected=true;break;}}}function menuVerticalBuild(menuids){var menuids=new Array("verticalMenu");var submenuoffset=-2;for(var i=0;i<menuids.length;i++){if($(menuids[i])==null){continue;}var ultags=$(menuids[i]).getElements("ul");for(var t=0;t<ultags.length;t++){ultags[t].parentNode.onmouseover=function(){if(!window.XMLHttpRequest){$$('select').setStyle('visibility','hidden');}this.getElementsByTagName("ul")[0].style.left=this.parentNode.offsetWidth+submenuoffset+"px";this.getElementsByTagName("ul")[0].style.display="block";};ultags[t].parentNode.onmouseout=function(){if(!window.XMLHttpRequest){$$('select').setStyle('visibility','');}this.getElementsByTagName("ul")[0].style.display="none";};}}}function messageShow(content){if(typeof(messageObj)!='object'){messageObj=new DHTML_modalMessage();}if(!$defined(content)){content='<img src="../images/loading.gif" title="Loading..." alt="Loading..." />';}messageObj.setHtmlContent(content);messageObj.setCssClassMessageBox(false);messageObj.setSize(277,178);messageObj.setShadowDivVisible(false);messageObj.display();}function messageClose(){messageObj.close();}function openpop(popname){if(btype=='IE4'||btype=='IE5'){document.all(popname).style.visibility='visible';}else{if(btype=='NS4'){document.layers['popname'].visibility='visible';}else if(btype=='NS6'){var myElement=document.getElementById(popname);myElement.style.visibility='visible';}}}function passwordsMatch(form){if(document.forms[form].FORM_firstName.value==''||document.forms[form].FORM_lastName.value==''||document.forms[form].FORM_userName.value==''||document.forms[form].FORM_password.value==''||document.forms[form].passwordVerify.value==''){window.alert('Please Fill Out All Fields!');return false;}else{if(document.forms[form].FORM_password.value!=document.forms[form].passwordVerify.value){window.alert('Passwords Do Not Match!');return false;}return true;}}function PCase(STRING){var strReturn_Value="";var iTemp=STRING.length;if(iTemp==0){return"";}var UcaseNext=false;strReturn_Value+=STRING.charAt(0).toUpperCase();for(var iCounter=1;iCounter<iTemp;iCounter++){var vIsLast=false;if(UcaseNext==true){strReturn_Value+=STRING.charAt(iCounter).toUpperCase();}else{strReturn_Value+=STRING.charAt(iCounter).toLowerCase();}var iChar=STRING.charCodeAt(iCounter);if(iChar==32||iChar==45||iChar==46){UcaseNext=true;}else{UcaseNext=false;}if(iChar==99||iChar==67){if(STRING.charCodeAt(iCounter-1)==77||STRING.charCodeAt(iCounter-1)==109){UcaseNext=true;}}if(iChar==118){vIsLast=true;}}strReturn_Value=strReturn_Value.replace('Iii','III');strReturn_Value=strReturn_Value.replace('Ii','II');if(vIsLast==true){strReturn_Value=strReturn_Value.replace('Iv','IV');}return strReturn_Value;}function popCertificate(theURL){alert('Congratulations on completing your course.  Please click okay and wait while your certificate loads.  This may take a couple of minutes.');if(navigator.appName=="Netscape"){newWin=window.open(theURL,"winName","scrollbars=no,resizable=no,menubar=no,status=no");newWin.focus();}else if(popStatus==true){if(newWin.closed==true){newWin=window.open(theURL,"winName","scrollbars=no,resizable=no,menubar=no,status=no");}else{newWin.location.href=theURL;newWin.focus();}}else{newWin=window.open(theURL,"winName","scrollbars=no,resizable=no,location=no,menubar=no,status=yes");popStatus=true;}}function popWindow(theURL){if(navigator.appName=="Netscape"){newWin=window.open(theURL,"winName");newWin.focus();}else if(popStatus==true){if(newWin.closed==true){newWin=window.open(theURL,"winName");}else{newWin.location.href=theURL;newWin.focus();}}else{newWin=window.open(theURL,"winName");popStatus=true;}}function redirector(){var isFramed=(top==self);var URL=arguments[0];if(arguments[1]){URL2=arguments[1];}else{URL2=arguments[0];}if(!isFramed){parent.location.href=URL;}else{location.href=URL2;}}function selectSearchController(direction,inputId,selectId,params){if(!$type(ls[inputId])){eval(inputId+" = new SelectSearch(inputId, selectId, params)");ls[inputId]=eval(inputId);}if(direction=='up'){ls[inputId].previous();}else{ls[inputId].next();}}function selectSearchEnter(event,inputId,selectId,params){var keyPressed=getKeyPressed(event,false);if(keyPressed==13){selectSearchController('down',inputId,selectId,params);return false;}else{return true;}}function setDateRange(){var dateRange;if((dateRange=$('dateRange'))){if(dateRange.getValue()!=''){if($('adminForm')){return adminFormSubmit();}else{document.usersForm.submit();}}}}function setDisplayLimit(){var displayLimit;if((displayLimit=$('displayLimit'))){if(displayLimit.getValue()!=''){if($('adminForm')){return adminFormSubmit();}else{document.usersForm.submit();}}}}function showButtonBox(myID){document.getElementById(myID).style.visibility="visible";}function strpos(haystack,needle,offset){if(typeof(haystack)=='undefined'){return false;}var i=haystack.indexOf(needle,offset);return i>=0?i:false;}function strrpos(haystack,needle,offset){if(typeof(haystack)=='undefined'){return false;}var i=haystack.lastIndexOf(needle,offset);return i>=0?i:false;}function substr(f_string,f_start,f_length){if(f_start<0){f_start+=f_string.length;}if(f_length==undefined){f_length=f_string.length;}else if(f_length<0){f_length+=f_string.length;}else{f_length+=f_start;}if(f_length<f_start){f_length=f_start;}return f_string.substring(f_start,f_length);}function tableruler(){if(document.getElementById&&document.createTextNode){var tables=$$('table').filterByClass('ruler');for(var i=0;i<tables.length;i++){var trs=tables[i].getElements('tr');for(var j=0;j<trs.length;j++){if(trs[j].parentNode.nodeName=='TBODY'){trs[j].onmouseover=function(){this.toggleClass('ruled');return false};trs[j].onmouseout=function(){this.toggleClass('ruled');return false};}}}}}function toupper(form,e){form.elements[e].value=form.elements[e].value.toUpperCase();}if(typeof(MooTools)=='object'){var SelectSearch=new Class({options:{dir:'down',callback:''},initialize:function(inputId,selectId,params){this.inputId=inputId;this.selectId=selectId;if(!$type(params)){var params={};params['type']='down';params['callback']='';}if($type(params['type'])!='string'||params['type']!='up'){this.options.dir='down';}else{this.options.dir='up';}if($type(params['callback'])=='function'){this.options.callback=params['callback'];}this.searchText='';this.oldSearch='';this.optionItems=$(this.selectId).options;this.position=0;if(this.options.dir=='up'){this.position=this.optionItems.length;}},next:function(){this.options.dir='down';this.searchOptions();},previous:function(){this.options.dir='up';this.searchOptions();},searchOptions:function(){this.setSearchText();var selected=$(this.selectId).getValue();var position=this.position;var regExp=new RegExp(this.searchText,"i");var i=(this.options.dir=='up')?this.position-1:this.position+1;var count=0;var loop=true;while(loop){if(this.optionItems[i].text.match(regExp)){this.optionItems[i].selected=true;this.position=i;break;}if(this.options.dir=='up'){i--;if(i<0){i=this.optionItems.length-1;}}else{i++;if(i>=this.optionItems.length){i=0;}}count++;if(count>this.optionItems.length){loop=false;}}if($(this.selectId).getValue()!=selected&&this.options.callback!=''){this.options.callback();}},setSearchText:function(){this.searchText=$(this.inputId).getValue();if(this.searchText!=this.oldSearch){this.oldSearch=this.searchText;this.position=0;if(this.options.dir=='up'){this.position=this.optionItems.length;}}}});}var ls={};var popStatus=false;var btype;if(document.layers){btype='NS4';}if(document.all&&!document.getElementById){btype='IE4';}if(document.all&&document.getElementById){btype='IE5';}if(!document.all&&document.getElementById){btype='NS6';}if(window.addEvent){window.addEvent("domready",function(){menuVerticalBuild();});window.addEvent("domready",function(){tableruler();});}
