var div_object;var httpObject=null;var pop_up_panel=false;function getHTTPObject(){if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP");}else if(window.XMLHttpRequest){return new XMLHttpRequest();}else{return null;}}function get_request(form,script,object_name){var rnd=Math.random();var str=getForm(form);if(httpObject=getHTTPObject()){div_object=object_name;url=script+"?"+str+"&rnd="+rnd;eval("document.getElementById('"+object_name+"').innerHTML+=loading_banner()");if(httpObject!=null){httpObject.open("POST",url,true);httpObject.send(null);httpObject.onreadystatechange=setOutput;}}}function setOutput(){if(httpObject.readyState==4){if(pop_up_panel){fadein(div_object);loadpanel_html="<table cellpadding='4' style=\"border-radius:10px; border:1px solid #C0C0C0; width: 500px; background-color: #4F4F4F;\"><tr><td style=\"width: 100px\"><input value='Drag Window' onmousedown=\"drag_object('"+div_object+"',true);this.style.cursor='move';\" onmouseup=\"drag_object('"+div_object+"',false);this.style.cursor='default'\" type='button' style='border-radius:5px; font-weight: bold; border-style: solid; border-width: thin;' ></td><td align='right'><input style='border-style: solid; border-width: thin; width: 30px; font-weight: bold; font-size: 10pt; background-color: #FF0000; color: #FFFFFF;' type='button' value='X' onclick=\"javascript:pop_up_close('"+div_object+"');\" ></td></tr></table>";}else{loadpanel_html="";}eval("document.getElementById('"+div_object+"').innerHTML=loadpanel_html");eval("document.getElementById('"+div_object+"').innerHTML+=httpObject.responseText");pop_up_panel=false;}}function loading_banner(){if(pop_up_panel==true){height=0;}else{height=posBottom()-30;}return "<div id='loading_banner' style='visibility:visible; position: absolute; top:"+height+"px; left:0px; height:20px; bottom:0; width:90px; padding: 5px; background-color:#FFFF99;'><font style='font-family:Verdana; font-size:10pt;'><b>Loading<img src='/images/circle.gif' height='16' width='16'></b></font></div>";}function pop_up_close(object_name){eval("document.getElementById('"+object_name+"').innerHTML=\"\"");eval("document.getElementById('"+object_name+"').style.width = '0'");eval("document.getElementById('"+object_name+"').style.height = '0'");eval("document.getElementById('"+object_name+"').style.visibility = 'hidden'");eval("document.getElementById('"+object_name+"').style.position = 'relative'");eval("document.getElementById('"+object_name+"').style.top = ''");eval("document.getElementById('"+object_name+"').style.left = ''");pop_up_panel=false;}function pop_up(form,script,object_name){pop_up_panel=true;if(eval("document.getElementById('"+object_name+"').style.visibility == 'visible'")){pop_up_close(object_name);}else{panel_width=500;eval("document.getElementById('"+object_name+"').style.position = 'absolute'");eval("document.getElementById('"+object_name+"').style.zIndex=100");eval("document.getElementById('"+object_name+"').style.width = panel_width");eval("document.getElementById('"+object_name+"').style.visibility = 'visible'");current_width=pageWidth()-5;change_position=tempX+panel_width+45;if(change_position>=current_width){change_position=tempX-(change_position-current_width);eval("document.getElementById('"+object_name+"').style.left = change_position");}get_request(form,script,object_name);}}function getForm(fobj){var str="";var ft="";var fv="";var fn="";var els="";if(typeof(fobj)!="object"){return fobj;}for(var i=0;i<fobj.elements.length;i++){els=fobj.elements[i];ft=els.title;fv=els.value;fn=els.name;switch(els.type){case "text":str+=fn+"="+encodeURI(fv)+"&";break;case "hidden":str+=fn+"="+encodeURI(fv)+"&";break;case "password":str+=fn+"="+encodeURI(fv)+"&";break;case "textarea":str+=fn+"="+encodeURI(fv)+"&";break;case "checkbox":str+=fn+"="+encodeURI(fv)+"&";break;case "radio":if(els.checked){str+=fn+"="+encodeURI(fv)+"&"};break;case "select-one":str+=fn+"="+els.options[els.selectedIndex].value+"&";break;}}str=str.substr(0,(str.length-1));return str;}function pageWidth(){return window.innerWidth!=null?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:document.body!=null?document.body.clientWidth:null;}function pageHeight(){return window.innerHeight!=null?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:document.body!=null?document.body.clientHeight:null;}function posTop(){return typeof window.pageYOffset!='undefined'?window.pageYOffset:document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop?document.body.scrollTop:0;}function posBottom(){return posTop()+pageHeight();}previous_bgcolor="";function chbk(id,color){if(color==""){document.getElementById(id).style.backgroundColor=previous_bgcolor;}else{previous_bgcolor=document.getElementById(id).style.backgroundColor;document.getElementById(id).style.backgroundColor=color;}}function delete_posting_verification(){var answer=confirm("Are you sure you want to delete this posting?");if(answer){return true;}else{return false;}}var IE=document.all?true:false;if(!IE){document.captureEvents(Event.MOUSEMOVE);}document.onmousemove=getMouseXY;var tempX=0;var tempY=0;var drag=false;var TempX_offset=0;var TempY_offset=0;var drag_div_object="";function getMouseXY(e){if(IE){tempX=event.clientX+document.body.scrollLeft;tempY=event.clientY+document.body.scrollTop;}else{tempX=e.pageX;tempY=e.pageY;}if(tempX<0){tempX=0;}if(tempY<0){tempY=0;}if(drag){tempX=tempX-50;tempY=tempY-12;eval("document.getElementById('"+drag_div_object+"').style.top = tempY");eval("document.getElementById('"+drag_div_object+"').style.left = tempX");}return true;}function drag_object(object,move){if(move==false){drag=false;}else if(move==true){drag_div_object=object;drag=true;}}function verify_removefaculty(id){var answer=confirm("Are you sure you want to remove this user?\nNote: Removing the user will erase all classes and postings");if(answer){eval("window.location='./faculty.php?function=remove&faculty_key="+id+"';");}else{return false;}}function verify_drop_class(classid){var answer=confirm("Do you want to drop this class?\nNote: Dropping this class will erase all postings");if(answer){eval("window.location='./classpanel.php?function=drop&class_id="+classid+"';");}else{return false;}}function confirm_account_delete(){var answer=confirm("Are you sure you want to cancel your account?");if(answer){return true;}else{return false;}}if(navigator.appName.indexOf("Microsoft")!=-1){browser="IE";}else{browser="Other";}function fadein(id){if(browser=="IE"){document.getElementById(id).style.filter="alpha(opacity=0)";popfadein(id);}else{document.getElementById(id).style.opacity=0;popfadein(id);}}function popfadein(id){if(document.getElementById(id).style.visibility=="hidden")document.getElementById(id).style.visibility="visible";if(browser=="IE"){if(document.getElementById(id).filters.alpha.opacity<100){document.getElementById(id).filters.alpha.opacity+=10;eval("setTimeout(\"popfadein('"+id+"')\",60)");}else{document.getElementById(id).style.filter="alpha(opacity=100)";}}else{if((document.getElementById(id).style.opacity*100)<100){document.getElementById(id).style.opacity=(document.getElementById(id).style.opacity*100+10)/100;eval("setTimeout(\"popfadein('"+id+"')\",60)");}else{document.getElementById(id).style.opacity=1;}}}
